[RFCv1 38/42] drm/omap: panel-dsi-cm: do not power on/off twice

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make sure, that we only power on/off the device once.

Signed-off-by: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>
---
 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
index 90132d1d1f5d..7f6b1129862a 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
@@ -290,6 +290,9 @@ static int dsicm_power_on(struct panel_drv_data *ddata)
 	u8 id1, id2, id3;
 	int r;
 
+	if (ddata->enabled)
+		return 0;
+
 	r = regulator_bulk_enable(DCS_REGULATOR_SUPPLY_NUM, ddata->supplies);
 	if (r) {
 		dev_err(&ddata->dsi->dev, "failed to enable supplies: %d\n", r);
@@ -354,6 +357,9 @@ static int dsicm_power_off(struct panel_drv_data *ddata)
 {
 	int r;
 
+	if (!ddata->enabled)
+		return 0;
+
 	ddata->enabled = 0;
 
 	r = mipi_dsi_dcs_set_display_off(ddata->dsi);
-- 
2.24.0

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux