From patchwork Tue Aug 16 13:35:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9284025 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 66A0160839 for ; Tue, 16 Aug 2016 14:13:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BBE428EBD for ; Tue, 16 Aug 2016 14:13:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 59E5328E99; Tue, 16 Aug 2016 14:13:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10C3928EBD for ; Tue, 16 Aug 2016 14:13:00 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 438672668F0; Tue, 16 Aug 2016 16:12:59 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 9B5DE2668F1; Tue, 16 Aug 2016 16:08:23 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id E9C292668BC; Tue, 16 Aug 2016 16:08:18 +0200 (CEST) Received: from mailout3.w1.samsung.com (mailout3.w1.samsung.com [210.118.77.13]) by alsa0.perex.cz (Postfix) with ESMTP id 74B752668CF for ; Tue, 16 Aug 2016 15:36:38 +0200 (CEST) Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OC000FF48H0OW30@mailout3.w1.samsung.com> for alsa-devel@alsa-project.org; Tue, 16 Aug 2016 14:36:36 +0100 (BST) X-AuditID: cbfec7f5-f792a6d000001302-4b-57b316e4d7a2 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 18.AB.04866.4E613B75; Tue, 16 Aug 2016 14:36:36 +0100 (BST) Received: from AMDC2174.DIGITAL.local ([106.120.53.17]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OC000MRK8GNJF30@eusync3.samsung.com>; Tue, 16 Aug 2016 14:36:36 +0100 (BST) From: Krzysztof Kozlowski To: Michael Turquette , Stephen Boyd , Stephen Warren , Lee Jones , Eric Anholt , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Krzysztof Kozlowski , Sylwester Nawrocki , Tomasz Figa , Kukjin Kim , Russell King , Mark Brown , linux-clk@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-i2c@vger.kernel.org, alsa-devel@alsa-project.org Date: Tue, 16 Aug 2016 15:35:05 +0200 Message-id: <1471354514-24224-9-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1471354514-24224-1-git-send-email-k.kozlowski@samsung.com> References: <1471354514-24224-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEIsWRmVeSWpSXmKPExsVy+t/xq7pPxDaHG1z+w2Vxa905VosrFw8x WWycsZ7VYm3vURaLqQ+fsFn8m3KD3eJA42VGi1/vjrBbvHm7hsni9QtDi/7Hr5ktdrQtZLHY 9Pgaq8XHnnusFh1/vzBaXN41h81i4u0N7BYzzu9jsjg0dS+jxdojd9ktLp5ytXg6czObxeE3 7awWP850s1i8W/2E0eLVwTYWi1W7/jA6SHts+NzE5tH0/hibx+VrF5k93t9oZfeYdf8skNvX y+Sxc9Zddo9NqzrZPDYvqfd4OfE3m8eWfqBQ35ZVjB6fN8l5bJwbGsAXxWWTkpqTWZZapG+X wJUxqbmRqeCzdMX5ZS9YGhhPiHcxcnBICJhILDrE2MXICWSKSVy4t56ti5GLQ0hgKaPE/CuP mCCcRiaJez9vglWxCRhLbF6+BKxKRGAVm8TCv2vBqpgFXjJKnD35iwmkSljAS+LvontsIDaL gKrEj+2Lwbp5Bdwl9jUfYIfYJydx8thkVhCbU8BD4tyFRmYQWwio5uT6dpYJjLwLGBlWMYqm liYXFCel5xrpFSfmFpfmpesl5+duYoTE3NcdjEuPWR1iFOBgVOLhPcGwKVyINbGsuDL3EKME B7OSCO9h0c3hQrwpiZVVqUX58UWlOanFhxilOViUxHln7nofIiSQnliSmp2aWpBaBJNl4uCU amBckTdLtHzr2xvnveff/+2mIu4raTFhy9cfO7fIREczc3akPU6sY5i/I/mz6TrJLx4pi75Y MORWKGTtn3hCe5udpIxuyuRdv/4sEnCwNpl2+PxZud1ZSSFMS0Rt86J3WGYv+Wxlt+VTce8s vdjN+kWvb2kUM0jy6XzODvhwen9z1yQVJZVX+a+VWIozEg21mIuKEwGWCxbltQIAAA== Cc: a.hajda@samsung.com, Javier Martinez Canillas , Charles Keepax , Bartlomiej Zolnierkiewicz , Marek Szyprowski Subject: [alsa-devel] [RFC 08/17] clk: fixed-factor: Switch to new clock controller API X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Allocate a clock controller and use new clk_register_with_ctrl() API. Signed-off-by: Krzysztof Kozlowski --- drivers/clk/clk-fixed-factor.c | 11 +++++++---- drivers/clk/samsung/clk.c | 2 +- include/linux/clk-provider.h | 4 +++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c index 4db3be214077..921a99b6e421 100644 --- a/drivers/clk/clk-fixed-factor.c +++ b/drivers/clk/clk-fixed-factor.c @@ -69,6 +69,7 @@ const struct clk_ops clk_fixed_factor_ops = { EXPORT_SYMBOL_GPL(clk_fixed_factor_ops); struct clk_hw *clk_hw_register_fixed_factor(struct device *dev, + struct clk_ctrl *ctrl, const char *name, const char *parent_name, unsigned long flags, unsigned int mult, unsigned int div) { @@ -103,13 +104,14 @@ struct clk_hw *clk_hw_register_fixed_factor(struct device *dev, } EXPORT_SYMBOL_GPL(clk_hw_register_fixed_factor); -struct clk *clk_register_fixed_factor(struct device *dev, const char *name, +struct clk *clk_register_fixed_factor(struct device *dev, + struct clk_ctrl *ctrl, const char *name, const char *parent_name, unsigned long flags, unsigned int mult, unsigned int div) { struct clk_hw *hw; - hw = clk_hw_register_fixed_factor(dev, name, parent_name, flags, mult, + hw = clk_hw_register_fixed_factor(dev, ctrl, name, parent_name, flags, mult, div); if (IS_ERR(hw)) return ERR_CAST(hw); @@ -176,8 +178,9 @@ void __init of_fixed_factor_clk_setup(struct device_node *node) if (of_match_node(set_rate_parent_matches, node)) flags |= CLK_SET_RATE_PARENT; - clk = clk_register_fixed_factor(NULL, clk_name, parent_name, flags, - mult, div); + /* TODO: convert to clk_ctrl */ + clk = clk_register_fixed_factor(NULL, NULL, clk_name, parent_name, + flags, mult, div); if (!IS_ERR(clk)) of_clk_add_provider(node, of_clk_src_simple_get, clk); } diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c index 1a296bbabd47..7bfd895781c5 100644 --- a/drivers/clk/samsung/clk.c +++ b/drivers/clk/samsung/clk.c @@ -176,7 +176,7 @@ void __init samsung_clk_register_fixed_factor(struct samsung_clk_provider *ctx, unsigned int idx; for (idx = 0; idx < nr_clk; idx++, list++) { - clk = clk_register_fixed_factor(NULL, list->name, + clk = clk_register_fixed_factor(NULL, ctx->clk_ctrl, list->name, list->parent_name, list->flags, list->mult, list->div); if (IS_ERR(clk)) { pr_err("%s: failed to register clock %s\n", __func__, diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index f5f062d267a9..26171815948e 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -545,11 +545,13 @@ struct clk_fixed_factor { #define to_clk_fixed_factor(_hw) container_of(_hw, struct clk_fixed_factor, hw) extern const struct clk_ops clk_fixed_factor_ops; -struct clk *clk_register_fixed_factor(struct device *dev, const char *name, +struct clk *clk_register_fixed_factor(struct device *dev, + struct clk_ctrl *ctrl, const char *name, const char *parent_name, unsigned long flags, unsigned int mult, unsigned int div); void clk_unregister_fixed_factor(struct clk *clk); struct clk_hw *clk_hw_register_fixed_factor(struct device *dev, + struct clk_ctrl *ctrl, const char *name, const char *parent_name, unsigned long flags, unsigned int mult, unsigned int div); void clk_hw_unregister_fixed_factor(struct clk_hw *hw);