From patchwork Sat Mar 18 13:42:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 71604 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp299077wrt; Sat, 18 Mar 2023 06:54:01 -0700 (PDT) X-Google-Smtp-Source: AK7set9yrlEd9rh/sdrDEmc/d+CaolG6v58UT2OgP1VVAyxZXxFwmYu9TVcvQJWwNPX+PmIiZvIV X-Received: by 2002:a17:90b:1bc4:b0:23b:bd09:7f0b with SMTP id oa4-20020a17090b1bc400b0023bbd097f0bmr12065010pjb.30.1679147641369; Sat, 18 Mar 2023 06:54:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679147641; cv=none; d=google.com; s=arc-20160816; b=E7PT0pcGVslefEwkEesEuLWiXOM1lMWc04rI2a5bDgFG6HJURtCARG82B4kKyak135 9sjwyum6xPPWBVB5y8SuW0H+aVhPv0dpO0bEkryFYe/ipIh5tYNT9XjbZXExct+LdXmk pepZq4hC0fxNvVr3dyidPx1C/jjfuxN35wNu0shrcFmkyQO525rMbPEcBOd8QG/iS79y wK4fgE2I+mJK67UttH5d5nnEe7J7fhCuq73TbDgF4Ke0biLWVgQsYlr6XuzX2YESbkMS ylrSO5uIUxo0wOSnUng0xuawQ/TI1fxu2GHo5H8SLNYTkzVy18zq/jJyrv+LU07+Jq/k A5TA== 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=aIbPombbDxmyRDTywJgWjOf1CZd4cWgNaES0ktW/3I3r6rD32iaF3s/RdY4LvliL7v XsHoffXoUtRH5aQeE0v2fd5UNqDge/UjKeimL2aXcBMCK19gSu1UdYdtCIHZuV6mbX/1 peIdEZDGKl+LLYjmgGou7dTRhykYinUBQhlsjMke865suIxDDZQm/iQAsofMKcl9db+i 9eNmjhjuQ7K9XBNI9zLdI2DTsHv9LMFNAV4f4S+NVAM4LqUqAbIy4slevw2fVSFE+Ke+ v/rdr65cqJ4oQRvrWPWEDVL27iHdJkmTH19tuetFIavUI8wBUofwFzxAsEMGpaqKouIJ 5apg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wqtSFUFV; 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 u19-20020a632353000000b00502f60c6809si5229939pgm.358.2023.03.18.06.53.46; Sat, 18 Mar 2023 06:54:01 -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=wqtSFUFV; 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 S229904AbjCRNnR (ORCPT + 99 others); Sat, 18 Mar 2023 09:43:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229816AbjCRNnI (ORCPT ); Sat, 18 Mar 2023 09:43:08 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A64333CDB for ; Sat, 18 Mar 2023 06:43:03 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id z42so7764944ljq.13 for ; Sat, 18 Mar 2023 06:43:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679146982; 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=wqtSFUFVe/xqQiyDgL02mrMIhKD9j3mvK3IMDaZT8NgtIad7uKJJJkPKJcNePc7zov papqa6Qe/Kmi6OW/nMwuPx31WMjgWPcbtPdd2xZTPLmfhugWHXncyIZK0x0/NkAqS6j2 oPzRd1Iw1WeR5enLKJxhQK5Wuz1M84u1MBjvOMdDGzkzZhoVhcpZd4tMUuebP8/vKgv0 J1m6+r9QY91Yk7GR98stE9vmz2rFIYUZxE7uLrKi+l2e6KA1YcElDyQ06rlfU03dWyQo 58XTu8umRnOxy55H3oVR/GZkPnpqLxkmeAmtrgtVhYYjwleHxusdPqsZT1UhEsq5YCaX 9zsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679146982; 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=UFiH61XjhXw8CryMbvitSrdM4sEZLP0JyOht78Cl+2/g+SF+kDUXkmTsJuo+eH+o7E mmYbyfanZ/5Ar9TtQp37vfBuRh+zXqCtsrjEuPPh+IQl+YQQmCN17O+tE4zK0BZv3G7P QXVyRmiynkOsV9VI2x5DRBCKEmAZzsr0OZhaXk5loa3WgXrO4zHQAeb0T30Kt+AVnUT3 RfDG4tOkiyIiJHNjU+hYxMnDmUX39yN3g+ND7tea4syRUX9rMXrfqKwquFnRO44JpcQY eQanJesVSw36NvuNHYaIRCeEA3d7xR+tENz0Miq6R6dC8gHAXqDq9v/yIllOCzOXdWCF mSAg== X-Gm-Message-State: AO0yUKVubA46L9AQvwZ9X38o5vnbOGjAdo75gSgLBEG+Sa/1iexsDqWd U5PLTSNuAXWxyMP3GKhjnqrnug== X-Received: by 2002:a2e:be85:0:b0:298:a7c4:f838 with SMTP id a5-20020a2ebe85000000b00298a7c4f838mr6668341ljr.25.1679146982761; Sat, 18 Mar 2023 06:43:02 -0700 (PDT) Received: from [192.168.1.101] (abym238.neoplus.adsl.tpnet.pl. [83.9.32.238]) by smtp.gmail.com with ESMTPSA id c2-20020a2e9d82000000b0029a0b50a34asm888367ljj.36.2023.03.18.06.43.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Mar 2023 06:43:02 -0700 (PDT) From: Konrad Dybcio Date: Sat, 18 Mar 2023 14:42:52 +0100 Subject: [PATCH v6 6/9] drm/msm/dsi: Switch the QCM2290-specific compatible to index autodetection MIME-Version: 1.0 Message-Id: <20230307-topic-dsi_qcm-v6-6-70e13b1214fa@linaro.org> References: <20230307-topic-dsi_qcm-v6-0-70e13b1214fa@linaro.org> In-Reply-To: <20230307-topic-dsi_qcm-v6-0-70e13b1214fa@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=1679146971; l=3233; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=e/ZDvN1pmXEVddNSmMJ2iSlA9sSO8FBakW2FjAcs2pg=; b=V6Mrw47+2xiejKuA4uajLkdylpMy4cmo+WOXWJZ/4BliI+KHPvZtBJ0Vkpgzr6xBJ34wctaW+Dq4 s4DT+DkuBDHmrFTQtyimBbnhBxb+LvZdkB5AmljaE4Xw0F8T0BJ9 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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?1760713917689886405?= X-GMAIL-MSGID: =?utf-8?q?1760713917689886405?= 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__ */