forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PM: Move clock-related definitions and headers to separate file
Since the PM clock management code in drivers/base/power/clock_ops.c is used for both runtime PM and system suspend/hibernation, the definitions of data structures and headers related to it should not be located in include/linux/pm_rumtime.h. Move them to a separate header file. Signed-off-by: Rafael J. Wysocki <[email protected]>
- Loading branch information
Showing
9 changed files
with
78 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* pm_clock.h - Definitions and headers related to device clocks. | ||
* | ||
* Copyright (C) 2011 Rafael J. Wysocki <[email protected]>, Renesas Electronics Corp. | ||
* | ||
* This file is released under the GPLv2. | ||
*/ | ||
|
||
#ifndef _LINUX_PM_CLOCK_H | ||
#define _LINUX_PM_CLOCK_H | ||
|
||
#include <linux/device.h> | ||
#include <linux/notifier.h> | ||
|
||
struct pm_clk_notifier_block { | ||
struct notifier_block nb; | ||
struct dev_pm_domain *pm_domain; | ||
char *con_ids[]; | ||
}; | ||
|
||
#ifdef CONFIG_PM_CLK | ||
static inline bool pm_clk_no_clocks(struct device *dev) | ||
{ | ||
return dev && dev->power.subsys_data | ||
&& list_empty(&dev->power.subsys_data->clock_list); | ||
} | ||
|
||
extern void pm_clk_init(struct device *dev); | ||
extern int pm_clk_create(struct device *dev); | ||
extern void pm_clk_destroy(struct device *dev); | ||
extern int pm_clk_add(struct device *dev, const char *con_id); | ||
extern void pm_clk_remove(struct device *dev, const char *con_id); | ||
extern int pm_clk_suspend(struct device *dev); | ||
extern int pm_clk_resume(struct device *dev); | ||
#else | ||
static inline bool pm_clk_no_clocks(struct device *dev) | ||
{ | ||
return true; | ||
} | ||
static inline void pm_clk_init(struct device *dev) | ||
{ | ||
} | ||
static inline int pm_clk_create(struct device *dev) | ||
{ | ||
return -EINVAL; | ||
} | ||
static inline void pm_clk_destroy(struct device *dev) | ||
{ | ||
} | ||
static inline int pm_clk_add(struct device *dev, const char *con_id) | ||
{ | ||
return -EINVAL; | ||
} | ||
static inline void pm_clk_remove(struct device *dev, const char *con_id) | ||
{ | ||
} | ||
#define pm_clk_suspend NULL | ||
#define pm_clk_resume NULL | ||
#endif | ||
|
||
#ifdef CONFIG_HAVE_CLK | ||
extern void pm_clk_add_notifier(struct bus_type *bus, | ||
struct pm_clk_notifier_block *clknb); | ||
#else | ||
static inline void pm_clk_add_notifier(struct bus_type *bus, | ||
struct pm_clk_notifier_block *clknb) | ||
{ | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters