From patchwork Mon Feb 13 12:10: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: 56250 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2309178wrn; Mon, 13 Feb 2023 04:16:38 -0800 (PST) X-Google-Smtp-Source: AK7set/o5/MUrmCNjrr/efCBpx1NlUxn/cnBH9lyejMm4BvhLD8PuVLtLKNr82MFQepcO/OOqO2X X-Received: by 2002:a17:907:6d29:b0:7c1:6e08:4c20 with SMTP id sa41-20020a1709076d2900b007c16e084c20mr31922924ejc.7.1676290598453; Mon, 13 Feb 2023 04:16:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676290598; cv=none; d=google.com; s=arc-20160816; b=aHB5U25W14IStlpTn9lxjc5qk6c4hhzHPBncTGFkVhlMLB3K/dYf9srXyo59+KoRHc V3y+43XcDzshSvup62wN98TDHMffGhihxVAffB+HlXcV+bgURgsfLkqfmIeLvJIxPE0l ilaWwEAW05M7sER0KqLLdcDUN0qNJ6+FaHrmydYC9hiisXzEQt693m2EsUsnxiGB0Wmd v0EShMEK09S0PgUcvxYAjj35Y2Oeq7d9i4Xclm4PfGgi0MxbvAaVtvm+ZSrsWtKf/iOR qMUpEmox3sEvDxcK1X8mqBRFB+sK8Xrcr2YgK/YXTpWuE6wHSDfIIFWz7qwXrPOs8Q3d ef/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8/ijGdXUpk/bOx95tYb/G/O+ZlxWtjcaYyWfUGg3pEc=; b=zw2ofyQfVm4T0B9Z49aIRkjqQqBuFB3QoLHv5j/ZOw4DhryPJClaT6Loe2U2woMOIm Hko0Uh2JfcB/oOYYv+uNa5wJ0wbskE/ASJYYVPdfuc3FSouOQAanl9cFYyoeObcY0Ovs Qi/1F0IVHJntViisKRhecYFNHhHRLWyhW0+0ju5xUfpZ3Pm+YOHN6Oj9ayBkmR6yz2QT TGG4R4XNBEvk+vcsvJv6ED4OeH9hBa6va263AWf2rt2KR2IogF9MsjFlsyGM1lD6O47v Ilgv3zEmpfo5V2yNk/zGj17VUc2Bg5xHOknMG2MwA3HdgIOmDAUpWPpH+pyds5dRYEhu uqPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DQNyvOFF; 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 l7-20020a056402028700b004ac089b971dsi9462222edv.114.2023.02.13.04.16.15; Mon, 13 Feb 2023 04:16:38 -0800 (PST) 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=DQNyvOFF; 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 S231469AbjBMMLw (ORCPT + 99 others); Mon, 13 Feb 2023 07:11:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231388AbjBMMLE (ORCPT ); Mon, 13 Feb 2023 07:11:04 -0500 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26EAB9EF4 for ; Mon, 13 Feb 2023 04:10:35 -0800 (PST) Received: by mail-ej1-x62b.google.com with SMTP id c26so26505392ejz.10 for ; Mon, 13 Feb 2023 04:10:35 -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=8/ijGdXUpk/bOx95tYb/G/O+ZlxWtjcaYyWfUGg3pEc=; b=DQNyvOFFReWgBK1ik8krxhrLtoU4RC3T3FNeQZM+IOH5fE25SpEsOmynkFIcOly4zE 5vTQcN9tsmTUaOxhE1XWjX74cAr31Fv7gx3dNDnI4FAuIj6/MPPIE6+p1riWKtProoEl 5XUuTj1eTuMnNnoe60nTOsz/Dq8xyj0q4Wrenh8d+E0c9ab8VekE77Ym6zG3GyOn8+VG fONx6Tn4uDY7rfUVo+d3EW8+id9Qbsfz4k6SdlUeaL4r2mjYVq3QdSFB4ioj1xc1ARZt U6uWRirFXGKLwXkxc926LYP8ixrmsL7OqcJw64yMqxPd4UdwE9e2GrOQkyGEA1zlRqqy x27A== 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=8/ijGdXUpk/bOx95tYb/G/O+ZlxWtjcaYyWfUGg3pEc=; b=LWCBl06Tkf1u9wdlJvEx+TKcYPGahFxT6EfM1h3DsS020Gkwjlt5F5c5rA5e10jUOs p7SArmiq/yXx4aMeBzDPicAiTQXsx4cSaSYIzbKQztbtUrbqZZtx/6a0dpNk33PplfuG /v6f6/wAAKlRBphNsUdH8dbujxCqGxsiWLO/B8XnKnqbsfimWctbbI44eehCNE4x88fm CS8dC2lNW/HoqavwFkisBe2fj7fzMHsfV0GEZAmzMm9DLlAbOEFwbIJo2p4OWMZ+ZzJc xBw58W8VN9Vhtk1+EAAXUYSdb4FZkdWsbj0xD5QPJnPpXbeq/0psztQmHxQcy6RezAK9 KoNw== X-Gm-Message-State: AO0yUKVjtgCQDfrj/EndoY2b5sxZ/JKJOgRjHpMNsv4UXZUC0hUt5W+z 9dA7jbYmbyz0O0Wv1N4kCZTmpw== X-Received: by 2002:a17:907:1ddc:b0:886:221b:44e5 with SMTP id og28-20020a1709071ddc00b00886221b44e5mr24043584ejc.62.1676290234028; Mon, 13 Feb 2023 04:10:34 -0800 (PST) Received: from localhost.localdomain (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id dt19-20020a170906b79300b0088ed7de4821sm6651586ejb.158.2023.02.13.04.10.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 04:10:33 -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 , Johan Hovold , Loic Poulain , Vinod Koul , Douglas Anderson , Neil Armstrong , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 6/9] drm/msm/dsi: Switch the QCM2290-specific compatible to index autodetection Date: Mon, 13 Feb 2023 13:10:09 +0100 Message-Id: <20230213121012.1768296-7-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213121012.1768296-1-konrad.dybcio@linaro.org> References: <20230213121012.1768296-1-konrad.dybcio@linaro.org> MIME-Version: 1.0 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 autolearn=unavailable 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?1757718091027773184?= X-GMAIL-MSGID: =?utf-8?q?1757718091027773184?= 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. Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dsi/dsi.c | 4 +++- drivers/gpu/drm/msm/dsi/dsi_cfg.c | 28 ++-------------------------- 2 files changed, 5 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 6d4b2ce4b918..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,25 +204,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 }, - }, -}; - 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 +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, -};