Merge branch 'i2c/for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
[sfrench/cifs-2.6.git] / arch / arm / plat-iop / i2c.c
index 7a79213db3e1c9d30259bad7d1051409e693793d..dfbd7c332866a3684e2e537d2a087ae98828ac5b 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/tty.h>
 #include <linux/serial_core.h>
 #include <linux/io.h>
+#include <linux/gpio/machine.h>
 #include <asm/pgtable.h>
 #include <asm/page.h>
 #include <asm/mach/map.h>
 #define IRQ_IOP3XX_I2C_1       IRQ_IOP33X_I2C_1
 #endif
 
+/*
+ * Each of the I2C busses have corresponding GPIO lines, and the driver
+ * need to access these directly to drive the bus low at times.
+ */
+
+struct gpiod_lookup_table iop3xx_i2c0_gpio_lookup = {
+       .dev_id = "IOP3xx-I2C.0",
+       .table = {
+               GPIO_LOOKUP("gpio-iop", 7, "scl", GPIO_ACTIVE_HIGH),
+               GPIO_LOOKUP("gpio-iop", 6, "sda", GPIO_ACTIVE_HIGH),
+               { }
+       },
+};
+
+struct gpiod_lookup_table iop3xx_i2c1_gpio_lookup = {
+       .dev_id = "IOP3xx-I2C.1",
+       .table = {
+               GPIO_LOOKUP("gpio-iop", 5, "scl", GPIO_ACTIVE_HIGH),
+               GPIO_LOOKUP("gpio-iop", 4, "sda", GPIO_ACTIVE_HIGH),
+               { }
+       },
+};
+
 static struct resource iop3xx_i2c0_resources[] = {
        [0] = {
                .start  = 0xfffff680,