From 4bde992ca341dd36080e4d5c54c2795a6192fdb9 Mon Sep 17 00:00:00 2001 From: Paul Sauro Date: Tue, 4 Feb 2025 13:45:46 +0100 Subject: [PATCH] pp502x: Fully shut down storage power on older(4g/photo, mini, mini2g) iPods On these older iPods, power was not being shut down completely, which led to a backfeed situation leading to decreased battery life and some stability issues. This was particuarly apparent when using SD card adapters that do not respect the ATA power management commands (ie all of them), as they never enter a low-power state on their own. With this change, there are reports of battery life exceeding 20 hours of continuous playback (~30% increase with CF cards, 3x improvement with SD cards) and appears to resolve intermittent wakeup stability issues with SD adapters. Change-Id: I46cfff7a59bb18a448989812303f30869df24d2d --- firmware/target/arm/ipod/power-ipod.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/firmware/target/arm/ipod/power-ipod.c b/firmware/target/arm/ipod/power-ipod.c index fcaf5b4ff8..34adf3315a 100644 --- a/firmware/target/arm/ipod/power-ipod.c +++ b/firmware/target/arm/ipod/power-ipod.c @@ -106,12 +106,16 @@ void ide_power_enable(bool on) if (on) { GPIO_CLEAR_BITWISE(GPIOJ_OUTPUT_VAL, 0x04); + GPIO_CLEAR_BITWISE(GPIOI_ENABLE, 0xBF); + GPIO_CLEAR_BITWISE(GPIOK_ENABLE, 0x1F); DEV_EN |= DEV_IDE0; } else { DEV_EN &= ~DEV_IDE0; GPIO_SET_BITWISE(GPIOJ_OUTPUT_VAL, 0x04); + GPIO_SET_BITWISE(GPIOI_ENABLE, 0xBF); + GPIO_SET_BITWISE(GPIOK_ENABLE, 0x1F); } #elif defined(IPOD_VIDEO) if (on)