Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E099C74A5B for ; Sat, 18 Mar 2023 13:43:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229628AbjCRNnK (ORCPT ); Sat, 18 Mar 2023 09:43:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229787AbjCRNnB (ORCPT ); Sat, 18 Mar 2023 09:43:01 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D80216898 for ; Sat, 18 Mar 2023 06:42:58 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id z5so7778310ljc.8 for ; Sat, 18 Mar 2023 06:42:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679146976; 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=j63kOdN48NM1FMwxcRvOouDRuBkw/SDRBHKcP2kCDXbu3eHffkQvdRMB5TPrDoXTcX mHr1VIHZmvH42mEPA3OI5L0LoLqyrsx3ZyHhwdllm985tYhkwUSHBTBf9xgZP1CnUgTy NxeutMT6w3eoDEOWbp74rUCl1bSWJAZLEfTlaHP138zVMIqyhh25b74XRzQfERfdMGKm a3TqcZoBGwQEkRIFc9bG7NZx76E0ZY/ALPtwDZcBrsPYXH9Vkw3rmxnJurwkukLBHiOE Jd/fkrIYQVRk/5yg2Y4uQZI4ZgtCNDUFmrsTufkgG7z35+BfeMn+K8YNwK8jNjQrHUMN PcrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679146976; 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=SN9EHrbCedXoascpUZRaN4RMLwte0WXLe4vrNy4HGEUu+kB/E3AZIMXiAtVWpgwNMn +TPfzJi6ZWgkJRvGteNNYMf6sAf9bYZo6Ss+hLQO2IBXdg/FcGXhSTul9wcUOWnO0d8i UkoK+uz8kymETcCCp+HB4wEFYBPBanHmB0P9guUxnU5n2utkGQvJhq4sOXUH9HLWU5sO Zu5uCZrfZgZqQVhZDIM2b0jsOLeGjB5ZI/BG/cGZgcpaMcWhUxRbE6Vj82BBAImfJl8/ bCqW9zNqxcgY8WIY+ItehjdsDredkIYc2zzAuEy5n8/FPrDV2Qh8MrlkbrVwl/7bgIkg uOeA== X-Gm-Message-State: AO0yUKXap6CbisJOyDQe1d1t4rFag8agPHqVPUYtHEhC4ISnlWSDSNVL wgSwlU3n9zQwa9oRJ6BVpNyW1g== X-Google-Smtp-Source: AK7set+8apd8tn9mAphOC18izxibwyQooL29lC9fvKqCL5UUy3N4m2lCRBggOum5nEJf5MYRJYnieQ== X-Received: by 2002:a05:651c:b10:b0:295:9659:fba5 with SMTP id b16-20020a05651c0b1000b002959659fba5mr5354998ljr.37.1679146976294; Sat, 18 Mar 2023 06:42:56 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Mar 2023 06:42:55 -0700 (PDT) From: Konrad Dybcio Date: Sat, 18 Mar 2023 14:42:48 +0100 Subject: [PATCH v6 2/9] drm/msm/dsi: Get rid of msm_dsi_config::num_dsi MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230307-topic-dsi_qcm-v6-2-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=5720; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=nAK7VhpEOKQPVDoVxGmSH//l3jkm1AocrDNJW7zWKno=; b=0sipnApXZIY2+VWgYQXjuxdpIip3V7pkk/e9SMtNlW7/sozotVv8DC+ri2fXG6ktgln5mEWPoQx6 cO56WjaJAvSYJhZTn5zVwfoXybtVsC1jvQYz/UY85zPo2/VBzZMG X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.39.2