[v8,19/38] drm/i915/icl: Allocate hosts for DSI ports

Submitted by Jani Nikula on Oct. 30, 2018, 11:56 a.m.

Details

Message ID 9f145a8a005048cce6bcf8c2cc42815e61c87ba2.1540900289.git.jani.nikula@intel.com
State New
Headers show
Series "drm/i915/icl: dsi enabling" ( rev: 3 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Jani Nikula Oct. 30, 2018, 11:56 a.m.
This patch allocates DSI host structure for each
DSI port available on gen11 and register them with
DSI fwk of DRM. Some of the DSI host operations are
also registered as part of this. This patch also fills
MIPI config block info from VBT to local structure.

v2 by Jani:
 - indentation

Signed-off-by: Madhav Chauhan <madhav.chauhan@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/icl_dsi.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/icl_dsi.c b/drivers/gpu/drm/i915/icl_dsi.c
index a117ecc6c5a3..d0c60d402dfe 100644
--- a/drivers/gpu/drm/i915/icl_dsi.c
+++ b/drivers/gpu/drm/i915/icl_dsi.c
@@ -982,6 +982,23 @@  static const struct drm_encoder_funcs gen11_dsi_encoder_funcs = {
 static const struct drm_connector_funcs gen11_dsi_connector_funcs = {
 };
 
+static int gen11_dsi_host_attach(struct mipi_dsi_host *host,
+				 struct mipi_dsi_device *dsi)
+{
+	return 0;
+}
+
+static int gen11_dsi_host_detach(struct mipi_dsi_host *host,
+				 struct mipi_dsi_device *dsi)
+{
+	return 0;
+}
+
+static const struct mipi_dsi_host_ops gen11_dsi_host_ops = {
+	.attach = gen11_dsi_host_attach,
+	.detach = gen11_dsi_host_detach,
+};
+
 void icl_dsi_init(struct drm_i915_private *dev_priv)
 {
 	struct drm_device *dev = &dev_priv->drm;
@@ -1052,6 +1069,21 @@  void icl_dsi_init(struct drm_i915_private *dev_priv)
 	intel_panel_init(&intel_connector->panel, fixed_mode, NULL);
 	intel_panel_setup_backlight(connector, INVALID_PIPE);
 
+	for_each_dsi_port(port, intel_dsi->ports) {
+		struct intel_dsi_host *host;
+
+		host = intel_dsi_host_init(intel_dsi, &gen11_dsi_host_ops, port);
+		if (!host)
+			goto err;
+
+		intel_dsi->dsi_hosts[port] = host;
+	}
+
+	if (!intel_dsi_vbt_init(intel_dsi, MIPI_DSI_GENERIC_PANEL_ID)) {
+		DRM_DEBUG_KMS("no device found\n");
+		goto err;
+	}
+
 	return;
 
 err:

Comments

On 10/30/2018 5:26 PM, Jani Nikula wrote:
> This patch allocates DSI host structure for each
> DSI port available on gen11 and register them with
> DSI fwk of DRM. Some of the DSI host operations are
> also registered as part of this. This patch also fills
> MIPI config block info from VBT to local structure.
>
> v2 by Jani:
>   - indentation

Looks fine.

Regards,
Madhav

>
> Signed-off-by: Madhav Chauhan <madhav.chauhan@intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>   drivers/gpu/drm/i915/icl_dsi.c | 32 ++++++++++++++++++++++++++++++++
>   1 file changed, 32 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/icl_dsi.c b/drivers/gpu/drm/i915/icl_dsi.c
> index a117ecc6c5a3..d0c60d402dfe 100644
> --- a/drivers/gpu/drm/i915/icl_dsi.c
> +++ b/drivers/gpu/drm/i915/icl_dsi.c
> @@ -982,6 +982,23 @@ static const struct drm_encoder_funcs gen11_dsi_encoder_funcs = {
>   static const struct drm_connector_funcs gen11_dsi_connector_funcs = {
>   };
>   
> +static int gen11_dsi_host_attach(struct mipi_dsi_host *host,
> +				 struct mipi_dsi_device *dsi)
> +{
> +	return 0;
> +}
> +
> +static int gen11_dsi_host_detach(struct mipi_dsi_host *host,
> +				 struct mipi_dsi_device *dsi)
> +{
> +	return 0;
> +}
> +
> +static const struct mipi_dsi_host_ops gen11_dsi_host_ops = {
> +	.attach = gen11_dsi_host_attach,
> +	.detach = gen11_dsi_host_detach,
> +};
> +
>   void icl_dsi_init(struct drm_i915_private *dev_priv)
>   {
>   	struct drm_device *dev = &dev_priv->drm;
> @@ -1052,6 +1069,21 @@ void icl_dsi_init(struct drm_i915_private *dev_priv)
>   	intel_panel_init(&intel_connector->panel, fixed_mode, NULL);
>   	intel_panel_setup_backlight(connector, INVALID_PIPE);
>   
> +	for_each_dsi_port(port, intel_dsi->ports) {
> +		struct intel_dsi_host *host;
> +
> +		host = intel_dsi_host_init(intel_dsi, &gen11_dsi_host_ops, port);
> +		if (!host)
> +			goto err;
> +
> +		intel_dsi->dsi_hosts[port] = host;
> +	}
> +
> +	if (!intel_dsi_vbt_init(intel_dsi, MIPI_DSI_GENERIC_PANEL_ID)) {
> +		DRM_DEBUG_KMS("no device found\n");
> +		goto err;
> +	}
> +
>   	return;
>   
>   err: