From 7521e61fc3316a1de631f0127fd54bb01dd6659c Mon Sep 17 00:00:00 2001 From: Deepak M Date: Thu, 20 Aug 2015 11:49:58 +0530 Subject: [PATCH] drm/i915: Execute RESET sequence before device ready Before setting the MIPI device to ready state, execute the RESET sequence. Signed-off-by: Gaurav K Singh --- drivers/gpu/drm/i915/intel_dsi.c | 2 ++ drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 14 +++++++++++++- include/drm/drm_panel.h | 9 +++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c index 4a601cf..a34a73a 100644 --- a/drivers/gpu/drm/i915/intel_dsi.c +++ b/drivers/gpu/drm/i915/intel_dsi.c @@ -433,6 +433,8 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder) tmp |= DPOUNIT_CLOCK_GATE_DISABLE; I915_WRITE(DSPCLK_GATE_D, tmp); + drm_panel_reset(intel_dsi->panel); + /* put device in ready state */ intel_dsi_device_ready(encoder); diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c index bdbaaf18..c2f3c9b 100644 --- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c +++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c @@ -352,7 +352,7 @@ static void generic_exec_sequence(struct intel_dsi *intel_dsi, const u8 *data) } } -static int vbt_panel_prepare(struct drm_panel *panel) +static int vbt_panel_reset(struct drm_panel *panel) { struct vbt_panel *vbt_panel = to_vbt_panel(panel); struct intel_dsi *intel_dsi = vbt_panel->intel_dsi; @@ -363,6 +363,17 @@ static int vbt_panel_prepare(struct drm_panel *panel) sequence = dev_priv->vbt.dsi.sequence[MIPI_SEQ_ASSERT_RESET]; generic_exec_sequence(intel_dsi, sequence); + return 0; + +} +static int vbt_panel_prepare(struct drm_panel *panel) +{ + struct vbt_panel *vbt_panel = to_vbt_panel(panel); + struct intel_dsi *intel_dsi = vbt_panel->intel_dsi; + struct drm_device *dev = intel_dsi->base.base.dev; + struct drm_i915_private *dev_priv = dev->dev_private; + const u8 *sequence; + sequence = dev_priv->vbt.dsi.sequence[MIPI_SEQ_INIT_OTP]; generic_exec_sequence(intel_dsi, sequence); @@ -437,6 +448,7 @@ static const struct drm_panel_funcs vbt_panel_funcs = { .disable = vbt_panel_disable, .unprepare = vbt_panel_unprepare, .prepare = vbt_panel_prepare, + .reset = vbt_panel_reset, .enable = vbt_panel_enable, .get_modes = vbt_panel_get_modes, }; diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index 13ff44b..0920862 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -69,6 +69,7 @@ struct drm_panel_funcs { int (*disable)(struct drm_panel *panel); int (*unprepare)(struct drm_panel *panel); int (*prepare)(struct drm_panel *panel); + int (*reset)(struct drm_panel *panel); int (*enable)(struct drm_panel *panel); int (*get_modes)(struct drm_panel *panel); int (*get_timings)(struct drm_panel *panel, unsigned int num_timings, @@ -101,6 +102,14 @@ static inline int drm_panel_disable(struct drm_panel *panel) return panel ? -ENOSYS : -EINVAL; } +static inline int drm_panel_reset(struct drm_panel *panel) +{ + if (panel && panel->funcs && panel->funcs->prepare) + return panel->funcs->reset(panel); + + return panel ? -ENOSYS : -EINVAL; +} + static inline int drm_panel_prepare(struct drm_panel *panel) { if (panel && panel->funcs && panel->funcs->prepare) -- 1.7.9.5