arm: omap2plus: GPIO cleanup
use gpio_request_<one|array>() instead of multiple gpiolib calls, remove unneeded variables, etc. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Tony Lindgren <tony@atomide.com>
This commit is contained in:
committed by
Tony Lindgren
parent
9e18630b68
commit
bc593f5d78
@@ -21,34 +21,19 @@
|
||||
#define LCD_PANEL_RESET_GPIO_PILOT 55
|
||||
#define LCD_PANEL_QVGA_GPIO 56
|
||||
|
||||
static struct gpio zoom_lcd_gpios[] __initdata = {
|
||||
{ -EINVAL, GPIOF_OUT_INIT_HIGH, "lcd reset" },
|
||||
{ LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "lcd qvga" },
|
||||
};
|
||||
|
||||
static void zoom_lcd_panel_init(void)
|
||||
{
|
||||
int ret;
|
||||
unsigned char lcd_panel_reset_gpio;
|
||||
|
||||
lcd_panel_reset_gpio = (omap_rev() > OMAP3430_REV_ES3_0) ?
|
||||
zoom_lcd_gpios[0].gpio = (omap_rev() > OMAP3430_REV_ES3_0) ?
|
||||
LCD_PANEL_RESET_GPIO_PROD :
|
||||
LCD_PANEL_RESET_GPIO_PILOT;
|
||||
|
||||
ret = gpio_request(lcd_panel_reset_gpio, "lcd reset");
|
||||
if (ret) {
|
||||
pr_err("Failed to get LCD reset GPIO (gpio%d).\n",
|
||||
lcd_panel_reset_gpio);
|
||||
return;
|
||||
}
|
||||
gpio_direction_output(lcd_panel_reset_gpio, 1);
|
||||
|
||||
ret = gpio_request(LCD_PANEL_QVGA_GPIO, "lcd qvga");
|
||||
if (ret) {
|
||||
pr_err("Failed to get LCD_PANEL_QVGA_GPIO (gpio%d).\n",
|
||||
LCD_PANEL_QVGA_GPIO);
|
||||
goto err0;
|
||||
}
|
||||
gpio_direction_output(LCD_PANEL_QVGA_GPIO, 1);
|
||||
|
||||
return;
|
||||
err0:
|
||||
gpio_free(lcd_panel_reset_gpio);
|
||||
if (gpio_request_array(zoom_lcd_gpios, ARRAY_SIZE(zoom_lcd_gpios)))
|
||||
pr_err("%s: Failed to get LCD GPIOs.\n", __func__);
|
||||
}
|
||||
|
||||
static int zoom_panel_enable_lcd(struct omap_dss_device *dssdev)
|
||||
|
Reference in New Issue
Block a user