From patchwork Thu Mar 16 08:51:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 70673 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp364714wrt; Thu, 16 Mar 2023 01:58:05 -0700 (PDT) X-Google-Smtp-Source: AK7set+ZSa7NdrZU4Vfp4DbnDpJuA5z65GWlRHZWZH5AaAZLdGS+Nbi47H7KoJnYen6dNV5+QTu7 X-Received: by 2002:a05:6a20:1445:b0:cd:c79:50e8 with SMTP id a5-20020a056a20144500b000cd0c7950e8mr3577704pzi.62.1678957084802; Thu, 16 Mar 2023 01:58:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678957084; cv=none; d=google.com; s=arc-20160816; b=yTMA95A49YMTnaBOirsl5QAOABa4ZbWAAEz6mernB1JyuNQjVtUsV2lY5ZDmULoX38 qIHwTTolUH5ThxDfdSnDS0dI7fq0qOOOZUOILEKBJyE7aj1g+LM8BjkSps/VB8AZR3mH jsaHzMuDD/ODgjYjzbUIa/tMeO8oRrqnUvRxv1m0qKV/xmbdOfTLWV+A2CyACT4Ezobj CtdenWY0/9m4/SYi/WdZKrGdHQpp3AIqoe5bK6syPPrKljrfxESFcJ5LBIgokjteK8Aw 6mHbRPmShr7hthnIeVNi5/KuODas3A8W5q16xJX3eND1GVefY+JqQAOsqF+Rc1DnqPm4 uC8A== 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=Ja37xKiglxJ/lPrUpuyUvSbThkrJV11m94PBRXq1WhI=; b=GraFph7NJTq/djQaq/aalx4zWN1985ENko2XqZ2xdBq5zCidut+kubIvrbpG9VOMCc nsGf1qg4tgb+Wy9p0RWfT3b74F0UfbEIM+eBWgPrHRpkkXZ3OuDFniNGpdQQI6hcdJSv gV+Ck9Gi/LK4BS+R3heYDPL6YkHFDeg5n38p1MWskcZWcU781n2F/BbdMyYUfSeXwxfr D82Wl6ubM70hAKfHzzMTCInAEW1xkBcbl2+h3j7Z1Y0/6Y2gWxoTl6jBlSzYa/YX6QaL ytRwGNVDEqtFxvcNtvf6lw/FySQ/PnJUGEv1t/sXsUeD0i/3snVLJAf4S2gP9gVvuq7z CwkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L9mMKpZ0; 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 r9-20020a655089000000b004fae7b9ed23si7373788pgp.791.2023.03.16.01.57.52; Thu, 16 Mar 2023 01:58:04 -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=L9mMKpZ0; 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 S231298AbjCPIwp (ORCPT + 99 others); Thu, 16 Mar 2023 04:52:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230116AbjCPIwU (ORCPT ); Thu, 16 Mar 2023 04:52:20 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 269EE94A47 for ; Thu, 16 Mar 2023 01:51:19 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id x36so841513ljq.7 for ; Thu, 16 Mar 2023 01:51:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678956673; 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=Ja37xKiglxJ/lPrUpuyUvSbThkrJV11m94PBRXq1WhI=; b=L9mMKpZ0y15yotTtEQtS4RCEnQF5hD7h8us5pLKOa8E4hMkkhdjAE8PR03BF7fbHNF O6+wuoDHh869ug6DV4gjFNtwZqdVmxFHExwQ7TW52GDVQVpTcqmwFnE7ISOC9iFlCt2J j6e6X+vitM47swDMLg46tZxCCgOKIAjLhv0IvuOpMLbpfrupJ5c5mDSyQeJMd0Ovt3x1 rNtysADZ9UWEzwx1f/0W7YW6sDobngzto836sjEwwizK7LPh6nSk/R4jDCtMfptx5EEs djiSRFzIxlVBZ3FPlMxDfF6xGDmk1cr+Ql8PMdC8rTj4MsoD+HHHHHhENxCkDBZN1lry R7ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678956673; 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=Ja37xKiglxJ/lPrUpuyUvSbThkrJV11m94PBRXq1WhI=; b=3wew1IKnIv6mX6fWJg6bkDC+5+9qItbZJb1LZkN2DqMiA914pWY/kTYhGCklThBSRN MECh2PmvqblsyOSl3jcaBvEwVkB2+TdLAzLvxCHNH8uBR4Km0BRLbvUH255ZnVQSGfBW RheG59s/5N8sHpI7+KUVVnR5qBhFwEtyzOMYpqrhIHkHGmc6ZFiOfppOn7z/4P6d3s29 x9SuXWQWGdaLiE8Dz6REvs2l5oCPrHVssZ/O0trd4b6KAcoAfs4K1bZ6TO58KvK/ihXK UI4Bx0IyTKDBMJrxqAQelFIQ3KDgGcV8vWfXur1Fmea5qr2EgcNa4DApkTDqzeciAzCq 8O3A== X-Gm-Message-State: AO0yUKVviXLoBjPfVhc+UNjoDycPhElrIk9Z928/gyzqBNParyQF3pgZ ejCeKiDkg4E118u3CrMeBCjQXQ== X-Received: by 2002:a2e:8e3c:0:b0:295:a2a6:672 with SMTP id r28-20020a2e8e3c000000b00295a2a60672mr1879358ljk.10.1678956673706; Thu, 16 Mar 2023 01:51:13 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Mar 2023 01:51:13 -0700 (PDT) From: Konrad Dybcio Date: Thu, 16 Mar 2023 09:51:08 +0100 Subject: [PATCH v5 02/10] drm/msm/dsi: Get rid of msm_dsi_config::num_dsi MIME-Version: 1.0 Message-Id: <20230307-topic-dsi_qcm-v5-2-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=5720; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=nAK7VhpEOKQPVDoVxGmSH//l3jkm1AocrDNJW7zWKno=; b=hgOcRqgu0xDXRY4QqYBtEKJ6MIyvPnIjrJcCpU/H7Z1PSxGnQ0YPJlUcCChkSHNsQF+NDNgECh8+ waGh95MpAuNBeu0KtbC4zlLvYVYn3Eos8ntpneAUskcWm234C2OX 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?1760514104457419974?= X-GMAIL-MSGID: =?utf-8?q?1760514104457419974?= In preparation for supporting multiple sets of possible base registers, remove the num_dsi variable. We're comparing the io_start array contents with the reg value from the DTS, so it will either match one of the expected values or don't match against a zero (which we get from partial array initialization). Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/dsi/dsi_cfg.c | 13 ------------- drivers/gpu/drm/msm/dsi/dsi_cfg.h | 1 - drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.c b/drivers/gpu/drm/msm/dsi/dsi_cfg.c index 6d21f0b33411..4515f52b407a 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.c +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.c @@ -22,7 +22,6 @@ static const struct msm_dsi_config apq8064_dsi_cfg = { .bus_clk_names = dsi_v2_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_v2_bus_clk_names), .io_start = { 0x4700000, 0x5800000 }, - .num_dsi = 2, }; static const char * const dsi_6g_bus_clk_names[] = { @@ -42,7 +41,6 @@ static const struct msm_dsi_config msm8974_apq8084_dsi_cfg = { .bus_clk_names = dsi_6g_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names), .io_start = { 0xfd922800, 0xfd922b00 }, - .num_dsi = 2, }; static const char * const dsi_8916_bus_clk_names[] = { @@ -61,7 +59,6 @@ static const struct msm_dsi_config msm8916_dsi_cfg = { .bus_clk_names = dsi_8916_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_8916_bus_clk_names), .io_start = { 0x1a98000 }, - .num_dsi = 1, }; static const char * const dsi_8976_bus_clk_names[] = { @@ -80,7 +77,6 @@ static const struct msm_dsi_config msm8976_dsi_cfg = { .bus_clk_names = dsi_8976_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_8976_bus_clk_names), .io_start = { 0x1a94000, 0x1a96000 }, - .num_dsi = 2, }; static const struct regulator_bulk_data msm8994_dsi_regulators[] = { @@ -99,7 +95,6 @@ static const struct msm_dsi_config msm8994_dsi_cfg = { .bus_clk_names = dsi_6g_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names), .io_start = { 0xfd998000, 0xfd9a0000 }, - .num_dsi = 2, }; static const char * const dsi_8996_bus_clk_names[] = { @@ -119,7 +114,6 @@ static const struct msm_dsi_config msm8996_dsi_cfg = { .bus_clk_names = dsi_8996_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_8996_bus_clk_names), .io_start = { 0x994000, 0x996000 }, - .num_dsi = 2, }; static const char * const dsi_msm8998_bus_clk_names[] = { @@ -138,7 +132,6 @@ static const struct msm_dsi_config msm8998_dsi_cfg = { .bus_clk_names = dsi_msm8998_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_msm8998_bus_clk_names), .io_start = { 0xc994000, 0xc996000 }, - .num_dsi = 2, }; static const char * const dsi_sdm660_bus_clk_names[] = { @@ -156,7 +149,6 @@ static const struct msm_dsi_config sdm660_dsi_cfg = { .bus_clk_names = dsi_sdm660_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_sdm660_bus_clk_names), .io_start = { 0xc994000, 0xc996000 }, - .num_dsi = 2, }; static const char * const dsi_sdm845_bus_clk_names[] = { @@ -178,7 +170,6 @@ static const struct msm_dsi_config sdm845_dsi_cfg = { .bus_clk_names = dsi_sdm845_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_sdm845_bus_clk_names), .io_start = { 0xae94000, 0xae96000 }, - .num_dsi = 2, }; static const struct regulator_bulk_data sm8550_dsi_regulators[] = { @@ -192,7 +183,6 @@ static const struct msm_dsi_config sm8550_dsi_cfg = { .bus_clk_names = dsi_sdm845_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_sdm845_bus_clk_names), .io_start = { 0xae94000, 0xae96000 }, - .num_dsi = 2, }; static const struct regulator_bulk_data sc7180_dsi_regulators[] = { @@ -206,7 +196,6 @@ static const struct msm_dsi_config sc7180_dsi_cfg = { .bus_clk_names = dsi_sc7180_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_sc7180_bus_clk_names), .io_start = { 0xae94000 }, - .num_dsi = 1, }; static const char * const dsi_sc7280_bus_clk_names[] = { @@ -224,7 +213,6 @@ static const struct msm_dsi_config sc7280_dsi_cfg = { .bus_clk_names = dsi_sc7280_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_sc7280_bus_clk_names), .io_start = { 0xae94000, 0xae96000 }, - .num_dsi = 2, }; static const char * const dsi_qcm2290_bus_clk_names[] = { @@ -242,7 +230,6 @@ static const struct msm_dsi_config qcm2290_dsi_cfg = { .bus_clk_names = dsi_qcm2290_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_qcm2290_bus_clk_names), .io_start = { 0x5e94000 }, - .num_dsi = 1, }; static const struct msm_dsi_host_cfg_ops msm_dsi_v2_host_ops = { diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.h b/drivers/gpu/drm/msm/dsi/dsi_cfg.h index 44be4a88aa83..6b6b16c5fd25 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.h +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.h @@ -39,7 +39,6 @@ struct msm_dsi_config { const char * const *bus_clk_names; const int num_bus_clks; const resource_size_t io_start[DSI_MAX]; - const int num_dsi; }; struct msm_dsi_host_cfg_ops { diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 18fa30e1e858..9021f0d65515 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -1868,7 +1868,7 @@ static int dsi_host_get_id(struct msm_dsi_host *msm_host) if (!res) return -EINVAL; - for (i = 0; i < cfg->num_dsi; i++) { + for (i = 0; i < DSI_MAX; i++) { if (cfg->io_start[i] == res->start) return i; }