From patchwork Mon Feb 14 15:37:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 12745739 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 990A8C433FE for ; Mon, 14 Feb 2022 15:37:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355900AbiBNPh4 (ORCPT ); Mon, 14 Feb 2022 10:37:56 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:32814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236092AbiBNPhy (ORCPT ); Mon, 14 Feb 2022 10:37:54 -0500 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A419DF96 for ; Mon, 14 Feb 2022 07:37:46 -0800 (PST) Received: by mail-wr1-x430.google.com with SMTP id v12so27563099wrv.2 for ; Mon, 14 Feb 2022 07:37:45 -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=YT5Imfq0LMuVZOXx0XtEYUfkVCCzeXiSTBNp7getK24=; b=Q4z2sLp9vgx5dFg2IuDY/HyEbLdPaVgbvkiNSjnchz9tPBDFLdvyLgY547tI8KRIN5 MJ8qWz4FYwY9eR7R1R0q+kinxAt4EUPMXxmKcoF6gS18Qz25FesdTkD0/nYf/CqMxzKC MpWY79AruqPuJA3m5UM8seDuvCgJw2ZH9dUOj1+l+CyAclR/ORjt0sUn7NLMJxqcM3pQ ryoHTY4Pn+rzP9fEhW36TX5VVzsqg7YTPWpgh/6HoNjwzaatCsO63jvb8IUYAa6HixMc L7yXbXwPKcAR7RdU7X+lBcresX4+g26j8peqlbIWG5zLTWCvm5PwsgatOH+oFFtib+bs xgxw== 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=YT5Imfq0LMuVZOXx0XtEYUfkVCCzeXiSTBNp7getK24=; b=vjSoCKSeSDbjvGsmubzzGEoon3E8QD/vqGJ90Ad7fy/pUJszb9vtVmatguxlW7NR6d l5+H6eMAK+WuWBf1pAgLk2TYawkUTD6ytUg4vl8RlZ2qI767ic9hWrc9Af/8pxC2pyyb Z8uMJcgVT3nTR3zQHNu3AwSBD7YgPEq9ab94E0xPDzQMoT+Wdee5CssyC94zFwevFz1H mw82/Qeih78k2BeoBkd5wa7XWN1n8NtzYKbywT87+7cx2grLIH/fenZr3RyY/psPHcCK 7VjRmBberYSfXHhLefBmbIND4JqTrFYPWl36bklMua6YkCKe2nt9UVY3WQIejh5rwr0I XABA== X-Gm-Message-State: AOAM530WOn+Ib4UO0cdsrzSPxTGA28ZLyeIekqzR5MfFDihaBqJ5HBZH /dPm9RaJFUaN4KhR0CyTyr6UBw== X-Google-Smtp-Source: ABdhPJxDmnQW8BFcCa9HYezn36gI/eXsK+ZpTY6byPQzuhuqYE5UDH49gKOgYeqccSAazZ0R7VG0aQ== X-Received: by 2002:a5d:5043:: with SMTP id h3mr169686wrt.394.1644853064495; Mon, 14 Feb 2022 07:37:44 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:82c:5f0:682b:4712:4b40:6814]) by smtp.gmail.com with ESMTPSA id l26sm12935850wms.24.2022.02.14.07.37.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Feb 2022 07:37:43 -0800 (PST) From: Loic Poulain To: dmitry.baryshkov@linaro.org, robdclark@gmail.com, robh+dt@kernel.org Cc: linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, bjorn.andersson@linaro.org, Loic Poulain Subject: [PATCH v2 1/3] drm/msm/dsi: Allow to specify dsi config as pdata Date: Mon, 14 Feb 2022 16:37:38 +0100 Message-Id: <1644853060-12222-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 --- 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__); From patchwork Mon Feb 14 15:37:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 12745738 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 5C71AC433EF for ; Mon, 14 Feb 2022 15:37:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354105AbiBNPhz (ORCPT ); Mon, 14 Feb 2022 10:37:55 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:32836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355899AbiBNPhz (ORCPT ); Mon, 14 Feb 2022 10:37:55 -0500 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D976EDF9A for ; Mon, 14 Feb 2022 07:37:46 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id v12so27563165wrv.2 for ; Mon, 14 Feb 2022 07:37:46 -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=piAsb4t4SD1sv2wty0vPkL+S6vbc8+vlfNWfjljedEY=; b=vV37BgTTvSmRurnENtb36TIlJprdlqgUKYZDt7jlyK64Ojo+EJMxry2PABuhUrFxS2 COzFkCIfXIzbIapPp1bGv/zu5KKwC+L3+cn6ewTn2PiUi8Ql85wjRSgLOOy3hqYoSQbi QHA+XGJIbxAVsEYIzADUbJE8frtBVhtQkhohPf0BMMVA6V9d+eagLpFBZ1ZodGKUgdnI Ar+JQpAoEXOy3EE8CpNFx+K6L4Y98Abv5fjeWrkLuCdx9s918iimS5hg39Ly+mSg0FIz Ck0Ok76uLEZb8Bzc+PP2uf6iCWEl2UNXLLxdcu772PAczO/Il1ms11rrMbBPjgqhEKdC 0MeQ== 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=piAsb4t4SD1sv2wty0vPkL+S6vbc8+vlfNWfjljedEY=; b=yfCkIvue4LtXvePrRzzLMocSO8Mbb5CQPoR8I6nIRaLvGHuUUWz8mciyHny9bNVmoe wqIg/bCUzJRYzPjKbYC1tBn7vjZZIizp3OyB9WYDmfS9xgQs1g6/++MwdlJPGh6hsCqS 08VOmHE/NTxDTRiU2Knpze6RjpU8ymWhSyT0GJw4GqAENV9xpc44IqxPXOrTc1c3xI/Q JGfKUMc0jve7C0GVqdVK37tGFsdpbu3GHVoX+/6MuyzHeGYDaiIk728aiUak4dmzJGKf 9DUJqiu/IZsv7DmflIR3O6j/0XH1gVWABLGTZghyTl0mtAPUHxU94SthNEoE6bamCRFQ d/jg== X-Gm-Message-State: AOAM533w7eQzIoNvCE/GsLCvilJGn/XZGrpLoQaNvL3L+zDUGveucTB5 MJfSLCwClUfTN2ZQOeC8efXaYtMg1eZecA== X-Google-Smtp-Source: ABdhPJziMz3tE+JW+CSk7fGBvFzWbBfKT7e5GCTRzgFmUfT7gpHXHC0Ov+qdiyvZTJJOKnoenRWifQ== X-Received: by 2002:a05:6000:188:: with SMTP id p8mr188339wrx.84.1644853065425; Mon, 14 Feb 2022 07:37:45 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:82c:5f0:682b:4712:4b40:6814]) by smtp.gmail.com with ESMTPSA id l26sm12935850wms.24.2022.02.14.07.37.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Feb 2022 07:37:44 -0800 (PST) From: Loic Poulain To: dmitry.baryshkov@linaro.org, robdclark@gmail.com, robh+dt@kernel.org Cc: linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, bjorn.andersson@linaro.org, Loic Poulain Subject: [PATCH v2 2/3] drm/msm/dsi: Add support for qcm2290 dsi controller Date: Mon, 14 Feb 2022 16:37:39 +0100 Message-Id: <1644853060-12222-2-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1644853060-12222-1-git-send-email-loic.poulain@linaro.org> References: <1644853060-12222-1-git-send-email-loic.poulain@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org QCM2290 MDSS includes a Qualcomm DSI controller v2.4.1. Since this controller version is not SoC specific, and already assigned to sc7180 for auto configuration, we rely on DSI block specific compatible string "qcom,dsi-ctrl-6g-qcm2290", and use the device's data to point to the right dsi config handler. Signed-off-by: Loic Poulain Reviewed-by: Dmitry Baryshkov --- v2: commit reword 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 Mon Feb 14 15:37:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 12745740 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 6BFD5C43217 for ; Mon, 14 Feb 2022 15:37:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236092AbiBNPh5 (ORCPT ); Mon, 14 Feb 2022 10:37:57 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:32902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355902AbiBNPh4 (ORCPT ); Mon, 14 Feb 2022 10:37:56 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F30E2DF84 for ; Mon, 14 Feb 2022 07:37:47 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id j26so16668341wrb.7 for ; Mon, 14 Feb 2022 07:37:47 -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=aijvcWsy9YtZiV+n1WapUIg4+6ntUJUoIxFuyguMb7g=; b=d2smxsP4lY8EQU1zErCDeEd9cyKWYZkCDUktgBcZ/37aIGxUVMJloxXmmMGDuI1aNY XM7mbLgPCEpq3H4LSR4gD2zckDXLiKmzBw/rf96aiVcoHu7FmcnK+n1u5Gbt4oV+977F laGYHR4xHhM9E2Z048+Ww+9KIu3CBm08UxTvnyGz/iPAljcYepLLyAzah/4G9X+XZp/e 886JNhKnUWCsb7vcSKDnXGGCEWQzXZnbh29alvExLBA0R4xGqiPRhybIZBNt1mXbun8N L1rfIQuhlzaQyxW6lPsuzJXQsiKZD71xStkMe5GS1sHEEV8vCGl+zswNmgzadtUA/mt6 6DKg== 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=aijvcWsy9YtZiV+n1WapUIg4+6ntUJUoIxFuyguMb7g=; b=1uyHAZIXxDbI4kxkBRhSsoBaY2DmYmIIw+DAk89IlF3sYKGU5HomskjKqjZ/8Bgd6x F9c5asvwno3WHXCRT3GQWbtOTH4AqAAQf8Eu0Oou4CZTRkQ7BFM55X7pqbOprTY8AZ4w QLCc1v1uFNQJULpBoXOaxA2S0E7Fn62EPU7KqsiWYXUKFXmISs6tSI1UnyKbzej0KAgd fFVW4MLTXSb9XNIXkjBY3vueiOI3TY0lCmKHGqphS19JyZOiGPBToDOcdYKOVeZBLhXB Xb//YODDfuie5cw/upcunWBciMGsDjyi/Fq5AHQsr2J5xYaelw0kCjKNebLSJQ8nu/XJ 6wGA== X-Gm-Message-State: AOAM531hSSpDXGRChN5NyHtazljwK71ZR7WdcCjSa/gvCl5J8fK9VjCH Z1iJoFrTE8ri3Llv6oPvv/X8hg== X-Google-Smtp-Source: ABdhPJy1jNaE/Z+WGRu0Cij1dahEbDE8D710Pc2g3XwPeNMUzaKum51xN0xAPyB7Gve6/2IpMXoqEg== X-Received: by 2002:a5d:53cd:: with SMTP id a13mr155713wrw.712.1644853066487; Mon, 14 Feb 2022 07:37:46 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:82c:5f0:682b:4712:4b40:6814]) by smtp.gmail.com with ESMTPSA id l26sm12935850wms.24.2022.02.14.07.37.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Feb 2022 07:37:45 -0800 (PST) From: Loic Poulain To: dmitry.baryshkov@linaro.org, robdclark@gmail.com, robh+dt@kernel.org Cc: linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, bjorn.andersson@linaro.org, Loic Poulain Subject: [PATCH v2 3/3] dt-bindings: msm/dsi: Add qcm2290 dsi controller binding Date: Mon, 14 Feb 2022 16:37:40 +0100 Message-Id: <1644853060-12222-3-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1644853060-12222-1-git-send-email-loic.poulain@linaro.org> References: <1644853060-12222-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 Acked-by: Rob Herring --- v2: no change .../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