From patchwork Fri Aug 4 09:34:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 109390 Delivered-To: patch@linaro.org Received: by 10.182.109.195 with SMTP id hu3csp1121269obb; Fri, 4 Aug 2017 02:35:29 -0700 (PDT) X-Received: by 10.98.29.73 with SMTP id d70mr1774395pfd.8.1501839329718; Fri, 04 Aug 2017 02:35:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501839329; cv=none; d=google.com; s=arc-20160816; b=xYZAPYqW2dYcJyG0PBXqq7iKh/TnA6yMiPBBjDyv0gpjoIpDzKCz3xLltvnwktG0q9 JJ5ovGLN2etZh7T8bIxYXvMZq+iUmNTg1dosoEafCoIVtHB04Bpvbqa9DYoZiKvYnYRj aCNv2imkjarct30Y5NclBCk24GWu9Orsf0Ewl+zR2fTWuOvJ+/BKsywoB5wo4U6tYIpb htopDAus84D8hRx9cuf3hl/qejkZNP7/x3xo4fpJJfVkTin+k/I7wkNBwqSdmt2tjwzO aKJAd5a+pL1lakLM4TIsRnFJo2XxFy6F49KHQN4Mr5JLV5RcWdN86dPxdKLy17ZR0ina LHNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=oppxM/6Euuq6e+RKreHzrookKeewJZIFrNcc780gacU=; b=UkaJuTny0rtrlhqQUkReVWPinBSn4mEpW73cOmuSOpJGvEJddrKtx3dboEvKaM/zCE TB/5wXzdm/m7npVH3NfIfz689wEijt0FlUA6a0mbc1GjClllcyRsjsEP8FOjGZSeL5er Mp0NVu1AHgG6ZzMeMvqpXZ/TdWyrVR0sYSpsV2xipo8bGuH4MnOjdBQibMqpBDqsBkzy FjTUqlff7LjKlcaRIHUrxNGQNGuL+mExkERY3UQTmNJanyB6jo2oiYx/wDVMxCQ9cJEZ mCYtHBPDTZbcryhQe6CgKjKIc3nit+ZPu49PUipIcj8yEwJENyKkWWWCcoyITs4IWWoT KxYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k2si735480pgs.179.2017.08.04.02.35.29; Fri, 04 Aug 2017 02:35:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752105AbdHDJf2 (ORCPT + 4 others); Fri, 4 Aug 2017 05:35:28 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:15761 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752095AbdHDJfY (ORCPT ); Fri, 4 Aug 2017 05:35:24 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OU500F45MMTBC50@mailout3.w1.samsung.com>; Fri, 04 Aug 2017 10:35:17 +0100 (BST) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170804093516eucas1p11513aa3d6a9b51d0e25e6e7c86cdcc2f~XmubH2HHC1372613726eucas1p1u; Fri, 4 Aug 2017 09:35:16 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1.samsung.com (EUCPMTA) with SMTP id 53.89.14140.6DF34895; Fri, 4 Aug 2017 10:35:18 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170804093515eucas1p1cc2273ba02d86767c5b2533430577698~XmuaYIqJX1373913739eucas1p1c; Fri, 4 Aug 2017 09:35:15 +0000 (GMT) X-AuditID: cbfec7ef-f796a6d00000373c-ce-59843fd6332b Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 59.3B.20206.3DF34895; Fri, 4 Aug 2017 10:35:15 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OU50004IMMJTPA0@eusync3.samsung.com>; Fri, 04 Aug 2017 10:35:15 +0100 (BST) From: Marek Szyprowski To: linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Marek Szyprowski , Stephen Boyd , Michael Turquette , Ulf Hansson , Sylwester Nawrocki , Chanwoo Choi , Inki Dae , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH v7 2/4] clk: samsung: Add support for runtime PM Date: Fri, 04 Aug 2017 11:34:52 +0200 Message-id: <1501839294-478-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1501839294-478-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHIsWRmVeSWpSXmKPExsWy7djPc7rX7FsiDTb2GVpsnLGe1eL6l+es FpPuT2CxOH9+A7vFpsfXWC0+9txjtfjce4TRYsb5fUwWa4/cZbe4eMrV4vCbdlaLH2e6WSyO rw134PV4f6OV3eNyXy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cMuYdpC3YLJC xfY3p1kbGN9KdTFyckgImEjc6W9hgrDFJC7cW8/WxcjFISSwhFGi/VszK4TTxCSx4v0RNpAq NgFDia63XWBVIgJNjBJP+qaxgzjMAm3MEv87vjKCVAkLOEj8ntcBNpdFQFVi760fYHFeATeJ z7uXskPsk5M4eWwyK4jNKeAuMfNXI9gGIaCaTRceME5g5F3AyLCKUSS1tDg3PbfYSK84Mbe4 NC9dLzk/dxMjMDK2Hfu5ZQdj17vgQ4wCHIxKPLwGM5ojhVgTy4orcw8xSnAwK4nwMqq0RArx piRWVqUW5ccXleakFh9iNAU6aiKzlGhyPjBq80riDU0MzS0NjYwtLMyNjJTEedUvN0UKCaQn lqRmp6YWpBbB9DFxcEo1MJY8ThT20U7+Y1JrFXDwXejSfZ5uytfn7H33ui54nesqxf7Zq9g2 NF9YxZnz3efrNnuPO98vHhVinLp6+//j14uW793VuuDwvqrCuxztM58F77Y9JVpsunqm/tJU teYHU7ZdPSAoznFynuj2xv9bhG66e8j/NgvZyvHtmXNSguPmz/MFfkRwVv9UYinOSDTUYi4q TgQA+0mY1qICAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170804093515eucas1p1cc2273ba02d86767c5b2533430577698 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170804093515eucas1p1cc2273ba02d86767c5b2533430577698 X-RootMTR: 20170804093515eucas1p1cc2273ba02d86767c5b2533430577698 References: <1501839294-478-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org This patch adds struct device pointer to samsung_clk_provider and forwarding it to clk_register_* functions, so drivers can register clocks, which use runtime pm feature. Signed-off-by: Marek Szyprowski Reviewed-by: Ulf Hansson --- drivers/clk/samsung/clk-pll.c | 2 +- drivers/clk/samsung/clk.c | 12 ++++++------ drivers/clk/samsung/clk.h | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Chanwoo Choi Tested-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski diff --git a/drivers/clk/samsung/clk-pll.c b/drivers/clk/samsung/clk-pll.c index 037c61484098..41ebb94d2855 100644 --- a/drivers/clk/samsung/clk-pll.c +++ b/drivers/clk/samsung/clk-pll.c @@ -1388,7 +1388,7 @@ static void __init _samsung_clk_register_pll(struct samsung_clk_provider *ctx, pll->lock_reg = base + pll_clk->lock_offset; pll->con_reg = base + pll_clk->con_offset; - ret = clk_hw_register(NULL, &pll->hw); + ret = clk_hw_register(ctx->dev, &pll->hw); if (ret) { pr_err("%s: failed to register pll clock %s : %d\n", __func__, pll_clk->name, ret); diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c index 7ce0fa86c5ff..aef97b091b50 100644 --- a/drivers/clk/samsung/clk.c +++ b/drivers/clk/samsung/clk.c @@ -134,7 +134,7 @@ void __init samsung_clk_register_fixed_rate(struct samsung_clk_provider *ctx, unsigned int idx, ret; for (idx = 0; idx < nr_clk; idx++, list++) { - clk_hw = clk_hw_register_fixed_rate(NULL, list->name, + clk_hw = clk_hw_register_fixed_rate(ctx->dev, list->name, list->parent_name, list->flags, list->fixed_rate); if (IS_ERR(clk_hw)) { pr_err("%s: failed to register clock %s\n", __func__, @@ -163,7 +163,7 @@ void __init samsung_clk_register_fixed_factor(struct samsung_clk_provider *ctx, unsigned int idx; for (idx = 0; idx < nr_clk; idx++, list++) { - clk_hw = clk_hw_register_fixed_factor(NULL, list->name, + clk_hw = clk_hw_register_fixed_factor(ctx->dev, list->name, list->parent_name, list->flags, list->mult, list->div); if (IS_ERR(clk_hw)) { pr_err("%s: failed to register clock %s\n", __func__, @@ -184,7 +184,7 @@ void __init samsung_clk_register_mux(struct samsung_clk_provider *ctx, unsigned int idx, ret; for (idx = 0; idx < nr_clk; idx++, list++) { - clk_hw = clk_hw_register_mux(NULL, list->name, + clk_hw = clk_hw_register_mux(ctx->dev, list->name, list->parent_names, list->num_parents, list->flags, ctx->reg_base + list->offset, list->shift, list->width, list->mux_flags, &ctx->lock); @@ -217,13 +217,13 @@ void __init samsung_clk_register_div(struct samsung_clk_provider *ctx, for (idx = 0; idx < nr_clk; idx++, list++) { if (list->table) - clk_hw = clk_hw_register_divider_table(NULL, + clk_hw = clk_hw_register_divider_table(ctx->dev, list->name, list->parent_name, list->flags, ctx->reg_base + list->offset, list->shift, list->width, list->div_flags, list->table, &ctx->lock); else - clk_hw = clk_hw_register_divider(NULL, list->name, + clk_hw = clk_hw_register_divider(ctx->dev, list->name, list->parent_name, list->flags, ctx->reg_base + list->offset, list->shift, list->width, list->div_flags, &ctx->lock); @@ -255,7 +255,7 @@ void __init samsung_clk_register_gate(struct samsung_clk_provider *ctx, unsigned int idx, ret; for (idx = 0; idx < nr_clk; idx++, list++) { - clk_hw = clk_hw_register_gate(NULL, list->name, list->parent_name, + clk_hw = clk_hw_register_gate(ctx->dev, list->name, list->parent_name, list->flags, ctx->reg_base + list->offset, list->bit_idx, list->gate_flags, &ctx->lock); if (IS_ERR(clk_hw)) { diff --git a/drivers/clk/samsung/clk.h b/drivers/clk/samsung/clk.h index b8ca0dd3a38b..f0acae4f5d1b 100644 --- a/drivers/clk/samsung/clk.h +++ b/drivers/clk/samsung/clk.h @@ -24,6 +24,7 @@ */ struct samsung_clk_provider { void __iomem *reg_base; + struct device *dev; spinlock_t lock; /* clk_data must be the last entry due to variable lenght 'hws' array */ struct clk_hw_onecell_data clk_data;