From patchwork Mon Feb 13 12:10:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 56245 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2308860wrn; Mon, 13 Feb 2023 04:15:55 -0800 (PST) X-Google-Smtp-Source: AK7set+gFoNeWfORJmciXUtWxftFzm/gB2kX5iNsLp7iHTelgqd5g676gpzmrKvDYcynmOsSIotF X-Received: by 2002:a17:902:c40b:b0:194:9b4e:1c90 with SMTP id k11-20020a170902c40b00b001949b4e1c90mr29212508plk.57.1676290555194; Mon, 13 Feb 2023 04:15:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676290555; cv=none; d=google.com; s=arc-20160816; b=ylbvIpyXF5fjvTi+ua19nsLzRaifduHtDBr2b0nO71IY8n0l3MpEK96FjmJg6ljEKI T1z9OucckCS3VTeaji01rKWLVUa/QMFxamWdUYW/uMfJtNQgefgm/gWYLMm3nY6NZHVm J+jBrjrFnlRlz3Yv7LbyfqCvuCM4sj8ZdCkBxhNev9M8SekG5pa9TI6/fi/T2ogt57Ir GtJcxta2e+Lq4EPG7D2FP1U8IPP4MaxUcCYLB0he+87c35KP9gvU7rn+Rti2Tobkrutr IsaF2MpFncJdeBhMtHVpdWDtcm74f+dNiH8ro4Xx98ipV6Rsy1xkJ7R+uisuytbvOLNa bhfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XBhzuhNM7NkSSplcxwh545i2vRIYXp6Q58I+x2Dr50w=; b=Fgyf++65/m0vaiiewerjbJhnhSaqIscXUk+c1suQ6BZMQ0rW96kD9l2Sd8A89L6P4R USzwoD3RmgWHrl7L5MzNw5wMJ0rmhP6kbwNhSHItQPXyQ53D/GsVRsukhuJA7JDL59EF 4zmbf59Lc+2PtqfTT2cI+YvZM/rU6DkJJ8nVYd+yExEG5FMd940md7d4+UBS46FxRuz1 MdUOIkmCGKMNZp5T23yLAH+DkldpKhYfy2BMbp5T0YpflTXqOfOJHFv+Qd8OjKPABXx1 9BnldYJLzGOFzmMFuBz4IyEw70BzRKhwa9bepDH1yJdgG6GZLUDYNZz24YdpQ3ryDWjQ 15Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BBuNyU0G; 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 b3-20020a170902d50300b0019aa5b2e122si2074576plg.504.2023.02.13.04.15.43; Mon, 13 Feb 2023 04:15:55 -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=BBuNyU0G; 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 S231334AbjBMMLD (ORCPT + 99 others); Mon, 13 Feb 2023 07:11:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231363AbjBMMKj (ORCPT ); Mon, 13 Feb 2023 07:10:39 -0500 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D8DD61AC for ; Mon, 13 Feb 2023 04:10:23 -0800 (PST) Received: by mail-ej1-x62e.google.com with SMTP id p26so31216317ejx.13 for ; Mon, 13 Feb 2023 04:10:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XBhzuhNM7NkSSplcxwh545i2vRIYXp6Q58I+x2Dr50w=; b=BBuNyU0GRinWhiIGAaqfLo2auMIm4XY8zH2oQBzzD4CYEcfunorOoPuNGmPjbO4DYJ y0/TrHQkiGt8g1wgslyWUtUJrHiHWTfUsgBy49+aLu5ZfOB7vIwTNherccZAlrfYPv1a CZYgfpu5wF/nRvVv/BYdFGlPEsxRBNM/1OPPYYrVHBPmK7IrgbRGxOiSm4W5uLah8Mms QEsi9/yxznsMOo+efvp9xoOeNP3ZM+0KjZ1HdFfkL/pYYhOLNyYYDjZYmG0D9mKCgaFS SFouTDAxrB6JxTys43yJmZiD+/GF6ECQgbT0Q7co4Wt2H7ZVRGJDOAVniKjS5qASTAPp jOGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XBhzuhNM7NkSSplcxwh545i2vRIYXp6Q58I+x2Dr50w=; b=C6+1TSX/upPsdds6aq5OOWjH7Onf4vsA5/UrvaT0YxlYyaVosf3YV4cksWQDfwP1Z6 xL93BT1BXRHH8A9eXE7xo9Vg0mATvsL7vMEk4iPpc4aTygbuA5fIocRIHAyPoGMdM/tI QZJ5o2v8QWMRuNbYcpl7W21eed3Ah3OOLtNHcECTWc5noJNLyulz/4Y5wmEhOQqFxWIl o7nF6fKLBEj8VWsSorBJAyFpIqbj1NvYhKB5EcR8ktVMLRM0vczLvnotF9+myE2eJ+HC 8Jk2bEKvbF+oWy/2o41PWwhLL9OAyKYmrQKThPXt7i8AY/WsN7UBx3gSg0YaAHQWoOlX DmeQ== X-Gm-Message-State: AO0yUKUYfMlOlolIPpCspC03P+nElP7QG6jWETYwYlGz48Y33A27eRa3 M2RpDqgl8nHOmhVjd+MsxM+Vqg== X-Received: by 2002:a17:906:4913:b0:88c:9b39:23c6 with SMTP id b19-20020a170906491300b0088c9b3923c6mr24353289ejq.14.1676290221727; Mon, 13 Feb 2023 04:10:21 -0800 (PST) Received: from localhost.localdomain (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id dt19-20020a170906b79300b0088ed7de4821sm6651586ejb.158.2023.02.13.04.10.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 04:10:21 -0800 (PST) From: Konrad Dybcio To: linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org, krzysztof.kozlowski@linaro.org Cc: marijn.suijten@somainline.org, Konrad Dybcio , Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Daniel Vetter , Douglas Anderson , Neil Armstrong , Loic Poulain , Vinod Koul , Vladimir Lypak , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/9] drm/msm/dsi: Get rid of msm_dsi_config::num_dsi Date: Mon, 13 Feb 2023 13:10:05 +0100 Message-Id: <20230213121012.1768296-3-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213121012.1768296-1-konrad.dybcio@linaro.org> References: <20230213121012.1768296-1-konrad.dybcio@linaro.org> MIME-Version: 1.0 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 autolearn=unavailable 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?1757718045100155538?= X-GMAIL-MSGID: =?utf-8?q?1757718045100155538?= 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). Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov --- 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; }