diff options
author | Pradeep Goudagunta <pgoudagunta@nvidia.com> | 2011-05-04 17:09:13 +0530 |
---|---|---|
committer | Niket Sirsi <nsirsi@nvidia.com> | 2011-06-02 22:52:02 -0700 |
commit | 906797d1d6924782eeb6fc7564e71421cd72a67c (patch) | |
tree | 5375217f30925b7ea62d3cf534b53031dea27734 | |
parent | 2022747ca798805d16ef4637c6e217552ca3ef0b (diff) |
ARM: tegra: display: pm269: Support for lvds
Added support to boot with LVDS display by default on pm269 board.
Bug 823160
Change-Id: I8013bc011328d4724f499af47aa1b118811cc3ec
Reviewed-on: http://git-master/r/30374
Reviewed-by: Niket Sirsi <nsirsi@nvidia.com>
Tested-by: Niket Sirsi <nsirsi@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/board-cardhu-panel.c | 93 |
1 files changed, 42 insertions, 51 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu-panel.c b/arch/arm/mach-tegra/board-cardhu-panel.c index 28a9e31be5b3..c28352e657ff 100644 --- a/arch/arm/mach-tegra/board-cardhu-panel.c +++ b/arch/arm/mach-tegra/board-cardhu-panel.c @@ -45,6 +45,7 @@ #define AVDD_LCD PMU_TCA6416_GPIO_PORT17 #define DSI_PANEL_RESET 0 +#define pm269_lvds_shutdown TEGRA_GPIO_PN6 #define cardhu_lvds_shutdown TEGRA_GPIO_PL2 #define cardhu_bl_enb TEGRA_GPIO_PH2 #define cardhu_bl_pwm TEGRA_GPIO_PH0 @@ -74,21 +75,19 @@ static int cardhu_backlight_init(struct device *dev) { int ret; #ifndef CONFIG_TEGRA_CARDHU_DSI - if (board_info.board_id != BOARD_PM269) { - tegra_gpio_disable(cardhu_bl_pwm); + tegra_gpio_disable(cardhu_bl_pwm); - ret = gpio_request(cardhu_bl_enb, "backlight_enb"); - if (ret < 0) - return ret; + ret = gpio_request(cardhu_bl_enb, "backlight_enb"); + if (ret < 0) + return ret; - ret = gpio_direction_output(cardhu_bl_enb, 1); - if (ret < 0) - gpio_free(cardhu_bl_enb); - else - tegra_gpio_enable(cardhu_bl_enb); + ret = gpio_direction_output(cardhu_bl_enb, 1); + if (ret < 0) + gpio_free(cardhu_bl_enb); + else + tegra_gpio_enable(cardhu_bl_enb); - return ret; - } + return ret; #endif #if DSI_PANEL_219 || DSI_PANEL_218 @@ -121,14 +120,12 @@ static int cardhu_backlight_init(struct device *dev) { static void cardhu_backlight_exit(struct device *dev) { #ifndef CONFIG_TEGRA_CARDHU_DSI - if (board_info.board_id != BOARD_PM269) { - /* int ret; */ - /*ret = gpio_request(cardhu_bl_enb, "backlight_enb");*/ - gpio_set_value(cardhu_bl_enb, 0); - gpio_free(cardhu_bl_enb); - tegra_gpio_disable(cardhu_bl_enb); - return; - } + /* int ret; */ + /*ret = gpio_request(cardhu_bl_enb, "backlight_enb");*/ + gpio_set_value(cardhu_bl_enb, 0); + gpio_free(cardhu_bl_enb); + tegra_gpio_disable(cardhu_bl_enb); + return; #endif #if DSI_PANEL_219 || DSI_PANEL_218 /* Disable back light for DSIa panel */ @@ -141,7 +138,7 @@ static void cardhu_backlight_exit(struct device *dev) { gpio_free(cardhu_dsib_bl_enb); tegra_gpio_disable(cardhu_dsib_bl_enb); - gpio_set_value(TEGRA_GPIO_PL2, 1); + gpio_set_value(cardhu_lvds_shutdown, 1); mdelay(20); #endif } @@ -152,12 +149,10 @@ static int cardhu_backlight_notify(struct device *unused, int brightness) int orig_brightness = brightness; #ifndef CONFIG_TEGRA_CARDHU_DSI - if (board_info.board_id != BOARD_PM269) { - /* Set the backlight GPIO pin mode to 'backlight_enable' */ - gpio_request(cardhu_bl_enb, "backlight_enb"); - gpio_set_value(cardhu_bl_enb, !!brightness); - goto final; - } + /* Set the backlight GPIO pin mode to 'backlight_enable' */ + gpio_request(cardhu_bl_enb, "backlight_enb"); + gpio_set_value(cardhu_bl_enb, !!brightness); + goto final; #endif #if DSI_PANEL_219 || DSI_PANEL_218 /* DSIa */ @@ -224,7 +219,11 @@ static int cardhu_panel_enable(void) else regulator_enable(cardhu_lvds_vdd_panel); } - gpio_set_value(cardhu_lvds_shutdown, 1); + if (board_info.board_id == BOARD_PM269) + gpio_set_value(pm269_lvds_shutdown, 1); + else + gpio_set_value(cardhu_lvds_shutdown, 1); + return 0; } @@ -241,8 +240,10 @@ static int cardhu_panel_disable(void) regulator_disable(cardhu_lvds_vdd_panel); regulator_put(cardhu_lvds_vdd_panel); cardhu_lvds_vdd_panel= NULL; - - gpio_set_value(cardhu_lvds_shutdown, 0); + if (board_info.board_id == BOARD_PM269) + gpio_set_value(pm269_lvds_shutdown, 0); + else + gpio_set_value(cardhu_lvds_shutdown, 0); return 0; } @@ -502,16 +503,6 @@ static int cardhu_dsi_panel_enable(void) tegra_gpio_enable(TEGRA_GPIO_PJ1); #if DSI_PANEL_219 - ret = gpio_request(TEGRA_GPIO_PL2, "pl2"); - if (ret < 0) - return ret; - ret = gpio_direction_output(TEGRA_GPIO_PL2, 0); - if (ret < 0) { - gpio_free(TEGRA_GPIO_PL2); - return ret; - } - else - tegra_gpio_enable(TEGRA_GPIO_PL2); ret = gpio_request(TEGRA_GPIO_PH0, "ph0"); if (ret < 0) @@ -546,7 +537,7 @@ static int cardhu_dsi_panel_enable(void) else tegra_gpio_enable(TEGRA_GPIO_PU2); - gpio_set_value(TEGRA_GPIO_PL2, 1); + gpio_set_value(cardhu_lvds_shutdown, 1); mdelay(20); gpio_set_value(TEGRA_GPIO_PH0, 1); mdelay(10); @@ -866,19 +857,19 @@ int __init cardhu_panel_init(void) tegra_get_board_info(&board_info); - if (board_info.board_id == BOARD_PM269) { - cardhu_disp1_out.type = TEGRA_DC_OUT_DSI; - cardhu_disp1_out.modes = cardhu_dsi_modes; - cardhu_disp1_out.n_modes = ARRAY_SIZE(cardhu_dsi_modes); - cardhu_disp1_out.dsi = &cardhu_dsi; - cardhu_disp1_out.enable = cardhu_dsi_panel_enable; - cardhu_disp1_out.disable = cardhu_dsi_panel_disable; - cardhu_disp1_pdata.fb = &cardhu_dsi_fb_data; - } - cardhu_carveouts[1].base = tegra_carveout_start; cardhu_carveouts[1].size = tegra_carveout_size; + if (board_info.board_id == BOARD_PM269) { + gpio_request(pm269_lvds_shutdown, "lvds_shutdown"); + gpio_direction_output(pm269_lvds_shutdown, 0); + tegra_gpio_enable(pm269_lvds_shutdown); + } else { + gpio_request(cardhu_lvds_shutdown, "lvds_shutdown"); + gpio_direction_output(cardhu_lvds_shutdown, 0); + tegra_gpio_enable(cardhu_lvds_shutdown); + } + tegra_gpio_enable(cardhu_hdmi_hpd); gpio_request(cardhu_hdmi_hpd, "hdmi_hpd"); gpio_direction_input(cardhu_hdmi_hpd); |