From: Tero Kristo <t-kristo@ti.com>
To: linux-omap@vger.kernel.org, tony@atomide.com, paul@pwsan.com
Cc: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/5] ARM: OMAP2+: omap_device: create clock alias purely from DT data
Date: Thu, 30 Jun 2016 16:14:59 +0300 [thread overview]
Message-ID: <1467292503-4376-2-git-send-email-t-kristo@ti.com> (raw)
In-Reply-To: <1467292503-4376-1-git-send-email-t-kristo@ti.com>
This avoids the need to add most of the clock aliases under
drivers/clk/ti/clk-xyz.c files.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/omap_device.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
index f7ff3b9..b32d7c8 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -63,7 +63,22 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias,
return;
}
- rc = clk_add_alias(clk_alias, dev_name(&od->pdev->dev), clk_name, NULL);
+ r = clk_get_sys(NULL, clk_name);
+
+ if (IS_ERR(r) && of_have_populated_dt()) {
+ struct of_phandle_args clkspec;
+
+ clkspec.np = of_find_node_by_name(NULL, clk_name);
+
+ r = of_clk_get_from_provider(&clkspec);
+
+ rc = clk_register_clkdev(r, clk_alias,
+ dev_name(&od->pdev->dev));
+ } else {
+ rc = clk_add_alias(clk_alias, dev_name(&od->pdev->dev),
+ clk_name, NULL);
+ }
+
if (rc) {
if (rc == -ENODEV || rc == -ENOMEM)
dev_err(&od->pdev->dev,
--
1.9.1
next prev parent reply other threads:[~2016-06-30 13:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-30 13:14 [PATCH 0/5] ARM: OMAP2+: hwmod/clk related fixes Tero Kristo
2016-06-30 13:14 ` Tero Kristo [this message]
2016-06-30 13:15 ` [PATCH 2/5] ARM: OMAP2+: hwmod: fetch main_clk based on hwmod name Tero Kristo
2016-07-04 6:54 ` Tony Lindgren
2016-07-04 9:17 ` Tero Kristo
2016-07-04 11:11 ` [PATCHv2 " Tero Kristo
2016-07-04 14:32 ` Tony Lindgren
2016-06-30 13:15 ` [PATCH 3/5] ARM: OMAP2+: timer: change order of hwmod data handling Tero Kristo
2016-06-30 13:15 ` [PATCH 4/5] ARM: OMAP2+: clockdomain: add usecounting support to autoidle APIs Tero Kristo
2016-06-30 13:15 ` [PATCH 5/5] ARM: AM33xx: fix module_wait_ready without clkctrl register Tero Kristo
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=1467292503-4376-2-git-send-email-t-kristo@ti.com \
--to=t-kristo@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=paul@pwsan.com \
--cc=tony@atomide.com \
/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).