From patchwork Thu Mar 16 08:51:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 70682 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp371736wrt; Thu, 16 Mar 2023 02:14:56 -0700 (PDT) X-Google-Smtp-Source: AK7set8Nl/cfjELFP/rtqVs37Dj9vkYfcpjB+k8Th3FnoWFb4YOI34WnLfstwNW2YKlB4BZd6H8b X-Received: by 2002:a17:902:c40c:b0:1a0:4526:3535 with SMTP id k12-20020a170902c40c00b001a045263535mr3167622plk.57.1678958096291; Thu, 16 Mar 2023 02:14:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678958096; cv=none; d=google.com; s=arc-20160816; b=T0au9sCVcOV8AW4LZchU6e3lVkItKGxXDd713Tsiw/RWvDYLB55I2JnTKV+SIYfKcm y9lHHaT1p7EBIyALpRAC79y7kPMeiggF9y53iiSknWym9rNL++QJ2YQg9YcNuMH+TtCn x09a2L9n2fneA5oPTLLNYyimNL73wPZ+zjO7OE92T/zK3mOTqDePzEu//u/VRE7fssJo ObXFstRFhlcSXyPvKijYF01+Rbm77TqSUyE8mlEIIRRLVxRlVe8JATtDZzzKoArxniBs T3ce9B0z0PRk1zrqId1dILf5azP32m6XUo8rLAf8VzCety/dxQ/R4hvjZb/nmN3TBlSI 6OGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=4ybpWSBp4lClKqhK/g5tZCNekBaDds3KID0LOYjNmjg=; b=kXd9S/xYCki2yeKjQbRqeQbJO4i+pHonaCPQcHqWvS53ht7tVisgim5kz0uRbF3aaE 4zSU89IXj7d3HlkjZI0vYnRjJdFVl4eAwXmESSeZc2i8oiEipxiREbcckc48eT+hMjQ1 iVmiACFQMuD5bVmwQr1xXhiBhyKwVN33wT0Lxe1vdw0zTMpYdHTT5xzbVCVDe4bTLqEc P9M3EFoqarzsfEq8SkopAvfHNLMg44TJl8TX6nq00PYYIhbHdJo/gXyqXOcy9odw42e7 CZqJLlNILvNq2NgwXifcqkQ06cEPeh4HzgWBbH0OysjF7SJ5XyNWpRubdjiU/4qkFy14 U9qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zouSvFH1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q14-20020a17090311ce00b001a19248bfcdsi1366475plh.436.2023.03.16.02.14.41; Thu, 16 Mar 2023 02:14:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zouSvFH1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229900AbjCPIwx (ORCPT + 99 others); Thu, 16 Mar 2023 04:52:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229838AbjCPIwY (ORCPT ); Thu, 16 Mar 2023 04:52:24 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7681022791 for ; Thu, 16 Mar 2023 01:51:25 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id z5so840220ljc.8 for ; Thu, 16 Mar 2023 01:51:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678956680; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=4ybpWSBp4lClKqhK/g5tZCNekBaDds3KID0LOYjNmjg=; b=zouSvFH1v/9SmuQivtr2cUC78XlCmCieUzZwqnfbhZ3jftbLu0iT90FS6zllJ8VdSC 27HwGoOYGSWhRVAz1ZAzhRp9Bxb6WCJX0jWWn4Co8ChAO9EVgfYwQ3eCpYyScpTNzB/p xgKIjAhhZmTy5MVczMdsBx9MhfksaqAPaYk3iDuTBjhyL8mppXKr8GOqgOR1G6SIvjHr rzg1ViFPC6edhwxhDuWlAdR1kvJv/Gueqc6LidyEmStzGEUpMc/9bj8j57ZZJI9TBzzE ULYxsIB0okR1hTQNUAsAN++HTZmf/eQQDQNk+OURE2HYgEHeMmvisFhWR6kaIOca3/yw ORBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678956680; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4ybpWSBp4lClKqhK/g5tZCNekBaDds3KID0LOYjNmjg=; b=Sg3m23a1nwu6qcMM3DF4lOZAGitY6hGd5kFMKbFAVF2k55FiQ049DoGzV8IRijWh4N lv6bwe60a9fTcSriLQkqpnhZ84Tg8LYzNZMyjBtsHmEWs14fsITSN4TYS5fwaC7ZGCrC DEcgvd4B2AvK7ZSggu8XeB92HnuM+vL1Ctteh19PBgRx1wW5UOszf+c5iyNGQMPqIDuE orpG+fEB0PXjfTp8t+vbuoQE66O7tRjS20vnHkiYbaucberrJOmRAudBbzkYZefFbQHD 6l6HO3M8/6J7bU0AJfMwvz5tcYokVuQw/1CyLQuaerK2OZRakDiY4lz67L87N2r6dS8T sXUw== X-Gm-Message-State: AO0yUKWep3eGbxc5UCs7I76IuuyXG+luePfkgo5h9NUbRvykIePeT21h EIZb5QMXEsmDOYITl02i7tj+1A== X-Received: by 2002:a2e:97da:0:b0:298:7018:e2e7 with SMTP id m26-20020a2e97da000000b002987018e2e7mr1791452ljj.22.1678956680108; Thu, 16 Mar 2023 01:51:20 -0700 (PDT) Received: from [192.168.1.101] (abyj16.neoplus.adsl.tpnet.pl. [83.9.29.16]) by smtp.gmail.com with ESMTPSA id o11-20020a2e730b000000b002991baef49bsm251566ljc.12.2023.03.16.01.51.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Mar 2023 01:51:19 -0700 (PDT) From: Konrad Dybcio Date: Thu, 16 Mar 2023 09:51:12 +0100 Subject: [PATCH v5 06/10] drm/msm/dsi: Switch the QCM2290-specific compatible to index autodetection MIME-Version: 1.0 Message-Id: <20230307-topic-dsi_qcm-v5-6-9d4235b77f4f@linaro.org> References: <20230307-topic-dsi_qcm-v5-0-9d4235b77f4f@linaro.org> In-Reply-To: <20230307-topic-dsi_qcm-v5-0-9d4235b77f4f@linaro.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Krishna Manikandan , Bryan O'Donoghue , Andy Gross , Bjorn Andersson Cc: Rob Herring , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678956668; l=3233; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=e/ZDvN1pmXEVddNSmMJ2iSlA9sSO8FBakW2FjAcs2pg=; b=8OFXVaPb/ToMkkmzsNU09aSl0aeWkDVN7OG+mFMgcET+hNQVHVpGr8xWjapYvsUapZkbZfXQuztK PtFBo8ZlBBPuRZWr6Si4F9qWzgVMCkfdWW7i2Y82KiQK58tJvAA8 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_HTTP,RCVD_IN_SORBS_SOCKS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760515164698510713?= X-GMAIL-MSGID: =?utf-8?q?1760515164698510713?= 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. Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/dsi/dsi.c | 5 +++-- drivers/gpu/drm/msm/dsi/dsi_cfg.c | 20 ++------------------ drivers/gpu/drm/msm/dsi/dsi_cfg.h | 3 --- 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c index 31fdee2052be..f761973e4cba 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -4,7 +4,6 @@ */ #include "dsi.h" -#include "dsi_cfg.h" bool msm_dsi_is_cmd_mode(struct msm_dsi *msm_dsi) { @@ -174,7 +173,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 03d98cbcc978..29ccd755cc2e 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.c +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.c @@ -169,7 +169,8 @@ 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 }, /* SDM845 / SDM670 / SC7180 */ + { 0xae94000, 0xae96000 }, /* SDM845 / SDM670 */ + { 0x5e94000 }, /* QCM2290 / SM6115 / SM6125 / SM6375 */ }, }; @@ -203,17 +204,6 @@ static const struct msm_dsi_config sc7280_dsi_cfg = { }, }; -static const struct msm_dsi_config qcm2290_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 = { - { 0x5e94000 }, - }, -}; - 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, @@ -304,9 +294,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, -}; diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.h b/drivers/gpu/drm/msm/dsi/dsi_cfg.h index 8772a3631ac1..91bdaf50bb1a 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.h +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.h @@ -65,8 +65,5 @@ 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__ */