From patchwork Tue Jun 11 09:31:06 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: 2754101 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 61D7EC0AB1 for ; Thu, 20 Jun 2013 09:39:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3509220451 for ; Thu, 20 Jun 2013 09:39:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CEE6A2044C for ; Thu, 20 Jun 2013 09:39:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757434Ab3FTJja (ORCPT ); Thu, 20 Jun 2013 05:39:30 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:53264 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756231Ab3FTJj3 (ORCPT ); Thu, 20 Jun 2013 05:39: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 <0MOO00CMKQTS9JY0@mailout3.samsung.com> for linux-samsung-soc@vger.kernel.org; Thu, 20 Jun 2013 18:39:28 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.125]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 97.D9.11618.0DDC2C15; Thu, 20 Jun 2013 18:39:28 +0900 (KST) X-AuditID: cbfee691-b7fef6d000002d62-35-51c2cdd01746 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 40.62.21068.0DDC2C15; Thu, 20 Jun 2013 18:39:28 +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 <0MOO006IBQTFAG00@mmp1.samsung.com>; Thu, 20 Jun 2013 18:39: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 v7 01/11] clk: samsung: Introduce a common samsung_clk_pll struct Date: Tue, 11 Jun 2013 15:01:06 +0530 Message-id: <1370943076-13461-2-git-send-email-yadi.brar@samsung.com> X-Mailer: git-send-email 1.7.0.4 In-reply-to: <1370943076-13461-1-git-send-email-yadi.brar@samsung.com> References: <1370943076-13461-1-git-send-email-yadi.brar@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplkeLIzCtJLcpLzFFi42JZI2JSq3vh7KFAgzmfRCxWvv/LaHF22UE2 i94FV9ksNj2+xmox4/w+JounEy6yWayf8ZrF4tiMJYwWTx5tY7aYM/0dkwOXx+yGiywed67t YfPYvKTeo2/LKkaPz5vkAlijuGxSUnMyy1KL9O0SuDJeHF/KUtAiWnG+t4uxgXGeYBcjJ4eE gInEk+a5zBC2mMSFe+vZuhi5OIQEljJKbPvVwwJT9O9LHxNEYhFQov8WVFUbk0T/rSNADgcH m4CRxKtjdiANIgKqEp/bFrCD1DALNDBJdG06DrZCWCBYYurSjawgNgtQUd+pNUwgNq+Aq8SV 9Y+ZILYpSLQuO8QOYnMKuEl87LkLZgsB1dzb0Am2WEJgE7vE3x8/2CAGCUh8m3yIBeQICQFZ iU0HoN6RlDi44gbLBEbhBYwMqxhFUwuSC4qT0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J551Rvd9C7X8a/YoP//VPnfrZLyRZtdg1mXB649zVvJVPnh5XPhLbNWrqn53qd Psf6I8Ynd5dFTm1UFooSzRB9tc/+4Yx5V3kt9fquXA/8GvORy77as5v10FHdkwIZDJFKLMUZ iYZazEXFiQBv7jQY9QIAAA== 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. Reviewed-by: Tomasz Figa 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;