Merge branch 'i2c/for-4.15' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / arch / arm / mach-ixp4xx / fsg-setup.c
index 6e32cbc4f590c5069db11cc6ac3b04da749726d6..033f79b35d5125cbaf0b8cd5fb8e725f260a998f 100644 (file)
@@ -23,7 +23,7 @@
 #include <linux/leds.h>
 #include <linux/reboot.h>
 #include <linux/i2c.h>
-#include <linux/i2c-gpio.h>
+#include <linux/gpio/machine.h>
 #include <linux/io.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -55,16 +55,21 @@ static struct platform_device fsg_flash = {
        .resource               = &fsg_flash_resource,
 };
 
-static struct i2c_gpio_platform_data fsg_i2c_gpio_data = {
-       .sda_pin                = FSG_SDA_PIN,
-       .scl_pin                = FSG_SCL_PIN,
+static struct gpiod_lookup_table fsg_i2c_gpiod_table = {
+       .dev_id         = "i2c-gpio",
+       .table          = {
+               GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", FSG_SDA_PIN,
+                               NULL, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
+               GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", FSG_SCL_PIN,
+                               NULL, 1, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
+       },
 };
 
 static struct platform_device fsg_i2c_gpio = {
        .name                   = "i2c-gpio",
        .id                     = 0,
        .dev = {
-               .platform_data  = &fsg_i2c_gpio_data,
+               .platform_data  = NULL,
        },
 };
 
@@ -197,6 +202,7 @@ static void __init fsg_init(void)
        /* Configure CS2 for operation, 8bit and writable */
        *IXP4XX_EXP_CS2 = 0xbfff0002;
 
+       gpiod_add_lookup_table(&fsg_i2c_gpiod_table);
        i2c_register_board_info(0, fsg_i2c_board_info,
                                ARRAY_SIZE(fsg_i2c_board_info));