Skip to content

Commit

Permalink
PM / Domains: Export of_genpd_get_from_provider function
Browse files Browse the repository at this point in the history
This function looks up a PM domain form the provider. This will be
useful to add parent/child domain relationship from the SoC specific
code. The caller of the function must make sure that PM domain provider
is already registered.

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Amit Daniel Kachhap authored and Rafael J. Wysocki committed Dec 17, 2014
1 parent cffa913 commit 7496fcb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/base/power/domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -2108,7 +2108,7 @@ EXPORT_SYMBOL_GPL(of_genpd_del_provider);
* Returns a valid pointer to struct generic_pm_domain on success or ERR_PTR()
* on failure.
*/
static struct generic_pm_domain *of_genpd_get_from_provider(
struct generic_pm_domain *of_genpd_get_from_provider(
struct of_phandle_args *genpdspec)
{
struct generic_pm_domain *genpd = ERR_PTR(-ENOENT);
Expand All @@ -2128,6 +2128,7 @@ static struct generic_pm_domain *of_genpd_get_from_provider(

return genpd;
}
EXPORT_SYMBOL_GPL(of_genpd_get_from_provider);

/**
* genpd_dev_pm_detach - Detach a device from its PM domain.
Expand Down
8 changes: 8 additions & 0 deletions include/linux/pm_domain.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ typedef struct generic_pm_domain *(*genpd_xlate_t)(struct of_phandle_args *args,
int __of_genpd_add_provider(struct device_node *np, genpd_xlate_t xlate,
void *data);
void of_genpd_del_provider(struct device_node *np);
struct generic_pm_domain *of_genpd_get_from_provider(
struct of_phandle_args *genpdspec);

struct generic_pm_domain *__of_genpd_xlate_simple(
struct of_phandle_args *genpdspec,
Expand All @@ -292,6 +294,12 @@ static inline int __of_genpd_add_provider(struct device_node *np,
}
static inline void of_genpd_del_provider(struct device_node *np) {}

static inline struct generic_pm_domain *of_genpd_get_from_provider(
struct of_phandle_args *genpdspec)
{
return NULL;
}

#define __of_genpd_xlate_simple NULL
#define __of_genpd_xlate_onecell NULL

Expand Down

0 comments on commit 7496fcb

Please sign in to comment.