From patchwork Wed Jun 18 08:40:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 4373821 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7F595BEEAA for ; Wed, 18 Jun 2014 08:43:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A1ACA202DD for ; Wed, 18 Jun 2014 08:43:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 97CFA20218 for ; Wed, 18 Jun 2014 08:43:13 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WxBQC-0002oM-Se; Wed, 18 Jun 2014 08:40:44 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WxBPw-0002C6-OM for linux-arm-kernel@lists.infradead.org; Wed, 18 Jun 2014 08:40:30 +0000 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N7C007MMW2SMH10@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 18 Jun 2014 17:40:04 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.115]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 52.B9.14704.46051A35; Wed, 18 Jun 2014 17:40:04 +0900 (KST) X-AuditID: cbfee68f-b7fef6d000003970-96-53a15064fac2 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 04.00.08203.46051A35; Wed, 18 Jun 2014 17:40:04 +0900 (KST) Received: from chan.10.32.193.11 ([10.252.81.195]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N7C0075WW2R2M91@mmp2.samsung.com>; Wed, 18 Jun 2014 17:40:04 +0900 (KST) From: Chanwoo Choi To: t.figa@samsung.com, kgene.kim@samsung.com, thomas.ab@samsung.com, viresh.kumar@linaro.org, mturquette@linaro.org, shawn.guo@linaro.org Subject: [PATCHv2 2/3] clk: samsung: exynos3250: Use cpu-clock provider type to support cpufreq Date: Wed, 18 Jun 2014 17:40:01 +0900 Message-id: <1403080802-2794-3-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1403080802-2794-1-git-send-email-cw00.choi@samsung.com> References: <1403080802-2794-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupgkeLIzCtJLcpLzFFi42JZI2JSrJsSsDDY4PQMJYvrX56zWvQuuMpm cbbpDbvFpsfXWC0u75rDZvG59wijxYzz+5gsnk64yGbxdN0SZov1M16zWHQsY7TY+NXDgcfj zrU9bB6bl9R79G1ZxejxeZNcAEsUl01Kak5mWWqRvl0CV8arRw9YCjaLVPTsvsDWwHhQsIuR k0NCwETix8QmNghbTOLCvfVANheHkMBSRolbb1rYYYraDr9lhUhMZ5S4fOQjC4TTxCTxYMUT sHY2AS2J/S9ugNkiAj2MEks77EGKmAV2MkrMv9rGDJIQFkiU+LR8AxOIzSKgKtHw8RfYCl4B F4nDJ5dCrZOT+LDnEZDNwcEp4Cqx8kMISFgIqGRP70WwKyQEdrFLnPy2gR1ijoDEt8mHWEDq JQRkJTYdYIYYIylxcMUNlgmM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tcpsqBp+rIirzmT X1gmNvxfunpqfaXVze86khN37lhxboLzy1d7X/NfOxXc4pVusadO4I3yYY6P/yNmu0qaLOmv MzDYKLPa8tsE07k1l693nuHx64xjOb6I51jJ8hb1I4nGrG8rXu5l8L2hvdcsxeictmiNKbOG 4cnjSizFGYmGWsxFxYkAkVdfVvgCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140618_014029_130747_BB086639 X-CRM114-Status: UNSURE ( 9.21 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.0 (------) Cc: linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, cw00.choi@samsung.com, kyungmin.park@samsung.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch use cpu-clock provider type to support cpufreq for Exynos3250. The clock-exynos3250.c didn't add separate 'arm_clk' divider for 'div_core2'. The 'div_core2' can be represented as a cpu-clock type and then use 'div_core2' directly to change cpu clock. Signed-off-by: Chanwoo Choi Acked-by: Kyungmin Park --- drivers/clk/samsung/clk-exynos3250.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/clk/samsung/clk-exynos3250.c b/drivers/clk/samsung/clk-exynos3250.c index 775a4ee..60ce369 100644 --- a/drivers/clk/samsung/clk-exynos3250.c +++ b/drivers/clk/samsung/clk-exynos3250.c @@ -357,8 +357,10 @@ static struct samsung_mux_clock mux_clks[] __initdata = { MUX(CLK_MOUT_MPLL_USER_C, "mout_mpll_user_c", mout_mpll_user_p, SRC_CPU, 24, 1), MUX(CLK_MOUT_HPM, "mout_hpm", mout_hpm_p, SRC_CPU, 20, 1), - MUX(CLK_MOUT_CORE, "mout_core", mout_core_p, SRC_CPU, 16, 1), - MUX(CLK_MOUT_APLL, "mout_apll", mout_apll_p, SRC_CPU, 0, 1), + MUX_F(CLK_MOUT_CORE, "mout_core", mout_core_p, SRC_CPU, 16, 1, 0, + CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_APLL, "mout_apll", mout_apll_p, SRC_CPU, 0, 1, + CLK_SET_RATE_PARENT, 0), }; static struct samsung_div_clock div_clks[] __initdata = { @@ -447,11 +449,13 @@ static struct samsung_div_clock div_clks[] __initdata = { /* DIV_CPU0 */ DIV(CLK_DIV_CORE2, "div_core2", "div_core", DIV_CPU0, 28, 3), - DIV(CLK_DIV_APLL, "div_apll", "mout_apll", DIV_CPU0, 24, 3), + DIV_F(CLK_DIV_APLL, "div_apll", "mout_apll", DIV_CPU0, 24, 3, + CLK_GET_RATE_NOCACHE, CLK_DIVIDER_READ_ONLY), DIV(CLK_DIV_PCLK_DBG, "div_pclk_dbg", "div_core2", DIV_CPU0, 20, 3), DIV(CLK_DIV_ATB, "div_atb", "div_core2", DIV_CPU0, 16, 3), DIV(CLK_DIV_COREM, "div_corem", "div_core2", DIV_CPU0, 4, 3), - DIV(CLK_DIV_CORE, "div_core", "mout_core", DIV_CPU0, 0, 3), + DIV_F(CLK_DIV_CORE, "div_core", "mout_core", DIV_CPU0, 0, 3, + CLK_GET_RATE_NOCACHE, CLK_DIVIDER_READ_ONLY), /* DIV_CPU1 */ DIV(CLK_DIV_HPM, "div_hpm", "div_copy", DIV_CPU1, 4, 3), @@ -820,6 +824,8 @@ static void __init exynos3_cmu_init(struct device_node *np, samsung_clk_register_mux(ctx, mux_clks, ARRAY_SIZE(mux_clks)); samsung_clk_register_div(ctx, div_clks, ARRAY_SIZE(div_clks)); samsung_clk_register_gate(ctx, gate_clks, ARRAY_SIZE(gate_clks)); + exynos_register_cpu_clock(ctx, 0, CLK_DIV_CORE2, "armclk", + mout_core_p[0], mout_core_p[1], np); if (soc == EXYNOS3472) { samsung_clk_register_mux(ctx, exynos3472_mux_clks,