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>
        struct host1x_client client;
        struct tegra_output output;
        struct device *dev;
+       bool enabled;
 
        struct regulator *vdd;
        struct regulator *pll;
        int retries = 1000;
        int err;
 
+       if (hdmi->enabled)
+               return 0;
+
        hdmi->dvi = !tegra_output_is_hdmi(output);
 
        pclk = mode->clock * 1000;
 
        /* TODO: add HDCP support */
 
+       hdmi->enabled = true;
+
        return 0;
 }
 
 {
        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;
 }