summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamalingam C <ramalingamc@nvidia.com>2013-03-18 12:13:00 +0530
committerMatthew Pedro <mapedro@nvidia.com>2013-03-18 10:45:29 -0700
commit0358875560c6a93898708e341461ae62b687d80a (patch)
tree6f660fbf031b80aeab96c4ba113c7d39ed89e713
parentf07c2859fab5ca4dc1f833b3879cbbae32ce13fb (diff)
arch: tegra: Ventana: vdd_ldo4 regulator handling
Cleaning up of the vdd_ldo4 regulator handling and also control the multiple calls for regulator_get call for vdd_ldo4 Bug 1241274 Change-Id: I0f62d5059212302956bfe7e48d24eb7f45ff2dda Signed-off-by: Ramalingam C <ramalingamc@nvidia.com> Reviewed-on: http://git-master/r/207516 GVS: Gerrit_Virtual_Submit Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/board-ventana-panel.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/arch/arm/mach-tegra/board-ventana-panel.c b/arch/arm/mach-tegra/board-ventana-panel.c
index d2d89392e1c5..d507dea88813 100644
--- a/arch/arm/mach-tegra/board-ventana-panel.c
+++ b/arch/arm/mach-tegra/board-ventana-panel.c
@@ -1,7 +1,7 @@
/*
* arch/arm/mach-tegra/board-ventana-panel.c
*
- * Copyright (c) 2010-2012 NVIDIA Corporation.
+ * Copyright (c) 2010-2013 NVIDIA Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -48,6 +48,7 @@
#define ventana_lvds_to_bl_ms 200
static struct regulator *pnl_pwr;
+static struct regulator *vdd_ldo4;
#ifdef CONFIG_TEGRA_DC
static struct regulator *ventana_hdmi_reg = NULL;
@@ -104,11 +105,17 @@ static struct platform_device ventana_backlight_device = {
#ifdef CONFIG_TEGRA_DC
static int ventana_panel_enable(void)
{
- struct regulator *reg = regulator_get(NULL, "vdd_ldo4");
-
- if (!reg) {
- regulator_enable(reg);
- regulator_put(reg);
+ if (vdd_ldo4 == NULL) {
+ vdd_ldo4 = regulator_get(NULL, "vdd_ldo4");
+
+ if (IS_ERR(vdd_ldo4)) {
+ pr_err("%s: couldn't get regulator vdd_ldo4: %ld\n",
+ __func__, PTR_ERR(vdd_ldo4));
+ } else {
+ regulator_enable(vdd_ldo4);
+ regulator_disable(vdd_ldo4);
+ regulator_put(vdd_ldo4);
+ }
}
if (pnl_pwr == NULL) {