i2c: gpio: Convert to use descriptors
[sfrench/cifs-2.6.git] / arch / arm / mach-ks8695 / board-acs5k.c
index e4d709c8ed32f317033b826918b636a855deacf6..f034724e01e11dca131b3c8da154e947be4da5c8 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_LOOKUP_IDX("KS8695", 5, NULL, 1, GPIO_ACTIVE_HIGH),
+       },
+};
+
 static struct i2c_gpio_platform_data acs5k_i2c_device_platdata = {
-       .sda_pin        = 4,
-       .scl_pin        = 5,
        .udelay         = 10,
 };
 
@@ -95,6 +101,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,