From patchwork Sat Mar 18 13:42:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 71601 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp297712wrt; Sat, 18 Mar 2023 06:50:06 -0700 (PDT) X-Google-Smtp-Source: AK7set9kcv/T2U8eWBueBs7fbUjrc7hUIPqNwtcmeK+sjKIdB21vmyoVaw4Zks4jyRHwBuqHw2dy X-Received: by 2002:a17:90b:3e8b:b0:231:248c:6ac4 with SMTP id rj11-20020a17090b3e8b00b00231248c6ac4mr11593416pjb.7.1679147406225; Sat, 18 Mar 2023 06:50:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679147406; cv=none; d=google.com; s=arc-20160816; b=VDYp5zg1l9FO7ZC+TFcXE07Fb99+Wi+BjKmbTxqDpGt7O5dq93bd8y+Kj26e3OoiId vntKi05lqtqsi+A+rsqUjrwaaIr0uxQQRCk6QzdK+gCMXPyeiTrqPLFWlBUMx4+8cH31 5Qe61YH3oa4KZATksAAVruFHqy+4bqBPHPtwco1uQxmEqOg8Jonuhxxj+XMdo8EryMgC nQBogr5E/ydBhCO89ExhXZxnGL2/au6+EX7c05oxI9oL7BBvdYA1rKmTafHtXlWKcL6Q 7lCuqdGJ/qog7xnJmXNwHOJH2U07ztTiiV0Xqws4yk8VYAn3JbQHq2pOIfIrHhQUN/nI uu6Q== 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=64Eim4J+wnLNg16H207185gsYiLvTQ9YXeAiDAajBeo=; b=uqGiiz0CRVK8OcfjOUtARfZcNwH7P4SzyCbelQzeHmuaE4HrGG166LoHmfyGGwKOoX BvumAP6bfITzMpMy60LeZ+2mRyQ/4mnTJWkoPtMKW7GZdgCVyNayzyksQHJhuLRPv3S8 /hxVRuu2tsPWEGxbRChJUlUz1vpem1aXleXvKgWyi/Ogv22FKh/m4h4D9RS3oDMdx0nW GawRFCLa4VFooatQQD8W0qUDRpy1iEvcLgU42e4o5NNwOqDMo6ozIdG9D1FMdPcnrQda Thn4Ykb0Dg02Z/cchQhXMZK8HDahqdEXmLmKgoFj59TTg996Ef6gfowegUnL/EmIOHiW KUSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZmPK7f34; 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 v20-20020a17090a899400b0023ef9514233si4993427pjn.116.2023.03.18.06.49.50; Sat, 18 Mar 2023 06:50:06 -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=ZmPK7f34; 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 S229820AbjCRNnL (ORCPT + 99 others); Sat, 18 Mar 2023 09:43:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229798AbjCRNnE (ORCPT ); Sat, 18 Mar 2023 09:43:04 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 552B432CD5 for ; Sat, 18 Mar 2023 06:43:00 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id t14so7791032ljd.5 for ; Sat, 18 Mar 2023 06:43:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679146979; 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=64Eim4J+wnLNg16H207185gsYiLvTQ9YXeAiDAajBeo=; b=ZmPK7f34jfn/APMqkk2gLGWySTgDjm48S5x6Fwx1Zwi05nRKt3SlJO2IUJNDEz7THd WIHnpkcpQ74MDnGHngpTAYbq/Hhd5BFfMKGWp7TKLIHFy7bZRvkZB8qZMbTBmHnr0EwG kN3puilAjHRR8Bb8Gua92H6kezHcO7qXGscCeZP5OsnIYYtU1PwztkZSL69EWp46uZro 83wBQxrU1qRvCAU9e1/I6x5x2+BtAxriBbQJ+R3Ofa44foGypVUWnIn9FcNXwclp2Ipt mr6t+WNUpqHmzCqAL6hSWoUmobNTQEhedKKdIpLN/zFaEhy8/OSf+kdGovb4wKABxAG+ 36Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679146979; 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=64Eim4J+wnLNg16H207185gsYiLvTQ9YXeAiDAajBeo=; b=5RHoh/D3pHgpvlvDFbUoQi4CGa5vb9Y+D+o1arUxNdtXiKA2fNgcccIObtr4Kh6h21 ancC7UyH23uGJ+cTYpuReCPkyHcEtPkz0WbUROl9cXmGRqbeZ7ss8LoEMiApOg90rKAb dGb4YRjuyKhYv0M+yXgMXu6ojVuIAA+9a2bKtmfS8qZDGK97FPDnkRyY1w1ySnT69bzD do1eLrEBl45A5pARJxiGbUP26xaZJbZ7fU/vcSNZotY01LJO9vAuWQmPT+vG4nUqOpsL iGeLMAWVQd1SiK0g4CbtOuv6VU1JqRTtUHBZ/ASoYKO9CHBdwKIviMJhSG9edhH7FjvX 6b1A== X-Gm-Message-State: AO0yUKWl21ZssqbqJ1OCaz5efnwj6ST5iFkEk00XbrNI9qRUm4P4xEfZ mlx3QLQKfQH/eP6QISJXP3egxA== X-Received: by 2002:a2e:be29:0:b0:290:6af8:ec25 with SMTP id z41-20020a2ebe29000000b002906af8ec25mr5831340ljq.52.1679146979675; Sat, 18 Mar 2023 06:42:59 -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.42.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Mar 2023 06:42:59 -0700 (PDT) From: Konrad Dybcio Date: Sat, 18 Mar 2023 14:42:50 +0100 Subject: [PATCH v6 4/9] drm/msm/dsi: dsi_cfg: Deduplicate identical structs MIME-Version: 1.0 Message-Id: <20230307-topic-dsi_qcm-v6-4-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=7014; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=eQGewel5eMIUbnjRWU8o9jYKXbfa44urQPoDhCO0rnI=; b=aIP2Ci+k4bWQEmaszkmmla0vcEoEAg71XC+VZWKNhlyqM9RKec6JOrzeikoDuGx8RBfy+CT/bgY5 4VtK1qW0BucTsvI7eVuEMI9vqDsF32vJ41jz2cAyaFqhOepQXBkq 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?1760713670306350159?= X-GMAIL-MSGID: =?utf-8?q?1760713670306350159?= Some structs were defined multiple times for no apparent reason. Deduplicate them. Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/dsi/dsi_cfg.c | 93 +++++++++++++-------------------------- 1 file changed, 30 insertions(+), 63 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.c b/drivers/gpu/drm/msm/dsi/dsi_cfg.c index 6c192963c100..039f503233d7 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 }, }, }; -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 }, }, @@ -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 }, }, @@ -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 }, }, @@ -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 }, }, }; -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 }, }, }; -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,27 +207,19 @@ 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 }, }, }; -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), + .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 }, },