I2C device board info
Subsystems (6)
Sascha,
I've noticed the following in i2c_board_info initializers:
arch/arm/mach-mx2/pcm038.c: I2C_BOARD_INFO("rtc-pcf8563", 0x51),arch/arm/mach-mx2/pcm038.c- .type = "pcf8563"
However, I2C_BOARD_INFO is defined as:
#define I2C_BOARD_INFO(dev_type, dev_addr) \
.type = dev_type, .addr = (dev_addr)
so you're initializing .type twice. Only one of these will be used, so you may want to correct these entries. (Looking at Realview, the one which is used is the second - so in the above case, .type will be initialized with current gcc to "pcf8563" not "rtc-pcf8563".)
Hi Russell,
Quoted 9 lines · Russell King - ARM Linux
Sascha,
I've noticed the following in
i2c_board_infoinitializers:
arch/arm/mach-mx2/pcm038.c:I2C_BOARD_INFO("rtc-pcf8563", 0x51),arch/arm/mach-mx2/pcm038.c-.type = "pcf8563"However,
I2C_BOARD_INFOis defined as:
Quoted 7 lines
#define
I2C_BOARD_INFO(dev_type, dev_addr)\
.type =dev_type, .addr = (dev_addr)so you're initializing .type twice. Only one of these will be used, so you may want to correct these entries. (Looking at Realview, the one which is used is the second - so in the above case, .type will be initialized with current gcc to "pcf8563" not "rtc-pcf8563".)
Most probably for historical reasons - the initial implementation of I2C_BOARD_INFO did define the driver name, and setting the device type was optional. Apparently the above piece of code was forgotten when I2C_BOARD_INFO() was modified.
The correct type name for this chip is "pcf8563" so the two lines above should be turned into:
I2C_BOARD_INFO("pcf8563", 0x51),Note that this is not an isolated case, although this one is worse because I2C_BOARD_INFO() and .type do not agree on the chip name. But there are several redundant .type definitions in arch/arm/mach-* and one in arch/blackfin/mach-bf527. Time to fix them?
Signature · 1 line
Jean Delvare
Quoted 4 lines · Jean Delvare
Note that this is not an isolated case, although this one is worse because
I2C_BOARD_INFO()and .type do not agree on the chip name. But there are several redundant .type definitions inarch/arm/mach-*and one inarch/blackfin/mach-bf527. Time to fix them?
That is my intention - I'm preparing patches for Realview and Versatile. This will only leave the MX* series of platforms in arch/arm doing this, which fall into Sascha's domain.
Quoted 9 lines · Russell King - ARM Linux
Quoted 4 lines · Jean Delvare
Note that this is not an isolated case, although this one is worse because
I2C_BOARD_INFO()and .type do not agree on the chip name. But there are several redundant .type definitions inarch/arm/mach-*and one inarch/blackfin/mach-bf527. Time to fix them?That is my intention - I'm preparing patches for Realview and Versatile. This will only leave the MX* series of platforms in
arch/armdoing this, which fall into Sascha's domain.
OK, thank you. I'll send a patch for the blackfin ones then.
Signature · 1 line
Jean Delvare
Quoted 7 lines · Jean Delvare
Quoted 6 lines · Russell King - ARM Linux
Quoted 4 lines · Jean Delvare
Note that this is not an isolated case, although this one is worse because
I2C_BOARD_INFO()and .type do not agree on the chip name. But there are several redundant .type definitions inarch/arm/mach-*and one inarch/blackfin/mach-bf527. Time to fix them?
Quoted 5 lines
Quoted 3 lines
That is my intention - I'm preparing patches for Realview and Versatile. This will only leave the MX* series of platforms in
arch/armdoing this, which fall into Sascha's domain.OK, thank you. I'll send a patch for the blackfin ones then.
Can I get an ack for this please?
Thanks.
Subject: ARM: Realview & Versatile: Fix i2c_board_info definitions
Fix i2c_board_info definitions - we were defining the 'type' field of these structures twice since the first argument of I2C_BOARD_INFO sets this field. Move the second definition into I2C_BOARD_INFO().
--- arch/arm/mach-realview/core.c | 3 +-- arch/arm/mach-versatile/core.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
arch/arm/mach-realview/core.c +1 -2
@@ -208,8 +208,7 @@ struct platform_device realview_i2c_device = {static struct i2c_board_info realview_i2c_board_info[] = { { -I2C_BOARD_INFO ("rtc-ds1307" ,0xd0 >>1 ), - .type ="ds1338" , +I2C_BOARD_INFO ("ds1338" ,0xd0 >>1 ), }, };
arch/arm/mach-versatile/core.c +1 -2
@@ -343,8 +343,7 @@ static struct platform_device versatile_i2c_device = {static struct i2c_board_info versatile_i2c_board_info[] = { { -I2C_BOARD_INFO ("rtc-ds1307" ,0xd0 >>1 ), - .type ="ds1338" , +I2C_BOARD_INFO ("ds1338" ,0xd0 >>1 ), }, };
Jean Delvare
Acked-byQuoted 43 lines · Russell King - ARM Linux
Quoted 6 lines · Jean Delvare
Quoted 3 lines · Russell King - ARM Linux
That is my intention - I'm preparing patches for Realview and Versatile. This will only leave the MX* series of platforms in
arch/armdoing this, which fall into Sascha's domain.OK, thank you. I'll send a patch for the blackfin ones then.
Can I get an ack for this please?
Thanks.
Subject: ARM: Realview & Versatile: Fix
i2c_board_infodefinitionsFix
i2c_board_infodefinitions - we were defining the 'type' field of these structures twice since the first argument ofI2C_BOARD_INFOsets this field. Move the second definition intoI2C_BOARD_INFO().Signed-off-by Russell King <rmk+kernel-lFZ/[email protected]>--- arch/arm/mach-realview/core.c | 3 +-- arch/arm/mach-versatile/core.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)arch/arm/mach-realview/core.c +1
-2@@ -208,8 +208,7 @@ struct platform_device realview_i2c_device = {static struct i2c_board_info realview_i2c_board_info[] = { { -I2C_BOARD_INFO ("rtc-ds1307" ,0xd0 >>1 ), - .type ="ds1338" , +I2C_BOARD_INFO ("ds1338" ,0xd0 >>1 ), }, };arch/arm/mach-versatile/core.c +0
-0
arch/arm/mach-versatile/core.c static struct platform_device versatile_i2c_device = { · line 349
Quoted 9 lines
arch/arm/mach-versatile/core.c +1
-2@@ -343,8 +343,7 @@ static struct platform_device versatile_i2c_device = {static struct i2c_board_info versatile_i2c_board_info[] = { { -I2C_BOARD_INFO ("rtc-ds1307" ,0xd0 >>1 ), - .type ="ds1338" , +I2C_BOARD_INFO ("ds1338" ,0xd0 >>1 ), }, };
Signature · 1 line
Jean Delvare
Ben Dooks
Acked-byQuoted 18 lines · Russell King - ARM Linux
Quoted 7 lines · Jean Delvare
Quoted 6 lines · Russell King - ARM Linux
Quoted 4 lines · Jean Delvare
Note that this is not an isolated case, although this one is worse because
I2C_BOARD_INFO()and .type do not agree on the chip name. But there are several redundant .type definitions inarch/arm/mach-*and one inarch/blackfin/mach-bf527. Time to fix them?Quoted 5 lines
Quoted 3 lines
That is my intention - I'm preparing patches for Realview and Versatile. This will only leave the MX* series of platforms in
arch/armdoing this, which fall into Sascha's domain.OK, thank you. I'll send a patch for the blackfin ones then.
Can I get an ack for this please?
Thanks.
Quoted 7 lines
Subject: ARM: Realview & Versatile: Fix
i2c_board_infodefinitionsFix
i2c_board_infodefinitions - we were defining the 'type' field of these structures twice since the first argument ofI2C_BOARD_INFOsets this field. Move the second definition intoI2C_BOARD_INFO().Signed-off-by Russell King <rmk+kernel-lFZ/[email protected]>
Quoted 33 lines
--- arch/arm/mach-realview/core.c | 3 +-- arch/arm/mach-versatile/core.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)arch/arm/mach-realview/core.c +1
-2@@ -208,8 +208,7 @@ struct platform_device realview_i2c_device = {static struct i2c_board_info realview_i2c_board_info[] = { { -I2C_BOARD_INFO ("rtc-ds1307" ,0xd0 >>1 ), - .type ="ds1338" , +I2C_BOARD_INFO ("ds1338" ,0xd0 >>1 ), }, };arch/arm/mach-versatile/core.c +1
-2@@ -343,8 +343,7 @@ static struct platform_device versatile_i2c_device = {static struct i2c_board_info versatile_i2c_board_info[] = { { -I2C_BOARD_INFO ("rtc-ds1307" ,0xd0 >>1 ), - .type ="ds1338" , +I2C_BOARD_INFO ("ds1338" ,0xd0 >>1 ), }, };
Signature · 5 lines
-- Ben Q: What's a light-year? A: One-third less calories than a regular year.
Quoted 9 lines · Russell King - ARM Linux
Sascha,
I've noticed the following in
i2c_board_infoinitializers:
arch/arm/mach-mx2/pcm038.c:I2C_BOARD_INFO("rtc-pcf8563", 0x51),arch/arm/mach-mx2/pcm038.c-.type = "pcf8563"However,
I2C_BOARD_INFOis defined as:
Quoted 8 lines
#define
I2C_BOARD_INFO(dev_type, dev_addr)\
.type =dev_type, .addr = (dev_addr)so you're initializing .type twice. Only one of these will be used, so you may want to correct these entries. (Looking at Realview, the one which is used is the second - so in the above case, .type will be initialized with current gcc to "pcf8563" not "rtc-pcf8563".)
Ok, here we go:
Quoted 1 line
From
89b5958a911ddcf1079e0dd6bbf2287f04c358d9Mon Sep 17 00:00:00 2001
From: Sascha Hauer <[email protected]>
Date: Mon, 20 Jul 2009 08:18:47 +0200
Subject: [PATCH] ARM: mxc: Fix i2c_board_info definitions
Fix i2c_board_info definitions - we were defining the 'type' field of these structures twice since the first argument of I2C_BOARD_INFO sets this field. Move the second definition into I2C_BOARD_INFO().
--- arch/arm/mach-mx1/mx1ads.c | 6 ++---- arch/arm/mach-mx2/eukrea_cpuimx27.c | 3 +-- arch/arm/mach-mx2/pcm038.c | 12 ++++-------- arch/arm/mach-mx3/pcm037.c | 3 +-- arch/arm/mach-mx3/pcm043.c | 3 +-- 5 files changed, 9 insertions(+), 18 deletions(-)
arch/arm/mach-mx1/mx1ads.c +2 -4
@@ -104,12 +104,10 @@ static struct imxi2c_platform_data mx1ads_i2c_data = {static struct i2c_board_info mx1ads_i2c_devices[] = { { -I2C_BOARD_INFO ("pcf857x" ,0x22 ), - .type ="pcf8575" , +I2C_BOARD_INFO ("pcf8575" ,0x22 ), .platform_data = &pcf857x_data[0 ], }, { -I2C_BOARD_INFO ("pcf857x" ,0x24 ), - .type ="pcf8575" , +I2C_BOARD_INFO ("pcf8575" ,0x24 ), .platform_data = &pcf857x_data[1 ], }, };
arch/arm/mach-mx2/eukrea_cpuimx27.c +1 -2
@@ -135,8 +135,7 @@ static struct imxi2c_platform_data eukrea_cpuimx27_i2c_1_data = {static struct i2c_board_info eukrea_cpuimx27_i2c_devices[] = { { -I2C_BOARD_INFO ("rtc-pcf8563" ,0x51 ), - .type ="pcf8563" +I2C_BOARD_INFO ("pcf8563" ,0x51 ), }, };
arch/arm/mach-mx2/pcm038.c +4 -8
@@ -186,17 +186,13 @@ static struct at24_platform_data board_eeprom = { };static struct i2c_board_info pcm038_i2c_devices[] = { - [0 ] = { + {I2C_BOARD_INFO ("at24" ,0x52 ),/* E0=0, E1=1, E2=0 */ .platform_data = &board_eeprom, - }, - [1 ] = { -I2C_BOARD_INFO ("rtc-pcf8563" ,0x51 ), - .type ="pcf8563" - }, - [2 ] = { + }, { +I2C_BOARD_INFO ("pcf8563" ,0x51 ), + }, {I2C_BOARD_INFO ("lm75" ,0x4a ), - .type ="lm75" } };
arch/arm/mach-mx3/pcm037.c +1 -2
@@ -266,8 +266,7 @@ static struct i2c_board_info pcm037_i2c_devices[] = { I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */ .platform_data = &board_eeprom, }, { -I2C_BOARD_INFO ("rtc-pcf8563" ,0x51 ), - .type = "pcf8563", + I2C_BOARD_INFO("pcf8563", 0x51), } };#endif
arch/arm/mach-mx3/pcm043.c +1 -2
@@ -133,8 +133,7 @@ static struct i2c_board_info pcm043_i2c_devices[] = { I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */ .platform_data = &board_eeprom, }, { -I2C_BOARD_INFO ("rtc-pcf8563" ,0x51 ), - .type = "pcf8563", + I2C_BOARD_INFO("pcf8563", 0x51), } };#endif
Signature · 7 lines
1.6.3.3 -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Jean Delvare
Acked-byQuoted 117 lines · Sascha Hauer
Quoted 9 lines · Russell King - ARM Linux
Sascha,
I've noticed the following in
i2c_board_infoinitializers:
arch/arm/mach-mx2/pcm038.c:I2C_BOARD_INFO("rtc-pcf8563", 0x51),arch/arm/mach-mx2/pcm038.c-.type = "pcf8563"However,
I2C_BOARD_INFOis defined as:Quoted 8 lines
#define
I2C_BOARD_INFO(dev_type, dev_addr)\
.type =dev_type, .addr = (dev_addr)so you're initializing .type twice. Only one of these will be used, so you may want to correct these entries. (Looking at Realview, the one which is used is the second - so in the above case, .type will be initialized with current gcc to "pcf8563" not "rtc-pcf8563".)
Ok, here we go:
From
89b5958a911ddcf1079e0dd6bbf2287f04c358d9Mon Sep 17 00:00:00 2001
From: Sascha Hauer <[email protected]>
Date: Mon, 20 Jul 2009 08:18:47 +0200
Subject: [PATCH] ARM: mxc: Fixi2c_board_infodefinitionsFix
i2c_board_infodefinitions - we were defining the 'type' field of these structures twice since the first argument ofI2C_BOARD_INFOsets this field. Move the second definition intoI2C_BOARD_INFO().Signed-off-by Sascha Hauer <[email protected]>--- arch/arm/mach-mx1/mx1ads.c | 6 ++---- arch/arm/mach-mx2/eukrea_cpuimx27.c | 3 +-- arch/arm/mach-mx2/pcm038.c | 12 ++++-------- arch/arm/mach-mx3/pcm037.c | 3 +-- arch/arm/mach-mx3/pcm043.c | 3 +-- 5 files changed, 9 insertions(+), 18 deletions(-)arch/arm/mach-mx1/mx1ads.c +2
-4@@ -104,12 +104,10 @@ static struct imxi2c_platform_data mx1ads_i2c_data = {static struct i2c_board_info mx1ads_i2c_devices[] = { { -I2C_BOARD_INFO ("pcf857x" ,0x22 ), - .type ="pcf8575" , +I2C_BOARD_INFO ("pcf8575" ,0x22 ), .platform_data = &pcf857x_data[0 ], }, { -I2C_BOARD_INFO ("pcf857x" ,0x24 ), - .type ="pcf8575" , +I2C_BOARD_INFO ("pcf8575" ,0x24 ), .platform_data = &pcf857x_data[1 ], }, };arch/arm/mach-mx2/eukrea_cpuimx27.c +1
-2@@ -135,8 +135,7 @@ static struct imxi2c_platform_data eukrea_cpuimx27_i2c_1_data = {static struct i2c_board_info eukrea_cpuimx27_i2c_devices[] = { { -I2C_BOARD_INFO ("rtc-pcf8563" ,0x51 ), - .type ="pcf8563" +I2C_BOARD_INFO ("pcf8563" ,0x51 ), }, };arch/arm/mach-mx2/pcm038.c +4
-8@@ -186,17 +186,13 @@ static struct at24_platform_data board_eeprom = { };static struct i2c_board_info pcm038_i2c_devices[] = { - [0 ] = { + {I2C_BOARD_INFO ("at24" ,0x52 ),/* E0=0, E1=1, E2=0 */ .platform_data = &board_eeprom, - }, - [1 ] = { -I2C_BOARD_INFO ("rtc-pcf8563" ,0x51 ), - .type ="pcf8563" - }, - [2 ] = { + }, { +I2C_BOARD_INFO ("pcf8563" ,0x51 ), + }, {I2C_BOARD_INFO ("lm75" ,0x4a ), - .type ="lm75" } };arch/arm/mach-mx3/pcm037.c +1
-2@@ -266,8 +266,7 @@ static struct i2c_board_info pcm037_i2c_devices[] = { I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */ .platform_data = &board_eeprom, }, { -I2C_BOARD_INFO ("rtc-pcf8563" ,0x51 ), - .type = "pcf8563", + I2C_BOARD_INFO("pcf8563", 0x51), } };#endif arch/arm/mach-mx3/pcm043.c +0
-0
arch/arm/mach-mx3/pcm043.c static struct i2c_board_info pcm043_i2c_devices[] = { · line 139
Quoted 9 lines
arch/arm/mach-mx3/pcm043.c +1
-2@@ -133,8 +133,7 @@ static struct i2c_board_info pcm043_i2c_devices[] = { I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */ .platform_data = &board_eeprom, }, { -I2C_BOARD_INFO ("rtc-pcf8563" ,0x51 ), - .type = "pcf8563", + I2C_BOARD_INFO("pcf8563", 0x51), } };#endif
Signature · 1 line
Jean Delvare