From patchwork Tue Mar 7 13:01:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 65447 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2415791wrd; Tue, 7 Mar 2023 05:04:44 -0800 (PST) X-Google-Smtp-Source: AK7set93OEzQvB6sZi6Xc71yTomy7nMqIU3Jfu24cA6n+Td2JWPRg0rDpiBazsii4Dx/9J2yIE4W X-Received: by 2002:a17:907:d28:b0:8e9:9e13:9290 with SMTP id gn40-20020a1709070d2800b008e99e139290mr19757713ejc.27.1678194284285; Tue, 07 Mar 2023 05:04:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678194284; cv=none; d=google.com; s=arc-20160816; b=oi3EX7fBvW21XspSgyEEFi9F6f15TvJzSeZbc+Y/icr8aEdqLOT0X4syoRGuadj1k4 es9mSrMMwIcywBTX5mYKSiexKoKMEpeGRjDIpa56zRbusfZUiDSj3Iz0ZtcYs/XolAr1 PwWuewqX2pm66fCPUcUndDUv0bc0n+2qheLMTmyNip48XJiRoR8DYNIfTQB6riUroyHY mOTBo/xMGaLoP9L+19Rjw9gQ+MMs75dnaRN1r9+AS38uT36jExQWqIj5AihD0XtD/FNm nwxujMpsXptoUQ8n4NFdWFjgz96yn4dpWKPb/fBkD1XaFDKY7xl1mGOsXScD03FgWhuL 904w== 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=fjTJZiNd6R83QWqXCKgFPnIkCB7wIuy8qVdIkOb07TA=; b=XojQaG8lu1OHRA92dFY/KaaJnm2Nz5HdknHbAv5HFw8k7ZroiIvEODZrr91HV1WQQy Y+M1K6WGDL0rWCI6W3k7e8MXcxfg06TSisl7cbTUd+66kb9AUb60P+C3H335hRI5yUlR 5VR/AFDRN1pJkTmoUwf/Wshzs4RF9QI5Ru8T3qJPSx3Etc62lLpt84NRXJwSZvKdLx0t b/HulNrWX8uPwPa/kSx77uUIUvA5+/AJvIprbFlFfFfHQ8FWEgzATptx/qljvBtZfVg7 FsM9/lYw//AAy/ewDdvHFulxHdp2sAhcjdxt6TU1+syWJNxfsR70MLWMWRqx80vykbZJ +4vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B0jnwDvi; 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-20020a1709065a8700b008b23cd04f30si631312ejq.877.2023.03.07.05.04.19; Tue, 07 Mar 2023 05:04:44 -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=B0jnwDvi; 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 S230041AbjCGNCG (ORCPT + 99 others); Tue, 7 Mar 2023 08:02:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229905AbjCGNBu (ORCPT ); Tue, 7 Mar 2023 08:01:50 -0500 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 749B6CA1E for ; Tue, 7 Mar 2023 05:01:48 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id s22so16929585lfi.9 for ; Tue, 07 Mar 2023 05:01:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678194108; 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=fjTJZiNd6R83QWqXCKgFPnIkCB7wIuy8qVdIkOb07TA=; b=B0jnwDviZ8EhOE7w6tWBqfeMLopMAcGiR608LOWDrRlR71R/bUdHkK4NtwW1OSjIee wctBeCLwXMGGrHYgvZzrcpUq7hsaQEjSKlTgr9ebz4dnkvAU5+upgCR6Als1+52C1QfE o4E5ZDH/DHsKwQZcaUPcUT1tZfzLf+9pvamao/jhCtrlTYyNe7F2RMMFU5Gnl9tAHtDO GYpWBgyFvdK0k/Yor7A6QVguoMEzmC737ORKGShwOoBaTo2Q9ZIySmwiO2hYAmAKhd+f u+ca3oM3i9HJEAVTxukn64qusfJd4ZmgcY83cuOgNAhh+ty9COwF+utK8MkO4dAjITcG Y4kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678194108; 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=fjTJZiNd6R83QWqXCKgFPnIkCB7wIuy8qVdIkOb07TA=; b=0tFwZ2TIwHvdBIwOM2kLENPg7zVEfY2Q99fo75D6dlV2wsTcdvH1dQewcjUnGj29xc bRGOo18UkJwLgPsOEre9IkYqlA7b1cdzMJDNapovdcAzniZLW851u+X5qiZkEk7RoWCQ aMwsfyh1cXoZCuHR2rANtWYhR+PzucZmirjd5FhAWsAYBVzJrI0E3feArXgDjFiOBzIv 2QhayT1RTl80GtPTY9gR1cXFw7N6hiQqL2Gqm10EJgkqPGoeaEcOiJtWT9WsychNLYTj X7Fn/h22OhXGzxDMnq3i2RGrzZRLtpZFxtO7Os6LTasRzkULX/67b1yzFSEE1JYB0OU/ UHRQ== X-Gm-Message-State: AO0yUKWPzXmfu7nNUI8ukYRQpWDSdDoazVcqhNoZabKNV5CDgKPibWTC xuK+VDcbtehyaM2mY2YZxiJV0A== X-Received: by 2002:ac2:51c4:0:b0:4cc:53e3:771d with SMTP id u4-20020ac251c4000000b004cc53e3771dmr3975638lfm.64.1678194107831; Tue, 07 Mar 2023 05:01:47 -0800 (PST) Received: from [192.168.1.101] (abyj16.neoplus.adsl.tpnet.pl. [83.9.29.16]) by smtp.gmail.com with ESMTPSA id u2-20020ac248a2000000b004cc5e97d356sm2048265lfg.148.2023.03.07.05.01.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 05:01:47 -0800 (PST) From: Konrad Dybcio Date: Tue, 07 Mar 2023 14:01:42 +0100 Subject: [PATCH v3 04/10] drm/msm/dsi: dsi_cfg: Deduplicate identical structs MIME-Version: 1.0 Message-Id: <20230307-topic-dsi_qcm-v3-4-8bd7e1add38a@linaro.org> References: <20230307-topic-dsi_qcm-v3-0-8bd7e1add38a@linaro.org> In-Reply-To: <20230307-topic-dsi_qcm-v3-0-8bd7e1add38a@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, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678194100; l=6178; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=FOznmitAnsxsxj/BCqVtxW8B1SKled4a7NwV407MWtY=; b=f50KP8xbmhZ1EHJCTyYfLubVlBW91cQUMunNAqQmHzGh11J7Agpwyyq0/osuTb3ZQdJKJ1Gbo6yO fqhhu507Dcd6Fo6Fo7cfObXUR9ivMkYpImKBOFeUGS3jbTarxfzt 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, URIBL_BLOCKED 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?1759714249759836626?= X-GMAIL-MSGID: =?utf-8?q?1759714249759836626?= Some structs were defined multiple times for no apparent reason. Deduplicate them. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio Reviewed-by: Marijn Suijten --- drivers/gpu/drm/msm/dsi/dsi_cfg.c | 77 +++++++++++++-------------------------- 1 file changed, 26 insertions(+), 51 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.c b/drivers/gpu/drm/msm/dsi/dsi_cfg.c index 6c192963c100..d39521850018 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,8 +207,8 @@ 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 }, },