Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b1cb21a5 authored by Madhav Chauhan's avatar Madhav Chauhan Committed by Jani Nikula
Browse files

drm/i915/icl: Enable DSI IO power



This patch configures mode of operation for DSI
and enable DDI IO power by configuring power well.

v2: Use for_each_dsi_port() for power get (Jani N)

Signed-off-by: default avatarMadhav Chauhan <madhav.chauhan@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1530798591-2077-5-git-send-email-madhav.chauhan@intel.com
parent 21652f3b
Loading
Loading
Loading
Loading
+23 −0
Original line number Original line Diff line number Diff line
@@ -54,11 +54,34 @@ static void gen11_dsi_program_esc_clk_div(struct intel_encoder *encoder)
	}
	}
}
}


static void gen11_dsi_enable_io_power(struct intel_encoder *encoder)
{
	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
	struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
	enum port port;
	u32 tmp;

	for_each_dsi_port(port, intel_dsi->ports) {
		tmp = I915_READ(ICL_DSI_IO_MODECTL(port));
		tmp |= COMBO_PHY_MODE_DSI;
		I915_WRITE(ICL_DSI_IO_MODECTL(port), tmp);
	}

	for_each_dsi_port(port, intel_dsi->ports) {
		intel_display_power_get(dev_priv, port == PORT_A ?
					POWER_DOMAIN_PORT_DDI_A_IO :
					POWER_DOMAIN_PORT_DDI_B_IO);
	}
}

static void __attribute__((unused))
static void __attribute__((unused))
gen11_dsi_pre_enable(struct intel_encoder *encoder,
gen11_dsi_pre_enable(struct intel_encoder *encoder,
		     const struct intel_crtc_state *pipe_config,
		     const struct intel_crtc_state *pipe_config,
		     const struct drm_connector_state *conn_state)
		     const struct drm_connector_state *conn_state)
{
{
	/* step2: enable IO power */
	gen11_dsi_enable_io_power(encoder);

	/* step3: enable DSI PLL */
	/* step3: enable DSI PLL */
	gen11_dsi_program_esc_clk_div(encoder);
	gen11_dsi_program_esc_clk_div(encoder);
}
}