devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/3] drm/msm/dsi: Allow to specify dsi config as pdata
@ 2022-02-14 15:37 Loic Poulain
  2022-02-14 15:37 ` [PATCH v2 2/3] drm/msm/dsi: Add support for qcm2290 dsi controller Loic Poulain
  2022-02-14 15:37 ` [PATCH v2 3/3] dt-bindings: msm/dsi: Add qcm2290 dsi controller binding Loic Poulain
  0 siblings, 2 replies; 4+ messages in thread
From: Loic Poulain @ 2022-02-14 15:37 UTC (permalink / raw)
  To: dmitry.baryshkov, robdclark, robh+dt
  Cc: linux-arm-msm, freedreno, devicetree, bjorn.andersson,
	Loic Poulain

Config autodetect based on DSI controller version is quite limited
since several qcom SoCs can integrate a DSI controller with the same
version, but with different config (io_offset, supplies, etc).

This change allows to specify dsi config via device data pointer.
config autodetect is still used in case data pointer is NULL.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 v2: no change

 drivers/gpu/drm/msm/dsi/dsi.c      | 2 +-
 drivers/gpu/drm/msm/dsi/dsi_host.c | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
index 0525488..06a9008 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.c
+++ b/drivers/gpu/drm/msm/dsi/dsi.c
@@ -170,7 +170,7 @@ static int dsi_dev_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id dt_match[] = {
-	{ .compatible = "qcom,mdss-dsi-ctrl" },
+	{ .compatible = "qcom,mdss-dsi-ctrl", .data = NULL /* autodetect cfg */ },
 	{}
 };
 
diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 6b3ced4..c540acc 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -212,6 +212,10 @@ static const struct msm_dsi_cfg_handler *dsi_get_config(
 	int ret;
 	u32 major = 0, minor = 0;
 
+	cfg_hnd = device_get_match_data(dev);
+	if (cfg_hnd)
+		return cfg_hnd;
+
 	ahb_clk = msm_clk_get(msm_host->pdev, "iface");
 	if (IS_ERR(ahb_clk)) {
 		pr_err("%s: cannot get interface clock\n", __func__);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-02-22 21:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-14 15:37 [PATCH v2 1/3] drm/msm/dsi: Allow to specify dsi config as pdata Loic Poulain
2022-02-14 15:37 ` [PATCH v2 2/3] drm/msm/dsi: Add support for qcm2290 dsi controller Loic Poulain
2022-02-14 15:37 ` [PATCH v2 3/3] dt-bindings: msm/dsi: Add qcm2290 dsi controller binding Loic Poulain
2022-02-22 21:54   ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).