From 2b7b0fc0e98bd91972413e1a5ecdc568102bd7b8 Mon Sep 17 00:00:00 2001 From: Ashokkumar G <0xfee1dead.sa@gmail.com> Date: Mon, 27 Jan 2014 09:26:20 -0700 Subject: [PATCH 2/8] arch:arm:mmp: initialize gpio driver before other drivers Add gpio driver for pxa168 based gplugd before adding other peripheral drivers to boot properly. Add I2C information while initializing TWSI --- arch/arm/mach-mmp/gplugd.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-mmp/gplugd.c b/arch/arm/mach-mmp/gplugd.c index d81b247..83a7019 100644 --- a/arch/arm/mach-mmp/gplugd.c +++ b/arch/arm/mach-mmp/gplugd.c @@ -133,6 +133,10 @@ static struct pxa_gpio_platform_data pxa168_gpio_pdata = { .irq_base = MMP_GPIO_TO_IRQ(0), }; +static struct i2c_pxa_platform_data i2c_info __initdata = { + .use_pio = 1, +}; + static struct i2c_board_info gplugd_i2c_board_info[] = { { .type = "isl1208", @@ -184,16 +188,17 @@ static void __init select_disp_freq(void) static void __init gplugd_init(void) { mfp_config(ARRAY_AND_SIZE(gplugd_pin_config)); + platform_device_add_data(&pxa168_device_gpio, &pxa168_gpio_pdata, + sizeof(struct pxa_gpio_platform_data)); + platform_device_register(&pxa168_device_gpio); select_disp_freq(); /* on-chip devices */ pxa168_add_uart(3); pxa168_add_ssp(1); - pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(gplugd_i2c_board_info)); - platform_device_add_data(&pxa168_device_gpio, &pxa168_gpio_pdata, - sizeof(struct pxa_gpio_platform_data)); - platform_device_register(&pxa168_device_gpio); + + pxa168_add_twsi(0, &i2c_info, ARRAY_AND_SIZE(gplugd_i2c_board_info)); pxa168_add_eth(&gplugd_eth_platform_data); } -- 2.8.0