All of lore.kernel.org
 help / color / mirror / Atom feed
From: brgl@bgdev.pl (Bartosz Golaszewski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/7] ARM: davinci: don't setup pm_clk if we're using genpd
Date: Wed,  7 Feb 2018 14:45:49 +0100	[thread overview]
Message-ID: <20180207134553.13510-4-brgl@bgdev.pl> (raw)
In-Reply-To: <20180207134553.13510-1-brgl@bgdev.pl>

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

As the first step in switching to using the genpd driver in DT mode,
check if a relevant genpd node exists and don't setup the clock pm in
this case.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/pm_domain.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-davinci/pm_domain.c b/arch/arm/mach-davinci/pm_domain.c
index 78eac2c0c146..98a4f3fcba50 100644
--- a/arch/arm/mach-davinci/pm_domain.c
+++ b/arch/arm/mach-davinci/pm_domain.c
@@ -13,6 +13,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/pm_clock.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 
 static struct dev_pm_domain davinci_pm_domain = {
 	.ops = {
@@ -28,7 +29,13 @@ static struct pm_clk_notifier_block platform_bus_notifier = {
 
 static int __init davinci_pm_runtime_init(void)
 {
-	pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
+	struct device_node *np;
+
+	/* Use pm_clk as fallback if we're not using genpd. */
+	np = of_find_compatible_node(NULL, NULL, "ti,davinci-pm-domains");
+	if (!np)
+		pm_clk_add_notifier(&platform_bus_type,
+				    &platform_bus_notifier);
 
 	return 0;
 }
-- 
2.16.1

WARNING: multiple messages have this Message-ID (diff)
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>, Sekhar Nori <nsekhar@ti.com>,
	Kevin Hilman <khilman@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	David Lechner <david@lechnology.com>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: [PATCH 3/7] ARM: davinci: don't setup pm_clk if we're using genpd
Date: Wed,  7 Feb 2018 14:45:49 +0100	[thread overview]
Message-ID: <20180207134553.13510-4-brgl@bgdev.pl> (raw)
In-Reply-To: <20180207134553.13510-1-brgl@bgdev.pl>

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

As the first step in switching to using the genpd driver in DT mode,
check if a relevant genpd node exists and don't setup the clock pm in
this case.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/pm_domain.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-davinci/pm_domain.c b/arch/arm/mach-davinci/pm_domain.c
index 78eac2c0c146..98a4f3fcba50 100644
--- a/arch/arm/mach-davinci/pm_domain.c
+++ b/arch/arm/mach-davinci/pm_domain.c
@@ -13,6 +13,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/pm_clock.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 
 static struct dev_pm_domain davinci_pm_domain = {
 	.ops = {
@@ -28,7 +29,13 @@ static struct pm_clk_notifier_block platform_bus_notifier = {
 
 static int __init davinci_pm_runtime_init(void)
 {
-	pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
+	struct device_node *np;
+
+	/* Use pm_clk as fallback if we're not using genpd. */
+	np = of_find_compatible_node(NULL, NULL, "ti,davinci-pm-domains");
+	if (!np)
+		pm_clk_add_notifier(&platform_bus_type,
+				    &platform_bus_notifier);
 
 	return 0;
 }
-- 
2.16.1

  parent reply	other threads:[~2018-02-07 13:45 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-07 13:45 [PATCH 0/7] ARM: davinci: add genpd support Bartosz Golaszewski
2018-02-07 13:45 ` Bartosz Golaszewski
2018-02-07 13:45 ` [PATCH 1/7] dt-bindings: soc: new driver for DaVinci genpd Bartosz Golaszewski
2018-02-07 13:45   ` Bartosz Golaszewski
2018-02-07 21:47   ` David Lechner
2018-02-07 21:47     ` David Lechner
2018-02-08  8:56     ` Bartosz Golaszewski
2018-02-08  8:56       ` Bartosz Golaszewski
2018-02-08  8:56       ` Bartosz Golaszewski
2018-02-09  0:40       ` Kevin Hilman
2018-02-09  0:40         ` Kevin Hilman
2018-02-09  0:40         ` Kevin Hilman
2018-02-07 13:45 ` [PATCH 2/7] soc: davinci: new genpd driver Bartosz Golaszewski
2018-02-07 13:45   ` Bartosz Golaszewski
2018-02-07 21:49   ` David Lechner
2018-02-07 21:49     ` David Lechner
2018-02-07 21:49     ` David Lechner
2018-02-08  9:30   ` Sekhar Nori
2018-02-08  9:30     ` Sekhar Nori
2018-02-08  9:30     ` Sekhar Nori
2018-02-08  9:54     ` Bartosz Golaszewski
2018-02-08  9:54       ` Bartosz Golaszewski
2018-02-08 12:56       ` Sekhar Nori
2018-02-08 12:56         ` Sekhar Nori
2018-02-08 12:56         ` Sekhar Nori
2018-02-08 13:27         ` Bartosz Golaszewski
2018-02-08 13:27           ` Bartosz Golaszewski
2018-02-08 13:27           ` Bartosz Golaszewski
2018-02-08 14:43           ` Sekhar Nori
2018-02-08 14:43             ` Sekhar Nori
2018-02-08 14:43             ` Sekhar Nori
2018-02-07 13:45 ` Bartosz Golaszewski [this message]
2018-02-07 13:45   ` [PATCH 3/7] ARM: davinci: don't setup pm_clk if we're using genpd Bartosz Golaszewski
2018-02-07 13:45 ` [PATCH 4/7] ARM: dts: da850: add power controller nodes Bartosz Golaszewski
2018-02-07 13:45   ` Bartosz Golaszewski
2018-02-07 21:58   ` David Lechner
2018-02-07 21:58     ` David Lechner
2018-02-07 21:58     ` David Lechner
2018-02-07 13:45 ` [PATCH 5/7] ARM: dts: da850: add power-domains properties to device nodes Bartosz Golaszewski
2018-02-07 13:45   ` Bartosz Golaszewski
2018-02-07 22:21   ` David Lechner
2018-02-07 22:21     ` David Lechner
2018-02-07 13:45 ` [PATCH 6/7] ARM: davinci: select generic power domains for DaVinci in DT mode Bartosz Golaszewski
2018-02-07 13:45   ` Bartosz Golaszewski
2018-02-07 13:45   ` Bartosz Golaszewski
2018-02-07 13:45 ` [PATCH 7/7] ARM: davinci_all_defconfig: select the DaVinci genpd driver " Bartosz Golaszewski
2018-02-07 13:45   ` Bartosz Golaszewski
2018-02-07 22:43 ` [PATCH 0/7] ARM: davinci: add genpd support David Lechner
2018-02-07 22:43   ` David Lechner
2018-02-09 12:42   ` Sekhar Nori
2018-02-09 12:42     ` Sekhar Nori
2018-02-09 12:42     ` Sekhar Nori
2018-02-18  3:41     ` David Lechner
2018-02-18  3:41       ` David Lechner
2018-02-18  3:41       ` David Lechner
2018-02-19 10:49       ` Bartosz Golaszewski
2018-02-19 10:49         ` Bartosz Golaszewski
2018-02-19 10:49         ` Bartosz Golaszewski

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=20180207134553.13510-4-brgl@bgdev.pl \
    --to=brgl@bgdev.pl \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.