Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 374155
b: refs/heads/master
c: fa2a02f
h: refs/heads/master
i:
  374153: 5736d74
  374151: ea97d14
v: v3
  • Loading branch information
Archit Taneja authored and Tomi Valkeinen committed Apr 4, 2013
1 parent 76845e7 commit be091b6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 53 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 130cbe57f8f8c2fdf68eeb085f55b88a067404e8
refs/heads/master: fa2a02f26e76a01351b6a51e9152ae2efd088f48
61 changes: 9 additions & 52 deletions trunk/arch/arm/mach-omap2/board-ldp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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;

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[0] = gpio + 7;
ldp_panel_data.gpio_invert[0] = true;

ldp_panel_data.gpios[1] = gpio + 15;
ldp_panel_data.gpio_invert[1] = true;

return 0;
}
Expand Down

0 comments on commit be091b6

Please sign in to comment.