Merge tag 'modules-for-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu...
[sfrench/cifs-2.6.git] / arch / arm / mach-ks8695 / board-acs5k.c
index e4d709c8ed32f317033b826918b636a855deacf6..937eb1d47e7bb793a774e06c015347e726abc513 100644 (file)
@@ -16,7 +16,7 @@
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
-
+#include <linux/gpio/machine.h>
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
 #include <linux/i2c-gpio.h>
 
 #include "generic.h"
 
+static struct gpiod_lookup_table acs5k_i2c_gpiod_table = {
+       .dev_id         = "i2c-gpio",
+       .table          = {
+               GPIO_LOOKUP_IDX("KS8695", 4, NULL, 0,
+                               GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
+               GPIO_LOOKUP_IDX("KS8695", 5, NULL, 1,
+                               GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
+       },
+};
+
 static struct i2c_gpio_platform_data acs5k_i2c_device_platdata = {
-       .sda_pin        = 4,
-       .scl_pin        = 5,
        .udelay         = 10,
 };
 
@@ -95,6 +103,7 @@ static struct i2c_board_info acs5k_i2c_devs[] __initdata = {
 static void acs5k_i2c_init(void)
 {
        /* The gpio interface */
+       gpiod_add_lookup_table(&acs5k_i2c_gpiod_table);
        platform_device_register(&acs5k_i2c_device);
        /* I2C devices */
        i2c_register_board_info(0, acs5k_i2c_devs,