From patchwork Tue Aug 16 13:35:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9283837 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 D1F8C600CB for ; Tue, 16 Aug 2016 13:37:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C335B28995 for ; Tue, 16 Aug 2016 13:37:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B747628B83; Tue, 16 Aug 2016 13:37:49 +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 5E4A128995 for ; Tue, 16 Aug 2016 13:37:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753854AbcHPNgx (ORCPT ); Tue, 16 Aug 2016 09:36:53 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:47477 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753549AbcHPNgr (ORCPT ); Tue, 16 Aug 2016 09:36:47 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OC0006DY8H7L330@mailout2.w1.samsung.com>; Tue, 16 Aug 2016 14:36:43 +0100 (BST) X-AuditID: cbfec7f4-f796c6d000001486-b7-57b316ebe323 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 6B.3D.05254.BE613B75; Tue, 16 Aug 2016 14:36:43 +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:43 +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 14/17] clk: samsung: clkout: samsung: Switch to new clock controller API Date: Tue, 16 Aug 2016 15:35:11 +0200 Message-id: <1471354514-24224-15-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/xq7qvxTaHGyy6pmNxa905VosrFw8x WWycsZ7VYm3vURaLqQ+fsFn8m3KD3eJA42VGi1/vjrBbvHm7hsni9QtDi/7Hr5ktdrQtZLHY 9Pgaq8XHnnusFh1/vzBaXN41h81i4u0N7BYzzu9jsjg0dS+jxdojd9ktLp5ytXg6czObxeE3 7awWP850s1i8W/2E0eLVwTYWi1W7/jA6SHts+NzE5tH0/hibx+VrF5k93t9oZfeYdf8skNvX y+Sxc9Zddo9NqzrZPDYvqfd4OfE3m8eWfqBQ35ZVjB6fN8l5bJwbGsAXxWWTkpqTWZZapG+X wJWx73JlwSe+ipWf+hkbGLfxdDFyckgImEjc2zSVBcIWk7hwbz1bFyMXh5DAUkaJpmvbmCCc RiaJs28vs4FUsQkYS2xevgSsSkRgFZvEwr9rwaqYBV4ySpw9+YsJpEpYIELibU8/I4jNIqAq 0fHiOjOIzSvgIXH+djMTxD45iZPHJrOC2JxA8XMXGsFqhATcJU6ub2eZwMi7gJFhFaNoamly QXFSeq6hXnFibnFpXrpecn7uJkZIzH3Zwbj4mNUhRgEORiUe3pMMm8KFWBPLiitzDzFKcDAr ifAeFt0cLsSbklhZlVqUH19UmpNafIhRmoNFSZx37q73IUIC6YklqdmpqQWpRTBZJg5OqQbG 5MZHfyfccH+Z9ehFZ8U8Bt7ZpyQ0FnGLrpMqmaUR/ji10Nv64vTfxZmhZ9dNvlJg7pZvGHRS 8gC7XviG+/uS2lpC32U3a3x//+vX2lmSzInzFuoJW/Xcv3TI64bRus1L5Faf+XY48KuWPMMn 2Ue2jCmmG6pDDBxv82+ryVeJTe3luHZ/8ecyJZbijERDLeai4kQA1fcxY7UCAAA= 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/samsung/clk-exynos-clkout.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/clk/samsung/clk-exynos-clkout.c b/drivers/clk/samsung/clk-exynos-clkout.c index 96fab6cfb202..9c57a623e741 100644 --- a/drivers/clk/samsung/clk-exynos-clkout.c +++ b/drivers/clk/samsung/clk-exynos-clkout.c @@ -26,6 +26,7 @@ #define EXYNOS5_CLKOUT_MUX_MASK 0x1f struct exynos_clkout { + struct clk_ctrl *clk_ctrl; struct clk_gate gate; struct clk_mux mux; spinlock_t slock; @@ -66,6 +67,10 @@ static void __init exynos_clkout_init(struct device_node *node, u32 mux_mask) if (!clkout) return; + clkout->clk_ctrl = clk_ctrl_register(NULL); + if (IS_ERR(clkout->clk_ctrl)) + goto free_clkout; + spin_lock_init(&clkout->slock); parent_count = 0; @@ -84,7 +89,7 @@ static void __init exynos_clkout_init(struct device_node *node, u32 mux_mask) } if (!parent_count) - goto free_clkout; + goto free_ctrl; clkout->reg = of_iomap(node, 0); if (!clkout->reg) @@ -100,7 +105,7 @@ static void __init exynos_clkout_init(struct device_node *node, u32 mux_mask) clkout->mux.shift = EXYNOS_CLKOUT_MUX_SHIFT; clkout->mux.lock = &clkout->slock; - clkout->clk_table[0] = clk_register_composite(NULL, "clkout", + clkout->clk_table[0] = clk_register_composite(NULL, clkout->clk_ctrl, "clkout", parent_names, parent_count, &clkout->mux.hw, &clk_mux_ops, NULL, NULL, &clkout->gate.hw, &clk_gate_ops, CLK_SET_RATE_PARENT @@ -126,6 +131,8 @@ clks_put: for (i = 0; i < EXYNOS_CLKOUT_PARENTS; ++i) if (!IS_ERR(parents[i])) clk_put(parents[i]); +free_ctrl: + clk_ctrl_unregister(clkout->clk_ctrl); free_clkout: kfree(clkout);