From patchwork Sat Jun 8 17:34:16 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: 2736241 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 DE52EC0AB1 for ; Mon, 17 Jun 2013 17:42:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 97ED3204F8 for ; Mon, 17 Jun 2013 17:42:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3651F204F9 for ; Mon, 17 Jun 2013 17:42:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754745Ab3FQRmf (ORCPT ); Mon, 17 Jun 2013 13:42:35 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:48187 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754695Ab3FQRmd (ORCPT ); Mon, 17 Jun 2013 13:42:33 -0400 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MOJ00MIWT6S1550@mailout1.samsung.com> for linux-samsung-soc@vger.kernel.org; Tue, 18 Jun 2013 02:42:32 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.122]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 4F.E0.17404.88A4FB15; Tue, 18 Jun 2013 02:42:32 +0900 (KST) X-AuditID: cbfee68d-b7f096d0000043fc-49-51bf4a88eaf2 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 32.06.21068.78A4FB15; Tue, 18 Jun 2013 02:42:31 +0900 (KST) Received: from localhost.localdomain ([107.108.83.81]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MOJ004JHT6L7730@mmp1.samsung.com>; Tue, 18 Jun 2013 02:42:31 +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 v5 1/7] clk: samsung: Introduce a common samsung_clk_pll struct. Date: Sat, 08 Jun 2013 23:04:16 +0530 Message-id: <1370712862-10501-2-git-send-email-yadi.brar@samsung.com> X-Mailer: git-send-email 1.7.0.4 In-reply-to: <1370712862-10501-1-git-send-email-yadi.brar@samsung.com> References: <1370712862-10501-1-git-send-email-yadi.brar@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphkeLIzCtJLcpLzFFi42JZI2JSpdvhtT/QYOYxdouV7/8yWpxddpDN onfBVTaLTY+vsVrMOL+PyeLphItsFutnvGaxODZjCaPFk0fbmC3mTH/H5MDlMbvhIovHnWt7 2Dw2L6n36NuyitHj8ya5ANYoLpuU1JzMstQifbsEroxPzd0sBVdFKvqXr2RpYPwi0MXIySEh YCIxd0oPO4QtJnHh3nq2LkYuDiGBpYwS3b+XMcIUdd76yQKRWMQo0fr/HCuE08Yk8Wd3B1AV BwebgJHEq2N2IA0iAqoSn9sWsIPUMAs0MEl0bTrODJIQFgiQuP/yHdhUFqCiyTMPgq3mFXCV uDl7OhvENgWJ1mWHwOKcAm4Sy05eAJsvBFSz6LI3yEwJgW3sEltbIGayCAhIfJt8iAWkRkJA VmLTAWaIMZISB1fcYJnAKLyAkWEVo2hqQXJ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p+9vX/Js/tv45rvHf/yiZm1fLGMc6/71Ku/9FW33fruHutf/8nILu7xfqGK OEN3ezPnO84eqSsSZi2Yl/RoWmHerGVvbmV1n9uRaP7OYAZfrZrgtCme1++/flVhWZ/0cUam EktxRqKhFnNRcSIApbPsS/QCAAA= 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.6 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 --- 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;