Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7357105rwn; Tue, 13 Sep 2022 19:21:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR5zEDWS8+zriTXEy1dKAJR8pIHPFbInvWFuUvu8afLDBZbuOocuniUedfHG38N7N311UE2z X-Received: by 2002:a17:907:a40a:b0:77e:f3ee:c791 with SMTP id sg10-20020a170907a40a00b0077ef3eec791mr6640266ejc.384.1663122088718; Tue, 13 Sep 2022 19:21:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663122088; cv=none; d=google.com; s=arc-20160816; b=R7XdlBE9W0xQZRhpr3UsbLzNsneu2CdYxd4LEg6hn1vfpJ1QYykff2WHkZWrzJGRej lA90nnniLa4lwFmcTE8GBO39sQ+ppozZqD4oRIm8ASGNVdM+7JQvEdzUA3Mi1TQLsNH+ YePT5Y1IcjdbYlJkAqgHuUiK/t8YhtBeBc6hBBT4VnAcFX5vflgwY8w2PoSaiMWaHdhl prqwxE/xYC0xdjH1UK1AVHNKrF/4fPi/M1s4iRImIvVHtEditw1sYCyS90B1llYhVIgI 7WOzXU8LRyLC4fjWZmXtqjQ8niiHCieK5DM3mf8xW49P7wRPwATYsq8hzgQXTzRFo1ls 1Vsw== 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=7GbYCslF48I7fDwOVdzpc0jOBmHVLbyPOHBU4jxAGaA=; b=LRBljQgFfxwxBeSt0O/xOxTHiEF6LoP/mVE88PThqNoct3jo2w1rWBqtes0JI8hi8p AYherKj3JEug66DZY226efrYfJyzUS5dAttaCKJlkbVaRd6TqpP4++4LdbjgMGosJ3Oq pT98Rk3TxF8BTg9bq2KVroG62cZZ/rysz/iEVERRQZTeu9bCWwPeWuLvFZJfw2hDvz7l ywDoM30hxDONMKlCve6dl2hTiLolKlfv0PawKiLeAmj1K81UonNZiJKBK4onvscLXKBU rSNAR6BMgKUGdI2ZLGBxz/H5+5rhSlhD8UpOhky6hajRZrPjWk1xbNpMHM1So/QM+IzQ g1Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Mzy9+Sng; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m5-20020aa7c2c5000000b0044f0dc2cbd6si9173530edp.378.2022.09.13.19.21.02; Tue, 13 Sep 2022 19:21:28 -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=@gmail.com header.s=20210112 header.b=Mzy9+Sng; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230040AbiINBkF (ORCPT + 99 others); Tue, 13 Sep 2022 21:40:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230005AbiINBj4 (ORCPT ); Tue, 13 Sep 2022 21:39:56 -0400 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46198205F1; Tue, 13 Sep 2022 18:39:54 -0700 (PDT) Received: by mail-io1-xd2f.google.com with SMTP id v128so11095151ioe.12; Tue, 13 Sep 2022 18:39:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=7GbYCslF48I7fDwOVdzpc0jOBmHVLbyPOHBU4jxAGaA=; b=Mzy9+SngTxurwyX3a/RKUi8Nv59x6UcdetgvEGUm0VMbJRdRogKLmxDyl6uplpADvm 3PrP9O5Y3tO0mQMreyunxJZFUsxAtCxwuTT4SCPibn6moks4ybyf74KRdntV1StLQuOJ K/4jhgy+TTXFPioB9pvbauPjZvPCn086lgU28nbxkGienPG73O/65fIpcrc4eSMvfoOB iG18bQyyg+/Z14kLG9+mEFrPpUzILTRM2C4s1zdTfhjtB5emTGuyVT8VEtC4Dkyg02i9 dmSJp+Wns8ABT9DyawMGqT4IbL7ZUMzzed11BsP+eDZGqGpFoUuHkY3P96ga8PtKC9ct P3ig== 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; bh=7GbYCslF48I7fDwOVdzpc0jOBmHVLbyPOHBU4jxAGaA=; b=V8bSI7Qk5s7AvUJyNTlbprSjjLPzjlwJbL4H1YJijpMH4FY7GJ1MJ6FoAloSJ4MQzA 7Bz466RfQv1wqBmzvN1MfpX5q5matDjAPrsQzCvDhvWviBsTELV1UzRfwAb+pyIhKwVH gf3JAbzIHl17Z/OFBBJbCRg6dzUeAv25oo0BGd6HZt/nuqa8e57BtO1ST1WDIKxQTsJC lL5gehSiKSOiGnsOwwp4NH7/m+Sx3P//uqAZx82mTAAKEd1F/kmmeYyrfv7RAJCGIhGp KX2yMNSB0a/56HdcOzg8qy4Snwe1YUPSHtzC0k6ZoqatKhCuZXMInJbdzqir31d+0mKb uheg== X-Gm-Message-State: ACgBeo1hR0hZ3XO/RYD6/7I328YWWOjq9mjnx01amkGKWrMMtQ4tbP/X C3smbGy7wFZ8gPFd21oIelptLfW01DA= X-Received: by 2002:a05:6638:16d6:b0:358:31d8:65d8 with SMTP id g22-20020a05663816d600b0035831d865d8mr16896674jat.137.1663119593201; Tue, 13 Sep 2022 18:39:53 -0700 (PDT) Received: from localhost ([2607:fea8:a2e2:2d00::af41]) by smtp.gmail.com with UTF8SMTPSA id s3-20020a02cf23000000b0034a6d12aa25sm6345760jar.4.2022.09.13.18.39.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Sep 2022 18:39:52 -0700 (PDT) From: Richard Acayan To: linux-arm-msm@vger.kernel.org Cc: Bjorn Andersson , Andy Gross , Konrad Dybcio , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Caleb Connolly , Joel Selvaraj Subject: [PATCH v4 2/3] clk: qcom: gcc-sdm845: use device tree match data Date: Tue, 13 Sep 2022 21:39:21 -0400 Message-Id: <20220914013922.198778-3-mailingradian@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220914013922.198778-1-mailingradian@gmail.com> References: <20220914013922.198778-1-mailingradian@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 This driver will support more than one SoC's set of clocks, and set of GDSCs. This behavior would be unclean with hard-coded static variables. Support it by grabbing clocks, GDSCs, and BCRs in the match data. Signed-off-by: Richard Acayan Reviewed-by: Krzysztof Kozlowski --- drivers/clk/qcom/gcc-sdm845.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/clk/qcom/gcc-sdm845.c b/drivers/clk/qcom/gcc-sdm845.c index 58aa3ec9a7fc..cd6e4e41dc9b 100644 --- a/drivers/clk/qcom/gcc-sdm845.c +++ b/drivers/clk/qcom/gcc-sdm845.c @@ -3574,7 +3574,7 @@ static const struct qcom_cc_desc gcc_sdm845_desc = { }; static const struct of_device_id gcc_sdm845_match_table[] = { - { .compatible = "qcom,gcc-sdm845" }, + { .compatible = "qcom,gcc-sdm845", .data = &gcc_sdm845_desc }, { } }; MODULE_DEVICE_TABLE(of, gcc_sdm845_match_table); @@ -3600,6 +3600,7 @@ static const struct clk_rcg_dfs_data gcc_dfs_clocks[] = { static int gcc_sdm845_probe(struct platform_device *pdev) { + const struct qcom_cc_desc *gcc_desc; struct regmap *regmap; int ret; @@ -3616,7 +3617,8 @@ static int gcc_sdm845_probe(struct platform_device *pdev) if (ret) return ret; - return qcom_cc_really_probe(pdev, &gcc_sdm845_desc, regmap); + gcc_desc = of_device_get_match_data(&pdev->dev); + return qcom_cc_really_probe(pdev, gcc_desc, regmap); } static struct platform_driver gcc_sdm845_driver = { -- 2.37.3