]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ARM: at91/i2c: change id to let i2c-gpio work
authorBo Shen <voice.shen@atmel.com>
Mon, 15 Oct 2012 09:30:27 +0000 (17:30 +0800)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 16 Nov 2012 16:46:55 +0000 (16:46 +0000)
commit 7840487cd6298f9f931103b558290d8d98d41c49 upstream.

The i2c core driver will turn the platform device ID to busnum
When using platfrom device ID as -1, it means dynamically assigned
the busnum. When writing code, we need to make sure the busnum,
and call i2c_register_board_info(int busnum, ...) to register device
if using -1, we do not know the value of busnum

In order to solve this issue, set the platform device ID as a fix number
Here using 0 to match the busnum used in i2c_regsiter_board_info()

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
arch/arm/mach-at91/at91rm9200_devices.c
arch/arm/mach-at91/at91sam9260_devices.c
arch/arm/mach-at91/at91sam9261_devices.c
arch/arm/mach-at91/at91sam9263_devices.c
arch/arm/mach-at91/at91sam9rl_devices.c

index 143eebbef6fe01384d34135a1ba6d20a79914f9e..929fd913e555e40e66aa6fa6fe236ed5c39b75ec 100644 (file)
@@ -462,7 +462,7 @@ static struct i2c_gpio_platform_data pdata = {
 
 static struct platform_device at91rm9200_twi_device = {
        .name                   = "i2c-gpio",
-       .id                     = -1,
+       .id                     = 0,
        .dev.platform_data      = &pdata,
 };
 
index 25909884422b58435f7e2f7177e1694428ab856a..465e026fbf517e5863253d196040bb91205a37bc 100644 (file)
@@ -467,7 +467,7 @@ static struct i2c_gpio_platform_data pdata = {
 
 static struct platform_device at91sam9260_twi_device = {
        .name                   = "i2c-gpio",
-       .id                     = -1,
+       .id                     = 0,
        .dev.platform_data      = &pdata,
 };
 
index daf3e66cfe1d4d750282ea4b1994fb9c700d2b2b..d6d1e769c2bc492ab4767f20f9aba0c79f456e14 100644 (file)
@@ -284,7 +284,7 @@ static struct i2c_gpio_platform_data pdata = {
 
 static struct platform_device at91sam9261_twi_device = {
        .name                   = "i2c-gpio",
-       .id                     = -1,
+       .id                     = 0,
        .dev.platform_data      = &pdata,
 };
 
index 32a7e4339107c531406367f31e5d34a8b543f37a..e051376e47643b736311db7960aa038bdd7c0e1b 100644 (file)
@@ -540,7 +540,7 @@ static struct i2c_gpio_platform_data pdata = {
 
 static struct platform_device at91sam9263_twi_device = {
        .name                   = "i2c-gpio",
-       .id                     = -1,
+       .id                     = 0,
        .dev.platform_data      = &pdata,
 };
 
index 628eb566d60ce2e5b7620e903417b010aede16fd..4862b23ac82e4822bf91f5c2ed569058c23975ed 100644 (file)
@@ -319,7 +319,7 @@ static struct i2c_gpio_platform_data pdata = {
 
 static struct platform_device at91sam9rl_twi_device = {
        .name                   = "i2c-gpio",
-       .id                     = -1,
+       .id                     = 0,
        .dev.platform_data      = &pdata,
 };