All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomeu Vizoso <tomeu.vizoso@collabora.com>
To: linux-kernel@vger.kernel.org
Cc: devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org,
	Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	linux-gpio@vger.kernel.org,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	alsa-devel@alsa-project.org, dri-devel@lists.freedesktop.org,
	linux-acpi@vger.kernel.org, Mark Brown <broonie@kernel.org>,
	linux-pwm@vger.kernel.org
Subject: [PATCH v2 10/12] pwm: register dependency parser for firmware nodes
Date: Wed,  1 Jul 2015 11:41:05 +0200	[thread overview]
Message-ID: <1435743667-11987-11-git-send-email-tomeu.vizoso@collabora.com> (raw)
In-Reply-To: <1435743667-11987-1-git-send-email-tomeu.vizoso@collabora.com>

So others can find out what depends on pwm controllers, as specified
in bindings/pwm/pwm.txt.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---

Changes in v2: None

 drivers/pwm/core.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 3a7769f..81b4fc0 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -917,11 +917,39 @@ static const struct file_operations pwm_debugfs_ops = {
 	.release = seq_release,
 };
 
+static void pwm_get_dependencies(struct fwnode_handle *fwnode,
+				 struct list_head *deps)
+{
+	struct device_node *np;
+	struct of_phandle_args pspec;
+	int count, i, ret;
+
+	np = to_of_node(fwnode);
+	if (!np)
+		return;
+
+	count = of_count_phandle_with_args(np, "pwms",
+					   "#pwm-cells");
+	for (i = 0; i < count; i++) {
+		ret = of_parse_phandle_with_args(np, "pwms",
+						 "#pwm-cells", i,
+						 &pspec);
+		if (ret || !pspec.np)
+			continue;
+
+		fwnode_add_dependency(&pspec.np->fwnode, deps);
+
+		of_node_put(pspec.np);
+	}
+}
+
 static int __init pwm_debugfs_init(void)
 {
 	debugfs_create_file("pwm", S_IFREG | S_IRUGO, NULL, NULL,
 			    &pwm_debugfs_ops);
 
+	fwnode_add_dependency_parser(pwm_get_dependencies);
+
 	return 0;
 }
 
-- 
2.4.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Tomeu Vizoso <tomeu.vizoso@collabora.com>
To: linux-kernel@vger.kernel.org
Cc: Mark Brown <broonie@kernel.org>,
	linux-acpi@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-fbdev@vger.kernel.org, linux-gpio@vger.kernel.org,
	devicetree@vger.kernel.org, linux-pwm@vger.kernel.org,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	alsa-devel@alsa-project.org,
	Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	Thierry Reding <thierry.reding@gmail.com>
Subject: [PATCH v2 10/12] pwm: register dependency parser for firmware nodes
Date: Wed,  1 Jul 2015 11:41:05 +0200	[thread overview]
Message-ID: <1435743667-11987-11-git-send-email-tomeu.vizoso@collabora.com> (raw)
In-Reply-To: <1435743667-11987-1-git-send-email-tomeu.vizoso@collabora.com>

So others can find out what depends on pwm controllers, as specified
in bindings/pwm/pwm.txt.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---

Changes in v2: None

 drivers/pwm/core.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 3a7769f..81b4fc0 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -917,11 +917,39 @@ static const struct file_operations pwm_debugfs_ops = {
 	.release = seq_release,
 };
 
+static void pwm_get_dependencies(struct fwnode_handle *fwnode,
+				 struct list_head *deps)
+{
+	struct device_node *np;
+	struct of_phandle_args pspec;
+	int count, i, ret;
+
+	np = to_of_node(fwnode);
+	if (!np)
+		return;
+
+	count = of_count_phandle_with_args(np, "pwms",
+					   "#pwm-cells");
+	for (i = 0; i < count; i++) {
+		ret = of_parse_phandle_with_args(np, "pwms",
+						 "#pwm-cells", i,
+						 &pspec);
+		if (ret || !pspec.np)
+			continue;
+
+		fwnode_add_dependency(&pspec.np->fwnode, deps);
+
+		of_node_put(pspec.np);
+	}
+}
+
 static int __init pwm_debugfs_init(void)
 {
 	debugfs_create_file("pwm", S_IFREG | S_IRUGO, NULL, NULL,
 			    &pwm_debugfs_ops);
 
+	fwnode_add_dependency_parser(pwm_get_dependencies);
+
 	return 0;
 }
 
-- 
2.4.1


WARNING: multiple messages have this Message-ID (diff)
From: Tomeu Vizoso <tomeu.vizoso@collabora.com>
To: linux-kernel@vger.kernel.org
Cc: devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org,
	Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	linux-gpio@vger.kernel.org,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	alsa-devel@alsa-project.org, dri-devel@lists.freedesktop.org,
	linux-acpi@vger.kernel.org, Mark Brown <broonie@kernel.org>,
	linux-pwm@vger.kernel.org
Subject: [PATCH v2 10/12] pwm: register dependency parser for firmware nodes
Date: Wed, 01 Jul 2015 09:41:05 +0000	[thread overview]
Message-ID: <1435743667-11987-11-git-send-email-tomeu.vizoso@collabora.com> (raw)
In-Reply-To: <1435743667-11987-1-git-send-email-tomeu.vizoso@collabora.com>

So others can find out what depends on pwm controllers, as specified
in bindings/pwm/pwm.txt.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---

Changes in v2: None

 drivers/pwm/core.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 3a7769f..81b4fc0 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -917,11 +917,39 @@ static const struct file_operations pwm_debugfs_ops = {
 	.release = seq_release,
 };
 
+static void pwm_get_dependencies(struct fwnode_handle *fwnode,
+				 struct list_head *deps)
+{
+	struct device_node *np;
+	struct of_phandle_args pspec;
+	int count, i, ret;
+
+	np = to_of_node(fwnode);
+	if (!np)
+		return;
+
+	count = of_count_phandle_with_args(np, "pwms",
+					   "#pwm-cells");
+	for (i = 0; i < count; i++) {
+		ret = of_parse_phandle_with_args(np, "pwms",
+						 "#pwm-cells", i,
+						 &pspec);
+		if (ret || !pspec.np)
+			continue;
+
+		fwnode_add_dependency(&pspec.np->fwnode, deps);
+
+		of_node_put(pspec.np);
+	}
+}
+
 static int __init pwm_debugfs_init(void)
 {
 	debugfs_create_file("pwm", S_IFREG | S_IRUGO, NULL, NULL,
 			    &pwm_debugfs_ops);
 
+	fwnode_add_dependency_parser(pwm_get_dependencies);
+
 	return 0;
 }
 
-- 
2.4.1


  parent reply	other threads:[~2015-07-01  9:41 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-01  9:40 [PATCH v2 0/12] Discover and probe dependencies Tomeu Vizoso
2015-07-01  9:40 ` Tomeu Vizoso
2015-07-01  9:40 ` Tomeu Vizoso
2015-07-01  9:40 ` [PATCH v2 01/12] device: property: delay device-driver matches Tomeu Vizoso
2015-07-01  9:40   ` Tomeu Vizoso
2015-07-01  9:40   ` Tomeu Vizoso
2015-07-01 23:29   ` Rafael J. Wysocki
2015-07-01 23:29     ` Rafael J. Wysocki
2015-07-10 11:39     ` Tomeu Vizoso
2015-07-10 11:39       ` Tomeu Vizoso
2015-07-10 11:39       ` Tomeu Vizoso
2015-07-16 20:23   ` Mark Brown
2015-07-16 20:23     ` Mark Brown
     [not found]     ` <20150716202312.GD11162-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-07-16 23:41       ` Rafael J. Wysocki
2015-07-16 23:41         ` Rafael J. Wysocki
2015-07-16 23:41         ` Rafael J. Wysocki
2015-07-17  0:06         ` Mark Brown
2015-07-17  0:06           ` Mark Brown
2015-07-01  9:40 ` [PATCH v2 02/12] device: property: find dependencies of a firmware node Tomeu Vizoso
2015-07-01  9:40   ` Tomeu Vizoso
2015-07-01  9:40   ` Tomeu Vizoso
2015-07-01 23:36   ` Rafael J. Wysocki
2015-07-02  0:02     ` Rafael J. Wysocki
2015-07-10 13:14     ` [alsa-devel] " Tomeu Vizoso
2015-07-10 13:14       ` Tomeu Vizoso
2015-07-10 13:14       ` Tomeu Vizoso
2015-07-11  2:52       ` Rafael J. Wysocki
2015-07-11  2:52         ` [alsa-devel] " Rafael J. Wysocki
2015-07-11  2:52         ` Rafael J. Wysocki
2015-07-01  9:40 ` [PATCH v2 03/12] string: Introduce strends() Tomeu Vizoso
2015-07-01  9:40   ` Tomeu Vizoso
2015-07-01  9:40   ` Tomeu Vizoso
2015-07-01  9:40 ` [PATCH v2 04/12] gpio: register dependency parser for firmware nodes Tomeu Vizoso
2015-07-01  9:40   ` Tomeu Vizoso
2015-07-01  9:40   ` Tomeu Vizoso
2015-07-01  9:41 ` [PATCH v2 05/12] gpu: host1x: " Tomeu Vizoso
2015-07-01  9:41   ` Tomeu Vizoso
2015-07-01  9:41   ` Tomeu Vizoso
2015-07-01  9:41 ` [PATCH v2 06/12] backlight: Document consumers of backlight nodes Tomeu Vizoso
2015-07-01  9:41   ` Tomeu Vizoso
2015-07-01  9:41   ` Tomeu Vizoso
2015-07-01  9:41 ` [PATCH v2 07/12] backlight: register dependency parser for firmware nodes Tomeu Vizoso
2015-07-01  9:41   ` Tomeu Vizoso
2015-07-01  9:41   ` Tomeu Vizoso
2015-07-01  9:41 ` [PATCH v2 08/12] USB: EHCI: " Tomeu Vizoso
2015-07-01  9:41   ` Tomeu Vizoso
2015-07-01  9:41   ` Tomeu Vizoso
2015-07-01  9:41 ` [PATCH v2 09/12] regulator: " Tomeu Vizoso
2015-07-01  9:41   ` Tomeu Vizoso
2015-07-01  9:41   ` Tomeu Vizoso
2015-07-16 21:38   ` Mark Brown
2015-07-16 21:38     ` Mark Brown
2015-07-01  9:41 ` Tomeu Vizoso [this message]
2015-07-01  9:41   ` [PATCH v2 10/12] pwm: " Tomeu Vizoso
2015-07-01  9:41   ` Tomeu Vizoso
2015-07-01  9:41 ` [PATCH v2 11/12] ASoC: tegra: " Tomeu Vizoso
2015-07-01  9:41   ` Tomeu Vizoso
2015-07-01  9:41   ` Tomeu Vizoso
2015-07-01 17:38   ` Mark Brown
2015-07-01 17:38     ` Mark Brown
2015-07-13 12:10     ` [alsa-devel] " Tomeu Vizoso
2015-07-13 12:10       ` Tomeu Vizoso
2015-07-13 12:10       ` Tomeu Vizoso
     [not found]       ` <CAAObsKDsEuDS46rW9CMuviDEDV-OVXe5q-kiWmw0D_n2D3Tf5A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-13 15:42         ` Mark Brown
2015-07-13 15:42           ` Mark Brown
2015-07-13 15:42           ` Mark Brown
2015-07-14  7:34           ` Tomeu Vizoso
2015-07-14  7:34             ` Tomeu Vizoso
2015-07-14  7:34             ` Tomeu Vizoso
     [not found]             ` <CAAObsKAVY7-QpcRyT4juc2RyB+vqibvzKO7wFCT2VsL9R8bzPw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-14 11:07               ` Mark Brown
2015-07-14 11:07                 ` Mark Brown
2015-07-14 11:07                 ` Mark Brown
2015-07-14 12:47                 ` Tomeu Vizoso
2015-07-14 12:47                   ` Tomeu Vizoso
2015-07-14 12:47                   ` Tomeu Vizoso
2015-07-16 23:04                   ` Mark Brown
2015-07-16 23:04                     ` Mark Brown
2015-07-01  9:41 ` [PATCH v2 12/12] driver-core: probe dependencies before probing Tomeu Vizoso
2015-07-01  9:41   ` Tomeu Vizoso
2015-07-01  9:41   ` Tomeu Vizoso

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=1435743667-11987-11-git-send-email-tomeu.vizoso@collabora.com \
    --to=tomeu.vizoso@collabora.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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.