summaryrefslogtreecommitdiff
path: root/firmware/target/arm
diff options
context:
space:
mode:
authorCástor Muñoz <cmvidal@gmail.com>2013-01-09 21:32:25 +0100
committerCástor Muñoz <cmvidal@gmail.com>2013-01-09 22:08:27 +0100
commit17e57e329184d7ef32151a68d2b3481efaa6089c (patch)
tree75d04227916645c52064aecfc86078edea8610ab /firmware/target/arm
parent1d901a82fdd0e2620fcdc70f08e414ace24331a2 (diff)
downloadrockbox-17e57e329184d7ef32151a68d2b3481efaa6089c.tar.gz
rockbox-17e57e329184d7ef32151a68d2b3481efaa6089c.zip
iPod Classic/6G: support USB suspend mode
Actually Rockbox does not use this mode, it is supported by other iPods, so implemented on Classic as well. Change-Id: Ia6578506df27a95a7f7522b3034b764631a8bb3a
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/s5l8702/ipod6g/power-ipod6g.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/firmware/target/arm/s5l8702/ipod6g/power-ipod6g.c b/firmware/target/arm/s5l8702/ipod6g/power-ipod6g.c
index 12948f581d..2e0fe87883 100644
--- a/firmware/target/arm/s5l8702/ipod6g/power-ipod6g.c
+++ b/firmware/target/arm/s5l8702/ipod6g/power-ipod6g.c
@@ -61,8 +61,17 @@ bool ide_powered()
61#ifdef HAVE_USB_CHARGING_ENABLE 61#ifdef HAVE_USB_CHARGING_ENABLE
62void usb_charging_maxcurrent_change(int maxcurrent) 62void usb_charging_maxcurrent_change(int maxcurrent)
63{ 63{
64 bool on = (maxcurrent >= 500); 64 bool suspend_charging = (maxcurrent < 100);
65 GPIOCMD = 0xb060e | (on ? 1 : 0); 65 bool fast_charging = (maxcurrent >= 500);
66
67 /* This GPIO is connected to the LTC4066's SUSP pin */
68 /* Setting it high prevents any power being drawn over USB */
69 /* which supports USB suspend */
70 GPIOCMD = 0xb070e | (suspend_charging ? 1 : 0);
71
72 /* This GPIO is connected to the LTC4066's HPWR pin */
73 /* Setting it low limits current to 100mA, setting it high allows 500mA */
74 GPIOCMD = 0xb060e | (fast_charging ? 1 : 0);
66} 75}
67#endif 76#endif
68 77