drm/i915/dsi: call dpi_send_cmd() for each dsi port at a higher level

Instead of having the for each dsi port loop within dpi_send_cmd(), add
a port parameter to the function and call it for each port instead.

This is a rewrite of

commit 4510cd779e
Author: Gaurav K Singh <gaurav.k.singh@intel.com>
Date:   Thu Dec 4 10:58:51 2014 +0530

    drm/i915: Dual link needs Shutdown and Turn on packet for both ports

to add more flexibility in using dpi_send_cmd() for just one port as
necessary. No functional changes.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-By: Shobhit Kumar <shobhit.kumar@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Jani Nikula
2015-01-16 14:27:16 +02:00
committed by Daniel Vetter
parent da2518f926
commit f03e4179ce
3 changed files with 16 additions and 19 deletions

View File

@@ -207,7 +207,8 @@ static void intel_dsi_enable(struct intel_encoder *encoder)
I915_WRITE(MIPI_MAX_RETURN_PKT_SIZE(port), 8 * 4);
else {
msleep(20); /* XXX */
dpi_send_cmd(intel_dsi, TURN_ON, DPI_LP_MODE_EN);
for_each_dsi_port(port, intel_dsi->ports)
dpi_send_cmd(intel_dsi, TURN_ON, DPI_LP_MODE_EN, port);
msleep(100);
if (intel_dsi->dev.dev_ops->enable)
@@ -275,12 +276,14 @@ static void intel_dsi_enable_nop(struct intel_encoder *encoder)
static void intel_dsi_pre_disable(struct intel_encoder *encoder)
{
struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
enum port port;
DRM_DEBUG_KMS("\n");
if (is_vid_mode(intel_dsi)) {
/* Send Shutdown command to the panel in LP mode */
dpi_send_cmd(intel_dsi, SHUTDOWN, DPI_LP_MODE_EN);
for_each_dsi_port(port, intel_dsi->ports)
dpi_send_cmd(intel_dsi, SHUTDOWN, DPI_LP_MODE_EN, port);
msleep(10);
}
}