diff options
author | Thierry Reding <treding@nvidia.com> | 2013-10-29 19:00:42 +0400 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2013-12-19 12:29:55 +0400 |
commit | 365765fc293e68a1d2ce63811b80c5b3c33eebd1 (patch) | |
tree | 566e75fc4d528d51e189d147807902149c9a6db2 /drivers/gpu/drm/tegra | |
parent | 17a8b6b03717fda28be73bc0d24a608a8339d646 (diff) | |
download | linux-365765fc293e68a1d2ce63811b80c5b3c33eebd1.tar.xz |
drm/tegra: Track HDMI enable state
The DRM core doesn't track enable and disable state of encoders and/or
connectors, so calls to the output's .enable() and .disable() are not
guaranteed to be balanced. Track the enable state internally so that
calls to regulator and clock frameworks remain balanced.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/drm/tegra')
-rw-r--r-- | drivers/gpu/drm/tegra/hdmi.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c index d8cc81f5de38..19ce750e4856 100644 --- a/drivers/gpu/drm/tegra/hdmi.c +++ b/drivers/gpu/drm/tegra/hdmi.c @@ -40,6 +40,7 @@ struct tegra_hdmi { struct host1x_client client; struct tegra_output output; struct device *dev; + bool enabled; struct regulator *vdd; struct regulator *pll; @@ -699,6 +700,9 @@ static int tegra_output_hdmi_enable(struct tegra_output *output) int retries = 1000; int err; + if (hdmi->enabled) + return 0; + hdmi->dvi = !tegra_output_is_hdmi(output); pclk = mode->clock * 1000; @@ -906,6 +910,8 @@ static int tegra_output_hdmi_enable(struct tegra_output *output) /* TODO: add HDCP support */ + hdmi->enabled = true; + return 0; } @@ -913,10 +919,15 @@ static int tegra_output_hdmi_disable(struct tegra_output *output) { struct tegra_hdmi *hdmi = to_hdmi(output); + if (!hdmi->enabled) + return 0; + reset_control_assert(hdmi->rst); clk_disable(hdmi->clk); regulator_disable(hdmi->pll); + hdmi->enabled = false; + return 0; } |