Commit a141a296 authored by Hans Verkuil's avatar Hans Verkuil Committed by Tomi Valkeinen

omapdrm: hdmi4: refcount hdmi_power_on/off_core

The hdmi_power_on/off_core functions can be called multiple times:
when the HPD changes and when the HDMI CEC support needs to power
the HDMI core.

So use a counter to know when to really power on or off the HDMI core.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 1d54ecf2
...@@ -124,9 +124,12 @@ static int hdmi_power_on_core(struct omap_dss_device *dssdev) ...@@ -124,9 +124,12 @@ static int hdmi_power_on_core(struct omap_dss_device *dssdev)
{ {
int r; int r;
if (hdmi.core.core_pwr_cnt++)
return 0;
r = regulator_enable(hdmi.vdda_reg); r = regulator_enable(hdmi.vdda_reg);
if (r) if (r)
return r; goto err_reg_enable;
r = hdmi_runtime_get(); r = hdmi_runtime_get();
if (r) if (r)
...@@ -143,12 +146,17 @@ static int hdmi_power_on_core(struct omap_dss_device *dssdev) ...@@ -143,12 +146,17 @@ static int hdmi_power_on_core(struct omap_dss_device *dssdev)
err_runtime_get: err_runtime_get:
regulator_disable(hdmi.vdda_reg); regulator_disable(hdmi.vdda_reg);
err_reg_enable:
hdmi.core.core_pwr_cnt--;
return r; return r;
} }
static void hdmi_power_off_core(struct omap_dss_device *dssdev) static void hdmi_power_off_core(struct omap_dss_device *dssdev)
{ {
if (--hdmi.core.core_pwr_cnt)
return;
hdmi.core_enabled = false; hdmi.core_enabled = false;
hdmi_runtime_put(); hdmi_runtime_put();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment