linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: matthias.bgg@kernel.org (matthias.bgg at kernel.org)
To: linux-arm-kernel@lists.infradead.org
Subject: [v2 08/10] clk: mediatek: mt8173-mm: switch to mfd device
Date: Mon, 23 Apr 2018 18:13:57 +0200	[thread overview]
Message-ID: <74bf4058534cf187e10ef041da1706878914aa45.1524497268.git.mbrugger@suse.com> (raw)
In-Reply-To: <cover.1524497268.git.mbrugger@suse.com>

From: Matthias Brugger <mbrugger@suse.com>

As the new mfd device is in place, switch probing
for the MMSYS to support invocation from the mfd device.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
---
 drivers/clk/mediatek/clk-mt8173.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/mediatek/clk-mt8173.c b/drivers/clk/mediatek/clk-mt8173.c
index 96c292c3e440..abd2592078d4 100644
--- a/drivers/clk/mediatek/clk-mt8173.c
+++ b/drivers/clk/mediatek/clk-mt8173.c
@@ -15,6 +15,7 @@
 #include <linux/clk.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/platform_device.h>
 
 #include "clk-mtk.h"
 #include "clk-gate.h"
@@ -1152,10 +1153,13 @@ static void __init mtk_imgsys_init(struct device_node *node)
 }
 CLK_OF_DECLARE(mtk_imgsys, "mediatek,mt8173-imgsys", mtk_imgsys_init);
 
-static void __init mtk_mmsys_init(struct device_node *node)
+static int mtk_mmsys_probe(struct platform_device *pdev)
 {
 	struct clk_onecell_data *clk_data;
 	int r;
+	struct device_node *node;
+
+	node = pdev->dev.parent->of_node;
 
 	clk_data = mtk_alloc_clk_data(CLK_MM_NR_CLK);
 
@@ -1166,8 +1170,17 @@ static void __init mtk_mmsys_init(struct device_node *node)
 	if (r)
 		pr_err("%s(): could not register clock provider: %d\n",
 			__func__, r);
+
+	return r;
 }
-CLK_OF_DECLARE(mtk_mmsys, "mediatek,mt8173-mmsys", mtk_mmsys_init);
+
+static struct platform_driver clk_mt8173_mm_drv = {
+	.probe = mtk_mmsys_probe,
+	.driver = {
+		.name = "clk-mt8173-mm",
+	},
+};
+builtin_platform_driver(clk_mt8173_mm_drv);
 
 static void __init mtk_vdecsys_init(struct device_node *node)
 {
-- 
2.16.3

  parent reply	other threads:[~2018-04-23 16:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-23 16:13 [v2 00/10] arm/arm64: mediatek: Fix mmsys device probing matthias.bgg at kernel.org
2018-04-23 16:13 ` [v2 01/10] dt-bindings: mediatek: mmsys: Add support for mfd matthias.bgg at kernel.org
2018-04-23 16:13 ` [v2 02/10] drm/mediatek: Use regmap for register access matthias.bgg at kernel.org
2018-04-23 16:13 ` [v2 03/10] mfd: mtk-mmsys: Add mmsys driver matthias.bgg at kernel.org
2018-04-23 16:13 ` [v2 04/10] drm/mediatek: mt2701: switch to mfd probing matthias.bgg at kernel.org
2018-04-23 16:13 ` [v2 05/10] clk: mediatek: mt2701-mm: switch to mfd device matthias.bgg at kernel.org
2018-04-23 16:13 ` [v2 06/10] mfd: mtk-mmsys: Add mt8173 nodes matthias.bgg at kernel.org
2018-04-23 16:13 ` [v2 07/10] drm/mediatek: Add mfd support for mt8173 matthias.bgg at kernel.org
2018-04-23 16:13 ` matthias.bgg at kernel.org [this message]
2018-04-24 10:05   ` [v2 08/10] clk: mediatek: mt8173-mm: switch to mfd device kbuild test robot
2018-04-23 16:13 ` [v2 09/10] drm: mediatek: Omit warning on probe defers matthias.bgg at kernel.org
2018-04-23 16:13 ` [v2 10/10] MAINTAINERS: update Mediatek Soc entry matthias.bgg at kernel.org
2018-04-24  5:48 ` [v2 00/10] arm/arm64: mediatek: Fix mmsys device probing Lee Jones
2018-04-24  9:46   ` Matthias Brugger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=74bf4058534cf187e10ef041da1706878914aa45.1524497268.git.mbrugger@suse.com \
    --to=matthias.bgg@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).