From patchwork Tue Aug 16 13:35:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9283917 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 75F0D600CB for ; Tue, 16 Aug 2016 13:41:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 64C9B28B83 for ; Tue, 16 Aug 2016 13:41:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5905E28C11; Tue, 16 Aug 2016 13:41:14 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED3B428B83 for ; Tue, 16 Aug 2016 13:41:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753595AbcHPNk6 (ORCPT ); Tue, 16 Aug 2016 09:40:58 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:59556 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753185AbcHPNge (ORCPT ); Tue, 16 Aug 2016 09:36:34 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OC000IF78GVAU30@mailout1.w1.samsung.com>; Tue, 16 Aug 2016 14:36:31 +0100 (BST) X-AuditID: cbfec7f5-f792a6d000001302-29-57b316df75ba Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 77.9B.04866.FD613B75; Tue, 16 Aug 2016 14:36:31 +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:30 +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 Cc: Marek Szyprowski , Charles Keepax , Javier Martinez Canillas , a.hajda@samsung.com, Bartlomiej Zolnierkiewicz Subject: [RFC 03/17] clk: s2mps11: Switch to new clock controller API Date: Tue, 16 Aug 2016 15:35:00 +0200 Message-id: <1471354514-24224-4-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/xq7r3xTaHG5yaxWZxa905VosrFw8x WWycsZ7VYm3vURaLqQ+fsFn8m3KD3eJA42VGi1/vjrBbvHm7hsni9QtDi/7Hr5ktdrQtZLHY 9Pgaq8XHnnusFh1/vzBaXN41h81i4u0N7BYzzu9jsjg0dS+jxdojd9ktLp5ytXg6czObxeE3 7awWP850s1i8W/2E0eLVwTYWi1W7/jA6SHts+NzE5tH0/hibx+VrF5k93t9oZfeYdf8skNvX y+Sxc9Zddo9NqzrZPDYvqfd4OfE3m8eWfqBQ35ZVjB6fN8l5bJwbGsAXxWWTkpqTWZZapG+X wJWx+No+5oK9vBVP3m5nbmDs5+5i5OSQEDCRuHN2MQuELSZx4d56ti5GLg4hgaWMEoevnmCC cBqZJO6t2scGUsUmYCyxefkSsCoRgVVsEgv/rgWrYhZ4yShx9uQvIIeDQ1jAVWLNVhmQBhYB VYn9/TsZQWxeAXeJru5/7BDr5CROHpvMCmJzCnhInLvQyAxiCwHVnFzfzjKBkXcBI8MqRtHU 0uSC4qT0XCO94sTc4tK8dL3k/NxNjJCY+7qDcekxq0OMAhyMSjy8Jxg2hQuxJpYVV+YeYpTg YFYS4T0sujlciDclsbIqtSg/vqg0J7X4EKM0B4uSOO/MXe9DhATSE0tSs1NTC1KLYLJMHJxS DYzMse1uyeu/h89yMmPyKA/qCfzvOL/OyzZCr1etyfJaKGfzw90MT6bPqd9oI3ArQCn58ven UyNMOyOnNJ/1yhazXqtz0NWrSahfZ1L/w195Yd/NU/8se8p34N6T7Cl8bFGzkz/dMmrJ8Jay 8N/Fel9rxrmTiyeJMdx5bvX33dFW1gPJmcrVV5RYijMSDbWYi4oTAbKwRiK1AgAA Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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-s2mps11.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c index fbaa84a33c46..881f1e226867 100644 --- a/drivers/clk/clk-s2mps11.c +++ b/drivers/clk/clk-s2mps11.c @@ -41,6 +41,7 @@ struct s2mps11_clk { struct clk_hw hw; struct clk *clk; struct clk_lookup *lookup; + struct clk_ctrl *clk_ctrl; u32 mask; unsigned int reg; }; @@ -176,6 +177,10 @@ static int s2mps11_clk_probe(struct platform_device *pdev) if (IS_ERR(s2mps11_clks->clk_np)) return PTR_ERR(s2mps11_clks->clk_np); + s2mps11_clks->clk_ctrl = clk_ctrl_register(&pdev->dev); + if (IS_ERR(s2mps11_clks->clk_ctrl)) + return PTR_ERR(s2mps11_clks->clk_ctrl); // FIXME: use devm-like + for (i = 0; i < S2MPS11_CLKS_NUM; i++) { if (i == S2MPS11_CLK_CP && hwid == S2MPS14X) continue; /* Skip clocks not present in some devices */ @@ -184,7 +189,8 @@ static int s2mps11_clk_probe(struct platform_device *pdev) s2mps11_clks[i].mask = 1 << i; s2mps11_clks[i].reg = s2mps11_reg; - s2mps11_clks[i].clk = devm_clk_register(&pdev->dev, + s2mps11_clks[i].clk = devm_clk_register_with_ctrl(&pdev->dev, + s2mps11_clks->clk_ctrl, &s2mps11_clks[i].hw); if (IS_ERR(s2mps11_clks[i].clk)) { dev_err(&pdev->dev, "Fail to register : %s\n", @@ -233,6 +239,8 @@ static int s2mps11_clk_remove(struct platform_device *pdev) clkdev_drop(s2mps11_clks[i].lookup); } + clk_ctrl_unregister(s2mps11_clks->clk_ctrl); + return 0; }