From patchwork Thu Mar 16 08:51:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 70679 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp369731wrt; Thu, 16 Mar 2023 02:09:34 -0700 (PDT) X-Google-Smtp-Source: AK7set9LlQ4JvKNeaP980IxjJjqvkma7zTgjE3/QuCoRWRyzAL2EZSDIfK4Q6bin+5qtgEWufWQO X-Received: by 2002:a05:6a21:7893:b0:c6:bd82:ea2d with SMTP id bf19-20020a056a21789300b000c6bd82ea2dmr3882118pzc.2.1678957774504; Thu, 16 Mar 2023 02:09:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678957774; cv=none; d=google.com; s=arc-20160816; b=zb9CDRYggg8ZxIpp2iCwg/XWAd/jT5rvyFKwu3MFTBBMJdmpBJA+VcSZcpShQb3maK VHU4lj2D7xK8UwQwSfK8/b4sMAItPUrFvsselv/9lzWEJnkeoJovX2tPmu1RxTfWwOrr L9Tgrku0ky1NHI7hiJSY2+fnivyhF5BKcJOokR5gAKQqQgn+2jSwe5oOy/8RVTDTQ+I0 B+HvjGmaWetqcqPcGzN9ExMPwLmMfDy714f535LnTdCMTHugsCUqaUxu1zR5GjLx+ODf RvuPHpzCIUdkZbHD71pBeQFu+wV8jOXVph4yH7HEQr/wtYjFVeyTqYj8j4uAOusAVqF+ eN+Q== 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=v9HSgsQ1f/oPVn4k8ZwA/HkMpNwUD0AtVlKFsglBDl3TlBEKVHdfZxRxBue5mJYw2C kKTfhj+AiRgVLbuaZbpEW5BrX1jYdBniVwYTeMiXkPmHjcEs/X7O9v/y4vjPftJt6lnv QWRq9QYRUUpCNC2//vGIvQKoC++C4T1SCinJOX9OupmSqrh/EpB7fULdhG1+IIvPm9g6 fF9Ock+kyAIzFWEoQOiBIGf7lj9aRAPAjwEmvF6YGA7S/EL5tRfmHLHKFJVe0U+1Vuqo 9uJSPIYouOZWcbSpTGBSk7gr6XaxniW6QQ8+1LmYM/5Ki+wiFq5DUzL3gDBDwNBA7ruz NEMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eS1hKUn0; 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 fb26-20020a056a002d9a00b00625edf717besi1576684pfb.259.2023.03.16.02.09.18; Thu, 16 Mar 2023 02:09:34 -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=eS1hKUn0; 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 S231303AbjCPIxL (ORCPT + 99 others); Thu, 16 Mar 2023 04:53:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231214AbjCPIw0 (ORCPT ); Thu, 16 Mar 2023 04:52:26 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1CA1B6D08 for ; Thu, 16 Mar 2023 01:51:22 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id h3so830731lja.12 for ; Thu, 16 Mar 2023 01:51:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678956677; 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=eS1hKUn08srQeT2eu2FF7gbbO3jcCdcr/5mVnwzdoySrrWJ1dl6xMJevAayiXBCkVZ 92XfYle1RLyvbKuEUdJrYMQb7sfnuiMXzd3pFFvRV5nHjhIrQX7mn/rp6U0LnFytg4bh IMUdkrXsBEXQpWb1BOw+EKjYJfM2by1512/4vrWDMJKfAaQIsBGV1v9u0nqq8MLR8qve 5Zgn3ofb3jRflny4ysPHeFmyd7NiEF3UA0pOMOzda69FpWju6Xn3WBa6oh5005IKVnHu CcNZ+H/R5wh6KS2G2/Vdtop42sX6xCqXN+TplD/qDulHI/4ufFLC0SBqDxJB7nzciCNl IF9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678956677; 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=q2MNHyAE1quMBKaI4G2smZP3yYP6bYqVjCBo0vTKm/MwLOopno12977ZupdO3w0NjT pUe99JKAynjFmIZv9yFEADqVTv4mhurdbMGgVm/eSf6DWiAzlrIud8TJfJXoGJvWYo9b eL3R5iPuAeHxXqFYAWrBvm5Vc9l7JUIccpxCioMqOOSkgKBaLL3AF8bXO9GG+KrxTyjx w80UgOjUyZSVZgsCHQ3Y/Jy59/YKWPjJ6v8UBG4KYu0BZc1AZKXiqsMUH6KOUhhnKVTr 1TaJ0gsU7PUplTQECTZ/z2Ncv8Q8ETq+ZIOpaA3DhEtasBDNjPhc+9uwozwrCWtasF0x nwYg== X-Gm-Message-State: AO0yUKXP0G5s18/kIhmBQBJyaVwa8UklwyW9/WU3GOlebYhw/bQffeTT gECUPmpJDExX1O1HMNc27n+A+g== X-Received: by 2002:a2e:9852:0:b0:299:2b6d:6e90 with SMTP id e18-20020a2e9852000000b002992b6d6e90mr781034ljj.34.1678956677021; Thu, 16 Mar 2023 01:51:17 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Mar 2023 01:51:16 -0700 (PDT) From: Konrad Dybcio Date: Thu, 16 Mar 2023 09:51:10 +0100 Subject: [PATCH v5 04/10] drm/msm/dsi: dsi_cfg: Deduplicate identical structs MIME-Version: 1.0 Message-Id: <20230307-topic-dsi_qcm-v5-4-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=7014; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=eQGewel5eMIUbnjRWU8o9jYKXbfa44urQPoDhCO0rnI=; b=SsPYU6abTVgFrbgo+KmZ3KUlWvIvCkRzHRqXpGGxJP3ioxboCZ3VUBwS49B5NBlATDvaco/QY//Y 39+um3miCRM/+8hPOjohWTzZ/8j/icTCsUhI3Vw/TwKKkybQKh08 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?1760514827415785165?= X-GMAIL-MSGID: =?utf-8?q?1760514827415785165?= 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 }, },