Merge tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[sfrench/cifs-2.6.git] / arch / arm / mach-pxa / cm-x300.c
index 0b850237597be2ae950b9e07af0784c04c5fff57..c5c0ab8ac9f91991a0cf6791ebb065cd7e055395 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/clk.h>
 
 #include <linux/gpio.h>
+#include <linux/gpio/machine.h>
 #include <linux/dm9000.h>
 #include <linux/leds.h>
 #include <linux/platform_data/rtc-v3020.h>
@@ -343,9 +344,6 @@ static inline void cm_x300_init_bl(void) {}
 #define LCD_SPI_BUS_NUM        (1)
 
 static struct spi_gpio_platform_data cm_x300_spi_gpio_pdata = {
-       .sck            = GPIO_LCD_SCL,
-       .mosi           = GPIO_LCD_DIN,
-       .miso           = GPIO_LCD_DOUT,
        .num_chipselect = 1,
 };
 
@@ -357,6 +355,21 @@ static struct platform_device cm_x300_spi_gpio = {
        },
 };
 
+static struct gpiod_lookup_table cm_x300_spi_gpiod_table = {
+       .dev_id         = "spi_gpio",
+       .table          = {
+               GPIO_LOOKUP("gpio-pxa", GPIO_LCD_SCL,
+                           "sck", GPIO_ACTIVE_HIGH),
+               GPIO_LOOKUP("gpio-pxa", GPIO_LCD_DIN,
+                           "mosi", GPIO_ACTIVE_HIGH),
+               GPIO_LOOKUP("gpio-pxa", GPIO_LCD_DOUT,
+                           "miso", GPIO_ACTIVE_HIGH),
+               GPIO_LOOKUP("gpio-pxa", GPIO_LCD_CS,
+                           "cs", GPIO_ACTIVE_HIGH),
+               { },
+       },
+};
+
 static struct tdo24m_platform_data cm_x300_tdo24m_pdata = {
        .model = TDO35S,
 };
@@ -367,7 +380,6 @@ static struct spi_board_info cm_x300_spi_devices[] __initdata = {
                .max_speed_hz           = 1000000,
                .bus_num                = LCD_SPI_BUS_NUM,
                .chip_select            = 0,
-               .controller_data        = (void *) GPIO_LCD_CS,
                .platform_data          = &cm_x300_tdo24m_pdata,
        },
 };
@@ -376,6 +388,7 @@ static void __init cm_x300_init_spi(void)
 {
        spi_register_board_info(cm_x300_spi_devices,
                                ARRAY_SIZE(cm_x300_spi_devices));
+       gpiod_add_lookup_table(&cm_x300_spi_gpiod_table);
        platform_device_register(&cm_x300_spi_gpio);
 }
 #else