* [PATCH v2 1/1] platform/x86: intel: Add 'intel' prefix to the modules automatically
@ 2024-10-16 10:59 Andy Shevchenko
2024-10-28 10:58 ` Andy Shevchenko
0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2024-10-16 10:59 UTC (permalink / raw)
To: Ilpo Järvinen, Andy Shevchenko, Tero Kristo, Hans de Goede,
Srinivas Pandruvada, platform-driver-x86, linux-kernel
Cc: linux-kbuild, Masahiro Yamada, Geert Uytterhoeven, David Gow
Rework Makefile to add 'intel' prefix to the modules automatically.
This removes a lot of boilerplate code in it and also makes robust
against mistypos in the prefix.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: fixed obvious typos (LKP), Cc'ed to Kbuild ML (Ilpo), dropped RFC marker
Note to Kbuild people: TBH I rather want to have something like this
to be available on the level of Kbuild for any of the subdirectories
in question.
drivers/platform/x86/intel/Makefile | 68 ++++++++-----------
.../intel/{intel_plr_tpmi.c => plr_tpmi.c} | 0
.../x86/intel/{tpmi.c => vsec_tpmi.c} | 2 +-
3 files changed, 30 insertions(+), 40 deletions(-)
rename drivers/platform/x86/intel/{intel_plr_tpmi.c => plr_tpmi.c} (100%)
rename drivers/platform/x86/intel/{tpmi.c => vsec_tpmi.c} (99%)
diff --git a/drivers/platform/x86/intel/Makefile b/drivers/platform/x86/intel/Makefile
index 74db065c82d6..78acb414e154 100644
--- a/drivers/platform/x86/intel/Makefile
+++ b/drivers/platform/x86/intel/Makefile
@@ -17,50 +17,40 @@ obj-$(CONFIG_INTEL_UNCORE_FREQ_CONTROL) += uncore-frequency/
# Intel input drivers
-intel-hid-y := hid.o
-obj-$(CONFIG_INTEL_HID_EVENT) += intel-hid.o
-intel-vbtn-y := vbtn.o
-obj-$(CONFIG_INTEL_VBTN) += intel-vbtn.o
+intel-target-$(CONFIG_INTEL_HID_EVENT) += hid.o
+intel-target-$(CONFIG_INTEL_VBTN) += vbtn.o
# Intel miscellaneous drivers
-obj-$(CONFIG_INTEL_ISHTP_ECLITE) += ishtp_eclite.o
-intel_int0002_vgpio-y := int0002_vgpio.o
-obj-$(CONFIG_INTEL_INT0002_VGPIO) += intel_int0002_vgpio.o
-intel_oaktrail-y := oaktrail.o
-obj-$(CONFIG_INTEL_OAKTRAIL) += intel_oaktrail.o
-intel_sdsi-y := sdsi.o
-obj-$(CONFIG_INTEL_SDSI) += intel_sdsi.o
-intel_vsec-y := vsec.o
-obj-$(CONFIG_INTEL_VSEC) += intel_vsec.o
+intel-target-$(CONFIG_INTEL_INT0002_VGPIO) += int0002_vgpio.o
+intel-target-$(CONFIG_INTEL_ISHTP_ECLITE) += ishtp_eclite.o
+intel-target-$(CONFIG_INTEL_OAKTRAIL) += oaktrail.o
+intel-target-$(CONFIG_INTEL_SDSI) += sdsi.o
+intel-target-$(CONFIG_INTEL_VSEC) += vsec.o
# Intel PMIC / PMC / P-Unit drivers
-intel_bxtwc_tmu-y := bxtwc_tmu.o
-obj-$(CONFIG_INTEL_BXTWC_PMIC_TMU) += intel_bxtwc_tmu.o
-intel_crystal_cove_charger-y := crystal_cove_charger.o
-obj-$(CONFIG_X86_ANDROID_TABLETS) += intel_crystal_cove_charger.o
-intel_bytcrc_pwrsrc-y := bytcrc_pwrsrc.o
-obj-$(CONFIG_INTEL_BYTCRC_PWRSRC) += intel_bytcrc_pwrsrc.o
-intel_chtdc_ti_pwrbtn-y := chtdc_ti_pwrbtn.o
-obj-$(CONFIG_INTEL_CHTDC_TI_PWRBTN) += intel_chtdc_ti_pwrbtn.o
-intel_chtwc_int33fe-y := chtwc_int33fe.o
-obj-$(CONFIG_INTEL_CHTWC_INT33FE) += intel_chtwc_int33fe.o
-intel_mrfld_pwrbtn-y := mrfld_pwrbtn.o
-obj-$(CONFIG_INTEL_MRFLD_PWRBTN) += intel_mrfld_pwrbtn.o
-intel_punit_ipc-y := punit_ipc.o
-obj-$(CONFIG_INTEL_PUNIT_IPC) += intel_punit_ipc.o
+intel-target-$(CONFIG_INTEL_BYTCRC_PWRSRC) += bytcrc_pwrsrc.o
+intel-target-$(CONFIG_INTEL_BXTWC_PMIC_TMU) += bxtwc_tmu.o
+intel-target-$(CONFIG_INTEL_CHTDC_TI_PWRBTN) += chtdc_ti_pwrbtn.o
+intel-target-$(CONFIG_INTEL_CHTWC_INT33FE) += chtwc_int33fe.o
+intel-target-$(CONFIG_X86_ANDROID_TABLETS) += crystal_cove_charger.o
+intel-target-$(CONFIG_INTEL_MRFLD_PWRBTN) += mrfld_pwrbtn.o
+intel-target-$(CONFIG_INTEL_PUNIT_IPC) += punit_ipc.o
# TPMI drivers
-intel_vsec_tpmi-y := tpmi.o
-obj-$(CONFIG_INTEL_TPMI) += intel_vsec_tpmi.o
-obj-$(CONFIG_INTEL_PLR_TPMI) += intel_plr_tpmi.o
-
-intel_tpmi_power_domains-y := tpmi_power_domains.o
-obj-$(CONFIG_INTEL_TPMI_POWER_DOMAINS) += intel_tpmi_power_domains.o
+intel-target-$(CONFIG_INTEL_PLR_TPMI) += plr_tpmi.o
+intel-target-$(CONFIG_INTEL_TPMI_POWER_DOMAINS) += tpmi_power_domains.o
+intel-target-$(CONFIG_INTEL_TPMI) += vsec_tpmi.o
# Intel Uncore drivers
-intel-rst-y := rst.o
-obj-$(CONFIG_INTEL_RST) += intel-rst.o
-intel-smartconnect-y := smartconnect.o
-obj-$(CONFIG_INTEL_SMARTCONNECT) += intel-smartconnect.o
-intel_turbo_max_3-y := turbo_max_3.o
-obj-$(CONFIG_INTEL_TURBO_MAX_3) += intel_turbo_max_3.o
+intel-target-$(CONFIG_INTEL_RST) += rst.o
+intel-target-$(CONFIG_INTEL_SMARTCONNECT) += smartconnect.o
+intel-target-$(CONFIG_INTEL_TURBO_MAX_3) += turbo_max_3.o
+
+# Add 'intel' prefix to each module listed in intel-target-*
+define INTEL_OBJ_TARGET
+intel-$(1)-y := $(1).o
+obj-$(2) += intel-$(1).o
+endef
+
+$(foreach target, $(basename $(intel-target-y)), $(eval $(call INTEL_OBJ_TARGET,$(target),y)))
+$(foreach target, $(basename $(intel-target-m)), $(eval $(call INTEL_OBJ_TARGET,$(target),m)))
diff --git a/drivers/platform/x86/intel/intel_plr_tpmi.c b/drivers/platform/x86/intel/plr_tpmi.c
similarity index 100%
rename from drivers/platform/x86/intel/intel_plr_tpmi.c
rename to drivers/platform/x86/intel/plr_tpmi.c
diff --git a/drivers/platform/x86/intel/tpmi.c b/drivers/platform/x86/intel/vsec_tpmi.c
similarity index 99%
rename from drivers/platform/x86/intel/tpmi.c
rename to drivers/platform/x86/intel/vsec_tpmi.c
index 486ddc9b3592..c637e32048a3 100644
--- a/drivers/platform/x86/intel/tpmi.c
+++ b/drivers/platform/x86/intel/vsec_tpmi.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
- * intel-tpmi : Driver to enumerate TPMI features and create devices
+ * Driver to enumerate TPMI features and create devices
*
* Copyright (c) 2023, Intel Corporation.
* All Rights Reserved.
--
2.43.0.rc1.1336.g36b5255a03ac
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH v2 1/1] platform/x86: intel: Add 'intel' prefix to the modules automatically
2024-10-16 10:59 [PATCH v2 1/1] platform/x86: intel: Add 'intel' prefix to the modules automatically Andy Shevchenko
@ 2024-10-28 10:58 ` Andy Shevchenko
2024-10-28 12:49 ` Masahiro Yamada
0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2024-10-28 10:58 UTC (permalink / raw)
To: Ilpo Järvinen, Tero Kristo, Hans de Goede,
Srinivas Pandruvada, platform-driver-x86, linux-kernel
Cc: linux-kbuild, Masahiro Yamada, Geert Uytterhoeven, David Gow
On Wed, Oct 16, 2024 at 01:59:51PM +0300, Andy Shevchenko wrote:
> Rework Makefile to add 'intel' prefix to the modules automatically.
> This removes a lot of boilerplate code in it and also makes robust
> against mistypos in the prefix.
> ---
>
> v2: fixed obvious typos (LKP), Cc'ed to Kbuild ML (Ilpo), dropped RFC marker
>
> Note to Kbuild people: TBH I rather want to have something like this
> to be available on the level of Kbuild for any of the subdirectories
> in question.
Anyone, any comments on this?
This already passed a CI tests without failure so far. Perhaps it's good
to apply to show the demand of such a feature in Kbuild in the future?
Because I want to do the same for various */tests/ folders where we have
tons of test*, *kunit modules effectively duplicating the folder name.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/1] platform/x86: intel: Add 'intel' prefix to the modules automatically
2024-10-28 10:58 ` Andy Shevchenko
@ 2024-10-28 12:49 ` Masahiro Yamada
2024-10-28 13:05 ` Andy Shevchenko
0 siblings, 1 reply; 6+ messages in thread
From: Masahiro Yamada @ 2024-10-28 12:49 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Ilpo Järvinen, Tero Kristo, Hans de Goede,
Srinivas Pandruvada, platform-driver-x86, linux-kernel,
linux-kbuild, Geert Uytterhoeven, David Gow
On Mon, Oct 28, 2024 at 11:58 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Wed, Oct 16, 2024 at 01:59:51PM +0300, Andy Shevchenko wrote:
> > Rework Makefile to add 'intel' prefix to the modules automatically.
> > This removes a lot of boilerplate code in it and also makes robust
> > against mistypos in the prefix.
>
> > ---
> >
> > v2: fixed obvious typos (LKP), Cc'ed to Kbuild ML (Ilpo), dropped RFC marker
> >
> > Note to Kbuild people: TBH I rather want to have something like this
> > to be available on the level of Kbuild for any of the subdirectories
> > in question.
>
> Anyone, any comments on this?
> This already passed a CI tests without failure so far. Perhaps it's good
> to apply to show the demand of such a feature in Kbuild in the future?
> Because I want to do the same for various */tests/ folders where we have
> tons of test*, *kunit modules effectively duplicating the folder name.
I do not like what you are doing here, but
it is up to you whatever you do in Makefiles you maintain.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/1] platform/x86: intel: Add 'intel' prefix to the modules automatically
2024-10-28 12:49 ` Masahiro Yamada
@ 2024-10-28 13:05 ` Andy Shevchenko
2024-10-31 14:39 ` Ilpo Järvinen
0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2024-10-28 13:05 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Ilpo Järvinen, Tero Kristo, Hans de Goede,
Srinivas Pandruvada, platform-driver-x86, linux-kernel,
linux-kbuild, Geert Uytterhoeven, David Gow
On Mon, Oct 28, 2024 at 01:49:52PM +0100, Masahiro Yamada wrote:
> On Mon, Oct 28, 2024 at 11:58 AM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > On Wed, Oct 16, 2024 at 01:59:51PM +0300, Andy Shevchenko wrote:
> > > Rework Makefile to add 'intel' prefix to the modules automatically.
> > > This removes a lot of boilerplate code in it and also makes robust
> > > against mistypos in the prefix.
> >
> > > ---
> > >
> > > v2: fixed obvious typos (LKP), Cc'ed to Kbuild ML (Ilpo), dropped RFC marker
> > >
> > > Note to Kbuild people: TBH I rather want to have something like this
> > > to be available on the level of Kbuild for any of the subdirectories
> > > in question.
> >
> > Anyone, any comments on this?
> > This already passed a CI tests without failure so far. Perhaps it's good
> > to apply to show the demand of such a feature in Kbuild in the future?
> > Because I want to do the same for various */tests/ folders where we have
> > tons of test*, *kunit modules effectively duplicating the folder name.
>
> I do not like what you are doing here,
That's why the question is to Kbuild if it's possible to have this feature
available treewide for users in a form that you like?
> but it is up to you whatever you do in Makefiles you maintain.
Thanks! Ilpo, what do you think about applying this in its current form?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/1] platform/x86: intel: Add 'intel' prefix to the modules automatically
2024-10-28 13:05 ` Andy Shevchenko
@ 2024-10-31 14:39 ` Ilpo Järvinen
2024-10-31 15:19 ` Andy Shevchenko
0 siblings, 1 reply; 6+ messages in thread
From: Ilpo Järvinen @ 2024-10-31 14:39 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Masahiro Yamada, Tero Kristo, Hans de Goede, Srinivas Pandruvada,
platform-driver-x86, LKML, linux-kbuild, Geert Uytterhoeven,
David Gow
[-- Attachment #1: Type: text/plain, Size: 1648 bytes --]
On Mon, 28 Oct 2024, Andy Shevchenko wrote:
> On Mon, Oct 28, 2024 at 01:49:52PM +0100, Masahiro Yamada wrote:
> > On Mon, Oct 28, 2024 at 11:58 AM Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> > > On Wed, Oct 16, 2024 at 01:59:51PM +0300, Andy Shevchenko wrote:
> > > > Rework Makefile to add 'intel' prefix to the modules automatically.
> > > > This removes a lot of boilerplate code in it and also makes robust
> > > > against mistypos in the prefix.
> > >
> > > > ---
> > > >
> > > > v2: fixed obvious typos (LKP), Cc'ed to Kbuild ML (Ilpo), dropped RFC marker
> > > >
> > > > Note to Kbuild people: TBH I rather want to have something like this
> > > > to be available on the level of Kbuild for any of the subdirectories
> > > > in question.
> > >
> > > Anyone, any comments on this?
> > > This already passed a CI tests without failure so far. Perhaps it's good
> > > to apply to show the demand of such a feature in Kbuild in the future?
> > > Because I want to do the same for various */tests/ folders where we have
> > > tons of test*, *kunit modules effectively duplicating the folder name.
> >
> > I do not like what you are doing here,
>
> That's why the question is to Kbuild if it's possible to have this feature
> available treewide for users in a form that you like?
>
> > but it is up to you whatever you do in Makefiles you maintain.
>
> Thanks! Ilpo, what do you think about applying this in its current form?
I applied this patch now to review-ilpo branch. Hopefully we'll one day
have a generic mechanism for this but until then this will have to do.
--
i.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/1] platform/x86: intel: Add 'intel' prefix to the modules automatically
2024-10-31 14:39 ` Ilpo Järvinen
@ 2024-10-31 15:19 ` Andy Shevchenko
0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2024-10-31 15:19 UTC (permalink / raw)
To: Ilpo Järvinen
Cc: Masahiro Yamada, Tero Kristo, Hans de Goede, Srinivas Pandruvada,
platform-driver-x86, LKML, linux-kbuild, Geert Uytterhoeven,
David Gow
On Thu, Oct 31, 2024 at 04:39:53PM +0200, Ilpo Järvinen wrote:
> On Mon, 28 Oct 2024, Andy Shevchenko wrote:
> > On Mon, Oct 28, 2024 at 01:49:52PM +0100, Masahiro Yamada wrote:
> > > On Mon, Oct 28, 2024 at 11:58 AM Andy Shevchenko
> > > <andriy.shevchenko@linux.intel.com> wrote:
> > > > On Wed, Oct 16, 2024 at 01:59:51PM +0300, Andy Shevchenko wrote:
> > > > > Rework Makefile to add 'intel' prefix to the modules automatically.
> > > > > This removes a lot of boilerplate code in it and also makes robust
> > > > > against mistypos in the prefix.
...
> > > > > v2: fixed obvious typos (LKP), Cc'ed to Kbuild ML (Ilpo), dropped RFC marker
> > > > >
> > > > > Note to Kbuild people: TBH I rather want to have something like this
> > > > > to be available on the level of Kbuild for any of the subdirectories
> > > > > in question.
> > > >
> > > > Anyone, any comments on this?
> > > > This already passed a CI tests without failure so far. Perhaps it's good
> > > > to apply to show the demand of such a feature in Kbuild in the future?
> > > > Because I want to do the same for various */tests/ folders where we have
> > > > tons of test*, *kunit modules effectively duplicating the folder name.
> > >
> > > I do not like what you are doing here,
> >
> > That's why the question is to Kbuild if it's possible to have this feature
> > available treewide for users in a form that you like?
> >
> > > but it is up to you whatever you do in Makefiles you maintain.
> >
> > Thanks! Ilpo, what do you think about applying this in its current form?
>
> I applied this patch now to review-ilpo branch. Hopefully we'll one day
> have a generic mechanism for this but until then this will have to do.
Yeah, that's what I want to have as well...
Thanks!
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-10-31 15:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-16 10:59 [PATCH v2 1/1] platform/x86: intel: Add 'intel' prefix to the modules automatically Andy Shevchenko
2024-10-28 10:58 ` Andy Shevchenko
2024-10-28 12:49 ` Masahiro Yamada
2024-10-28 13:05 ` Andy Shevchenko
2024-10-31 14:39 ` Ilpo Järvinen
2024-10-31 15:19 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox