From patchwork Wed Mar 1 16:32:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 13156221 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E0C0BC7EE2F for ; Wed, 1 Mar 2023 16:34:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=l+I041EauhMVmgGSSbGBE0fg9b9sb0d9aJQhLh/8ZX8=; b=3SU6QbxpnU0VDV q0jVCPChALmLw17wViRzeKfllxLC/Q4ZoXu7wu/Xy9Rtr1PJi45+mSf+iJaCoSWDCeDan5wwtyKxU 3Dz/vaJmQF861NIaYOfiNuqDrGGmnFRyqvxu5jz2s3HjJH862+RRt95BH0GNH/oXn0g0pMlM7TdJG U0Gp+k1lGCQTXGR/1QQXmfdknCAZl/RMAq5NP+PZ/7ZCxYgKOWCq8vXTuyTq5dihMQlQhzygG5gVa iIXwPGOgWzAKV3mFkIh7ejxrgKMe4bElxR0AS+VWKORGXTIlfVbhC6WQ9usb4pcAPnocx/dJlb95f 9aAvdpFdRnbMCGkCavyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pXPOF-00GpYM-Ls; Wed, 01 Mar 2023 16:33:15 +0000 Received: from phobos.denx.de ([85.214.62.61]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pXPOB-00GpW8-0i for linux-arm-kernel@lists.infradead.org; Wed, 01 Mar 2023 16:33:13 +0000 Received: from tr.lan (ip-86-49-120-218.bb.vodafone.cz [86.49.120.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 9F71B80AE5; Wed, 1 Mar 2023 17:33:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1677688388; bh=6kCuwUfxuT8CRN0hHIyxXlK4ZNkmCusoJml8YpXRQ78=; h=From:To:Cc:Subject:Date:From; b=jnKlunVVpX7znjifAgfnJ7MZjl6CnLLj7zDyYR5+TT9vpCGyCAtMbPCZehg0Edv2M dy6XOdqwP6HC7MsLMNcdTskYZ+VbcDGIlurYzDTnprVS/Y8sX5+EFQg2IN5fFgcwlf 3mCNKTbYVZylW5HvnBp9qBygTrDdGgGnpQ068uuL6o+upC1p/sPYTbB7NCNIhRJngJ r5hvcAixrQqCM23wcnO3UN1BLPtzqBW9edri4Zn8GO+yVpXKWti9XslbzL3Afga6Wa IIhYA4YTv6PQrzaN/VyyTkcl1Fy4sxDL4mauIe1+jsuJ84BGpMN5j+vvC9y9nZ8frM L8uWjCC5BDkIg== From: Marek Vasut To: linux-clk@vger.kernel.org Cc: Marek Vasut , Peng Fan , Fabio Estevam , Adam Ford , Alexander Stein , Abel Vesa , Jacky Bai , Krzysztof Kozlowski , Laurent Pinchart , Luca Ceresoli , Lucas Stach , Marco Felsch , Michael Turquette , NXP Linux Team , Pengutronix Kernel Team , Richard Cochran , Rob Herring , Sascha Hauer , Shawn Guo , Stephen Boyd , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v7 1/5] clk: Introduce devm_clk_hw_register_gate_parent_data() Date: Wed, 1 Mar 2023 17:32:53 +0100 Message-Id: <20230301163257.49005-1-marex@denx.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230301_083311_474452_F03A03C0 X-CRM114-Status: GOOD ( 12.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add an API for clock gate that uses parent_data for the parent instead of a string parent_name. Reviewed-by: Peng Fan Reviewed-by: Fabio Estevam Tested-by: Adam Ford #imx8mp-beacon-kit Tested-by: Alexander Stein Signed-off-by: Marek Vasut Tested-by: Richard Leitner Reviewed-by: Stephen Boyd --- Cc: Abel Vesa Cc: Alexander Stein Cc: Fabio Estevam Cc: Jacky Bai Cc: Krzysztof Kozlowski Cc: Laurent Pinchart Cc: Luca Ceresoli Cc: Lucas Stach Cc: Marco Felsch Cc: Michael Turquette Cc: NXP Linux Team Cc: Peng Fan Cc: Pengutronix Kernel Team Cc: Richard Cochran Cc: Rob Herring Cc: Sascha Hauer Cc: Shawn Guo Cc: Stephen Boyd Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-clk@vger.kernel.org --- V3: New patch V4: - Rebase on next 20230223 V5: Add TB from Adam and Alexander V6: Add RB from Fabio V7: Add RB from Peng --- include/linux/clk-provider.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 842e72a5348fa..92b7c794c6272 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -608,6 +608,25 @@ struct clk *clk_register_gate(struct device *dev, const char *name, __devm_clk_hw_register_gate((dev), NULL, (name), (parent_name), NULL, \ NULL, (flags), (reg), (bit_idx), \ (clk_gate_flags), (lock)) + +/** + * devm_clk_hw_register_gate - register a gate clock with the clock framework + * @dev: device that is registering this clock + * @name: name of this clock + * @parent_data: parent clk data + * @flags: framework-specific flags for this clock + * @reg: register address to control gating of this clock + * @bit_idx: which bit in the register controls gating of this clock + * @clk_gate_flags: gate-specific flags for this clock + * @lock: shared register lock for this clock + */ +#define devm_clk_hw_register_gate_parent_data(dev, name, parent_data, flags, \ + reg, bit_idx, clk_gate_flags, \ + lock) \ + __devm_clk_hw_register_gate((dev), NULL, (name), NULL, NULL, \ + (parent_data), (flags), (reg), (bit_idx), \ + (clk_gate_flags), (lock)) + void clk_unregister_gate(struct clk *clk); void clk_hw_unregister_gate(struct clk_hw *hw); int clk_gate_is_enabled(struct clk_hw *hw);