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: 652893 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 95C26C636CC for ; Sat, 11 Feb 2023 11:52:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230265AbjBKLwo (ORCPT ); Sat, 11 Feb 2023 06:52:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230137AbjBKLwT (ORCPT ); Sat, 11 Feb 2023 06:52:19 -0500 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0161720565 for ; Sat, 11 Feb 2023 03:52:06 -0800 (PST) Received: by mail-ed1-x531.google.com with SMTP id w3so326563edc.2 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=TinRvhbPJZ1AWCR70KwOr9aQrOFsmJy+Vj7z8phohbYhwwxwKbKQYSB21wUSW8YOQ4 FkqIHjSst6xkoEPJuqUVqQ/q3TbhABqoNHRbLuliPJZI1l2O8SbxihYQtIMg6E6nc//9 FDuPA2XUjldrbIG9BUR5PmudBFNsA2sZIQLfla3q9J15um/CaK38Gm0VOdIQmUYqp9uj FsgZfgimLVYKU8JZaWztoU1Qg/Punzf1x9ali9EJe9hf1BySVo4dGMv9qqkL8jGnLloT 2y2UvkSI6i+3sPxnnMGK+mWZcbxv8mknu14DiNLHC6bMZ8ZZAEMjl1dq1Qzn6ZGohlot MrLw== X-Gm-Message-State: AO0yUKVzO35ihUsFo78NtrcxCmqbs4suA8nbGDqdh+5DVM253rwuabdj U5fRPwe+3JDTp0xRa/9tJoQBBqUbhyTChshk 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 Cc: marijn.suijten@somainline.org, Konrad Dybcio , Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Daniel Vetter , Kuogee Hsieh , Loic Poulain , Johan Hovold , Vinod Koul , Douglas Anderson , Neil Armstrong , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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, -};