diff options
| author | Sekhar Nori <nsekhar@ti.com> | 2018-04-18 05:32:46 -0400 |
|---|---|---|
| committer | Sekhar Nori <nsekhar@ti.com> | 2018-05-02 05:25:06 -0400 |
| commit | 9411ac07cd764be34bbd7ff09125a6b7b9175d4c (patch) | |
| tree | 6234e28e7d99c2d1c556e9a9ded92a1f182e5bfa | |
| parent | 5c054de228dd6d97bf8e38962bd118953b66e5a0 (diff) | |
ARM: davinci: fix GPIO lookup for I2C
The GPIO chip is called davinci_gpio.0 in legacy mode. Fix it, so that
I2C can correctly lookup the recovery gpios.
Note that it is the gpio-davinci driver that sets the gpiochip label to
davinci_gpio.0.
Also, the I2C device uses an id of 1 on DM644x and DM355.
While at it, convert to using GPIO_TO_PIN() for referring to GPIO pin
numbers, like it is done in rest of the board support files.
Fixes: e53537653791 ("i2c/ARM: davinci: Deep refactoring of I2C recovery")
Reviewed-by: David Lechner <david@lechnology.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
| -rw-r--r-- | arch/arm/mach-davinci/board-dm355-evm.c | 9 | ||||
| -rw-r--r-- | arch/arm/mach-davinci/board-dm644x-evm.c | 10 |
2 files changed, 13 insertions, 6 deletions
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c index 762d29683a3a..23ab9e8bc04c 100644 --- a/arch/arm/mach-davinci/board-dm355-evm.c +++ b/arch/arm/mach-davinci/board-dm355-evm.c | |||
| @@ -110,12 +110,15 @@ static struct platform_device davinci_nand_device = { | |||
| 110 | }, | 110 | }, |
| 111 | }; | 111 | }; |
| 112 | 112 | ||
| 113 | #define DM355_I2C_SDA_PIN GPIO_TO_PIN(0, 15) | ||
| 114 | #define DM355_I2C_SCL_PIN GPIO_TO_PIN(0, 14) | ||
| 115 | |||
| 113 | static struct gpiod_lookup_table i2c_recovery_gpiod_table = { | 116 | static struct gpiod_lookup_table i2c_recovery_gpiod_table = { |
| 114 | .dev_id = "i2c_davinci", | 117 | .dev_id = "i2c_davinci.1", |
| 115 | .table = { | 118 | .table = { |
| 116 | GPIO_LOOKUP("davinci_gpio", 15, "sda", | 119 | GPIO_LOOKUP("davinci_gpio.0", DM355_I2C_SDA_PIN, "sda", |
| 117 | GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), | 120 | GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), |
| 118 | GPIO_LOOKUP("davinci_gpio", 14, "scl", | 121 | GPIO_LOOKUP("davinci_gpio.0", DM355_I2C_SCL_PIN, "scl", |
| 119 | GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), | 122 | GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), |
| 120 | }, | 123 | }, |
| 121 | }; | 124 | }; |
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c index 95b55aae1366..509e64ab1994 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/i2c.h> | 17 | #include <linux/i2c.h> |
| 18 | #include <linux/platform_data/pcf857x.h> | 18 | #include <linux/platform_data/pcf857x.h> |
| 19 | #include <linux/platform_data/at24.h> | 19 | #include <linux/platform_data/at24.h> |
| 20 | #include <linux/platform_data/gpio-davinci.h> | ||
| 20 | #include <linux/mtd/mtd.h> | 21 | #include <linux/mtd/mtd.h> |
| 21 | #include <linux/mtd/rawnand.h> | 22 | #include <linux/mtd/rawnand.h> |
| 22 | #include <linux/mtd/partitions.h> | 23 | #include <linux/mtd/partitions.h> |
| @@ -596,12 +597,15 @@ static struct i2c_board_info __initdata i2c_info[] = { | |||
| 596 | }, | 597 | }, |
| 597 | }; | 598 | }; |
| 598 | 599 | ||
| 600 | #define DM644X_I2C_SDA_PIN GPIO_TO_PIN(2, 12) | ||
| 601 | #define DM644X_I2C_SCL_PIN GPIO_TO_PIN(2, 11) | ||
| 602 | |||
| 599 | static struct gpiod_lookup_table i2c_recovery_gpiod_table = { | 603 | static struct gpiod_lookup_table i2c_recovery_gpiod_table = { |
| 600 | .dev_id = "i2c_davinci", | 604 | .dev_id = "i2c_davinci.1", |
| 601 | .table = { | 605 | .table = { |
| 602 | GPIO_LOOKUP("davinci_gpio", 44, "sda", | 606 | GPIO_LOOKUP("davinci_gpio.0", DM644X_I2C_SDA_PIN, "sda", |
| 603 | GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), | 607 | GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), |
| 604 | GPIO_LOOKUP("davinci_gpio", 43, "scl", | 608 | GPIO_LOOKUP("davinci_gpio.0", DM644X_I2C_SCL_PIN, "scl", |
| 605 | GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), | 609 | GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), |
| 606 | }, | 610 | }, |
| 607 | }; | 611 | }; |
