From patchwork Wed Jun 14 11:35:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 692763 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 9A1B8EB64DC for ; Wed, 14 Jun 2023 11:35:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244061AbjFNLfx (ORCPT ); Wed, 14 Jun 2023 07:35:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235309AbjFNLfw (ORCPT ); Wed, 14 Jun 2023 07:35:52 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 249B91BF6 for ; Wed, 14 Jun 2023 04:35:51 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4f764e92931so1005168e87.2 for ; Wed, 14 Jun 2023 04:35:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686742549; x=1689334549; 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=GgG/M1SdADb+CjPujPqNKA6Um2dIkmunogTu3ghoPwU=; b=JPQOJ7GBzRg4+++Tk8jOeJWHuz89DMz5L2yRUw7DboCRZNnZAyh5VyDNqZrhdBUcHa eZJB+ZsUw9/I+JF0ipDZvEF8HDngp76ZiXOJ/VhekYngSPgLWuCp+IebZEJOOMbTGNDe kGFuJB8DjVPD3op5/kSvFi/dVcclVtT9NSGjESElDd/J3BExyM4XWemCtoTUFUPcnMyI lcK0KSufCoH5qGhnKvMEHPji1VIV8hV3a6DnMz2bY1pZG3scaLYqDGkY6QDz1HFjXUHm NnVZPAXVv2u0SOjL7D9OG1YPwT1JC59C/s6dyH0eQeUZgGibA1/7BO/sWH6ZK4gun3M0 1mRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686742549; x=1689334549; 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=GgG/M1SdADb+CjPujPqNKA6Um2dIkmunogTu3ghoPwU=; b=Zq4GxIgMNuAfjl90lwk/PYLe/TuVAheDJxOyhFcrTQt3k9hBxYk8bRG338j/ha1+q6 b4YJTPQGMbXSjrRJBQRaV0V3GxmFGS5tEQij8E7q6tR1kSsdtyy9j6PkLh+QV0eGmXAN 9wDy8PImbq6xGQAnp8jKzlS8Bxy8hiLNJn9iLhE7V7YfbLRVEK6779wV6my0R3jcdF5v JB6IiTgPeTFpwT5CuOPAswRCjZJOUhqC/zBKz7MIYPOFw2dPPnTaCZsIFkbaTVV5S0SB TiTYSRMetARpU+M7qm40urO+0ktw3xC0V4PDektN5vYDgoMrwoFic0jM0TNSvy/RgPQ8 92FQ== X-Gm-Message-State: AC+VfDy4yGjY9xSDIs4WLhErF2ihGVPTtdHymfTbM8giFhZkj0OYf2QU GO+9ovq7sfKyeqTmtEkLPuWIIA== X-Google-Smtp-Source: ACHHUZ4oQaFWwTY451PXFB29BsRrMgGvYB+CIFZrHN9pYl1l7/9xk3nBom7r1SWohRqLqAGvBWx1aw== X-Received: by 2002:ac2:5592:0:b0:4f6:1722:d737 with SMTP id v18-20020ac25592000000b004f61722d737mr8441604lfg.9.1686742549348; Wed, 14 Jun 2023 04:35:49 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id x1-20020ac25dc1000000b004f64b8eee61sm2088406lfq.97.2023.06.14.04.35.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 04:35:49 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 13:35:32 +0200 Subject: [PATCH v2 1/7] clk: qcom: gpucc-sm6350: Introduce index-based clk lookup MIME-Version: 1.0 Message-Id: <20230315-topic-lagoon_gpu-v2-1-afcdfb18bb13@linaro.org> References: <20230315-topic-lagoon_gpu-v2-0-afcdfb18bb13@linaro.org> In-Reply-To: <20230315-topic-lagoon_gpu-v2-0-afcdfb18bb13@linaro.org> To: Bjorn Andersson , Andy Gross , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , AngeloGioacchino Del Regno , Conor Dooley Cc: Marijn Suijten , Rob Herring , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686742545; l=2501; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=TaMoHmTX5YmIOUIdAoElMKm2cSA2iQeh1gPxDTztMHU=; b=SuDstwjNjC4hB4jFdESHz9+jus8boaBzbYU+NNQHiLZongyDXxnapKuBEHAt5EBMcs95Y2i/H TdQqQNj02JUCwkN8winp20RjQqBJuUrth0siHnCXo/wmoKj7gHVe7RQ X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add the nowadays-prefered and marginally faster way of looking up parent clocks in the device tree. It also allows for clock-names-independent operation, so long as the order (which is enforced by schema) is kept. Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/gpucc-sm6350.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/clk/qcom/gpucc-sm6350.c b/drivers/clk/qcom/gpucc-sm6350.c index ef15185a99c3..a9887d1f0ed7 100644 --- a/drivers/clk/qcom/gpucc-sm6350.c +++ b/drivers/clk/qcom/gpucc-sm6350.c @@ -24,6 +24,12 @@ #define CX_GMU_CBCR_WAKE_MASK 0xF #define CX_GMU_CBCR_WAKE_SHIFT 8 +enum { + DT_BI_TCXO, + DT_GPLL0_OUT_MAIN, + DT_GPLL0_OUT_MAIN_DIV, +}; + enum { P_BI_TCXO, P_GPLL0_OUT_MAIN, @@ -61,6 +67,7 @@ static struct clk_alpha_pll gpu_cc_pll0 = { .hw.init = &(struct clk_init_data){ .name = "gpu_cc_pll0", .parent_data = &(const struct clk_parent_data){ + .index = DT_BI_TCXO, .fw_name = "bi_tcxo", }, .num_parents = 1, @@ -104,6 +111,7 @@ static struct clk_alpha_pll gpu_cc_pll1 = { .hw.init = &(struct clk_init_data){ .name = "gpu_cc_pll1", .parent_data = &(const struct clk_parent_data){ + .index = DT_BI_TCXO, .fw_name = "bi_tcxo", }, .num_parents = 1, @@ -121,11 +129,11 @@ static const struct parent_map gpu_cc_parent_map_0[] = { }; static const struct clk_parent_data gpu_cc_parent_data_0[] = { - { .fw_name = "bi_tcxo" }, + { .index = DT_BI_TCXO, .fw_name = "bi_tcxo" }, { .hw = &gpu_cc_pll0.clkr.hw }, { .hw = &gpu_cc_pll1.clkr.hw }, - { .fw_name = "gcc_gpu_gpll0_clk" }, - { .fw_name = "gcc_gpu_gpll0_div_clk" }, + { .index = DT_GPLL0_OUT_MAIN, .fw_name = "gcc_gpu_gpll0_clk" }, + { .index = DT_GPLL0_OUT_MAIN_DIV, .fw_name = "gcc_gpu_gpll0_div_clk" }, }; static const struct parent_map gpu_cc_parent_map_1[] = { @@ -138,12 +146,12 @@ static const struct parent_map gpu_cc_parent_map_1[] = { }; static const struct clk_parent_data gpu_cc_parent_data_1[] = { - { .fw_name = "bi_tcxo" }, + { .index = DT_BI_TCXO, .fw_name = "bi_tcxo" }, { .hw = &crc_div.hw }, { .hw = &gpu_cc_pll0.clkr.hw }, { .hw = &gpu_cc_pll1.clkr.hw }, { .hw = &gpu_cc_pll1.clkr.hw }, - { .fw_name = "gcc_gpu_gpll0_clk" }, + { .index = DT_GPLL0_OUT_MAIN, .fw_name = "gcc_gpu_gpll0_clk" }, }; static const struct freq_tbl ftbl_gpu_cc_gmu_clk_src[] = {