From patchwork Tue Feb 8 18:51:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 12739230 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E155EC433F5 for ; Tue, 8 Feb 2022 18:51:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343821AbiBHSvS (ORCPT ); Tue, 8 Feb 2022 13:51:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239828AbiBHSvR (ORCPT ); Tue, 8 Feb 2022 13:51:17 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B02EC0612C0 for ; Tue, 8 Feb 2022 10:51:16 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id v12so61212wrv.2 for ; Tue, 08 Feb 2022 10:51:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Ea7FJAwj20JTEOZOtkT9qnZbvbISkrOzMmRItGjSAeI=; b=wbRwe85oAtMOL7cL96DbEkUOulzafBW/KTyqS7gNUFevsb9BMP2qg5a1Lp7Y4rFgl5 4j4jyjnAM8k8U1SnbEg5nvzcOgcPYn1m0Y4DBuTKaOJqo77qdJgPoAaeRSXWBk8U8gSt Ac12ZQyFbQ1Qt30f6te1osdfqBrxm6zETzcyF9v4CbtBWFfm2KCNAbsK3e3SNh9F2Z27 977b4fxgmWP+oDYQDM24pgzvYM0H8eB/edIUqmVPkOhoWnQ+8qgawGk+v+74+KHtFSJp S1B9BzIe85mchTJ2mTv2mGHimpFRclZyYe3A9IUX5sMNO+K0pbt/J3P7CHjWKZkintCh cI9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Ea7FJAwj20JTEOZOtkT9qnZbvbISkrOzMmRItGjSAeI=; b=xynDFTCjdi/F7l+MbaY/NpYJ7uQXdvHaOYAGeGHkVrBkg63OFjhgofvz3ZfLbuDCEr lAZOxbK/xdJo65A5qQg7jJUVDcn1oqOHMbsQQhfl8duXBWddVTNHwj6kmvhZ2sGFHu4/ 51uij2hw9CS2MWYa5A2VUjLd6cSQTAnUznx8rWI/0b2PsqL2rKvZvV6B9xgJMVlsdDhZ IEXuWOYaIblSX+7QiGpAMuZbEH51ERTQsenZVHywuS2pvCcwg5DwuvYjHIgeZmholyMS ZkGoOtzqNYa0WTwklaOHPjFOzgyXJVUE7Q9FFDFZkJXuiXRki9szP2TZbZvbtPg3z1J+ MO1A== X-Gm-Message-State: AOAM532imNXEf3896SqB7Bl45uZLci9S2ObZI9B4Y50ZEIuXYX+iQo+O vNHhuRllGS3fJUzJc6q49M8+AA== X-Google-Smtp-Source: ABdhPJxqvibPy3hhJZAzjdv558CWf5H+Qon6jv0A+osra3Q6OH8xosDsaQLwBCfn1WVgDF3dmHKi2A== X-Received: by 2002:adf:dbcb:: with SMTP id e11mr4585506wrj.175.1644346274798; Tue, 08 Feb 2022 10:51:14 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:82c:5f0:682b:4712:4b40:6814]) by smtp.gmail.com with ESMTPSA id z17sm2762725wmf.11.2022.02.08.10.51.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Feb 2022 10:51:14 -0800 (PST) From: Loic Poulain To: robdclark@gmail.com, sean@poorly.run, robh+dt@kernel.org, dmitry.baryshkov@linaro.org Cc: linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, Loic Poulain Subject: [PATCH 1/3] drm/msm/dsi: Allow to specify dsi config as pdata Date: Tue, 8 Feb 2022 19:51:10 +0100 Message-Id: <1644346272-3403-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 Reviewed-by: Dmitry Baryshkov --- 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__); From patchwork Tue Feb 8 18:51:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 12739231 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEA67C4332F for ; Tue, 8 Feb 2022 18:51:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353077AbiBHSvT (ORCPT ); Tue, 8 Feb 2022 13:51:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239828AbiBHSvT (ORCPT ); Tue, 8 Feb 2022 13:51:19 -0500 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6493FC0613CB for ; Tue, 8 Feb 2022 10:51:18 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id s18so17740wrv.7 for ; Tue, 08 Feb 2022 10:51:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5ALVzrTKLAEPJC1Xi/eint/DQ6mkJeJEeqYUi1S2gxY=; b=nKDB50aVVHjB1xgWZTsMctY0IInrnCloiEnmZGApHrjfNKbfOX7XqZh6Qev38Sg+35 VUErEzlCn++Vs5HrxvjP0pTwLIeXdMnjeYxwajgHRwisBHIEfdHzlCobLDOGcgzw4Y9C dDIB46Ewy+27TE6xQMiZZlTRnk70Icj2v+rO+/v0rDsnYFnAUtjGmBG3N0lMroJ5aQA8 Awvdsw+k0RfvLnLWXI5TlxMICjeM1GJdwyZtNWnhJJg3HyfNGOrM8RQePTWrw8Y3qihS rz9SuH1IAHbFpliJJVUCCOvpj//i1QHQ3vZxe8FGygtrA/CQhoBcRKHDy+zGR85XqAov Yo2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5ALVzrTKLAEPJC1Xi/eint/DQ6mkJeJEeqYUi1S2gxY=; b=nVoeM6qwxbs/cc1insyCnp3rO9Ni88BOHoGbJl4K8Xo70gCSvEZ0LUE1kxoBQddbwF 7ZKKJ4WWq9jpGYdA4rMbJY9hxPWTmXDTZKRDvwcs2k3foEPcsYkuZ8pQOJcky50TvI4U 1Cx9BhUgvFiBIag+Ezwo+kCVaKnIUsSuq8xCA5PqvlWddGGlV01IYJ0ZAhCl9XqIikHt KHFYOv0G3+lufPo4k9xQanCITo+AAkV/ANpzmz9b0quNUFOpzBmHPKjuaa4Tam4uRKll CtnnbAMqRGgEOtFpX/BrXSrDZgN4TmqMJlt7P+UPy3ZU2X1NGdrX0UplDJ20RsOeBmYE n1Xg== X-Gm-Message-State: AOAM53202U9162I202hvrvUlSJefqSFwohqXOrYb7KgSENsIxqR3awhI sqrX/fchy3VOs/n2uVHiXQBOdg== X-Google-Smtp-Source: ABdhPJz/tUn5rWWb97PhmCF/3fHm+0f1rFa7bKgE8Zk9tgOGKsk+jQPJMmJOWUsCtocsRv3sJZFR2Q== X-Received: by 2002:a05:6000:3c6:: with SMTP id b6mr4536758wrg.12.1644346276133; Tue, 08 Feb 2022 10:51:16 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:82c:5f0:682b:4712:4b40:6814]) by smtp.gmail.com with ESMTPSA id z17sm2762725wmf.11.2022.02.08.10.51.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Feb 2022 10:51:15 -0800 (PST) From: Loic Poulain To: robdclark@gmail.com, sean@poorly.run, robh+dt@kernel.org, dmitry.baryshkov@linaro.org Cc: linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, Loic Poulain Subject: [PATCH 2/3] drm/msm/dsi: Add support for qcm2290 dsi controller Date: Tue, 8 Feb 2022 19:51:11 +0100 Message-Id: <1644346272-3403-2-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1644346272-3403-1-git-send-email-loic.poulain@linaro.org> References: <1644346272-3403-1-git-send-email-loic.poulain@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Using exact version of the block as compatible string. Signed-off-by: Loic Poulain Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dsi/dsi.c | 2 ++ drivers/gpu/drm/msm/dsi/dsi_cfg.c | 23 +++++++++++++++++++++++ drivers/gpu/drm/msm/dsi/dsi_cfg.h | 3 +++ 3 files changed, 28 insertions(+) diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c index 06a9008..bed8b24b 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -4,6 +4,7 @@ */ #include "dsi.h" +#include "dsi_cfg.h" struct drm_encoder *msm_dsi_get_encoder(struct msm_dsi *msm_dsi) { @@ -171,6 +172,7 @@ static int dsi_dev_remove(struct platform_device *pdev) static const struct of_device_id dt_match[] = { { .compatible = "qcom,mdss-dsi-ctrl", .data = NULL /* autodetect cfg */ }, + { .compatible = "qcom,dsi-ctrl-6g-qcm2290", .data = &qcm2290_dsi_cfg_handler }, {} }; diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.c b/drivers/gpu/drm/msm/dsi/dsi_cfg.c index 96bbc8b..2c23324 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.c +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.c @@ -213,6 +213,24 @@ static const struct msm_dsi_config sc7280_dsi_cfg = { .num_dsi = 1, }; +static const char * const dsi_qcm2290_bus_clk_names[] = { + "iface", "bus", +}; + +static const struct msm_dsi_config qcm2290_dsi_cfg = { + .io_offset = DSI_6G_REG_SHIFT, + .reg_cfg = { + .num = 1, + .regs = { + {"vdda", 21800, 4 }, /* 1.2 V */ + }, + }, + .bus_clk_names = dsi_qcm2290_bus_clk_names, + .num_bus_clks = ARRAY_SIZE(dsi_qcm2290_bus_clk_names), + .io_start = { 0x5e94000 }, + .num_dsi = 1, +}; + static const struct msm_dsi_host_cfg_ops msm_dsi_v2_host_ops = { .link_clk_set_rate = dsi_link_clk_set_rate_v2, .link_clk_enable = dsi_link_clk_enable_v2, @@ -300,3 +318,8 @@ const struct msm_dsi_cfg_handler *msm_dsi_cfg_get(u32 major, u32 minor) return cfg_hnd; } +/* Non autodetect configs */ +const struct msm_dsi_cfg_handler qcm2290_dsi_cfg_handler = { + .cfg = &qcm2290_dsi_cfg, + .ops = &msm_dsi_6g_v2_host_ops, +}; diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.h b/drivers/gpu/drm/msm/dsi/dsi_cfg.h index 41e99a9..fe54a99 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.h +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.h @@ -60,5 +60,8 @@ struct msm_dsi_cfg_handler { const struct msm_dsi_cfg_handler *msm_dsi_cfg_get(u32 major, u32 minor); +/* Non autodetect configs */ +extern const struct msm_dsi_cfg_handler qcm2290_dsi_cfg_handler; + #endif /* __MSM_DSI_CFG_H__ */ From patchwork Tue Feb 8 18:51:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 12739232 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0EB2C433F5 for ; Tue, 8 Feb 2022 18:51:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239828AbiBHSvU (ORCPT ); Tue, 8 Feb 2022 13:51:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352977AbiBHSvT (ORCPT ); Tue, 8 Feb 2022 13:51:19 -0500 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8F99C0612C0 for ; Tue, 8 Feb 2022 10:51:18 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id w11so45577wra.4 for ; Tue, 08 Feb 2022 10:51:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IObv89LbNrZYavKYMS1gWTg3+LyoAzoINhD0LOwgdjs=; b=KKOc6hDgttGYmwNMZ7uKkcrJ/eVJsYKtLyWmf9aufdxpHwXpoVlEfNJE/i4x9MCpcP AUAJfk6MFRYKLvTnz8PHZj/4qL5BMtg+OQh0CjjI7KFvHz70p307ow8O9uyhzwesfVkw 3VYAwCfqTHz9w9vEDmwfbZ5lasLkrNV1oHfCNkVz7HyX0YhpW9AVwFpNREsuYXe1pKmz hmDJIUTVxW9zRq2dgC9qC6Px/87w1K4yxo/C69CcaROSnhag/XWmLVNEw4WjE/Dten6I 6bXaWVkRco3AJi7usYwd3RvOq2drUCcyo2YKuL5BB/Jr2ozqxZeANHKtd+CBMw6sW1R5 NBDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IObv89LbNrZYavKYMS1gWTg3+LyoAzoINhD0LOwgdjs=; b=hJ5+Gj2djmjQ+zu5riNA2JPCWTOIRaItcyisaoP9iA/3JMnvPYM/JfYh3/NRDBP97D b80TC6nyJxiPbxqE7tRDz58rKXXvyjoCRY0SZqE3N3GZxbt67hN4Tc48xHVTKBlCbJQ0 ipzDeVivWMUn6E8tTrUOXHvJ6c++odONU+ObukuibNqpbKu7VjgjErw9kwRyC9ps5tkL Wt1BpB5/ALtEGuRr5wpAXLg0SLtVeRyDin0Hmjrp3E8epbbghDbWuNQJ1hS1ik3zWnM9 zj9dQNAqr/OImsBBYMa+hd/zpA3VvBF+stBnSr/ogHc8cevbPlTAcjMcf3GjBVXL/1fB Hc+Q== X-Gm-Message-State: AOAM530Yud7Svx8d9mglCjYu53gFg+chpPx2mvQ8NOmRs6m/xPcfq7U3 LlS9qgeE7HQqcpYxvQXWgp96TA== X-Google-Smtp-Source: ABdhPJzckKCpxQU8AxLxjSn8e70QPd5LCPCMa8xWCpXhvK90ywMKDZUPguJLO+EeqzpHACovvYWCdw== X-Received: by 2002:adf:e10e:: with SMTP id t14mr4585122wrz.299.1644346277422; Tue, 08 Feb 2022 10:51:17 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:82c:5f0:682b:4712:4b40:6814]) by smtp.gmail.com with ESMTPSA id z17sm2762725wmf.11.2022.02.08.10.51.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Feb 2022 10:51:16 -0800 (PST) From: Loic Poulain To: robdclark@gmail.com, sean@poorly.run, robh+dt@kernel.org, dmitry.baryshkov@linaro.org Cc: linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, Loic Poulain Subject: [PATCH 3/3] dt-bindings: msm/dsi: Add qcm2290 dsi controller binding Date: Tue, 8 Feb 2022 19:51:12 +0100 Message-Id: <1644346272-3403-3-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1644346272-3403-1-git-send-email-loic.poulain@linaro.org> References: <1644346272-3403-1-git-send-email-loic.poulain@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add DSI block specific qcm2290 compatible string as valid Qualcomm DSI controller. Signed-off-by: Loic Poulain --- .../devicetree/bindings/display/msm/dsi-controller-main.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml index 35426fd..7095ec3c8 100644 --- a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml +++ b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml @@ -14,8 +14,9 @@ allOf: properties: compatible: - items: - - const: qcom,mdss-dsi-ctrl + enum: + - qcom,mdss-dsi-ctrl + - qcom,dsi-ctrl-6g-qcm2290 reg: maxItems: 1