drm/msm/dsi: Allow to specify dsi config as pdata
authorLoic Poulain <loic.poulain@linaro.org>
Mon, 14 Feb 2022 15:37:38 +0000 (16:37 +0100)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Wed, 23 Feb 2022 02:56:43 +0000 (05:56 +0300)
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>
Patchwork: https://patchwork.freedesktop.org/patch/474089/
Link: https://lore.kernel.org/r/1644853060-12222-1-git-send-email-loic.poulain@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drivers/gpu/drm/msm/dsi/dsi.c
drivers/gpu/drm/msm/dsi/dsi_host.c

index 0fe0252..e61a8ee 100644 (file)
@@ -175,7 +175,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 */ },
        {}
 };
 
index be474dc..d51e70f 100644 (file)
@@ -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__);