mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 1/2] mfd: intel_soc_pmic: use 'depends on' instead of 'select'
@ 2017-06-15 13:07 Hans de Goede
  2017-06-15 13:07 ` [PATCH v2 2/2] mfd: intel_soc_pmic_chtwc: " Hans de Goede
  2017-06-15 13:47 ` [PATCH v2 1/2] mfd: intel_soc_pmic: " Lee Jones
  0 siblings, 2 replies; 4+ messages in thread
From: Hans de Goede @ 2017-06-15 13:07 UTC (permalink / raw)
  To: Lee Jones; +Cc: Hans de Goede, linux-kernel, Arnd Bergmann

From: Arnd Bergmann <arnd@arndb.de>

I ran into a build error on ARM with a platform that has a non-standard
clk implementation:

drivers/clk/clk.o: In function `clk_disable':
clk.c:(.text.clk_disable+0x0): multiple definition of `clk_disable'
arch/arm/mach-omap1/clock.o:clock.c:(.text.clk_disable+0x0): first defined here
drivers/clk/clk.o: In function `clk_enable':
clk.c:(.text.clk_enable+0x0): multiple definition of `clk_enable'
arch/arm/mach-omap1/clock.o:clock.c:(.text.clk_enable+0x0): first defined here

The problem is a device driver that uses 'select COMMON_CLK', which is
generally a bad idea: selecting a subsystem should only be done from
a platform, otherwise we run into circular dependencies. The same driver
also selects 'GPIOLIB' and 'I2C', which has a similar effect.

This turns all three into 'depends on', as it should be.

Finally, we can limit the build to x86, unless we are compile testing.

Fixes: 5f125f1f5705 ("mfd: intel_soc_pmic: Select designware i2c-bus driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
-Split into 2 seperate patches for config INTEL_SOC_PMIC and
 config INTEL_SOC_PMIC_CHTWC
---
 drivers/mfd/Kconfig | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 95e868360e9a..2499f8b5135a 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -453,14 +453,12 @@ config LPC_SCH
 
 config INTEL_SOC_PMIC
 	bool "Support for Crystal Cove PMIC"
-	depends on HAS_IOMEM
-	select GPIOLIB
-	select I2C
+	depends on HAS_IOMEM && I2C=y && GPIOLIB && COMMON_CLK
+	depends on X86 || COMPILE_TEST
 	select MFD_CORE
 	select REGMAP_I2C
 	select REGMAP_IRQ
-	select COMMON_CLK
-	select I2C_DESIGNWARE_PLATFORM
+	select I2C_DESIGNWARE_PLATFORM if ACPI
 	help
 	  Select this option to enable support for Crystal Cove PMIC
 	  on some Intel SoC systems. The PMIC provides ADC, GPIO,
-- 
2.13.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] mfd: intel_soc_pmic_chtwc: use 'depends on' instead of 'select'
  2017-06-15 13:07 [PATCH v2 1/2] mfd: intel_soc_pmic: use 'depends on' instead of 'select' Hans de Goede
@ 2017-06-15 13:07 ` Hans de Goede
  2017-06-15 13:48   ` Lee Jones
  2017-06-15 13:47 ` [PATCH v2 1/2] mfd: intel_soc_pmic: " Lee Jones
  1 sibling, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2017-06-15 13:07 UTC (permalink / raw)
  To: Lee Jones; +Cc: Hans de Goede, linux-kernel, Arnd Bergmann

From: Arnd Bergmann <arnd@arndb.de>

I ran into a build error on ARM with a platform that has a non-standard
clk implementation:

drivers/clk/clk.o: In function `clk_disable':
clk.c:(.text.clk_disable+0x0): multiple definition of `clk_disable'
arch/arm/mach-omap1/clock.o:clock.c:(.text.clk_disable+0x0): first defined here
drivers/clk/clk.o: In function `clk_enable':
clk.c:(.text.clk_enable+0x0): multiple definition of `clk_enable'
arch/arm/mach-omap1/clock.o:clock.c:(.text.clk_enable+0x0): first defined here

The problem is a device driver that uses 'select COMMON_CLK', which is
generally a bad idea: selecting a subsystem should only be done from
a platform, otherwise we run into circular dependencies. The same driver
also selects 'GPIOLIB' and 'I2C', which has a similar effect.

This turns all three into 'depends on', as it should be.

Finally, we can limit the build to x86, unless we are compile testing.

Fixes: 2f91ded5f8f4 ("mfd: Add Cherry Trail Whiskey Cove PMIC driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
-Split into 2 seperate patches for config INTEL_SOC_PMIC and
 config INTEL_SOC_PMIC_CHTWC
---
 drivers/mfd/Kconfig | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 2499f8b5135a..1428814c33f9 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -481,13 +481,12 @@ config INTEL_SOC_PMIC_BXTWC
 	  on these systems.
 
 config INTEL_SOC_PMIC_CHTWC
-	bool "Support for Intel Cherry Trail Whiskey Cove PMIC"
-	depends on ACPI && HAS_IOMEM
+	tristate "Support for Intel Cherry Trail Whiskey Cove PMIC"
+	depends on ACPI && HAS_IOMEM && I2C=y && COMMON_CLK
+	depends on X86 || COMPILE_TEST
 	select MFD_CORE
-	select I2C
 	select REGMAP_I2C
 	select REGMAP_IRQ
-	select COMMON_CLK
 	select I2C_DESIGNWARE_PLATFORM
 	help
 	  Select this option to enable support for the Intel Cherry Trail
-- 
2.13.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 1/2] mfd: intel_soc_pmic: use 'depends on' instead of 'select'
  2017-06-15 13:07 [PATCH v2 1/2] mfd: intel_soc_pmic: use 'depends on' instead of 'select' Hans de Goede
  2017-06-15 13:07 ` [PATCH v2 2/2] mfd: intel_soc_pmic_chtwc: " Hans de Goede
@ 2017-06-15 13:47 ` Lee Jones
  1 sibling, 0 replies; 4+ messages in thread
From: Lee Jones @ 2017-06-15 13:47 UTC (permalink / raw)
  To: Hans de Goede; +Cc: linux-kernel, Arnd Bergmann

On Thu, 15 Jun 2017, Hans de Goede wrote:

> From: Arnd Bergmann <arnd@arndb.de>
> 
> I ran into a build error on ARM with a platform that has a non-standard
> clk implementation:
> 
> drivers/clk/clk.o: In function `clk_disable':
> clk.c:(.text.clk_disable+0x0): multiple definition of `clk_disable'
> arch/arm/mach-omap1/clock.o:clock.c:(.text.clk_disable+0x0): first defined here
> drivers/clk/clk.o: In function `clk_enable':
> clk.c:(.text.clk_enable+0x0): multiple definition of `clk_enable'
> arch/arm/mach-omap1/clock.o:clock.c:(.text.clk_enable+0x0): first defined here
> 
> The problem is a device driver that uses 'select COMMON_CLK', which is
> generally a bad idea: selecting a subsystem should only be done from
> a platform, otherwise we run into circular dependencies. The same driver
> also selects 'GPIOLIB' and 'I2C', which has a similar effect.
> 
> This turns all three into 'depends on', as it should be.
> 
> Finally, we can limit the build to x86, unless we are compile testing.
> 
> Fixes: 5f125f1f5705 ("mfd: intel_soc_pmic: Select designware i2c-bus driver")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> Changes in v2:
> -Split into 2 seperate patches for config INTEL_SOC_PMIC and
>  config INTEL_SOC_PMIC_CHTWC
> ---
>  drivers/mfd/Kconfig | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 95e868360e9a..2499f8b5135a 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -453,14 +453,12 @@ config LPC_SCH
>  
>  config INTEL_SOC_PMIC
>  	bool "Support for Crystal Cove PMIC"
> -	depends on HAS_IOMEM
> -	select GPIOLIB
> -	select I2C
> +	depends on HAS_IOMEM && I2C=y && GPIOLIB && COMMON_CLK
> +	depends on X86 || COMPILE_TEST
>  	select MFD_CORE
>  	select REGMAP_I2C
>  	select REGMAP_IRQ
> -	select COMMON_CLK
> -	select I2C_DESIGNWARE_PLATFORM
> +	select I2C_DESIGNWARE_PLATFORM if ACPI
>  	help
>  	  Select this option to enable support for Crystal Cove PMIC
>  	  on some Intel SoC systems. The PMIC provides ADC, GPIO,

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 2/2] mfd: intel_soc_pmic_chtwc: use 'depends on' instead of 'select'
  2017-06-15 13:07 ` [PATCH v2 2/2] mfd: intel_soc_pmic_chtwc: " Hans de Goede
@ 2017-06-15 13:48   ` Lee Jones
  0 siblings, 0 replies; 4+ messages in thread
From: Lee Jones @ 2017-06-15 13:48 UTC (permalink / raw)
  To: Hans de Goede; +Cc: linux-kernel, Arnd Bergmann

On Thu, 15 Jun 2017, Hans de Goede wrote:

> From: Arnd Bergmann <arnd@arndb.de>
> 
> I ran into a build error on ARM with a platform that has a non-standard
> clk implementation:
> 
> drivers/clk/clk.o: In function `clk_disable':
> clk.c:(.text.clk_disable+0x0): multiple definition of `clk_disable'
> arch/arm/mach-omap1/clock.o:clock.c:(.text.clk_disable+0x0): first defined here
> drivers/clk/clk.o: In function `clk_enable':
> clk.c:(.text.clk_enable+0x0): multiple definition of `clk_enable'
> arch/arm/mach-omap1/clock.o:clock.c:(.text.clk_enable+0x0): first defined here
> 
> The problem is a device driver that uses 'select COMMON_CLK', which is
> generally a bad idea: selecting a subsystem should only be done from
> a platform, otherwise we run into circular dependencies. The same driver
> also selects 'GPIOLIB' and 'I2C', which has a similar effect.
> 
> This turns all three into 'depends on', as it should be.
> 
> Finally, we can limit the build to x86, unless we are compile testing.
> 
> Fixes: 2f91ded5f8f4 ("mfd: Add Cherry Trail Whiskey Cove PMIC driver")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> Changes in v2:
> -Split into 2 seperate patches for config INTEL_SOC_PMIC and
>  config INTEL_SOC_PMIC_CHTWC
> ---
>  drivers/mfd/Kconfig | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 2499f8b5135a..1428814c33f9 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -481,13 +481,12 @@ config INTEL_SOC_PMIC_BXTWC
>  	  on these systems.
>  
>  config INTEL_SOC_PMIC_CHTWC
> -	bool "Support for Intel Cherry Trail Whiskey Cove PMIC"
> -	depends on ACPI && HAS_IOMEM
> +	tristate "Support for Intel Cherry Trail Whiskey Cove PMIC"
> +	depends on ACPI && HAS_IOMEM && I2C=y && COMMON_CLK
> +	depends on X86 || COMPILE_TEST
>  	select MFD_CORE
> -	select I2C
>  	select REGMAP_I2C
>  	select REGMAP_IRQ
> -	select COMMON_CLK
>  	select I2C_DESIGNWARE_PLATFORM
>  	help
>  	  Select this option to enable support for the Intel Cherry Trail

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-15 13:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-15 13:07 [PATCH v2 1/2] mfd: intel_soc_pmic: use 'depends on' instead of 'select' Hans de Goede
2017-06-15 13:07 ` [PATCH v2 2/2] mfd: intel_soc_pmic_chtwc: " Hans de Goede
2017-06-15 13:48   ` Lee Jones
2017-06-15 13:47 ` [PATCH v2 1/2] mfd: intel_soc_pmic: " Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®