diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2024-09-18 08:13:24 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2024-09-18 08:26:14 -0400 |
commit | e0df9952fd13904da646adae0409b5c76c67f298 (patch) | |
tree | faebef53c892535a8b1984eea87889f53f08afe7 /firmware/drivers | |
parent | c71b6265b09aa3ff017e17e3a1eb4c260aef816d (diff) | |
download | rockbox-e0df9952fd13904da646adae0409b5c76c67f298.tar.gz rockbox-e0df9952fd13904da646adae0409b5c76c67f298.zip |
ata: Alter ata_is_active() when drive doesn't support power management
Due to the heisenberg principle, we don't want to check the battery
level when the ATA drive is "spun up".
Unfortunately some ATA devices *cough most SD adapters cough* don't
support mandatory ATA power management commands like flushing caches and
(safely) shutting down so we have to leave them "spinning".
This leads to us never updating our battery status with these
out-of-spec devices. Work around this issue by having is_active() always
return false if that's what we have.
Change-Id: I629f3fdbc7e5cffb0a4d546c80cb5fca8529c0e6
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/ata.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 7b9c4910cf..b4d8a388ec 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -845,7 +845,7 @@ void ata_spindown(int seconds) | |||
845 | 845 | ||
846 | bool ata_disk_is_active(void) | 846 | bool ata_disk_is_active(void) |
847 | { | 847 | { |
848 | return ata_state >= ATA_SPINUP; | 848 | return ata_disk_can_poweroff() ? (ata_state >= ATA_SPINUP) : 0; |
849 | } | 849 | } |
850 | 850 | ||
851 | void ata_sleepnow(void) | 851 | void ata_sleepnow(void) |