From patchwork Mon Jun 10 13:24:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yadwinder Singh Brar X-Patchwork-Id: 2749491 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D3E979F39E for ; Wed, 19 Jun 2013 13:32:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EAB6F20315 for ; Wed, 19 Jun 2013 13:32:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B1E6A202F4 for ; Wed, 19 Jun 2013 13:32:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756678Ab3FSNca (ORCPT ); Wed, 19 Jun 2013 09:32:30 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:61868 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756566Ab3FSNc3 (ORCPT ); Wed, 19 Jun 2013 09:32:29 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MON00GH66Y4S640@mailout3.samsung.com> for linux-samsung-soc@vger.kernel.org; Wed, 19 Jun 2013 22:32:28 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.124]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 99.C4.11618.BE2B1C15; Wed, 19 Jun 2013 22:32:28 +0900 (KST) X-AuditID: cbfee691-b7fef6d000002d62-83-51c1b2eb6b3c Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 78.00.21068.BE2B1C15; Wed, 19 Jun 2013 22:32:27 +0900 (KST) Received: from localhost.localdomain ([107.108.83.81]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MON00DH96XUF820@mmp2.samsung.com>; Wed, 19 Jun 2013 22:32:27 +0900 (KST) From: Yadwinder Singh Brar To: linux-samsung-soc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, kgene.kim@samsung.com, mturquette@linaro.org, thomas.abraham@linaro.org, dianders@chromium.org, t.figa@samsung.com, vikas.sajjan@linaro.org, abrestic@chromium.org, Yadwinder Singh Brar Subject: [PATCH v6 1/7] clk: samsung: Introduce a common samsung_clk_pll struct Date: Mon, 10 Jun 2013 18:54:13 +0530 Message-id: <1370870659-10929-2-git-send-email-yadi.brar@samsung.com> X-Mailer: git-send-email 1.7.0.4 In-reply-to: <1370870659-10929-1-git-send-email-yadi.brar@samsung.com> References: <1370870659-10929-1-git-send-email-yadi.brar@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpikeLIzCtJLcpLzFFi42JZI2JSo/tm08FAg/eqFivf/2W0OLvsIJtF 74KrbBabHl9jtZhxfh+TxdMJF9ks1s94zWJxbMYSRosnj7YxW8yZ/o7JgctjdsNFFo871/aw eWxeUu/Rt2UVo8fnTXIBrFFcNimpOZllqUX6dglcGZ+au1kKropU9C9fydLA+EWgi5GTQ0LA ROL+9mfMELaYxIV769m6GLk4hASWMkq8fLKQFabo6eRORojEdEaJeQ17WUASQgJtTBIHvuV1 MXJwsAkYSbw6ZgcSFhFQlfjctoAdpJ5ZoIFJomvTcbANwgL+Egt2H2QBqWcBKtq5gQ0kzCvg KvF83i5GiF0KEq3LDrGD2JwCbhIztkPUCAHVNJz8B3aDhMAmdomPPVvBjmMREJD4NvkQ2EwJ AVmJTQegnpGUOLjiBssERuEFjAyrGEVTC5ILipPSi0z1ihNzi0vz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HOXWz77+Jb+yM3Km7s7F9Ls/F9PN7D7LyPDGqfvK+NuvzTA9P+7kR6gHyWpn6 QfcVlS9OV8g91aNsOHfTuTa/toO8c40N9q+bIVYXUb/zbUXb57NZki1W1jurZIRWXdigxFKc kWioxVxUnAgAsjX+ovMCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, DATE_IN_PAST_96_XX, RCVD_IN_DNSWL_HI, 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 unifies clk strutures used for PLL35xx & PLL36xx and adding an extra member lock_reg, so that common code can be factored out. Signed-off-by: Yadwinder Singh Brar Reviewed-by: Tomasz Figa --- drivers/clk/samsung/clk-pll.c | 30 ++++++++++++------------------ 1 files changed, 12 insertions(+), 18 deletions(-) diff --git a/drivers/clk/samsung/clk-pll.c b/drivers/clk/samsung/clk-pll.c index 89135f6..8224bde 100644 --- a/drivers/clk/samsung/clk-pll.c +++ b/drivers/clk/samsung/clk-pll.c @@ -13,6 +13,14 @@ #include "clk.h" #include "clk-pll.h" +struct samsung_clk_pll { + struct clk_hw hw; + void __iomem *lock_reg; + void __iomem *con_reg; +}; + +#define to_clk_pll(_hw) container_of(_hw, struct samsung_clk_pll, hw) + /* * PLL35xx Clock Type */ @@ -24,17 +32,10 @@ #define PLL35XX_PDIV_SHIFT (8) #define PLL35XX_SDIV_SHIFT (0) -struct samsung_clk_pll35xx { - struct clk_hw hw; - const void __iomem *con_reg; -}; - -#define to_clk_pll35xx(_hw) container_of(_hw, struct samsung_clk_pll35xx, hw) - static unsigned long samsung_pll35xx_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { - struct samsung_clk_pll35xx *pll = to_clk_pll35xx(hw); + struct samsung_clk_pll *pll = to_clk_pll(hw); u32 mdiv, pdiv, sdiv, pll_con; u64 fvco = parent_rate; @@ -56,7 +57,7 @@ static const struct clk_ops samsung_pll35xx_clk_ops = { struct clk * __init samsung_clk_register_pll35xx(const char *name, const char *pname, const void __iomem *con_reg) { - struct samsung_clk_pll35xx *pll; + struct samsung_clk_pll *pll; struct clk *clk; struct clk_init_data init; @@ -100,17 +101,10 @@ struct clk * __init samsung_clk_register_pll35xx(const char *name, #define PLL36XX_PDIV_SHIFT (8) #define PLL36XX_SDIV_SHIFT (0) -struct samsung_clk_pll36xx { - struct clk_hw hw; - const void __iomem *con_reg; -}; - -#define to_clk_pll36xx(_hw) container_of(_hw, struct samsung_clk_pll36xx, hw) - static unsigned long samsung_pll36xx_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { - struct samsung_clk_pll36xx *pll = to_clk_pll36xx(hw); + struct samsung_clk_pll *pll = to_clk_pll(hw); u32 mdiv, pdiv, sdiv, kdiv, pll_con0, pll_con1; u64 fvco = parent_rate; @@ -135,7 +129,7 @@ static const struct clk_ops samsung_pll36xx_clk_ops = { struct clk * __init samsung_clk_register_pll36xx(const char *name, const char *pname, const void __iomem *con_reg) { - struct samsung_clk_pll36xx *pll; + struct samsung_clk_pll *pll; struct clk *clk; struct clk_init_data init;