From fa2a02f26e76a01351b6a51e9152ae2efd088f48 Mon Sep 17 00:00:00 2001 From: Archit Taneja Date: Mon, 19 Nov 2012 16:57:43 +0530 Subject: [PATCH] arm: omap: board-ldp: use generic dpi panel's gpio handling The ldp board file currently requests gpios required to configure the NEC DPI panel, and provides platform_enable/disable callbacks to configure them. These tasks have been moved to the generic dpi panel driver itself and shouldn't be done in the board files. Remove the gpio requests and the platform callbacks from the board file. Configure the gpio information in generic dpi panel's platform data so that it's passed to the panel driver. Signed-off-by: Archit Taneja Cc: Tony Lindgren --- arch/arm/mach-omap2/board-ldp.c | 59 +++++---------------------------- 1 file changed, 8 insertions(+), 51 deletions(-) diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index 8a8e505a0e90..d0d17bc58d9b 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c @@ -181,34 +181,13 @@ static inline void __init ldp_init_smsc911x(void) /* LCD */ -static int ldp_backlight_gpio; -static int ldp_lcd_enable_gpio; - #define LCD_PANEL_RESET_GPIO 55 #define LCD_PANEL_QVGA_GPIO 56 -static int ldp_panel_enable_lcd(struct omap_dss_device *dssdev) -{ - if (gpio_is_valid(ldp_lcd_enable_gpio)) - gpio_direction_output(ldp_lcd_enable_gpio, 1); - if (gpio_is_valid(ldp_backlight_gpio)) - gpio_direction_output(ldp_backlight_gpio, 1); - - return 0; -} - -static void ldp_panel_disable_lcd(struct omap_dss_device *dssdev) -{ - if (gpio_is_valid(ldp_lcd_enable_gpio)) - gpio_direction_output(ldp_lcd_enable_gpio, 0); - if (gpio_is_valid(ldp_backlight_gpio)) - gpio_direction_output(ldp_backlight_gpio, 0); -} - static struct panel_generic_dpi_data ldp_panel_data = { .name = "nec_nl2432dr22-11b", - .platform_enable = ldp_panel_enable_lcd, - .platform_disable = ldp_panel_disable_lcd, + .num_gpios = 4, + /* gpios filled in code */ }; static struct omap_dss_device ldp_lcd_device = { @@ -231,41 +210,19 @@ static struct omap_dss_board_info ldp_dss_data = { static void __init ldp_display_init(void) { - int r; - - static struct gpio gpios[] __initdata = { - {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"}, - {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"}, - }; - - r = gpio_request_array(gpios, ARRAY_SIZE(gpios)); - if (r) { - pr_err("Cannot request LCD GPIOs, error %d\n", r); - return; - } + ldp_panel_data.gpios[2] = LCD_PANEL_RESET_GPIO; + ldp_panel_data.gpios[3] = LCD_PANEL_QVGA_GPIO; omap_display_init(&ldp_dss_data); } static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { - int r; + ldp_panel_data.gpios[0] = gpio + 7; + ldp_panel_data.gpio_invert[0] = true; - struct gpio gpios[] = { - {gpio + 7 , GPIOF_OUT_INIT_LOW, "LCD ENABLE"}, - {gpio + 15, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"}, - }; - - r = gpio_request_array(gpios, ARRAY_SIZE(gpios)); - if (r) { - pr_err("Cannot request LCD GPIOs, error %d\n", r); - ldp_backlight_gpio = -EINVAL; - ldp_lcd_enable_gpio = -EINVAL; - return r; - } - - ldp_backlight_gpio = gpio + 15; - ldp_lcd_enable_gpio = gpio + 7; + ldp_panel_data.gpios[1] = gpio + 15; + ldp_panel_data.gpio_invert[1] = true; return 0; }