diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/pm.h | 51 | ||||
-rw-r--r-- | include/linux/pm_runtime.h | 6 | ||||
-rw-r--r-- | include/linux/serial_sci.h | 6 |
3 files changed, 57 insertions, 6 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index e80df06ad22a..8e258c727971 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -215,20 +215,59 @@ struct dev_pm_ops { | |||
215 | int (*runtime_idle)(struct device *dev); | 215 | int (*runtime_idle)(struct device *dev); |
216 | }; | 216 | }; |
217 | 217 | ||
218 | #ifdef CONFIG_PM_SLEEP | ||
219 | #define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ | ||
220 | .suspend = suspend_fn, \ | ||
221 | .resume = resume_fn, \ | ||
222 | .freeze = suspend_fn, \ | ||
223 | .thaw = resume_fn, \ | ||
224 | .poweroff = suspend_fn, \ | ||
225 | .restore = resume_fn, | ||
226 | #else | ||
227 | #define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) | ||
228 | #endif | ||
229 | |||
230 | #ifdef CONFIG_PM_RUNTIME | ||
231 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ | ||
232 | .runtime_suspend = suspend_fn, \ | ||
233 | .runtime_resume = resume_fn, \ | ||
234 | .runtime_idle = idle_fn, | ||
235 | #else | ||
236 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) | ||
237 | #endif | ||
238 | |||
218 | /* | 239 | /* |
219 | * Use this if you want to use the same suspend and resume callbacks for suspend | 240 | * Use this if you want to use the same suspend and resume callbacks for suspend |
220 | * to RAM and hibernation. | 241 | * to RAM and hibernation. |
221 | */ | 242 | */ |
222 | #define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \ | 243 | #define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \ |
223 | const struct dev_pm_ops name = { \ | 244 | const struct dev_pm_ops name = { \ |
224 | .suspend = suspend_fn, \ | 245 | SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ |
225 | .resume = resume_fn, \ | 246 | } |
226 | .freeze = suspend_fn, \ | 247 | |
227 | .thaw = resume_fn, \ | 248 | /* |
228 | .poweroff = suspend_fn, \ | 249 | * Use this for defining a set of PM operations to be used in all situations |
229 | .restore = resume_fn, \ | 250 | * (sustem suspend, hibernation or runtime PM). |
251 | */ | ||
252 | #define UNIVERSAL_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn) \ | ||
253 | const struct dev_pm_ops name = { \ | ||
254 | SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ | ||
255 | SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ | ||
230 | } | 256 | } |
231 | 257 | ||
258 | /* | ||
259 | * Use this for subsystems (bus types, device types, device classes) that don't | ||
260 | * need any special suspend/resume handling in addition to invoking the PM | ||
261 | * callbacks provided by device drivers supporting both the system sleep PM and | ||
262 | * runtime PM, make the pm member point to generic_subsys_pm_ops. | ||
263 | */ | ||
264 | #ifdef CONFIG_PM_OPS | ||
265 | extern struct dev_pm_ops generic_subsys_pm_ops; | ||
266 | #define GENERIC_SUBSYS_PM_OPS (&generic_subsys_pm_ops) | ||
267 | #else | ||
268 | #define GENERIC_SUBSYS_PM_OPS NULL | ||
269 | #endif | ||
270 | |||
232 | /** | 271 | /** |
233 | * PM_EVENT_ messages | 272 | * PM_EVENT_ messages |
234 | * | 273 | * |
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 7d773aac5314..b776db737244 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
@@ -62,6 +62,11 @@ static inline void device_set_run_wake(struct device *dev, bool enable) | |||
62 | dev->power.run_wake = enable; | 62 | dev->power.run_wake = enable; |
63 | } | 63 | } |
64 | 64 | ||
65 | static inline bool pm_runtime_suspended(struct device *dev) | ||
66 | { | ||
67 | return dev->power.runtime_status == RPM_SUSPENDED; | ||
68 | } | ||
69 | |||
65 | #else /* !CONFIG_PM_RUNTIME */ | 70 | #else /* !CONFIG_PM_RUNTIME */ |
66 | 71 | ||
67 | static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; } | 72 | static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; } |
@@ -89,6 +94,7 @@ static inline void pm_runtime_get_noresume(struct device *dev) {} | |||
89 | static inline void pm_runtime_put_noidle(struct device *dev) {} | 94 | static inline void pm_runtime_put_noidle(struct device *dev) {} |
90 | static inline bool device_run_wake(struct device *dev) { return false; } | 95 | static inline bool device_run_wake(struct device *dev) { return false; } |
91 | static inline void device_set_run_wake(struct device *dev, bool enable) {} | 96 | static inline void device_set_run_wake(struct device *dev, bool enable) {} |
97 | static inline bool pm_runtime_suspended(struct device *dev) { return false; } | ||
92 | 98 | ||
93 | #endif /* !CONFIG_PM_RUNTIME */ | 99 | #endif /* !CONFIG_PM_RUNTIME */ |
94 | 100 | ||
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index 1c297ddc9d5a..1b177d29a7f0 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __LINUX_SERIAL_SCI_H | 2 | #define __LINUX_SERIAL_SCI_H |
3 | 3 | ||
4 | #include <linux/serial_core.h> | 4 | #include <linux/serial_core.h> |
5 | #include <asm/dmaengine.h> | ||
5 | 6 | ||
6 | /* | 7 | /* |
7 | * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) | 8 | * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) |
@@ -16,6 +17,8 @@ enum { | |||
16 | SCIx_NR_IRQS, | 17 | SCIx_NR_IRQS, |
17 | }; | 18 | }; |
18 | 19 | ||
20 | struct device; | ||
21 | |||
19 | /* | 22 | /* |
20 | * Platform device specific platform_data struct | 23 | * Platform device specific platform_data struct |
21 | */ | 24 | */ |
@@ -26,6 +29,9 @@ struct plat_sci_port { | |||
26 | unsigned int type; /* SCI / SCIF / IRDA */ | 29 | unsigned int type; /* SCI / SCIF / IRDA */ |
27 | upf_t flags; /* UPF_* flags */ | 30 | upf_t flags; /* UPF_* flags */ |
28 | char *clk; /* clock string */ | 31 | char *clk; /* clock string */ |
32 | struct device *dma_dev; | ||
33 | enum sh_dmae_slave_chan_id dma_slave_tx; | ||
34 | enum sh_dmae_slave_chan_id dma_slave_rx; | ||
29 | }; | 35 | }; |
30 | 36 | ||
31 | #endif /* __LINUX_SERIAL_SCI_H */ | 37 | #endif /* __LINUX_SERIAL_SCI_H */ |