aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata.h
diff options
context:
space:
mode:
authorAaron Lu <aaron.lu@intel.com>2013-01-15 04:21:01 -0500
committerJeff Garzik <jgarzik@redhat.com>2013-01-21 15:41:56 -0500
commit213342053db58eabdaddff9c036c2b81ca63c443 (patch)
treee6c8b474717496289a5cbc3674e639f4814f784a /drivers/ata/libata.h
parent3dc67440d99b2c718ef5f1eb1424a9066ffa3fb9 (diff)
libata: handle power transition of ODD
When ata port is runtime suspended, it will check if the ODD attched to it is a zero power(ZP) capable ODD and if the ZP capable ODD is in zero power ready state. And if this is not the case, the highest acpi state will be limited to ACPI_STATE_D3_HOT to avoid powering off the ODD. And if the ODD can be powered off, runtime wake capability needs to be enabled and powered_off flag will be set to let resume code knows that the ODD was in powered off state. And on resume, before it is powered on, if it was powered off during suspend, runtime wake capability needs to be disabled. After it is recovered, the ODD is considered functional, post power on processing like eject tray if the ODD is drawer type is done, and several ZPODD related fields will also be reset. Signed-off-by: Aaron Lu <aaron.lu@intel.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/libata.h')
-rw-r--r--drivers/ata/libata.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
index b9b2bb1d5dc6..c949dd311b2e 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -242,11 +242,19 @@ static inline bool zpodd_dev_enabled(struct ata_device *dev)
242 return dev->zpodd != NULL; 242 return dev->zpodd != NULL;
243} 243}
244void zpodd_on_suspend(struct ata_device *dev); 244void zpodd_on_suspend(struct ata_device *dev);
245bool zpodd_zpready(struct ata_device *dev);
246void zpodd_enable_run_wake(struct ata_device *dev);
247void zpodd_disable_run_wake(struct ata_device *dev);
248void zpodd_post_poweron(struct ata_device *dev);
245#else /* CONFIG_SATA_ZPODD */ 249#else /* CONFIG_SATA_ZPODD */
246static inline void zpodd_init(struct ata_device *dev) {} 250static inline void zpodd_init(struct ata_device *dev) {}
247static inline void zpodd_exit(struct ata_device *dev) {} 251static inline void zpodd_exit(struct ata_device *dev) {}
248static inline bool zpodd_dev_enabled(struct ata_device *dev) { return false; } 252static inline bool zpodd_dev_enabled(struct ata_device *dev) { return false; }
249static inline void zpodd_on_suspend(struct ata_device *dev) {} 253static inline void zpodd_on_suspend(struct ata_device *dev) {}
254static inline bool zpodd_zpready(struct ata_device *dev) { return false; }
255static inline void zpodd_enable_run_wake(struct ata_device *dev) {}
256static inline void zpodd_disable_run_wake(struct ata_device *dev) {}
257static inline void zpodd_post_poweron(struct ata_device *dev) {}
250#endif /* CONFIG_SATA_ZPODD */ 258#endif /* CONFIG_SATA_ZPODD */
251 259
252#endif /* __LIBATA_H__ */ 260#endif /* __LIBATA_H__ */