From: Arun Kumar Swain Date: Tue, 4 Jun 2013 23:04:28 +0000 (-0700) Subject: arm: tegra: ardbeg: Support HDMI X-Git-Tag: daily-2014.03.25.0_l4t/l4t-r19.1~3682 X-Git-Url: http://nv-tegra.nvidia.com/gitweb/?p=linux-3.10.git;a=commitdiff_plain;h=00d4fee6df595bf5c30347168382519846c4c53c arm: tegra: ardbeg: Support HDMI Bug 1284834 Change-Id: Icd49b8b82d38c39d099aa19d10583f5a6d0dc69e Signed-off-by: Arun Kumar Swain Reviewed-on: http://git-master/r/235639 Reviewed-by: Simone Willett Tested-by: Simone Willett --- diff --git a/arch/arm/mach-tegra/board-ardbeg-panel.c b/arch/arm/mach-tegra/board-ardbeg-panel.c index d1292b3..1e213e8 100644 --- a/arch/arm/mach-tegra/board-ardbeg-panel.c +++ b/arch/arm/mach-tegra/board-ardbeg-panel.c @@ -90,6 +90,8 @@ struct platform_device * __init ardbeg_host1x_init(void) #endif /* hdmi related regulators */ +static struct regulator *ardbeg_hdmi_reg; +static struct regulator *ardbeg_hdmi_pll; static struct regulator *ardbeg_hdmi_vddio; static struct resource ardbeg_disp1_resources[] = { @@ -174,13 +176,51 @@ static struct tegra_dc_out ardbeg_disp1_out = { static int ardbeg_hdmi_enable(struct device *dev) { - /* TODO */ + int ret; + if (!ardbeg_hdmi_reg) { + ardbeg_hdmi_reg = regulator_get(dev, "avdd_hdmi"); + if (IS_ERR_OR_NULL(ardbeg_hdmi_reg)) { + pr_err("hdmi: couldn't get regulator avdd_hdmi\n"); + ardbeg_hdmi_reg = NULL; + return PTR_ERR(ardbeg_hdmi_reg); + } + } + ret = regulator_enable(ardbeg_hdmi_reg); + if (ret < 0) { + pr_err("hdmi: couldn't enable regulator avdd_hdmi\n"); + return ret; + } + if (!ardbeg_hdmi_pll) { + ardbeg_hdmi_pll = regulator_get(dev, "avdd_hdmi_pll"); + if (IS_ERR_OR_NULL(ardbeg_hdmi_pll)) { + pr_err("hdmi: couldn't get regulator avdd_hdmi_pll\n"); + ardbeg_hdmi_pll = NULL; + regulator_put(ardbeg_hdmi_reg); + ardbeg_hdmi_reg = NULL; + return PTR_ERR(ardbeg_hdmi_pll); + } + } + ret = regulator_enable(ardbeg_hdmi_pll); + if (ret < 0) { + pr_err("hdmi: couldn't enable regulator avdd_hdmi_pll\n"); + return ret; + } return 0; } static int ardbeg_hdmi_disable(void) { - /* TODO */ + if (ardbeg_hdmi_reg) { + regulator_disable(ardbeg_hdmi_reg); + regulator_put(ardbeg_hdmi_reg); + ardbeg_hdmi_reg = NULL; + } + + if (ardbeg_hdmi_pll) { + regulator_disable(ardbeg_hdmi_pll); + regulator_put(ardbeg_hdmi_pll); + ardbeg_hdmi_pll = NULL; + } return 0; } diff --git a/arch/arm/mach-tegra/board-ardbeg-power.c b/arch/arm/mach-tegra/board-ardbeg-power.c index a6987af..f19ae47 100644 --- a/arch/arm/mach-tegra/board-ardbeg-power.c +++ b/arch/arm/mach-tegra/board-ardbeg-power.c @@ -552,7 +552,7 @@ FIXED_REG(5, vdd_dis_3v3a_sw, vdd_dis_3v3a_sw, FIXED_REG(6, vdd_hdmi_5v0, vdd_hdmi_5v0, NULL, 0, 0, - TEGRA_GPIO_PH7, true, true, 0, 5000, 5000); + TEGRA_GPIO_PH7, false, true, 0, 5000, 5000); /* * Creating fixed regulator device tables