From patchwork Sat Feb 11 11:51:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13137033 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 63447C636CC for ; Sat, 11 Feb 2023 11:51:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5914A10E15F; Sat, 11 Feb 2023 11:51:47 +0000 (UTC) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5AB0610E15F for ; Sat, 11 Feb 2023 11:51:45 +0000 (UTC) Received: by mail-ed1-x52c.google.com with SMTP id cq19so4580877edb.5 for ; Sat, 11 Feb 2023 03:51:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sLkh67ooWyVObn1J2I1Qu7dXdNbX+Cd0UoL9axKT34o=; b=oltznk2rV7cDqVbUdNVtJ8xpjZjQpPXAe0K1+3HPWxtatzOXOJU0Ubuyg6e7SUfbpl m1eM9ON4PETCcwFpxrE17SDiVqcgQ4qMA6ASwiLe07mpN+9d9bzDs9zATe7+Xg+3zsKY t/Ph1p7W2YsWJorjsNF2YGZyOGu2FKvOehd79IGioJBG2mcvMtjKBYwuAU9pZ6BzxPMO tSZ8wVx8O0oVWhRUREjHGe3AacbYvbdiDrqZa+MwBgKjlngPjh42cVTHezvHBh/qgw+p KwllStugYL60DK9XlS3dhhhxsAbOIfRRLL27sxg5Xv0eiewLUPW74JInzpF6m4/mOEdW +LwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sLkh67ooWyVObn1J2I1Qu7dXdNbX+Cd0UoL9axKT34o=; b=M5qxbhaorGbeoQPD09NLt45d+KXa6MHug1hKCDN1uoBmC3QpYDciDOiRKF2b3UhcFq LvSi1O3xES0Ic52x5OGA/VxhFnejjN/lCM5j3e94vORI8QfTTyZ5+/kJc9zFDRGZWqBK 7xu/HIfRpElzmxLvwWqmGuGw+apZbhckrLg4mptANVshAobFaKM1ZlTnPnqsQUrRszIb t8qmb14sNlrCrjhP0SajKhpKWYwY2YzK0PeQ92anLKz5C9gLzym9fkeny7/yqXR6LQok QwCa/fk/wd0RA3S7fCF8ELY+juVJD4tFUqF+lq2PJPyXvgOOkSzpKjdzHXY8XQGTYi/8 wi1A== X-Gm-Message-State: AO0yUKUok81X/Hwv06lU7CgRVQYvO1GwsEIZuATB6V5mNjv7YlqJE65e bvkOOXGDzBp3479OwZW6fGZirg== X-Google-Smtp-Source: AK7set+FQ8jTth7bS0gyIXngSI7gGV8x5+Sg7Jip1fRYG9F1ouZXXNdruBZInEMV8zMNS8gwStxJpQ== X-Received: by 2002:a50:8e41:0:b0:4aa:c354:a0e7 with SMTP id 1-20020a508e41000000b004aac354a0e7mr18903423edx.25.1676116303952; Sat, 11 Feb 2023 03:51:43 -0800 (PST) Received: from localhost.localdomain (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id r10-20020a50d68a000000b004aabb714230sm3636070edi.35.2023.02.11.03.51.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Feb 2023 03:51:43 -0800 (PST) From: Konrad Dybcio To: linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org, krzysztof.kozlowski@linaro.org Subject: [PATCH 01/10] dt-bindings: display/msm: dsi-controller-main: Fix deprecated QCM2290 compatible Date: Sat, 11 Feb 2023 12:51:01 +0100 Message-Id: <20230211115110.1462920-2-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230211115110.1462920-1-konrad.dybcio@linaro.org> References: <20230211115110.1462920-1-konrad.dybcio@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: freedreno@lists.freedesktop.org, Krzysztof Kozlowski , devicetree@vger.kernel.org, Abhinav Kumar , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Rob Herring , Krishna Manikandan , Bryan O'Donoghue , Dmitry Baryshkov , marijn.suijten@somainline.org, Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The qcom, prefix was missed previously. Fix it. Fixes: 0c0f65c6dd44 ("dt-bindings: msm: dsi-controller-main: Add compatible strings for every current SoC") Signed-off-by: Konrad Dybcio --- .../devicetree/bindings/display/msm/dsi-controller-main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml index e75a3efe4dac..2494817c1bd6 100644 --- a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml +++ b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml @@ -33,7 +33,7 @@ properties: - const: qcom,mdss-dsi-ctrl - items: - enum: - - dsi-ctrl-6g-qcm2290 + - qcom,dsi-ctrl-6g-qcm2290 - const: qcom,mdss-dsi-ctrl deprecated: true From patchwork Sat Feb 11 11:51:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13137034 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4FB52C64EC4 for ; Sat, 11 Feb 2023 11:51:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E94D010E160; Sat, 11 Feb 2023 11:51:51 +0000 (UTC) Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 959EF10E160 for ; Sat, 11 Feb 2023 11:51:49 +0000 (UTC) Received: by mail-ed1-x52a.google.com with SMTP id bt8so1504351edb.12 for ; Sat, 11 Feb 2023 03:51:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/W1yN038JHBkZa936DvMVOCfu8R7n0uZaSVb3zgCCfI=; b=d4y2N5O4WC0XbfkuF+PWiYsvvT9dZHVpZUH2azWkndreplnqUor0ZJRp9cx20tGMi2 IrK2iwoeDlP/OXKb8fK1NJxAL/+eHidzH8zo37Obi3nQBSCs68aG/F1REjY/Nv7064kg rICCOttEFo6lCktwcXLckWBbyXnjlakWN0S5K+zXovIQ2cUUsVO8t3Z1s4ZDwxcLjC50 lw4AROrHcShlrQjwtYC6fg1MCjtZho5R9yNzv3g264c70xs5FmE4K65dsaG0wE5YDMrA 4OY8vsLJvyr/+hiDw06weFXLwXFu7wdmIx5/TtbhxyCsimLtoGrfqzi8UjiKg+JxE6wk Tx3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/W1yN038JHBkZa936DvMVOCfu8R7n0uZaSVb3zgCCfI=; b=KDvjEniyw+nOYwYjInRTNV8HCaBXpj0LIy3oUZxZl+6/nVSBiTuFdJ0REIq98iJ7QS rLFoORheCIlM72J/B7fBC9Bo7gNqm4GZg1IgV+REo8QKY0WINcNg93tNYuejqRZmBmv4 AUKM3spOK/oa37J+DVPxN+5vbLraW5aAcrMvHbTyUUzgsRaSZtB+VQioN/bwyUNFz/vn B4LGJcPLnL7uc1de/xGFMbci7ZTZmsuzC73/OQpKLRTqJHhaFz0/NCF9ZajDL9ijjJZM 0203S4efQj8iPk8xpD+BVzJoJfaC1mYZhjVCcC/sL7g2TexOSGnjrlu6QcuQ4uV5k7f1 jCqw== X-Gm-Message-State: AO0yUKWmLuMz7V9uO3LwjxRPpGX7aZRsiASE4AwKzwM3fgpzmHMpLQ95 Qf/VuTI/jq24Q4eKRA7tSBA0aw== X-Google-Smtp-Source: AK7set+745x9yS5kCdk9kzsGrxClr42QgJOO6KFpatlu4ZJbSdqeBoWMq5GU/3myVvmTAEjBrj/omQ== X-Received: by 2002:a50:ccd8:0:b0:4ac:b838:a902 with SMTP id b24-20020a50ccd8000000b004acb838a902mr1160166edj.13.1676116308162; Sat, 11 Feb 2023 03:51:48 -0800 (PST) Received: from localhost.localdomain (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id r10-20020a50d68a000000b004aabb714230sm3636070edi.35.2023.02.11.03.51.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Feb 2023 03:51:47 -0800 (PST) From: Konrad Dybcio To: linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org, krzysztof.kozlowski@linaro.org Subject: [PATCH 02/10] drm/msm/dsi: Turn msm_dsi_config::io_start into a 2d array Date: Sat, 11 Feb 2023 12:51:02 +0100 Message-Id: <20230211115110.1462920-3-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230211115110.1462920-1-konrad.dybcio@linaro.org> References: <20230211115110.1462920-1-konrad.dybcio@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , Loic Poulain , Vinod Koul , Vladimir Lypak , Abhinav Kumar , dri-devel@lists.freedesktop.org, Douglas Anderson , Konrad Dybcio , Dmitry Baryshkov , marijn.suijten@somainline.org, freedreno@lists.freedesktop.org, Sean Paul , linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Currently, we allow for MAX_DSI entries in io_start to facilitate for MAX_DSI number of DSI hosts at different addresses. The configuration is matched against the DSI CTRL hardware revision read back from the component. We need a way to resolve situations where multiple SoCs with different register maps may use the same version of DSI CTRL. In preparation to do so, make msm_dsi_config a 2d array where each entry represents a set of configurations adequate for a given SoC. This is totally fine to do, as the only differentiating factors between same-version-different-SoCs configurations are the number of DSI hosts (1 or 2, at least as of today) and the set of registers. The regulator setup is the same, because the DSI hardware is the same, regardless of the SoC it was implemented in. Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/dsi/dsi_cfg.c | 52 ++++++++++++++++++++++-------- drivers/gpu/drm/msm/dsi/dsi_cfg.h | 5 ++- drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +- 3 files changed, 44 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.c b/drivers/gpu/drm/msm/dsi/dsi_cfg.c index 6d21f0b33411..068d45b3a8f0 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.c +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.c @@ -21,7 +21,9 @@ static const struct msm_dsi_config apq8064_dsi_cfg = { .num_regulators = ARRAY_SIZE(apq8064_dsi_regulators), .bus_clk_names = dsi_v2_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_v2_bus_clk_names), - .io_start = { 0x4700000, 0x5800000 }, + .io_start = { + { 0x4700000, 0x5800000 }, + }, .num_dsi = 2, }; @@ -41,7 +43,9 @@ static const struct msm_dsi_config msm8974_apq8084_dsi_cfg = { .num_regulators = ARRAY_SIZE(msm8974_apq8084_regulators), .bus_clk_names = dsi_6g_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names), - .io_start = { 0xfd922800, 0xfd922b00 }, + .io_start = { + { 0xfd922800, 0xfd922b00 }, + }, .num_dsi = 2, }; @@ -60,7 +64,9 @@ static const struct msm_dsi_config msm8916_dsi_cfg = { .num_regulators = ARRAY_SIZE(msm8916_dsi_regulators), .bus_clk_names = dsi_8916_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_8916_bus_clk_names), - .io_start = { 0x1a98000 }, + .io_start = { + { 0x1a98000 }, + }, .num_dsi = 1, }; @@ -79,7 +85,9 @@ static const struct msm_dsi_config msm8976_dsi_cfg = { .num_regulators = ARRAY_SIZE(msm8976_dsi_regulators), .bus_clk_names = dsi_8976_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_8976_bus_clk_names), - .io_start = { 0x1a94000, 0x1a96000 }, + .io_start = { + { 0x1a94000, 0x1a96000 }, + }, .num_dsi = 2, }; @@ -98,7 +106,9 @@ static const struct msm_dsi_config msm8994_dsi_cfg = { .num_regulators = ARRAY_SIZE(msm8994_dsi_regulators), .bus_clk_names = dsi_6g_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names), - .io_start = { 0xfd998000, 0xfd9a0000 }, + .io_start = { + { 0xfd998000, 0xfd9a0000 }, + }, .num_dsi = 2, }; @@ -118,7 +128,9 @@ static const struct msm_dsi_config msm8996_dsi_cfg = { .num_regulators = ARRAY_SIZE(msm8996_dsi_regulators), .bus_clk_names = dsi_8996_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_8996_bus_clk_names), - .io_start = { 0x994000, 0x996000 }, + .io_start = { + { 0x994000, 0x996000 }, + }, .num_dsi = 2, }; @@ -137,7 +149,9 @@ static const struct msm_dsi_config msm8998_dsi_cfg = { .num_regulators = ARRAY_SIZE(msm8998_dsi_regulators), .bus_clk_names = dsi_msm8998_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_msm8998_bus_clk_names), - .io_start = { 0xc994000, 0xc996000 }, + .io_start = { + { 0xc994000, 0xc996000 }, + }, .num_dsi = 2, }; @@ -155,7 +169,9 @@ static const struct msm_dsi_config sdm660_dsi_cfg = { .num_regulators = ARRAY_SIZE(sdm660_dsi_regulators), .bus_clk_names = dsi_sdm660_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_sdm660_bus_clk_names), - .io_start = { 0xc994000, 0xc996000 }, + .io_start = { + { 0xc994000, 0xc996000 }, + }, .num_dsi = 2, }; @@ -177,7 +193,9 @@ static const struct msm_dsi_config sdm845_dsi_cfg = { .num_regulators = ARRAY_SIZE(sdm845_dsi_regulators), .bus_clk_names = dsi_sdm845_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_sdm845_bus_clk_names), - .io_start = { 0xae94000, 0xae96000 }, + .io_start = { + { 0xae94000, 0xae96000 }, + }, .num_dsi = 2, }; @@ -191,7 +209,9 @@ static const struct msm_dsi_config sm8550_dsi_cfg = { .num_regulators = ARRAY_SIZE(sm8550_dsi_regulators), .bus_clk_names = dsi_sdm845_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_sdm845_bus_clk_names), - .io_start = { 0xae94000, 0xae96000 }, + .io_start = { + { 0xae94000, 0xae96000 }, + }, .num_dsi = 2, }; @@ -205,7 +225,9 @@ static const struct msm_dsi_config sc7180_dsi_cfg = { .num_regulators = ARRAY_SIZE(sc7180_dsi_regulators), .bus_clk_names = dsi_sc7180_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_sc7180_bus_clk_names), - .io_start = { 0xae94000 }, + .io_start = { + { 0xae94000 }, + }, .num_dsi = 1, }; @@ -223,7 +245,9 @@ static const struct msm_dsi_config sc7280_dsi_cfg = { .num_regulators = ARRAY_SIZE(sc7280_dsi_regulators), .bus_clk_names = dsi_sc7280_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_sc7280_bus_clk_names), - .io_start = { 0xae94000, 0xae96000 }, + .io_start = { + { 0xae94000, 0xae96000 }, + }, .num_dsi = 2, }; @@ -241,7 +265,9 @@ static const struct msm_dsi_config qcm2290_dsi_cfg = { .num_regulators = ARRAY_SIZE(qcm2290_dsi_cfg_regulators), .bus_clk_names = dsi_qcm2290_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_qcm2290_bus_clk_names), - .io_start = { 0x5e94000 }, + .io_start = { + { 0x5e94000 }, + }, .num_dsi = 1, }; diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.h b/drivers/gpu/drm/msm/dsi/dsi_cfg.h index 44be4a88aa83..df9f09876ccb 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.h +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.h @@ -32,13 +32,16 @@ #define DSI_6G_REG_SHIFT 4 +/* Maximum number of configurations matched against the same hw revision */ +#define VARIANTS_MAX 2 + struct msm_dsi_config { u32 io_offset; const struct regulator_bulk_data *regulator_data; int num_regulators; const char * const *bus_clk_names; const int num_bus_clks; - const resource_size_t io_start[DSI_MAX]; + const resource_size_t io_start[VARIANTS_MAX][DSI_MAX]; const int num_dsi; }; diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 18fa30e1e858..22ba8726b0ea 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -1869,7 +1869,7 @@ static int dsi_host_get_id(struct msm_dsi_host *msm_host) return -EINVAL; for (i = 0; i < cfg->num_dsi; i++) { - if (cfg->io_start[i] == res->start) + if (cfg->io_start[0][i] == res->start) return i; } From patchwork Sat Feb 11 11:51:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13137035 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 57DA2C61DA4 for ; Sat, 11 Feb 2023 11:51:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E29B510E166; Sat, 11 Feb 2023 11:51:55 +0000 (UTC) Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by gabe.freedesktop.org (Postfix) with ESMTPS id BCFCF10E166 for ; Sat, 11 Feb 2023 11:51:52 +0000 (UTC) Received: by mail-ed1-x533.google.com with SMTP id w3so326107edc.2 for ; Sat, 11 Feb 2023 03:51:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6d/ZVSA0QFC6MXtjamKYBGsXvhDKvXab75YapPa5sNQ=; b=rkpcdafCk9gxjEwIKlPV311jheyalW+L/U1VJddyjYZYeZzPJkfScGT3MrI68COmNo u9c/OzbbOCh59N0qCxva15f/1VY5aYUo14KMrwsWuPJ/F+BHkZTNDb7S12sHWWpIZ2EN cDh8F4ovZS6wSo8Pmr0Oa8jC6zMLZjFlLD2XzRjsZZmUBQsRoCi2ilB19nxqd7XUY8bj cjriyF+L1z7+Sqj3nbkTWtSyOQiY4FOPYJFHmPrVL4Kt8cfS2QXbd4PXjnsn6jHwCAlj FEN0CdN3NotV6Tx1qz7qPL/ULJ4VMCs03jem1hN5aM5d+q+uUM+bPAzqY7wY6aGG6g+V o91A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6d/ZVSA0QFC6MXtjamKYBGsXvhDKvXab75YapPa5sNQ=; b=cbp3R27C0FJTHiw9HJ10lCxW7kbm8FNT/UZv24HUR5C1VbQUO+bTU5P8wTOmhjtwQR 9cMTxNAckWW2tk32xkOyEnw7cdi00O+BKGgd8CDjPU/8N0k+Fk4yLiK25KotlPTOs4/m ZXXRVn9pJQOQQcGa5Uo0veePFQLAT1RX4yXm9sHPf0DzL9FZ3ounHwS+pWMb7a6PuNoW ElJoUMV2WPjIhu5ykfpqGbA8ZWL25XwBuFcR2Urc7I6ShTQgFe5exs0TDDmD2r0Q34fk ouE1JiiFuYcbZPrpwAPjl9fsSuJUrRfoKZOUS+9y0lbjd3cmJL8qJCG1/wTE3qb6SLkA h+kQ== X-Gm-Message-State: AO0yUKVTV0Vg/53TlRc4V92IgTPTtEYD8P87GcZ6K4U6HReOzCqNNOz+ iOg3nD9BEU81q4UcFs0r6PY/eQ== X-Google-Smtp-Source: AK7set/8yGN5ifzP6nn45s7t9NiKUHu0g0SGLLP6joFvn3me6Ca2PqnuHzuLzmzygeMaIsaZe11R5Q== X-Received: by 2002:a50:a6dc:0:b0:4ac:bd84:43d8 with SMTP id f28-20020a50a6dc000000b004acbd8443d8mr311825edc.8.1676116312398; Sat, 11 Feb 2023 03:51:52 -0800 (PST) Received: from localhost.localdomain (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id r10-20020a50d68a000000b004aabb714230sm3636070edi.35.2023.02.11.03.51.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Feb 2023 03:51:52 -0800 (PST) From: Konrad Dybcio To: linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org, krzysztof.kozlowski@linaro.org Subject: [PATCH 03/10] drm/msm/dsi: Zero-terminate msm_dsi_config::io_start Date: Sat, 11 Feb 2023 12:51:03 +0100 Message-Id: <20230211115110.1462920-4-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230211115110.1462920-1-konrad.dybcio@linaro.org> References: <20230211115110.1462920-1-konrad.dybcio@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , Loic Poulain , Vinod Koul , Vladimir Lypak , Abhinav Kumar , dri-devel@lists.freedesktop.org, Douglas Anderson , Konrad Dybcio , Dmitry Baryshkov , marijn.suijten@somainline.org, freedreno@lists.freedesktop.org, Sean Paul , linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In preparation for supporting multiple sets of possible base registers, Zero-terminate the array that contains them to remove the need of specifying num_dsi for each set. Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/dsi/dsi_cfg.c | 39 ++++++++++-------------------- drivers/gpu/drm/msm/dsi/dsi_cfg.h | 4 +-- drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +- 3 files changed, 16 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.c b/drivers/gpu/drm/msm/dsi/dsi_cfg.c index 068d45b3a8f0..5f62c563bd1c 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.c +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.c @@ -22,9 +22,8 @@ static const struct msm_dsi_config apq8064_dsi_cfg = { .bus_clk_names = dsi_v2_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_v2_bus_clk_names), .io_start = { - { 0x4700000, 0x5800000 }, + { 0x4700000, 0x5800000, 0 }, }, - .num_dsi = 2, }; static const char * const dsi_6g_bus_clk_names[] = { @@ -44,9 +43,8 @@ static const struct msm_dsi_config msm8974_apq8084_dsi_cfg = { .bus_clk_names = dsi_6g_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names), .io_start = { - { 0xfd922800, 0xfd922b00 }, + { 0xfd922800, 0xfd922b00, 0 }, }, - .num_dsi = 2, }; static const char * const dsi_8916_bus_clk_names[] = { @@ -65,9 +63,8 @@ static const struct msm_dsi_config msm8916_dsi_cfg = { .bus_clk_names = dsi_8916_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_8916_bus_clk_names), .io_start = { - { 0x1a98000 }, + { 0x1a98000, 0 }, }, - .num_dsi = 1, }; static const char * const dsi_8976_bus_clk_names[] = { @@ -86,9 +83,8 @@ static const struct msm_dsi_config msm8976_dsi_cfg = { .bus_clk_names = dsi_8976_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_8976_bus_clk_names), .io_start = { - { 0x1a94000, 0x1a96000 }, + { 0x1a94000, 0x1a96000, 0 }, }, - .num_dsi = 2, }; static const struct regulator_bulk_data msm8994_dsi_regulators[] = { @@ -107,9 +103,8 @@ static const struct msm_dsi_config msm8994_dsi_cfg = { .bus_clk_names = dsi_6g_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names), .io_start = { - { 0xfd998000, 0xfd9a0000 }, + { 0xfd998000, 0xfd9a0000, 0 }, }, - .num_dsi = 2, }; static const char * const dsi_8996_bus_clk_names[] = { @@ -129,9 +124,8 @@ static const struct msm_dsi_config msm8996_dsi_cfg = { .bus_clk_names = dsi_8996_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_8996_bus_clk_names), .io_start = { - { 0x994000, 0x996000 }, + { 0x994000, 0x996000, 0 }, }, - .num_dsi = 2, }; static const char * const dsi_msm8998_bus_clk_names[] = { @@ -150,9 +144,8 @@ static const struct msm_dsi_config msm8998_dsi_cfg = { .bus_clk_names = dsi_msm8998_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_msm8998_bus_clk_names), .io_start = { - { 0xc994000, 0xc996000 }, + { 0xc994000, 0xc996000, 0 }, }, - .num_dsi = 2, }; static const char * const dsi_sdm660_bus_clk_names[] = { @@ -170,9 +163,8 @@ static const struct msm_dsi_config sdm660_dsi_cfg = { .bus_clk_names = dsi_sdm660_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_sdm660_bus_clk_names), .io_start = { - { 0xc994000, 0xc996000 }, + { 0xc994000, 0xc996000, 0 }, }, - .num_dsi = 2, }; static const char * const dsi_sdm845_bus_clk_names[] = { @@ -194,9 +186,8 @@ static const struct msm_dsi_config sdm845_dsi_cfg = { .bus_clk_names = dsi_sdm845_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_sdm845_bus_clk_names), .io_start = { - { 0xae94000, 0xae96000 }, + { 0xae94000, 0xae96000, 0 }, }, - .num_dsi = 2, }; static const struct regulator_bulk_data sm8550_dsi_regulators[] = { @@ -210,9 +201,8 @@ static const struct msm_dsi_config sm8550_dsi_cfg = { .bus_clk_names = dsi_sdm845_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_sdm845_bus_clk_names), .io_start = { - { 0xae94000, 0xae96000 }, + { 0xae94000, 0xae96000, 0 }, }, - .num_dsi = 2, }; static const struct regulator_bulk_data sc7180_dsi_regulators[] = { @@ -226,9 +216,8 @@ static const struct msm_dsi_config sc7180_dsi_cfg = { .bus_clk_names = dsi_sc7180_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_sc7180_bus_clk_names), .io_start = { - { 0xae94000 }, + { 0xae94000, 0 }, }, - .num_dsi = 1, }; static const char * const dsi_sc7280_bus_clk_names[] = { @@ -246,9 +235,8 @@ static const struct msm_dsi_config sc7280_dsi_cfg = { .bus_clk_names = dsi_sc7280_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_sc7280_bus_clk_names), .io_start = { - { 0xae94000, 0xae96000 }, + { 0xae94000, 0xae96000, 0 }, }, - .num_dsi = 2, }; static const char * const dsi_qcm2290_bus_clk_names[] = { @@ -266,9 +254,8 @@ static const struct msm_dsi_config qcm2290_dsi_cfg = { .bus_clk_names = dsi_qcm2290_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_qcm2290_bus_clk_names), .io_start = { - { 0x5e94000 }, + { 0x5e94000, 0 }, }, - .num_dsi = 1, }; static const struct msm_dsi_host_cfg_ops msm_dsi_v2_host_ops = { diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.h b/drivers/gpu/drm/msm/dsi/dsi_cfg.h index df9f09876ccb..03493cc6b772 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.h +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.h @@ -41,8 +41,8 @@ struct msm_dsi_config { int num_regulators; const char * const *bus_clk_names; const int num_bus_clks; - const resource_size_t io_start[VARIANTS_MAX][DSI_MAX]; - const int num_dsi; + /* Allow + 1 entry for the zero-terminator */ + const resource_size_t io_start[VARIANTS_MAX][DSI_MAX + 1]; }; struct msm_dsi_host_cfg_ops { diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 22ba8726b0ea..f5092b4d0757 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -1868,7 +1868,7 @@ static int dsi_host_get_id(struct msm_dsi_host *msm_host) if (!res) return -EINVAL; - for (i = 0; i < cfg->num_dsi; i++) { + for (i = 0; cfg->io_start[0][i]; i++) { if (cfg->io_start[0][i] == res->start) return i; } From patchwork Sat Feb 11 11:51:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13137036 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3768CC61DA4 for ; Sat, 11 Feb 2023 11:52:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9C2B410E176; Sat, 11 Feb 2023 11:52:00 +0000 (UTC) Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by gabe.freedesktop.org (Postfix) with ESMTPS id A994C10E176 for ; Sat, 11 Feb 2023 11:51:57 +0000 (UTC) Received: by mail-ed1-x535.google.com with SMTP id m8so7284228edd.10 for ; Sat, 11 Feb 2023 03:51:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zW+Y9s4c1yRvon1yWv9+3TgQXnziiU3kCR/96B6KXds=; b=TQtaWs28pO9XDAkHX2tefGKjjdl83OBLBeG56rO5GUjRm9XsfeAimbleEl0ZRh2mC2 eRDM+Ma9OWB6TYiNkL8AT0JjkSGNebW6zZIdSVashk9ppxa3ANoUSv8f1XZ9n9+rVQ6w naWH5YN+NqDFuyUBvuRDviqWa1chRnaQD6VCvk+pAI53txqtv7Xb4Z1+oS4G93dgdj7J A5dfiYoFW0Yrl1zdc/htvnzttiRtS5Ia9Di6auyv950ldDvHkcW6DSn6VzuJoYOpxzmz rz5IjzIlsGYRTjEVgtsbMsBjSj6f86R+y8q5Jk/Vh4CmojKWbkU7udIqt1IKOWK4dwhL VONQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zW+Y9s4c1yRvon1yWv9+3TgQXnziiU3kCR/96B6KXds=; b=Z/e7Ji2veDRqwPGwmVmIhMKffM7MowidCQMd2Yo2GM8MIVOISXe3T1In37x1mzHrSk lZfnc/sFH9Rxpf4gQzPmnNFalby62bDrKmmHVawDdFJlefMYdxPFvA95mKhXuxAbLYhr 8vSNuVzqaPcMgIv4eu8RP5vxwWJWnkjH1k/U9khqq4jp9ZWFph6O+98xwiUgAp/jVCb+ C1aBdOt45lRtzA4r1XUgS/VysE91LNfTFHmLXrgq43uJKVYEVzEraTZvmzeQdZi01rVY YYUUmbA34SBuVtJDez3l5aqAz4s+2SYlGzeTb7d8s1efi72PRjOewd0ttUV9t/SGoLwz szKQ== X-Gm-Message-State: AO0yUKUhknCsfbiCFl8TX6C1a/15RTmJY3MLNjXw5IeZFwVkhsOvptiz XetVIQSbBYB4n04YFYDTs8lxQA== X-Google-Smtp-Source: AK7set/4aYd+qbpanSLKwt7HWW/q9Cv/BGaym6KARMys8+e4SWPJhZbGmGYx8lPFsJ5wssrev9LlGg== X-Received: by 2002:a50:9feb:0:b0:4ac:b3af:1e1 with SMTP id c98-20020a509feb000000b004acb3af01e1mr3102029edf.13.1676116315918; Sat, 11 Feb 2023 03:51:55 -0800 (PST) Received: from localhost.localdomain (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id r10-20020a50d68a000000b004aabb714230sm3636070edi.35.2023.02.11.03.51.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Feb 2023 03:51:55 -0800 (PST) From: Konrad Dybcio To: linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org, krzysztof.kozlowski@linaro.org Subject: [PATCH 04/10] drm/msm/dsi: dsi_host: Fix DSI index detection when version clash occurs Date: Sat, 11 Feb 2023 12:51:04 +0100 Message-Id: <20230211115110.1462920-5-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230211115110.1462920-1-konrad.dybcio@linaro.org> References: <20230211115110.1462920-1-konrad.dybcio@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , Archit Taneja , Loic Poulain , Vinod Koul , Vladimir Lypak , Abhinav Kumar , dri-devel@lists.freedesktop.org, Douglas Anderson , Konrad Dybcio , Dmitry Baryshkov , marijn.suijten@somainline.org, freedreno@lists.freedesktop.org, Sean Paul , linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Now that msm_dsi_config is ready to accept multiple sets of registers (where array[n][idx] holds the base registers of DSI(idx) for the nth entry), loop through all available configs to resolve hw version clashes. Fixes: 32280d66fd44 ("drm/msm/dsi: Don't get DSI index from DT") Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/dsi/dsi_cfg.h | 1 + drivers/gpu/drm/msm/dsi/dsi_host.c | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.h b/drivers/gpu/drm/msm/dsi/dsi_cfg.h index 03493cc6b772..4a47705234bd 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.h +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.h @@ -43,6 +43,7 @@ struct msm_dsi_config { const int num_bus_clks; /* Allow + 1 entry for the zero-terminator */ const resource_size_t io_start[VARIANTS_MAX][DSI_MAX + 1]; + const int num_variants; }; struct msm_dsi_host_cfg_ops { diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index f5092b4d0757..8dfa69bcff77 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -1862,16 +1862,18 @@ static int dsi_host_get_id(struct msm_dsi_host *msm_host) struct platform_device *pdev = msm_host->pdev; const struct msm_dsi_config *cfg = msm_host->cfg_hnd->cfg; struct resource *res; - int i; + int i, j, num_variants; res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dsi_ctrl"); if (!res) return -EINVAL; - for (i = 0; cfg->io_start[0][i]; i++) { - if (cfg->io_start[0][i] == res->start) - return i; - } + num_variants = cfg->num_variants ? cfg->num_variants : 1; + + for (i = 0; i < num_variants; i++) + for (j = 0; cfg->io_start[i][j]; j++) + if (cfg->io_start[i][j] == res->start) + return j; return -EINVAL; } From patchwork Sat Feb 11 11:51:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13137037 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3C279C61DA4 for ; Sat, 11 Feb 2023 11:52:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8381410E175; Sat, 11 Feb 2023 11:52:05 +0000 (UTC) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9408110E161 for ; Sat, 11 Feb 2023 11:52:00 +0000 (UTC) Received: by mail-ed1-x52c.google.com with SMTP id cq19so4581354edb.5 for ; Sat, 11 Feb 2023 03:52:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vjuw/WKHUzl4CS0skPJYkF1VfQoY8YcicD8uoD7GMqo=; b=MMlGoG1QFkDFz6fzoQUmVxZRb5Qrt5eSRBTekI+BGXfrpFp8ss7RqovWc9M/65m4e2 lBxVsa52ZYn+vLJG4F9UncIF4P1HSbtEsyfHhBN189oHiHimX4c8q9JyKn8Iv6KdVKA8 dvGZNd22XRq7Dp/QuFIM7l2givieqLuIAqZFjly0sRBisMHsampGLW5m8uhhHsOpt6pi ozvXoS1JCgzRmOGkSs+AfYDbmzeAn3zUzo90Lymndvred2gLK7p580lnoUojah/YozWu RETxhQslzqxxU4xK/Ich0474I2UNT65viWeEQ2Hw36GoCk4dAfkkxbBKv+VUDdZIszlP bvaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vjuw/WKHUzl4CS0skPJYkF1VfQoY8YcicD8uoD7GMqo=; b=cp6yof2Zlu1M+ZDL3RO13aDExPod+wtZrMwZthlJqcVKE8IckZqSgdCphXgBJ4i7PH HfSX5TPenJAk5idjP/QFuNezun3aJ4dr6FDzshuAeNri9mCipjfP2KaQihXeurFoboCg 0AZMqVjTMNK/5/H0nH0g9Fhdxj6hJK6/2im38wGLQpfOfBHlkVy6uEBkx9JUfaAWgR6b skNqik7CAR9POVjb9emUoftVq2r/c3kVoU0Rydjzl6hIebds4iz8c055PqM9LPUFPYPV q7nMyBKtKNUSQRQ6fO4j57ZiNhW5GEvSrtbkuADvT21NEIOlFz+KIErqOhB0QdOMXxkW 5H4g== X-Gm-Message-State: AO0yUKWl2HP3cthDc1gGXwSrmjErf7y2pMubupgDkibDUokaNiIOdGu5 FZCoQqOKYx1UYU2dTn63M/i7ew== X-Google-Smtp-Source: AK7set9Z67CdTMkJyRDgYcair70owljearLWjv3M69xJNXvSz5MtdMyaiuQatBSdjmETEaPzOBN25Q== X-Received: by 2002:a50:cd5a:0:b0:4ac:b9c0:77a6 with SMTP id d26-20020a50cd5a000000b004acb9c077a6mr912991edj.15.1676116320218; Sat, 11 Feb 2023 03:52:00 -0800 (PST) Received: from localhost.localdomain (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id r10-20020a50d68a000000b004aabb714230sm3636070edi.35.2023.02.11.03.51.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Feb 2023 03:51:59 -0800 (PST) From: Konrad Dybcio To: linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org, krzysztof.kozlowski@linaro.org Subject: [PATCH 05/10] drm/msm/dsi: dsi_cfg: Deduplicate identical structs Date: Sat, 11 Feb 2023 12:51:05 +0100 Message-Id: <20230211115110.1462920-6-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230211115110.1462920-1-konrad.dybcio@linaro.org> References: <20230211115110.1462920-1-konrad.dybcio@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , Archit Taneja , Loic Poulain , Harigovindan P , Stephen Boyd , freedreno@lists.freedesktop.org, Abhinav Kumar , dri-devel@lists.freedesktop.org, Douglas Anderson , Konrad Dybcio , Rajeev Nandan , Dmitry Baryshkov , marijn.suijten@somainline.org, AngeloGioacchino Del Regno , Sean Paul , linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Some structs were defined multiple times for no apparent reason. Deduplicate them. Fixes: 3f3c8aff1f8f ("drm/msm/dsi: Add configuration for 8x76") Fixes: 3a3ff88a0fc1 ("drm/msm/dsi: Add 8x96 info in dsi_cfg") Fixes: 6125bd327e16 ("drm/msm: add DSI support for sc7180") Fixes: 65c391b31994 ("drm/msm/dsi: Add DSI support for SC7280") Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dsi/dsi_cfg.c | 77 +++++++++++-------------------- 1 file changed, 26 insertions(+), 51 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.c b/drivers/gpu/drm/msm/dsi/dsi_cfg.c index 5f62c563bd1c..860681bfc084 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.c +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.c @@ -47,41 +47,32 @@ static const struct msm_dsi_config msm8974_apq8084_dsi_cfg = { }, }; -static const char * const dsi_8916_bus_clk_names[] = { +static const char * const dsi_v1_3_1_clk_names[] = { "mdp_core", "iface", "bus", }; -static const struct regulator_bulk_data msm8916_dsi_regulators[] = { +static const struct regulator_bulk_data dsi_v1_3_1_regulators[] = { { .supply = "vdda", .init_load_uA = 100000 }, /* 1.2 V */ { .supply = "vddio", .init_load_uA = 100000 }, /* 1.8 V */ }; static const struct msm_dsi_config msm8916_dsi_cfg = { .io_offset = DSI_6G_REG_SHIFT, - .regulator_data = msm8916_dsi_regulators, - .num_regulators = ARRAY_SIZE(msm8916_dsi_regulators), - .bus_clk_names = dsi_8916_bus_clk_names, - .num_bus_clks = ARRAY_SIZE(dsi_8916_bus_clk_names), + .regulator_data = dsi_v1_3_1_regulators, + .num_regulators = ARRAY_SIZE(dsi_v1_3_1_regulators), + .bus_clk_names = dsi_v1_3_1_clk_names, + .num_bus_clks = ARRAY_SIZE(dsi_v1_3_1_clk_names), .io_start = { { 0x1a98000, 0 }, }, }; -static const char * const dsi_8976_bus_clk_names[] = { - "mdp_core", "iface", "bus", -}; - -static const struct regulator_bulk_data msm8976_dsi_regulators[] = { - { .supply = "vdda", .init_load_uA = 100000 }, /* 1.2 V */ - { .supply = "vddio", .init_load_uA = 100000 }, /* 1.8 V */ -}; - static const struct msm_dsi_config msm8976_dsi_cfg = { .io_offset = DSI_6G_REG_SHIFT, - .regulator_data = msm8976_dsi_regulators, - .num_regulators = ARRAY_SIZE(msm8976_dsi_regulators), - .bus_clk_names = dsi_8976_bus_clk_names, - .num_bus_clks = ARRAY_SIZE(dsi_8976_bus_clk_names), + .regulator_data = dsi_v1_3_1_regulators, + .num_regulators = ARRAY_SIZE(dsi_v1_3_1_regulators), + .bus_clk_names = dsi_v1_3_1_clk_names, + .num_bus_clks = ARRAY_SIZE(dsi_v1_3_1_clk_names), .io_start = { { 0x1a94000, 0x1a96000, 0 }, }, @@ -107,10 +98,6 @@ static const struct msm_dsi_config msm8994_dsi_cfg = { }, }; -static const char * const dsi_8996_bus_clk_names[] = { - "mdp_core", "iface", "bus", "core_mmss", -}; - static const struct regulator_bulk_data msm8996_dsi_regulators[] = { { .supply = "vdda", .init_load_uA = 18160 }, /* 1.25 V */ { .supply = "vcca", .init_load_uA = 17000 }, /* 0.925 V */ @@ -121,8 +108,8 @@ static const struct msm_dsi_config msm8996_dsi_cfg = { .io_offset = DSI_6G_REG_SHIFT, .regulator_data = msm8996_dsi_regulators, .num_regulators = ARRAY_SIZE(msm8996_dsi_regulators), - .bus_clk_names = dsi_8996_bus_clk_names, - .num_bus_clks = ARRAY_SIZE(dsi_8996_bus_clk_names), + .bus_clk_names = dsi_6g_bus_clk_names, + .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names), .io_start = { { 0x994000, 0x996000, 0 }, }, @@ -167,24 +154,20 @@ static const struct msm_dsi_config sdm660_dsi_cfg = { }, }; -static const char * const dsi_sdm845_bus_clk_names[] = { +static const char * const dsi_v2_4_clk_names[] = { "iface", "bus", }; -static const char * const dsi_sc7180_bus_clk_names[] = { - "iface", "bus", -}; - -static const struct regulator_bulk_data sdm845_dsi_regulators[] = { +static const struct regulator_bulk_data dsi_v2_4_regulators[] = { { .supply = "vdda", .init_load_uA = 21800 }, /* 1.2 V */ }; static const struct msm_dsi_config sdm845_dsi_cfg = { .io_offset = DSI_6G_REG_SHIFT, - .regulator_data = sdm845_dsi_regulators, - .num_regulators = ARRAY_SIZE(sdm845_dsi_regulators), - .bus_clk_names = dsi_sdm845_bus_clk_names, - .num_bus_clks = ARRAY_SIZE(dsi_sdm845_bus_clk_names), + .regulator_data = dsi_v2_4_regulators, + .num_regulators = ARRAY_SIZE(dsi_v2_4_regulators), + .bus_clk_names = dsi_v2_4_clk_names, + .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names), .io_start = { { 0xae94000, 0xae96000, 0 }, }, @@ -198,32 +181,24 @@ static const struct msm_dsi_config sm8550_dsi_cfg = { .io_offset = DSI_6G_REG_SHIFT, .regulator_data = sm8550_dsi_regulators, .num_regulators = ARRAY_SIZE(sm8550_dsi_regulators), - .bus_clk_names = dsi_sdm845_bus_clk_names, - .num_bus_clks = ARRAY_SIZE(dsi_sdm845_bus_clk_names), + .bus_clk_names = dsi_v2_4_clk_names, + .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names), .io_start = { { 0xae94000, 0xae96000, 0 }, }, }; -static const struct regulator_bulk_data sc7180_dsi_regulators[] = { - { .supply = "vdda", .init_load_uA = 21800 }, /* 1.2 V */ -}; - static const struct msm_dsi_config sc7180_dsi_cfg = { .io_offset = DSI_6G_REG_SHIFT, - .regulator_data = sc7180_dsi_regulators, - .num_regulators = ARRAY_SIZE(sc7180_dsi_regulators), - .bus_clk_names = dsi_sc7180_bus_clk_names, - .num_bus_clks = ARRAY_SIZE(dsi_sc7180_bus_clk_names), + .regulator_data = dsi_v2_4_regulators, + .num_regulators = ARRAY_SIZE(dsi_v2_4_regulators), + .bus_clk_names = dsi_v2_4_clk_names, + .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names), .io_start = { { 0xae94000, 0 }, }, }; -static const char * const dsi_sc7280_bus_clk_names[] = { - "iface", "bus", -}; - static const struct regulator_bulk_data sc7280_dsi_regulators[] = { { .supply = "vdda", .init_load_uA = 8350 }, /* 1.2 V */ }; @@ -232,8 +207,8 @@ static const struct msm_dsi_config sc7280_dsi_cfg = { .io_offset = DSI_6G_REG_SHIFT, .regulator_data = sc7280_dsi_regulators, .num_regulators = ARRAY_SIZE(sc7280_dsi_regulators), - .bus_clk_names = dsi_sc7280_bus_clk_names, - .num_bus_clks = ARRAY_SIZE(dsi_sc7280_bus_clk_names), + .bus_clk_names = dsi_v2_4_clk_names, + .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names), .io_start = { { 0xae94000, 0xae96000, 0 }, }, From patchwork Sat Feb 11 11:51:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13137038 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ECAADC636D7 for ; Sat, 11 Feb 2023 11:52:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DE00310E178; Sat, 11 Feb 2023 11:52:05 +0000 (UTC) Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3BAE310E178 for ; Sat, 11 Feb 2023 11:52:03 +0000 (UTC) Received: by mail-ed1-x533.google.com with SMTP id w3so326458edc.2 for ; Sat, 11 Feb 2023 03:52:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Xu29OnoYbs7XlgjQ7eQ5Uic7usShH1dqxj/7r0Nr9hA=; b=Azhb35xQfIkRkppUDbGElCHDXkOGIHdkj1Wv+qJ9Ee16d9Isac9HTm6yCOEXSMRLCI xtpA8d+cpYU/ZIYscQwv9uDWxWMpLgT1wl/6JirdYNKfZ/Jz9Tx7N22uGIBi/qZLhsed RTNgmdvFI/iWwkiySU9bWbkOtdvmIl/64w3c8qECr+fV/bkKxIoyjqvH6qofhw2pV+/B d/ul1NoifWxFv0E7kVA46uZOfWZLjGr8VHGUPlZFSY/h4XAnI7beO+Yw9V/3U5p/AP+q cF4JXHsznSlH+gNl632wsRfoqbsJu6QflbMJrhF8itMclgsZYKxRQ1sa1ht4EPSJccRM KL+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xu29OnoYbs7XlgjQ7eQ5Uic7usShH1dqxj/7r0Nr9hA=; b=Px1EYZrKgW2uVdtCcbcTxAN+3Ks/T34JOEq/SX60/iiO5tMykfR/YQfkT5AbUa3QeI g9Rzvi99ablduO93c6D2poEbqNObAi0NbZl48n5QYnT5IsEjTrLaRm8CRWV20d2BipDt PDe4Ac8bpnAx4FxjcZLtHQEv6nhxY3bHwUn/kggJOTviAAyKy91wHskRP0inCQehH6Vq vMhbrwE4WPrLwMOvHkDNFcoQbm2hoFjiwFzg2ojILDBiqzD9oqUv8BvCUJvyF4Zh8hZp fp3NFmOBUAbp0aj+3Aye6mN4RkRsIRJHcmhcE7o1AagcBW2gKlVVKZkks/n9Hnc4ba7h 0JDQ== X-Gm-Message-State: AO0yUKVl3TCWgc8eJl8MYYRb+TOXhUphGcPjtBWIt1O6xj+d4rGrIs4x 7ghDC30glvaGKp/pPZrxCCtwsA== X-Google-Smtp-Source: AK7set+zlTzVfecZAmxXHXbYPcxJi6BLvT4chUPZUZHzMJWd+/2Pm9Csni4qi7rylweFb3x30/UkDg== X-Received: by 2002:a50:9f28:0:b0:4ab:b0d5:6bb0 with SMTP id b37-20020a509f28000000b004abb0d56bb0mr4200948edf.18.1676116322880; Sat, 11 Feb 2023 03:52:02 -0800 (PST) Received: from localhost.localdomain (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id r10-20020a50d68a000000b004aabb714230sm3636070edi.35.2023.02.11.03.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Feb 2023 03:52:02 -0800 (PST) From: Konrad Dybcio To: linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org, krzysztof.kozlowski@linaro.org Subject: [PATCH 06/10] drm/msm/dsi: dsi_cfg: Merge SC7180 config into SDM845 Date: Sat, 11 Feb 2023 12:51:06 +0100 Message-Id: <20230211115110.1462920-7-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230211115110.1462920-1-konrad.dybcio@linaro.org> References: <20230211115110.1462920-1-konrad.dybcio@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , Loic Poulain , Harigovindan P , Abhinav Kumar , dri-devel@lists.freedesktop.org, Douglas Anderson , Konrad Dybcio , Dmitry Baryshkov , marijn.suijten@somainline.org, freedreno@lists.freedesktop.org, Sean Paul , linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The configs are identical, other than the number of *maximum* DSI hosts allowed. This isn't an issue, unless somebody deliberately tries to access the inexistent host by adding a dt node for it. Remove the SC7180 struct and point the hw revision match to the SDM845's one. On a note, this could have been done back when 7180 support was introduced. Fixes: 6125bd327e16 ("drm/msm: add DSI support for sc7180") Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dsi/dsi_cfg.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.c b/drivers/gpu/drm/msm/dsi/dsi_cfg.c index 860681bfc084..142a0f1e2576 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.c +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.c @@ -169,7 +169,7 @@ static const struct msm_dsi_config sdm845_dsi_cfg = { .bus_clk_names = dsi_v2_4_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names), .io_start = { - { 0xae94000, 0xae96000, 0 }, + { 0xae94000, 0xae96000, 0 }, /* SDM845 / SDM670 / SC7180 */ }, }; @@ -188,17 +188,6 @@ static const struct msm_dsi_config sm8550_dsi_cfg = { }, }; -static const struct msm_dsi_config sc7180_dsi_cfg = { - .io_offset = DSI_6G_REG_SHIFT, - .regulator_data = dsi_v2_4_regulators, - .num_regulators = ARRAY_SIZE(dsi_v2_4_regulators), - .bus_clk_names = dsi_v2_4_clk_names, - .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names), - .io_start = { - { 0xae94000, 0 }, - }, -}; - static const struct regulator_bulk_data sc7280_dsi_regulators[] = { { .supply = "vdda", .init_load_uA = 8350 }, /* 1.2 V */ }; @@ -299,7 +288,7 @@ static const struct msm_dsi_cfg_handler dsi_cfg_handlers[] = { {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_4_0, &sdm845_dsi_cfg, &msm_dsi_6g_v2_host_ops}, {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_4_1, - &sc7180_dsi_cfg, &msm_dsi_6g_v2_host_ops}, + &sdm845_dsi_cfg, &msm_dsi_6g_v2_host_ops}, {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_5_0, &sc7280_dsi_cfg, &msm_dsi_6g_v2_host_ops}, {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_6_0, From patchwork Sat Feb 11 11:51:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13137039 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37001C636CC for ; Sat, 11 Feb 2023 11:52:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 29E3B10E16F; Sat, 11 Feb 2023 11:52:09 +0000 (UTC) Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by gabe.freedesktop.org (Postfix) with ESMTPS id B49EB10E180 for ; Sat, 11 Feb 2023 11:52:06 +0000 (UTC) Received: by mail-ed1-x52a.google.com with SMTP id bt8so1504974edb.12 for ; Sat, 11 Feb 2023 03:52:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Nzh9retSVIyMmp57bQNIeqL4Qh27h4qyWsMsM/hhbxc=; b=kmXKYVHwswRrA4LI2hz1zuC1ZB+aegsUZUKkBR7KDF27Nrt0UScprMI5AI1B4FP4Y8 dZE6kLHaWBnul93HSxeqQXNdaDxj71RW7guiOUs1GcWgsyIfewE5WdlnUFM4UKfCDQEp 4CumJqfe1EIjTiDDqrWobK4hCWaxq1CGXWLJNPu3Jb2m6Ninl8cqqQ4EMN2jijTAhYrY VaS3fNHp4UZekS2JDauri54E+vRD+PCLKCTxKA3ZqoDpWIKHRbVchmsNx9miVqG3O/0U guDJI45qT93E5nTL8+9BsD/1noIirMXDJyqhym5JVwFLrB++A8VXBXextL8WzOVIAFG9 bgJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Nzh9retSVIyMmp57bQNIeqL4Qh27h4qyWsMsM/hhbxc=; b=CConhqtnNqdNUvCM/UvSVL4lkw5kAqtumRg20yge4wLMOrlBPQGqBVqQccnl98Ud7m OvGM2HDNG+BZUZ0x3mtM9HqG77eeaqQU7FpkfcpT6Y2TBjwCLg1oSJaTMLDw/WshS/7+ E7T5uqmVMtsV4m2Gh8IOwYV7cTLWjYT7liYSBV7cLdw9UxbRlujUshTg5JJFc5Glq7p9 MYjNK8oJLKCr2uPZMoZa1J5nitQDGugLah3nMXKdnc9Q7y4BK80+vaxI1KS7XZ7hBnDp cnKD90S4ob+rnwHrL/qk3+7yGTsFskTmrPB1s8MKiZqI7oB7pyjYu2RHkdTvAYhqNtPm hyoQ== X-Gm-Message-State: AO0yUKWXO8xsCBK9C8xao/X14XHh9DsMpmEzGis6Eyp3qq+QwOwp9uBz /3oSuMQAXVIs1zKnIWNnQSrYsA== X-Google-Smtp-Source: AK7set9gDFzCqt5oQQltwLSBeKE/xvPC8xj9Tf6vP9Bec/fKL55oBBqubpLWKTfK6NVSEQWLRenoKg== X-Received: by 2002:a50:d0c4:0:b0:4ab:1f18:7839 with SMTP id g4-20020a50d0c4000000b004ab1f187839mr9908229edf.22.1676116326366; Sat, 11 Feb 2023 03:52:06 -0800 (PST) Received: from localhost.localdomain (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id r10-20020a50d68a000000b004aabb714230sm3636070edi.35.2023.02.11.03.52.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Feb 2023 03:52:06 -0800 (PST) From: Konrad Dybcio To: linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org, krzysztof.kozlowski@linaro.org Subject: [PATCH 07/10] drm/msm/dsi: Switch the QCM2290-specific compatible to index autodetection Date: Sat, 11 Feb 2023 12:51:07 +0100 Message-Id: <20230211115110.1462920-8-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230211115110.1462920-1-konrad.dybcio@linaro.org> References: <20230211115110.1462920-1-konrad.dybcio@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Douglas Anderson , Vinod Koul , Loic Poulain , linux-kernel@vger.kernel.org, Neil Armstrong , Abhinav Kumar , dri-devel@lists.freedesktop.org, Kuogee Hsieh , Konrad Dybcio , Dmitry Baryshkov , marijn.suijten@somainline.org, freedreno@lists.freedesktop.org, Sean Paul , Johan Hovold Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Now that the logic can handle multiple sets of registers, move the QCM2290 to the common logic and mark it deprecated. This allows us to remove a couple of structs, saving some memory. Fixes: ee1f09678f14 ("drm/msm/dsi: Add support for qcm2290 dsi controller") Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/dsi/dsi.c | 4 +++- drivers/gpu/drm/msm/dsi/dsi_cfg.c | 29 +++-------------------------- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c index 31fdee2052be..90d43628b22b 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -174,7 +174,9 @@ 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 }, + + /* Deprecated, don't use */ + { .compatible = "qcom,dsi-ctrl-6g-qcm2290", .data = NULL }, {} }; diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.c b/drivers/gpu/drm/msm/dsi/dsi_cfg.c index 142a0f1e2576..81d41f247040 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.c +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.c @@ -169,8 +169,10 @@ static const struct msm_dsi_config sdm845_dsi_cfg = { .bus_clk_names = dsi_v2_4_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names), .io_start = { - { 0xae94000, 0xae96000, 0 }, /* SDM845 / SDM670 / SC7180 */ + { 0xae94000, 0xae96000, 0 }, /* SDM845 / SDM670 */ + { 0x5e94000, 0 }, /* QCM2290 / SM6115 / SM6125 / SM6375 */ }, + .num_variants = 2, }; static const struct regulator_bulk_data sm8550_dsi_regulators[] = { @@ -203,25 +205,6 @@ static const struct msm_dsi_config sc7280_dsi_cfg = { }, }; -static const char * const dsi_qcm2290_bus_clk_names[] = { - "iface", "bus", -}; - -static const struct regulator_bulk_data qcm2290_dsi_cfg_regulators[] = { - { .supply = "vdda", .init_load_uA = 21800 }, /* 1.2 V */ -}; - -static const struct msm_dsi_config qcm2290_dsi_cfg = { - .io_offset = DSI_6G_REG_SHIFT, - .regulator_data = qcm2290_dsi_cfg_regulators, - .num_regulators = ARRAY_SIZE(qcm2290_dsi_cfg_regulators), - .bus_clk_names = dsi_qcm2290_bus_clk_names, - .num_bus_clks = ARRAY_SIZE(dsi_qcm2290_bus_clk_names), - .io_start = { - { 0x5e94000, 0 }, - }, -}; - 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, @@ -312,9 +295,3 @@ 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, -}; From patchwork Sat Feb 11 11:51:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13137040 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7A0B0C61DA4 for ; Sat, 11 Feb 2023 11:52:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BA12610E161; Sat, 11 Feb 2023 11:52:12 +0000 (UTC) Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3262910E182 for ; Sat, 11 Feb 2023 11:52:10 +0000 (UTC) Received: by mail-ed1-x534.google.com with SMTP id c1so3525349edt.4 for ; Sat, 11 Feb 2023 03:52:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rmt6VW0qzHeVmfsiW1rh5EIINQ5Xr+hUNmJsEmBTOOs=; b=EzfpwYOsuX2EE/VJNfqpGd6gfX3N3ZS3aObHcIi4JhKxtgNap2qsxZJ7nI/hBQWeO8 SaB0NLjyYdJw9m3w4lxsp8VagGW1QSx16dWoz60m/gCm08jWxlBvsdo13QydlmhNAKED V8N80WYqq1DHALFRoU4/NahRAShWnQ+ibT3LGKmgiYPjJhV2iRjKkAk/ognNtVPo5KaJ zSlzgTN2nW+Dhwy6jO0N3Q9YYoDKhKWF38o7D24o1aF7w8XMyvu1707u4mtu1VlTuWH9 sIW+5wx6/WfOWHqW0Ia1q73M2+U1kkeF372RfGS5n3NcJXtPelFkc91fSs2Nrb6KXiSQ imDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rmt6VW0qzHeVmfsiW1rh5EIINQ5Xr+hUNmJsEmBTOOs=; b=esAHSrFeBorHO3rUdfosdjPT8LZ7hHotg7PkA9JYLHSWrTfezDoAptJtc+WnLy/jlD Coo7GfhYtoEg5/B45iNDwQ3oDq307qAresp3r1Vf6SJAbsScm23HYLwE0CPzh7w17hMq AAk2eiV+LQYPcpTb0DL+8ByJARYzXX9BDrbhx+r4e/79eCQrdUuBK6XGF4Fg4mdTkqHx gf61IzZ9BzrONdY2iZvxnBGELeBhrRTWztpMT4lBijnIUdAeOtCkWkWcehHbxljo9hjN lwu4yNpNmLjnlDYtfOS0JTq42CqyWtvEytuvoR3aiqVZ25numHJM/n7NWRT756Hrrhdv IRrA== X-Gm-Message-State: AO0yUKUz7DcZPUsExVMr8Zg0yMv3Q4LPJFePbkC0oeyuCA9YakYp7gaF jZdEcNzWT3ENE/9lygwlzrm+5g== X-Google-Smtp-Source: AK7set+HItO3J1ZJhnIfUsw7yCnVjuQ5TGwGNs3uryJQQ415r1DaItG0qGXWjy+dNKjFkdvZ3HoD3g== X-Received: by 2002:a50:935a:0:b0:4ac:b4b1:53fe with SMTP id n26-20020a50935a000000b004acb4b153femr3345338eda.20.1676116329827; Sat, 11 Feb 2023 03:52:09 -0800 (PST) Received: from localhost.localdomain (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id r10-20020a50d68a000000b004aabb714230sm3636070edi.35.2023.02.11.03.52.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Feb 2023 03:52:09 -0800 (PST) From: Konrad Dybcio To: linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org, krzysztof.kozlowski@linaro.org Subject: [PATCH 08/10] drm/msm/dsi: Remove custom DSI config handling Date: Sat, 11 Feb 2023 12:51:08 +0100 Message-Id: <20230211115110.1462920-9-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230211115110.1462920-1-konrad.dybcio@linaro.org> References: <20230211115110.1462920-1-konrad.dybcio@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Douglas Anderson , Vinod Koul , Loic Poulain , linux-kernel@vger.kernel.org, Vladimir Lypak , Abhinav Kumar , dri-devel@lists.freedesktop.org, Kuogee Hsieh , Konrad Dybcio , Dmitry Baryshkov , marijn.suijten@somainline.org, freedreno@lists.freedesktop.org, Sean Paul , Johan Hovold Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Now that the only user is handled by common code, remove the option to specify custom handlers through match data. This is effectively a revert of commit: 5ae15e76271 ("drm/msm/dsi: Allow to specify dsi config as pdata") Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dsi/dsi.c | 4 ++-- drivers/gpu/drm/msm/dsi/dsi_host.c | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c index 90d43628b22b..e0b911af618d 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -173,10 +173,10 @@ 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,mdss-dsi-ctrl" }, /* Deprecated, don't use */ - { .compatible = "qcom,dsi-ctrl-6g-qcm2290", .data = NULL }, + { .compatible = "qcom,dsi-ctrl-6g-qcm2290" }, {} }; diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 8dfa69bcff77..79c33d066348 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -214,10 +214,6 @@ 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 Sat Feb 11 11:51:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13137041 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BB35EC61DA4 for ; Sat, 11 Feb 2023 11:52:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D2B0710E182; Sat, 11 Feb 2023 11:52:15 +0000 (UTC) Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by gabe.freedesktop.org (Postfix) with ESMTPS id 470C810E165 for ; Sat, 11 Feb 2023 11:52:13 +0000 (UTC) Received: by mail-ed1-x530.google.com with SMTP id p12so149000edc.0 for ; Sat, 11 Feb 2023 03:52:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ep4dAxNDBfiGXuqBk5NhBpEX23ggwEaT57AExj6qK0E=; b=Ws9TMQBBjwg4Bf+XyEsFTANdDjnR52eVQqWllfm/eL6AswidbXnlQJFDHH4YLmfETD U3OxqDa/TZbXDxlHMmsZi40sD+HCNDSN34F3xv8sTzXEdmPfYuwUdiWzAWnb61rVQ0xf j8B+2w5F3dKIm3fGRFDOHXMjEtM6O+TU1dpWFBhRoB9K2Nv6uCaSb/rotnGu6iYPUOvA FuF2RJQaRu2z1CVEicVn07dV6HUMckQrZ67f3T8p84wIYZWVvYQ0Z+IO3oLs3J1l8Jk9 6ZTftQ2i8DJ9seg2/lTq/0tRRfa1/PJlP2CkPgmbRZ8d5rL8G1g6yB1W82v84ptd3yGh gc/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ep4dAxNDBfiGXuqBk5NhBpEX23ggwEaT57AExj6qK0E=; b=rayJ43UbzCqFMjEDdZcxYK8m8fy2SXtpVqYo8gHpYiZFQYyR49y7NSs1q02Tl6Eg4l HAWEXFyLPdq+avFMNQqospJea6myySfy4S8wpRo3AsLb+QhIrenYGo/KGII+F1Lss6JA cBJ5dFMyWAmS0cWrRB4JOm7rcwQKEnBVnkmGd3fDhYDOGHNM8/RFrp1nmw06zGjTEWhW FTvzSVL0HWxJnopc0Jr1Vme08yknt2rirc1VRM2PuJWinNWw7kT1GQBl5OokLHwUOeoY 74v0zepUZC3v75Ze1HA3ZbLHokvGP6B7+FtxHnRK3FXJJQFPCds7s7bjX4XgNUWUahMH zadQ== X-Gm-Message-State: AO0yUKXjCQPJxvUaH7FpkLo3gIQ4+dGYzmLPj4ZurZ8sxHmx5vrz06IC 3/pfVDxgaRdW8H6BBSB/Lwtxnw== X-Google-Smtp-Source: AK7set8nFD70BQHFMI+e62J+GhDF/grxODnHtEHEYhGYWTRQeWxm2mDUL3KfNlThoD0Bp0JBR/zXtQ== X-Received: by 2002:a50:9e6e:0:b0:4aa:a709:8aaa with SMTP id z101-20020a509e6e000000b004aaa7098aaamr19205386ede.26.1676116331919; Sat, 11 Feb 2023 03:52:11 -0800 (PST) Received: from localhost.localdomain (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id r10-20020a50d68a000000b004aabb714230sm3636070edi.35.2023.02.11.03.52.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Feb 2023 03:52:11 -0800 (PST) From: Konrad Dybcio To: linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org, krzysztof.kozlowski@linaro.org Subject: [PATCH 09/10] dt-bindings: display/msm: dsi-controller-main: Add SM6115 Date: Sat, 11 Feb 2023 12:51:09 +0100 Message-Id: <20230211115110.1462920-10-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230211115110.1462920-1-konrad.dybcio@linaro.org> References: <20230211115110.1462920-1-konrad.dybcio@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: freedreno@lists.freedesktop.org, Krzysztof Kozlowski , devicetree@vger.kernel.org, Abhinav Kumar , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Rob Herring , Krishna Manikandan , Dmitry Baryshkov , marijn.suijten@somainline.org, Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add a compatible for the DSI on SM6115. Signed-off-by: Konrad Dybcio --- .../devicetree/bindings/display/msm/dsi-controller-main.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml index 2494817c1bd6..f195530ae964 100644 --- a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml +++ b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml @@ -25,6 +25,7 @@ properties: - qcom,sc7280-dsi-ctrl - qcom,sdm660-dsi-ctrl - qcom,sdm845-dsi-ctrl + - qcom,sm6115-dsi-ctrl - qcom,sm8150-dsi-ctrl - qcom,sm8250-dsi-ctrl - qcom,sm8350-dsi-ctrl @@ -351,6 +352,7 @@ allOf: contains: enum: - qcom,sdm845-dsi-ctrl + - qcom,sm6115-dsi-ctrl then: properties: clocks: