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
This commit is contained in:
Paul Sauro 2025-02-04 13:45:46 +01:00 committed by Solomon Peachy
parent f60892e26c
commit 4bde992ca3

View file

@ -106,12 +106,16 @@ void ide_power_enable(bool on)
if (on) if (on)
{ {
GPIO_CLEAR_BITWISE(GPIOJ_OUTPUT_VAL, 0x04); GPIO_CLEAR_BITWISE(GPIOJ_OUTPUT_VAL, 0x04);
GPIO_CLEAR_BITWISE(GPIOI_ENABLE, 0xBF);
GPIO_CLEAR_BITWISE(GPIOK_ENABLE, 0x1F);
DEV_EN |= DEV_IDE0; DEV_EN |= DEV_IDE0;
} }
else else
{ {
DEV_EN &= ~DEV_IDE0; DEV_EN &= ~DEV_IDE0;
GPIO_SET_BITWISE(GPIOJ_OUTPUT_VAL, 0x04); GPIO_SET_BITWISE(GPIOJ_OUTPUT_VAL, 0x04);
GPIO_SET_BITWISE(GPIOI_ENABLE, 0xBF);
GPIO_SET_BITWISE(GPIOK_ENABLE, 0x1F);
} }
#elif defined(IPOD_VIDEO) #elif defined(IPOD_VIDEO)
if (on) if (on)