diff options
author | Pritesh Raithatha <praithatha@nvidia.com> | 2012-03-13 17:17:46 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2012-03-14 16:39:19 -0700 |
commit | d0c816598ec8863297826f07a6b38b9d62f89e9c (patch) | |
tree | f599f45c74d7347a5f78ce19d67db665e527dd1b /arch/arm/mach-tegra/board-ventana-panel.c | |
parent | ae63d1dc308dd20fc42c402185796c7d7d883cfc (diff) |
arm: tegra: ventana: use fixed regulator instead of direct gpio
Bug 925547
Change-Id: I81f87cef3a9767d9bd60b72e33a23620392ab5fc
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-on: http://git-master/r/89736
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/board-ventana-panel.c')
-rw-r--r-- | arch/arm/mach-tegra/board-ventana-panel.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/arch/arm/mach-tegra/board-ventana-panel.c b/arch/arm/mach-tegra/board-ventana-panel.c index cad303de3db5..4cacd3dc4216 100644 --- a/arch/arm/mach-tegra/board-ventana-panel.c +++ b/arch/arm/mach-tegra/board-ventana-panel.c @@ -37,7 +37,6 @@ #include "gpio-names.h" #include "board.h" -#define ventana_pnl_pwr_enb TEGRA_GPIO_PC6 #define ventana_bl_enb TEGRA_GPIO_PD4 #define ventana_lvds_shutdown TEGRA_GPIO_PB2 #define ventana_hdmi_hpd TEGRA_GPIO_PN7 @@ -47,6 +46,8 @@ #define ventana_pnl_to_lvds_ms 0 #define ventana_lvds_to_bl_ms 200 +static struct regulator *pnl_pwr; + #ifdef CONFIG_TEGRA_DC static struct regulator *ventana_hdmi_reg = NULL; static struct regulator *ventana_hdmi_pll = NULL; @@ -112,7 +113,17 @@ static int ventana_panel_enable(void) regulator_put(reg); } - gpio_set_value(ventana_pnl_pwr_enb, 1); + if (pnl_pwr == NULL) { + pnl_pwr = regulator_get(NULL, "pnl_pwr"); + if (WARN_ON(IS_ERR(pnl_pwr))) + pr_err("%s: couldn't get regulator pnl_pwr: %ld\n", + __func__, PTR_ERR(pnl_pwr)); + else + regulator_enable(pnl_pwr); + } else { + regulator_enable(pnl_pwr); + } + mdelay(ventana_pnl_to_lvds_ms); gpio_set_value(ventana_lvds_shutdown, 1); mdelay(ventana_lvds_to_bl_ms); @@ -122,7 +133,7 @@ static int ventana_panel_enable(void) static int ventana_panel_disable(void) { gpio_set_value(ventana_lvds_shutdown, 0); - gpio_set_value(ventana_pnl_pwr_enb, 0); + regulator_disable(pnl_pwr); return 0; } @@ -384,10 +395,6 @@ int __init ventana_panel_init(void) int err; struct resource __maybe_unused *res; - gpio_request(ventana_pnl_pwr_enb, "pnl_pwr_enb"); - gpio_direction_output(ventana_pnl_pwr_enb, 1); - tegra_gpio_enable(ventana_pnl_pwr_enb); - gpio_request(ventana_lvds_shutdown, "lvds_shdn"); gpio_direction_output(ventana_lvds_shutdown, 1); tegra_gpio_enable(ventana_lvds_shutdown); |