All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] ARM Davinci warning fixes
@ 2016-02-01 20:35 Arnd Bergmann
  2016-02-01 20:35   ` Arnd Bergmann
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Arnd Bergmann @ 2016-02-01 20:35 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Kevin and Sekhar,

Here are a couple of warning fixes for Davinci that I have
collected while testing randconfig kernels.

The first three are rather obvious, the last one might
need some discussion, maybe there is another way to do this.

Please apply for 4.6, or Ack

	Arnd

Arnd Bergmann (4):
  ARM: davinci: limit DT support to DA850
  ARM: davinci: avoid unused mityomapl138_pn_info variable
  ARM: davinci: DA8xx+DMx combined kernels need PATCH_PHYS_VIRT
  ARM: davinci: make I2C support optional

 arch/arm/Kconfig                           |  1 +
 arch/arm/mach-davinci/Kconfig              | 22 ++++------------------
 arch/arm/mach-davinci/board-dm644x-evm.c   |  8 ++++++--
 arch/arm/mach-davinci/board-dm646x-evm.c   |  7 +++++++
 arch/arm/mach-davinci/board-mityomapl138.c |  2 +-
 5 files changed, 19 insertions(+), 21 deletions(-)

-- 
2.7.0

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

* [PATCH 1/4] ARM: davinci: limit DT support to DA850
  2016-02-01 20:35 [PATCH 0/4] ARM Davinci warning fixes Arnd Bergmann
@ 2016-02-01 20:35   ` Arnd Bergmann
  2016-02-01 20:35   ` Arnd Bergmann
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: Arnd Bergmann @ 2016-02-01 20:35 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman; +Cc: linux-arm-kernel, Arnd Bergmann, linux-kernel

When da8xx-dt.c is built with onlu DA830 support but not DA850
support enabled, we get a compiler warning about unused symbols:

arch/arm/mach-davinci/da8xx-dt.c:28:20: warning: 'da8xx_init_irq' defined but not used [-Wunused-function]
 static void __init da8xx_init_irq(void)
arch/arm/mach-davinci/da8xx-dt.c:33:30: warning: 'da850_auxdata_lookup' defined but not used [-Wunused-variable]
 static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {

Obviously none of the file make sense for DA830, so we should not
even attempt this, so we can avoid the warning by ensuring it is
only built for 850, not 830.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-davinci/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index 83e0f40f9ff1..6124c69154c3 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -68,7 +68,7 @@ comment "DaVinci Board Type"
 config MACH_DA8XX_DT
 	bool "Support DA8XX platforms using device tree"
 	default y
-	depends on ARCH_DAVINCI_DA8XX
+	depends on ARCH_DAVINCI_DA850
 	select PINCTRL
 	help
 	  Say y here to include support for TI DaVinci DA850 based using
-- 
2.7.0

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

* [PATCH 1/4] ARM: davinci: limit DT support to DA850
@ 2016-02-01 20:35   ` Arnd Bergmann
  0 siblings, 0 replies; 14+ messages in thread
From: Arnd Bergmann @ 2016-02-01 20:35 UTC (permalink / raw)
  To: linux-arm-kernel

When da8xx-dt.c is built with onlu DA830 support but not DA850
support enabled, we get a compiler warning about unused symbols:

arch/arm/mach-davinci/da8xx-dt.c:28:20: warning: 'da8xx_init_irq' defined but not used [-Wunused-function]
 static void __init da8xx_init_irq(void)
arch/arm/mach-davinci/da8xx-dt.c:33:30: warning: 'da850_auxdata_lookup' defined but not used [-Wunused-variable]
 static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {

Obviously none of the file make sense for DA830, so we should not
even attempt this, so we can avoid the warning by ensuring it is
only built for 850, not 830.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-davinci/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index 83e0f40f9ff1..6124c69154c3 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -68,7 +68,7 @@ comment "DaVinci Board Type"
 config MACH_DA8XX_DT
 	bool "Support DA8XX platforms using device tree"
 	default y
-	depends on ARCH_DAVINCI_DA8XX
+	depends on ARCH_DAVINCI_DA850
 	select PINCTRL
 	help
 	  Say y here to include support for TI DaVinci DA850 based using
-- 
2.7.0

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

* [PATCH 2/4] ARM: davinci: avoid unused mityomapl138_pn_info variable
  2016-02-01 20:35 [PATCH 0/4] ARM Davinci warning fixes Arnd Bergmann
@ 2016-02-01 20:35   ` Arnd Bergmann
  2016-02-01 20:35   ` Arnd Bergmann
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: Arnd Bergmann @ 2016-02-01 20:35 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman; +Cc: linux-arm-kernel, Arnd Bergmann, linux-kernel

The mityomapl138_pn_info structure belongs into the CPU_FREQ support
that is hidden behind an #ifdef, and causes a harmless warning when
that support is disabled:

mach-davinci/board-mityomapl138.c:59:28: error: 'mityomapl138_pn_info' defined but not used [-Werror=unused-variable]

This moves the variable definition where it belongs.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-davinci/board-mityomapl138.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c
index de1316bf643a..c1f4b34785db 100644
--- a/arch/arm/mach-davinci/board-mityomapl138.c
+++ b/arch/arm/mach-davinci/board-mityomapl138.c
@@ -51,6 +51,7 @@ struct factory_config {
 
 static struct factory_config factory_config;
 
+#ifdef CONFIG_CPU_FREQ
 struct part_no_info {
 	const char	*part_no;	/* part number string of interest */
 	int		max_freq;	/* khz */
@@ -87,7 +88,6 @@ static struct part_no_info mityomapl138_pn_info[] = {
 	},
 };
 
-#ifdef CONFIG_CPU_FREQ
 static void mityomapl138_cpufreq_init(const char *partnum)
 {
 	int i, ret;
-- 
2.7.0

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

* [PATCH 2/4] ARM: davinci: avoid unused mityomapl138_pn_info variable
@ 2016-02-01 20:35   ` Arnd Bergmann
  0 siblings, 0 replies; 14+ messages in thread
From: Arnd Bergmann @ 2016-02-01 20:35 UTC (permalink / raw)
  To: linux-arm-kernel

The mityomapl138_pn_info structure belongs into the CPU_FREQ support
that is hidden behind an #ifdef, and causes a harmless warning when
that support is disabled:

mach-davinci/board-mityomapl138.c:59:28: error: 'mityomapl138_pn_info' defined but not used [-Werror=unused-variable]

This moves the variable definition where it belongs.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-davinci/board-mityomapl138.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c
index de1316bf643a..c1f4b34785db 100644
--- a/arch/arm/mach-davinci/board-mityomapl138.c
+++ b/arch/arm/mach-davinci/board-mityomapl138.c
@@ -51,6 +51,7 @@ struct factory_config {
 
 static struct factory_config factory_config;
 
+#ifdef CONFIG_CPU_FREQ
 struct part_no_info {
 	const char	*part_no;	/* part number string of interest */
 	int		max_freq;	/* khz */
@@ -87,7 +88,6 @@ static struct part_no_info mityomapl138_pn_info[] = {
 	},
 };
 
-#ifdef CONFIG_CPU_FREQ
 static void mityomapl138_cpufreq_init(const char *partnum)
 {
 	int i, ret;
-- 
2.7.0

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

* [PATCH 3/4] ARM: davinci: DA8xx+DMx combined kernels need PATCH_PHYS_VIRT
  2016-02-01 20:35 [PATCH 0/4] ARM Davinci warning fixes Arnd Bergmann
@ 2016-02-01 20:35   ` Arnd Bergmann
  2016-02-01 20:35   ` Arnd Bergmann
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: Arnd Bergmann @ 2016-02-01 20:35 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman
  Cc: linux-arm-kernel, Arnd Bergmann, Russell King, linux-kernel

We already forbid that combination when AUTO_ZRELADDR is disabled,
for the same reason that the two have their RAM at different
physical addresses as seen from the CPU.

This does the same change for PATCH_PHYS_VIRT: if you disable
either of the options, Kconfig now enforces that you have to
pick one or the other SoC family.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/Kconfig              | 1 +
 arch/arm/mach-davinci/Kconfig | 6 ++----
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 21d79b2531cc..8b10ccf4077e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -612,6 +612,7 @@ config ARCH_DAVINCI
 	select ARCH_HAS_HOLES_MEMORYMODEL
 	select ARCH_REQUIRE_GPIOLIB
 	select CLKDEV_LOOKUP
+	select CPU_ARM926T
 	select GENERIC_ALLOCATOR
 	select GENERIC_CLOCKEVENTS
 	select GENERIC_IRQ_CHIP
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index 6124c69154c3..8f54be83ec15 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -9,7 +9,6 @@ config CP_INTC
 
 config ARCH_DAVINCI_DMx
 	bool
-	select CPU_ARM926T
 
 menu "TI DaVinci Implementations"
 
@@ -32,7 +31,7 @@ config ARCH_DAVINCI_DM646x
 
 config ARCH_DAVINCI_DA830
 	bool "DA830/OMAP-L137/AM17x based system"
-	depends on !ARCH_DAVINCI_DMx || AUTO_ZRELADDR
+	depends on !ARCH_DAVINCI_DMx || (AUTO_ZRELADDR && ARM_PATCH_PHYS_VIRT)
 	select ARCH_DAVINCI_DA8XX
 	# needed on silicon revs 1.0, 1.1:
 	select CPU_DCACHE_WRITETHROUGH if !CPU_DCACHE_DISABLE
@@ -40,13 +39,12 @@ config ARCH_DAVINCI_DA830
 
 config ARCH_DAVINCI_DA850
 	bool "DA850/OMAP-L138/AM18x based system"
-	depends on !ARCH_DAVINCI_DMx || AUTO_ZRELADDR
+	depends on !ARCH_DAVINCI_DMx || (AUTO_ZRELADDR && ARM_PATCH_PHYS_VIRT)
 	select ARCH_DAVINCI_DA8XX
 	select CP_INTC
 
 config ARCH_DAVINCI_DA8XX
 	bool
-	select CPU_ARM926T
 
 config ARCH_DAVINCI_DM365
 	bool "DaVinci 365 based system"
-- 
2.7.0

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

* [PATCH 3/4] ARM: davinci: DA8xx+DMx combined kernels need PATCH_PHYS_VIRT
@ 2016-02-01 20:35   ` Arnd Bergmann
  0 siblings, 0 replies; 14+ messages in thread
From: Arnd Bergmann @ 2016-02-01 20:35 UTC (permalink / raw)
  To: linux-arm-kernel

We already forbid that combination when AUTO_ZRELADDR is disabled,
for the same reason that the two have their RAM at different
physical addresses as seen from the CPU.

This does the same change for PATCH_PHYS_VIRT: if you disable
either of the options, Kconfig now enforces that you have to
pick one or the other SoC family.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/Kconfig              | 1 +
 arch/arm/mach-davinci/Kconfig | 6 ++----
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 21d79b2531cc..8b10ccf4077e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -612,6 +612,7 @@ config ARCH_DAVINCI
 	select ARCH_HAS_HOLES_MEMORYMODEL
 	select ARCH_REQUIRE_GPIOLIB
 	select CLKDEV_LOOKUP
+	select CPU_ARM926T
 	select GENERIC_ALLOCATOR
 	select GENERIC_CLOCKEVENTS
 	select GENERIC_IRQ_CHIP
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index 6124c69154c3..8f54be83ec15 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -9,7 +9,6 @@ config CP_INTC
 
 config ARCH_DAVINCI_DMx
 	bool
-	select CPU_ARM926T
 
 menu "TI DaVinci Implementations"
 
@@ -32,7 +31,7 @@ config ARCH_DAVINCI_DM646x
 
 config ARCH_DAVINCI_DA830
 	bool "DA830/OMAP-L137/AM17x based system"
-	depends on !ARCH_DAVINCI_DMx || AUTO_ZRELADDR
+	depends on !ARCH_DAVINCI_DMx || (AUTO_ZRELADDR && ARM_PATCH_PHYS_VIRT)
 	select ARCH_DAVINCI_DA8XX
 	# needed on silicon revs 1.0, 1.1:
 	select CPU_DCACHE_WRITETHROUGH if !CPU_DCACHE_DISABLE
@@ -40,13 +39,12 @@ config ARCH_DAVINCI_DA830
 
 config ARCH_DAVINCI_DA850
 	bool "DA850/OMAP-L138/AM18x based system"
-	depends on !ARCH_DAVINCI_DMx || AUTO_ZRELADDR
+	depends on !ARCH_DAVINCI_DMx || (AUTO_ZRELADDR && ARM_PATCH_PHYS_VIRT)
 	select ARCH_DAVINCI_DA8XX
 	select CP_INTC
 
 config ARCH_DAVINCI_DA8XX
 	bool
-	select CPU_ARM926T
 
 config ARCH_DAVINCI_DM365
 	bool "DaVinci 365 based system"
-- 
2.7.0

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

* [PATCH 4/4] ARM: davinci: make I2C support optional
  2016-02-01 20:35 [PATCH 0/4] ARM Davinci warning fixes Arnd Bergmann
@ 2016-02-01 20:35   ` Arnd Bergmann
  2016-02-01 20:35   ` Arnd Bergmann
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: Arnd Bergmann @ 2016-02-01 20:35 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman; +Cc: linux-arm-kernel, Arnd Bergmann, linux-kernel

The davinci platform has tried to get support for the EEPROM right,
but failed to get a clean build so far. At the moment, we get
a warning whenever CONFIG_SYSFS is disabled, as that is needed by
EEPROM_AT24:

warning: (MACH_DAVINCI_EVM && MACH_SFFSDR && MACH_DAVINCI_DM6467_EVM && MACH_DAVINCI_DM365_EVM && MACH_DAVINCI_DA830_EVM && MACH_MITYOMAPL138 && MACH_MINI2440) selects EEPROM_AT24 which has unmet direct dependencies (I2C && SYSFS)

Kevin Hilman initially added the 'select' to ensure that EEPROM_AT24
is always enabled in machines that really want it for normal operation
(i.e. for reading the MAC address). This broke when I2C was disabled,
and Russell King followed up with another patch to select that as
well.

I now see that the SYSFS dependency is still missing, which leaves
us with three options:

a) add 'select SYSFS' in addition to the others
b) change AT24_EEPPROM to work without sysfs (should be possible)
c) remove all those selects again and get the files to build when
   I2C is disabled.

I would really hate to do a) because adding select statements that
hardwire user-selectable symbols is generally a bad idea. I first
tried b) but then ended up redoing the patch from scratch to approach
c), so we can also remove the other selects.

I checked that CONFIG_I2C is still enabled with davinci_all_defconfig,
so that does not have to change.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 45b146d746ea ("ARM: Davinci: Fix I2C build errors")
Fixes: 22ca466847ad ("davinci: kconfig: select at24 eeprom for selected boards")
---
 arch/arm/mach-davinci/Kconfig            | 14 +-------------
 arch/arm/mach-davinci/board-dm644x-evm.c |  8 ++++++--
 arch/arm/mach-davinci/board-dm646x-evm.c |  7 +++++++
 3 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index 8f54be83ec15..c1d2cb4ec04f 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -76,8 +76,6 @@ config MACH_DAVINCI_EVM
 	bool "TI DM644x EVM"
 	default ARCH_DAVINCI_DM644x
 	depends on ARCH_DAVINCI_DM644x
-	select EEPROM_AT24
-	select I2C
 	help
 	  Configure this option to specify the whether the board used
 	  for development is a DM644x EVM
@@ -85,8 +83,6 @@ config MACH_DAVINCI_EVM
 config MACH_SFFSDR
 	bool "Lyrtech SFFSDR"
 	depends on ARCH_DAVINCI_DM644x
-	select EEPROM_AT24
-	select I2C
 	help
 	  Say Y here to select the Lyrtech Small Form Factor
 	  Software Defined Radio (SFFSDR) board.
@@ -117,8 +113,6 @@ config MACH_DAVINCI_DM6467_EVM
 	bool "TI DM6467 EVM"
 	default ARCH_DAVINCI_DM646x
 	depends on ARCH_DAVINCI_DM646x
-	select EEPROM_AT24
-	select I2C
 	select MACH_DAVINCI_DM6467TEVM
 	help
 	  Configure this option to specify the whether the board used
@@ -131,8 +125,6 @@ config MACH_DAVINCI_DM365_EVM
 	bool "TI DM365 EVM"
 	default ARCH_DAVINCI_DM365
 	depends on ARCH_DAVINCI_DM365
-	select EEPROM_AT24
-	select I2C
 	help
 	  Configure this option to specify whether the board used
 	  for development is a DM365 EVM
@@ -141,9 +133,7 @@ config MACH_DAVINCI_DA830_EVM
 	bool "TI DA830/OMAP-L137/AM17x Reference Platform"
 	default ARCH_DAVINCI_DA830
 	depends on ARCH_DAVINCI_DA830
-	select EEPROM_AT24
-	select GPIO_PCF857X
-	select I2C
+	select GPIO_PCF857X if I2C
 	help
 	  Say Y here to select the TI DA830/OMAP-L137/AM17x Evaluation Module.
 
@@ -212,8 +202,6 @@ endchoice
 config MACH_MITYOMAPL138
 	bool "Critical Link MityDSP-L138/MityARM-1808 SoM"
 	depends on ARCH_DAVINCI_DA850
-	select EEPROM_AT24
-	select I2C
 	help
 	  Say Y here to select the Critical Link MityDSP-L138/MityARM-1808
 	  System on Module.  Information on this SoM may be found at
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 7a20507a3eef..68cc09907828 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -267,7 +267,7 @@ static struct platform_device rtc_dev = {
 static struct snd_platform_data dm644x_evm_snd_data;
 
 /*----------------------------------------------------------------------*/
-
+#ifdef CONFIG_I2C
 /*
  * I2C GPIO expanders
  */
@@ -612,6 +612,7 @@ static void __init evm_init_i2c(void)
 	i2c_add_driver(&dm6446evm_msp_driver);
 	i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info));
 }
+#endif
 
 #define VENC_STD_ALL	(V4L2_STD_NTSC | V4L2_STD_PAL)
 
@@ -780,7 +781,9 @@ static __init void davinci_evm_init(void)
 				pr_warn("%s: Cannot configure AEMIF\n",
 					__func__);
 
+#ifdef CONFIG_I2C
 			evm_leds[7].default_trigger = "nand-disk";
+#endif
 			if (HAS_NOR)
 				pr_warn("WARNING: both NAND and NOR flash are enabled; disable one of them.\n");
 		} else if (HAS_NOR)
@@ -789,9 +792,10 @@ static __init void davinci_evm_init(void)
 
 	platform_add_devices(davinci_evm_devices,
 			     ARRAY_SIZE(davinci_evm_devices));
+#ifdef CONFIG_I2C
 	evm_init_i2c();
-
 	davinci_setup_mmc(0, &dm6446evm_mmc_config);
+#endif
 	dm644x_init_video(&dm644xevm_capture_cfg, &dm644xevm_display_cfg);
 
 	davinci_serial_init(dm644x_serial_device);
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index ee6ab7e8d3b0..f702d4fc8eb8 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -121,6 +121,7 @@ static struct platform_device davinci_nand_device = {
 
 #define HAS_ATA		IS_ENABLED(CONFIG_BLK_DEV_PALMCHIP_BK3710)
 
+#ifdef CONFIG_I2C
 /* CPLD Register 0 bits to control ATA */
 #define DM646X_EVM_ATA_RST		BIT(0)
 #define DM646X_EVM_ATA_PWD		BIT(1)
@@ -316,6 +317,7 @@ static struct at24_platform_data eeprom_info = {
 	.setup          = davinci_get_mac_addr,
 	.context	= (void *)0x7f00,
 };
+#endif
 
 static u8 dm646x_iis_serializer_direction[] = {
        TX_MODE, RX_MODE, INACTIVE_MODE, INACTIVE_MODE,
@@ -346,6 +348,7 @@ static struct snd_platform_data dm646x_evm_snd_data[] = {
 	},
 };
 
+#ifdef CONFIG_I2C
 static struct i2c_client *cpld_client;
 
 static int cpld_video_probe(struct i2c_client *client,
@@ -710,6 +713,7 @@ static void __init evm_init_i2c(void)
 	evm_init_cpld();
 	evm_init_video();
 }
+#endif
 
 #define DM6467T_EVM_REF_FREQ		33000000
 
@@ -764,7 +768,10 @@ static __init void evm_init(void)
 	if (ret)
 		pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
 
+#ifdef CONFIG_I2C
 	evm_init_i2c();
+#endif
+
 	davinci_serial_init(dm646x_serial_device);
 	dm646x_init_mcasp0(&dm646x_evm_snd_data[0]);
 	dm646x_init_mcasp1(&dm646x_evm_snd_data[1]);
-- 
2.7.0

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

* [PATCH 4/4] ARM: davinci: make I2C support optional
@ 2016-02-01 20:35   ` Arnd Bergmann
  0 siblings, 0 replies; 14+ messages in thread
From: Arnd Bergmann @ 2016-02-01 20:35 UTC (permalink / raw)
  To: linux-arm-kernel

The davinci platform has tried to get support for the EEPROM right,
but failed to get a clean build so far. At the moment, we get
a warning whenever CONFIG_SYSFS is disabled, as that is needed by
EEPROM_AT24:

warning: (MACH_DAVINCI_EVM && MACH_SFFSDR && MACH_DAVINCI_DM6467_EVM && MACH_DAVINCI_DM365_EVM && MACH_DAVINCI_DA830_EVM && MACH_MITYOMAPL138 && MACH_MINI2440) selects EEPROM_AT24 which has unmet direct dependencies (I2C && SYSFS)

Kevin Hilman initially added the 'select' to ensure that EEPROM_AT24
is always enabled in machines that really want it for normal operation
(i.e. for reading the MAC address). This broke when I2C was disabled,
and Russell King followed up with another patch to select that as
well.

I now see that the SYSFS dependency is still missing, which leaves
us with three options:

a) add 'select SYSFS' in addition to the others
b) change AT24_EEPPROM to work without sysfs (should be possible)
c) remove all those selects again and get the files to build when
   I2C is disabled.

I would really hate to do a) because adding select statements that
hardwire user-selectable symbols is generally a bad idea. I first
tried b) but then ended up redoing the patch from scratch to approach
c), so we can also remove the other selects.

I checked that CONFIG_I2C is still enabled with davinci_all_defconfig,
so that does not have to change.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 45b146d746ea ("ARM: Davinci: Fix I2C build errors")
Fixes: 22ca466847ad ("davinci: kconfig: select at24 eeprom for selected boards")
---
 arch/arm/mach-davinci/Kconfig            | 14 +-------------
 arch/arm/mach-davinci/board-dm644x-evm.c |  8 ++++++--
 arch/arm/mach-davinci/board-dm646x-evm.c |  7 +++++++
 3 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index 8f54be83ec15..c1d2cb4ec04f 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -76,8 +76,6 @@ config MACH_DAVINCI_EVM
 	bool "TI DM644x EVM"
 	default ARCH_DAVINCI_DM644x
 	depends on ARCH_DAVINCI_DM644x
-	select EEPROM_AT24
-	select I2C
 	help
 	  Configure this option to specify the whether the board used
 	  for development is a DM644x EVM
@@ -85,8 +83,6 @@ config MACH_DAVINCI_EVM
 config MACH_SFFSDR
 	bool "Lyrtech SFFSDR"
 	depends on ARCH_DAVINCI_DM644x
-	select EEPROM_AT24
-	select I2C
 	help
 	  Say Y here to select the Lyrtech Small Form Factor
 	  Software Defined Radio (SFFSDR) board.
@@ -117,8 +113,6 @@ config MACH_DAVINCI_DM6467_EVM
 	bool "TI DM6467 EVM"
 	default ARCH_DAVINCI_DM646x
 	depends on ARCH_DAVINCI_DM646x
-	select EEPROM_AT24
-	select I2C
 	select MACH_DAVINCI_DM6467TEVM
 	help
 	  Configure this option to specify the whether the board used
@@ -131,8 +125,6 @@ config MACH_DAVINCI_DM365_EVM
 	bool "TI DM365 EVM"
 	default ARCH_DAVINCI_DM365
 	depends on ARCH_DAVINCI_DM365
-	select EEPROM_AT24
-	select I2C
 	help
 	  Configure this option to specify whether the board used
 	  for development is a DM365 EVM
@@ -141,9 +133,7 @@ config MACH_DAVINCI_DA830_EVM
 	bool "TI DA830/OMAP-L137/AM17x Reference Platform"
 	default ARCH_DAVINCI_DA830
 	depends on ARCH_DAVINCI_DA830
-	select EEPROM_AT24
-	select GPIO_PCF857X
-	select I2C
+	select GPIO_PCF857X if I2C
 	help
 	  Say Y here to select the TI DA830/OMAP-L137/AM17x Evaluation Module.
 
@@ -212,8 +202,6 @@ endchoice
 config MACH_MITYOMAPL138
 	bool "Critical Link MityDSP-L138/MityARM-1808 SoM"
 	depends on ARCH_DAVINCI_DA850
-	select EEPROM_AT24
-	select I2C
 	help
 	  Say Y here to select the Critical Link MityDSP-L138/MityARM-1808
 	  System on Module.  Information on this SoM may be found at
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 7a20507a3eef..68cc09907828 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -267,7 +267,7 @@ static struct platform_device rtc_dev = {
 static struct snd_platform_data dm644x_evm_snd_data;
 
 /*----------------------------------------------------------------------*/
-
+#ifdef CONFIG_I2C
 /*
  * I2C GPIO expanders
  */
@@ -612,6 +612,7 @@ static void __init evm_init_i2c(void)
 	i2c_add_driver(&dm6446evm_msp_driver);
 	i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info));
 }
+#endif
 
 #define VENC_STD_ALL	(V4L2_STD_NTSC | V4L2_STD_PAL)
 
@@ -780,7 +781,9 @@ static __init void davinci_evm_init(void)
 				pr_warn("%s: Cannot configure AEMIF\n",
 					__func__);
 
+#ifdef CONFIG_I2C
 			evm_leds[7].default_trigger = "nand-disk";
+#endif
 			if (HAS_NOR)
 				pr_warn("WARNING: both NAND and NOR flash are enabled; disable one of them.\n");
 		} else if (HAS_NOR)
@@ -789,9 +792,10 @@ static __init void davinci_evm_init(void)
 
 	platform_add_devices(davinci_evm_devices,
 			     ARRAY_SIZE(davinci_evm_devices));
+#ifdef CONFIG_I2C
 	evm_init_i2c();
-
 	davinci_setup_mmc(0, &dm6446evm_mmc_config);
+#endif
 	dm644x_init_video(&dm644xevm_capture_cfg, &dm644xevm_display_cfg);
 
 	davinci_serial_init(dm644x_serial_device);
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index ee6ab7e8d3b0..f702d4fc8eb8 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -121,6 +121,7 @@ static struct platform_device davinci_nand_device = {
 
 #define HAS_ATA		IS_ENABLED(CONFIG_BLK_DEV_PALMCHIP_BK3710)
 
+#ifdef CONFIG_I2C
 /* CPLD Register 0 bits to control ATA */
 #define DM646X_EVM_ATA_RST		BIT(0)
 #define DM646X_EVM_ATA_PWD		BIT(1)
@@ -316,6 +317,7 @@ static struct at24_platform_data eeprom_info = {
 	.setup          = davinci_get_mac_addr,
 	.context	= (void *)0x7f00,
 };
+#endif
 
 static u8 dm646x_iis_serializer_direction[] = {
        TX_MODE, RX_MODE, INACTIVE_MODE, INACTIVE_MODE,
@@ -346,6 +348,7 @@ static struct snd_platform_data dm646x_evm_snd_data[] = {
 	},
 };
 
+#ifdef CONFIG_I2C
 static struct i2c_client *cpld_client;
 
 static int cpld_video_probe(struct i2c_client *client,
@@ -710,6 +713,7 @@ static void __init evm_init_i2c(void)
 	evm_init_cpld();
 	evm_init_video();
 }
+#endif
 
 #define DM6467T_EVM_REF_FREQ		33000000
 
@@ -764,7 +768,10 @@ static __init void evm_init(void)
 	if (ret)
 		pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
 
+#ifdef CONFIG_I2C
 	evm_init_i2c();
+#endif
+
 	davinci_serial_init(dm646x_serial_device);
 	dm646x_init_mcasp0(&dm646x_evm_snd_data[0]);
 	dm646x_init_mcasp1(&dm646x_evm_snd_data[1]);
-- 
2.7.0

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

* Re: [PATCH 4/4] ARM: davinci: make I2C support optional
  2016-02-01 20:35   ` Arnd Bergmann
@ 2016-02-05 13:20     ` Sekhar Nori
  -1 siblings, 0 replies; 14+ messages in thread
From: Sekhar Nori @ 2016-02-05 13:20 UTC (permalink / raw)
  To: Arnd Bergmann, Kevin Hilman; +Cc: linux-arm-kernel, linux-kernel

On Tuesday 02 February 2016 02:05 AM, Arnd Bergmann wrote:
> The davinci platform has tried to get support for the EEPROM right,
> but failed to get a clean build so far. At the moment, we get
> a warning whenever CONFIG_SYSFS is disabled, as that is needed by
> EEPROM_AT24:
> 
> warning: (MACH_DAVINCI_EVM && MACH_SFFSDR && MACH_DAVINCI_DM6467_EVM && MACH_DAVINCI_DM365_EVM && MACH_DAVINCI_DA830_EVM && MACH_MITYOMAPL138 && MACH_MINI2440) selects EEPROM_AT24 which has unmet direct dependencies (I2C && SYSFS)
> 
> Kevin Hilman initially added the 'select' to ensure that EEPROM_AT24
> is always enabled in machines that really want it for normal operation
> (i.e. for reading the MAC address). This broke when I2C was disabled,
> and Russell King followed up with another patch to select that as
> well.
> 
> I now see that the SYSFS dependency is still missing, which leaves
> us with three options:
> 
> a) add 'select SYSFS' in addition to the others
> b) change AT24_EEPPROM to work without sysfs (should be possible)
> c) remove all those selects again and get the files to build when
>    I2C is disabled.
> 
> I would really hate to do a) because adding select statements that
> hardwire user-selectable symbols is generally a bad idea. I first
> tried b) but then ended up redoing the patch from scratch to approach
> c), so we can also remove the other selects.
> 
> I checked that CONFIG_I2C is still enabled with davinci_all_defconfig,
> so that does not have to change.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 45b146d746ea ("ARM: Davinci: Fix I2C build errors")
> Fixes: 22ca466847ad ("davinci: kconfig: select at24 eeprom for selected boards")

This looks good to me. The #ifdefs in the middle of davinci_evm_init()
are an eyesore, but getting rid of the selects is a big plus.

Thanks,
Sekhar

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

* [PATCH 4/4] ARM: davinci: make I2C support optional
@ 2016-02-05 13:20     ` Sekhar Nori
  0 siblings, 0 replies; 14+ messages in thread
From: Sekhar Nori @ 2016-02-05 13:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 02 February 2016 02:05 AM, Arnd Bergmann wrote:
> The davinci platform has tried to get support for the EEPROM right,
> but failed to get a clean build so far. At the moment, we get
> a warning whenever CONFIG_SYSFS is disabled, as that is needed by
> EEPROM_AT24:
> 
> warning: (MACH_DAVINCI_EVM && MACH_SFFSDR && MACH_DAVINCI_DM6467_EVM && MACH_DAVINCI_DM365_EVM && MACH_DAVINCI_DA830_EVM && MACH_MITYOMAPL138 && MACH_MINI2440) selects EEPROM_AT24 which has unmet direct dependencies (I2C && SYSFS)
> 
> Kevin Hilman initially added the 'select' to ensure that EEPROM_AT24
> is always enabled in machines that really want it for normal operation
> (i.e. for reading the MAC address). This broke when I2C was disabled,
> and Russell King followed up with another patch to select that as
> well.
> 
> I now see that the SYSFS dependency is still missing, which leaves
> us with three options:
> 
> a) add 'select SYSFS' in addition to the others
> b) change AT24_EEPPROM to work without sysfs (should be possible)
> c) remove all those selects again and get the files to build when
>    I2C is disabled.
> 
> I would really hate to do a) because adding select statements that
> hardwire user-selectable symbols is generally a bad idea. I first
> tried b) but then ended up redoing the patch from scratch to approach
> c), so we can also remove the other selects.
> 
> I checked that CONFIG_I2C is still enabled with davinci_all_defconfig,
> so that does not have to change.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 45b146d746ea ("ARM: Davinci: Fix I2C build errors")
> Fixes: 22ca466847ad ("davinci: kconfig: select at24 eeprom for selected boards")

This looks good to me. The #ifdefs in the middle of davinci_evm_init()
are an eyesore, but getting rid of the selects is a big plus.

Thanks,
Sekhar

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

* Re: [PATCH 4/4] ARM: davinci: make I2C support optional
  2016-02-05 13:20     ` Sekhar Nori
@ 2016-02-05 14:15       ` Arnd Bergmann
  -1 siblings, 0 replies; 14+ messages in thread
From: Arnd Bergmann @ 2016-02-05 14:15 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Sekhar Nori, Kevin Hilman, linux-kernel

On Friday 05 February 2016 18:50:29 Sekhar Nori wrote:
> > I checked that CONFIG_I2C is still enabled with davinci_all_defconfig,
> > so that does not have to change.
> > 
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > Fixes: 45b146d746ea ("ARM: Davinci: Fix I2C build errors")
> > Fixes: 22ca466847ad ("davinci: kconfig: select at24 eeprom for selected boards")
> 
> This looks good to me. The #ifdefs in the middle of davinci_evm_init()
> are an eyesore, but getting rid of the selects is a big plus.
> 

I agree on the eyesore. I had an earlier version using "if (IS_BUILTIN(CONFIG_I2C))"
checks that was much nicer, but it didn't work because all the declarations
in include/linux/i2c.h are hidden behind an #ifdef.

I thought about sending a patch for that file too, but I think it has come up
before and was nacked then.

	Arnd

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

* [PATCH 4/4] ARM: davinci: make I2C support optional
@ 2016-02-05 14:15       ` Arnd Bergmann
  0 siblings, 0 replies; 14+ messages in thread
From: Arnd Bergmann @ 2016-02-05 14:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 05 February 2016 18:50:29 Sekhar Nori wrote:
> > I checked that CONFIG_I2C is still enabled with davinci_all_defconfig,
> > so that does not have to change.
> > 
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > Fixes: 45b146d746ea ("ARM: Davinci: Fix I2C build errors")
> > Fixes: 22ca466847ad ("davinci: kconfig: select at24 eeprom for selected boards")
> 
> This looks good to me. The #ifdefs in the middle of davinci_evm_init()
> are an eyesore, but getting rid of the selects is a big plus.
> 

I agree on the eyesore. I had an earlier version using "if (IS_BUILTIN(CONFIG_I2C))"
checks that was much nicer, but it didn't work because all the declarations
in include/linux/i2c.h are hidden behind an #ifdef.

I thought about sending a patch for that file too, but I think it has come up
before and was nacked then.

	Arnd

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

* [PATCH 0/4] ARM Davinci warning fixes
  2016-02-01 20:35 [PATCH 0/4] ARM Davinci warning fixes Arnd Bergmann
                   ` (3 preceding siblings ...)
  2016-02-01 20:35   ` Arnd Bergmann
@ 2016-02-17 15:11 ` Sekhar Nori
  4 siblings, 0 replies; 14+ messages in thread
From: Sekhar Nori @ 2016-02-17 15:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 02 February 2016 02:05 AM, Arnd Bergmann wrote:
> Hi Kevin and Sekhar,
> 
> Here are a couple of warning fixes for Davinci that I have
> collected while testing randconfig kernels.
> 
> The first three are rather obvious, the last one might
> need some discussion, maybe there is another way to do this.
> 
> Please apply for 4.6, or Ack

Hi Arnd, I have applied the series for v4.6. I will send a pull request
soon after I am done with some testing on these.

Regards,
Sekhar

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

end of thread, other threads:[~2016-02-17 15:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-01 20:35 [PATCH 0/4] ARM Davinci warning fixes Arnd Bergmann
2016-02-01 20:35 ` [PATCH 1/4] ARM: davinci: limit DT support to DA850 Arnd Bergmann
2016-02-01 20:35   ` Arnd Bergmann
2016-02-01 20:35 ` [PATCH 2/4] ARM: davinci: avoid unused mityomapl138_pn_info variable Arnd Bergmann
2016-02-01 20:35   ` Arnd Bergmann
2016-02-01 20:35 ` [PATCH 3/4] ARM: davinci: DA8xx+DMx combined kernels need PATCH_PHYS_VIRT Arnd Bergmann
2016-02-01 20:35   ` Arnd Bergmann
2016-02-01 20:35 ` [PATCH 4/4] ARM: davinci: make I2C support optional Arnd Bergmann
2016-02-01 20:35   ` Arnd Bergmann
2016-02-05 13:20   ` Sekhar Nori
2016-02-05 13:20     ` Sekhar Nori
2016-02-05 14:15     ` Arnd Bergmann
2016-02-05 14:15       ` Arnd Bergmann
2016-02-17 15:11 ` [PATCH 0/4] ARM Davinci warning fixes Sekhar Nori

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.