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 / dsmg600-setup.c
index db488ecc98b54ea6f832bcba1b5e45d4edafd4f0..ac97a459903454e0a88a36de7ab258f68d773c6f 100644 (file)
@@ -26,7 +26,7 @@
 #include <linux/leds.h>
 #include <linux/reboot.h>
 #include <linux/i2c.h>
-#include <linux/i2c-gpio.h>
+#include <linux/gpio/machine.h>
 
 #include <mach/hardware.h>
 
@@ -69,16 +69,21 @@ static struct platform_device dsmg600_flash = {
        .resource               = &dsmg600_flash_resource,
 };
 
-static struct i2c_gpio_platform_data dsmg600_i2c_gpio_data = {
-       .sda_pin                = DSMG600_SDA_PIN,
-       .scl_pin                = DSMG600_SCL_PIN,
+static struct gpiod_lookup_table dsmg600_i2c_gpiod_table = {
+       .dev_id         = "i2c-gpio",
+       .table          = {
+               GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", DSMG600_SDA_PIN,
+                               NULL, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
+               GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", DSMG600_SCL_PIN,
+                               NULL, 1, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
+       },
 };
 
 static struct platform_device dsmg600_i2c_gpio = {
        .name                   = "i2c-gpio",
        .id                     = 0,
        .dev     = {
-               .platform_data  = &dsmg600_i2c_gpio_data,
+               .platform_data  = NULL,
        },
 };
 
@@ -175,7 +180,7 @@ static int power_button_countdown;
 #define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
 
 static void dsmg600_power_handler(unsigned long data);
-static DEFINE_TIMER(dsmg600_power_timer, dsmg600_power_handler, 0, 0);
+static DEFINE_TIMER(dsmg600_power_timer, dsmg600_power_handler);
 
 static void dsmg600_power_handler(unsigned long data)
 {
@@ -270,6 +275,7 @@ static void __init dsmg600_init(void)
        dsmg600_flash_resource.end =
                IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
 
+       gpiod_add_lookup_table(&dsmg600_i2c_gpiod_table);
        i2c_register_board_info(0, dsmg600_i2c_board_info,
                                ARRAY_SIZE(dsmg600_i2c_board_info));