diff mbox

[v2,09/12] drm: panel: Add idle/busy in Sharp lq101r1sx01 driver

Message ID 1435738915-31973-10-git-send-email-markz@nvidia.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mark Zhang July 1, 2015, 8:21 a.m. UTC
Signed-off-by: Mark Zhang <markz@nvidia.com>
---
 drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c |   26 +++++++++++++++++++++++
 1 file changed, 26 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c b/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c
index e32f1449b067..64eb437ee7b3 100644
--- a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c
+++ b/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c
@@ -89,6 +89,18 @@  static __maybe_unused int sharp_panel_read(struct sharp_panel *sharp,
 	return err;
 }
 
+static int sharp_panel_idle(struct drm_panel *panel)
+{
+	struct sharp_panel *sharp = to_sharp_panel(panel);
+	int err = 0;
+
+	err = mipi_dsi_dcs_enter_idle_mode(sharp->link1);
+	if (err < 0)
+		dev_err(panel->dev, "failed to enter idle: %d\n", err);
+
+	return err;
+}
+
 static int sharp_panel_disable(struct drm_panel *panel)
 {
 	struct sharp_panel *sharp = to_sharp_panel(panel);
@@ -167,6 +179,18 @@  static int sharp_setup_symmetrical_split(struct mipi_dsi_device *left,
 	return 0;
 }
 
+static int sharp_panel_busy(struct drm_panel *panel)
+{
+	struct sharp_panel *sharp = to_sharp_panel(panel);
+	int err = 0;
+
+	err = mipi_dsi_dcs_exit_idle_mode(sharp->link1);
+	if (err < 0)
+		dev_err(panel->dev, "failed to exit idle: %d\n", err);
+
+	return err;
+}
+
 static int sharp_panel_prepare(struct drm_panel *panel)
 {
 	struct sharp_panel *sharp = to_sharp_panel(panel);
@@ -318,6 +342,8 @@  static int sharp_panel_get_modes(struct drm_panel *panel)
 }
 
 static const struct drm_panel_funcs sharp_panel_funcs = {
+	.idle = sharp_panel_idle,
+	.busy = sharp_panel_busy,
 	.disable = sharp_panel_disable,
 	.unprepare = sharp_panel_unprepare,
 	.prepare = sharp_panel_prepare,