From: sjg@chromium.org (Simon Glass)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/7] PM / Domains: add generic function 'pm_genpd_of_add_device_by_name'
Date: Tue, 18 Sep 2012 11:21:53 -0700 [thread overview]
Message-ID: <1347992519-6904-2-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1347992519-6904-1-git-send-email-sjg@chromium.org>
From: Prathyush K <prathyush.k@samsung.com>
A new function pm_genpd_of_add_device_by_name is added to the pm_domain
file. This function takes three parameters - target device to be added to
genpd, a device node and the name of the property. This function reads
the "propname" property from the device node and finds the corresponding
genpd device node. The target device is then added to this genpd by
calling __pm_genpd_of_add_device.
of_property_read_u32(dev_node, propname, &val);
genpd_node = of_find_node_by_phandle(val);
__pm_genpd_of_add_device(genpd_node, dev, NULL);
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Prathyush Kalashwaram <prathyush@chromium.org>
---
include/linux/pm_domain.h | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 30f794e..c733ece 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -137,6 +137,18 @@ static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
return __pm_genpd_add_device(genpd, dev, NULL);
}
+static inline int pm_genpd_of_add_device_by_name(
+ struct device_node *dev_node,
+ struct device *dev,
+ char *propname)
+{
+ u32 val;
+ struct device_node *genpd_node;
+ of_property_read_u32(dev_node, propname, &val);
+ genpd_node = of_find_node_by_phandle(val);
+ return __pm_genpd_of_add_device(genpd_node, dev, NULL);
+}
+
static inline int pm_genpd_of_add_device(struct device_node *genpd_node,
struct device *dev)
{
@@ -184,6 +196,13 @@ static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
{
return -ENOSYS;
}
+static inline int pm_genpd_of_add_device_by_name(
+ struct device_node *dev_node,
+ struct device *dev,
+ char *propname)
+{
+ return -ENOSYS;
+}
static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd,
struct device *dev)
{
--
1.7.7.3
next prev parent reply other threads:[~2012-09-18 18:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-18 18:21 [PATCH 0/7] Add support for Exynos5 ISP SPI ports Simon Glass
2012-09-18 18:21 ` Simon Glass [this message]
2012-09-18 18:21 ` [PATCH 2/7] spi: s3c64xx: Fix enum dma_data_direction warning Simon Glass
2012-09-18 18:21 ` [PATCH 3/7] spi: s3c64xx: Add support for ISP SPI ports Simon Glass
2012-09-18 18:21 ` [PATCH 4/7] spi: s3c64xx: Use jiffies instead of loops for timeout Simon Glass
2012-09-18 18:21 ` [PATCH 5/7] spi: s3c64xx: Allow use with SPI ports without dma Simon Glass
2012-09-18 18:21 ` [PATCH 6/7] spi: s3c64xx: Tidy up SPI chip select handling Simon Glass
2012-09-18 18:21 ` [PATCH 7/7] spi: s3c64xx: Write to PACKET_CNT after reset Simon Glass
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=1347992519-6904-2-git-send-email-sjg@chromium.org \
--to=sjg@chromium.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).