summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2006-02-13 22:49:59 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2006-02-13 22:49:59 +0000
commit2612d371db45413f2536e898dfb66e19d7623598 (patch)
treeccfdddc23612eab5b978e0980877b25a271b2ce6
parentb8441b590e7751ac67d7fdc02e15aac1a0c27da1 (diff)
downloadrockbox-2612d371db45413f2536e898dfb66e19d7623598.tar.gz
rockbox-2612d371db45413f2536e898dfb66e19d7623598.zip
More correct power handling of the HDD and ISD300 chips on the H300 platform
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8688 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/power.c14
-rw-r--r--firmware/usb.c9
2 files changed, 14 insertions, 9 deletions
diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c
index d7750a33b2..e11921ea91 100644
--- a/firmware/drivers/power.c
+++ b/firmware/drivers/power.c
@@ -71,6 +71,13 @@ void power_init(void)
71 or_l(0x00080000, &GPIO1_ENABLE); 71 or_l(0x00080000, &GPIO1_ENABLE);
72 or_l(0x00080000, &GPIO1_FUNCTION); 72 or_l(0x00080000, &GPIO1_FUNCTION);
73 73
74#ifdef IRIVER_H300_SERIES
75 /* ISD300 3.3V ON */
76 or_l(8,&GPIO1_FUNCTION);
77 or_l(8,&GPIO1_OUT);
78 or_l(8,&GPIO1_ENABLE);
79#endif
80
74#ifndef BOOTLOADER 81#ifndef BOOTLOADER
75 /* The boot loader controls the power */ 82 /* The boot loader controls the power */
76 ide_power_enable(true); 83 ide_power_enable(true);
@@ -178,6 +185,13 @@ void ide_power_enable(bool on)
178 and_l(~0x80000000, &GPIO_OUT); 185 and_l(~0x80000000, &GPIO_OUT);
179 else 186 else
180 or_l(0x80000000, &GPIO_OUT); 187 or_l(0x80000000, &GPIO_OUT);
188#ifdef IRIVER_H300_SERIES
189 if(on)
190 and_l(~0x00000008,&GPIO1_OUT); /* ISD300 3.3V on */
191 else
192 or_l(0x00000008,&GPIO1_OUT); /* ISD300 3.3V off */
193#endif
194
181#elif defined(IAUDIO_X5) 195#elif defined(IAUDIO_X5)
182 /* X5 TODO */ 196 /* X5 TODO */
183#elif (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020) 197#elif (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020)
diff --git a/firmware/usb.c b/firmware/usb.c
index 1c90d63519..d6a154c51b 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -151,8 +151,6 @@ void usb_enable(bool on)
151 /* Power on the Cypress chip */ 151 /* Power on the Cypress chip */
152#ifdef IRIVER_H100_SERIES 152#ifdef IRIVER_H100_SERIES
153 or_l(0x01000040, &GPIO_OUT); 153 or_l(0x01000040, &GPIO_OUT);
154#else
155 and_l(~0x00000008,&GPIO1_OUT);
156#endif 154#endif
157 sleep(2); 155 sleep(2);
158 } 156 }
@@ -161,8 +159,6 @@ void usb_enable(bool on)
161 /* Power off the Cypress chip */ 159 /* Power off the Cypress chip */
162#ifdef IRIVER_H100_SERIES 160#ifdef IRIVER_H100_SERIES
163 and_l(~0x01000040, &GPIO_OUT); 161 and_l(~0x01000040, &GPIO_OUT);
164#else
165 or_l(0x00000008,&GPIO1_OUT);
166#endif 162#endif
167 } 163 }
168 164
@@ -483,11 +479,6 @@ void usb_init(void)
483 or_l(0x00000080, &GPIO1_FUNCTION); /* GPIO39 is the USB detect input */ 479 or_l(0x00000080, &GPIO1_FUNCTION); /* GPIO39 is the USB detect input */
484 480
485#ifdef IRIVER_H300_SERIES 481#ifdef IRIVER_H300_SERIES
486 /* ISD300 3.3V ON */
487 or_l(8,&GPIO1_FUNCTION);
488 or_l(8,&GPIO1_OUT);
489 or_l(8,&GPIO1_ENABLE);
490
491 /* Tristate the SCK/SDA to the ISD300 config EEPROM */ 482 /* Tristate the SCK/SDA to the ISD300 config EEPROM */
492 and_l(~0x03000000, &GPIO_ENABLE); 483 and_l(~0x03000000, &GPIO_ENABLE);
493 or_l(0x03000000, &GPIO_FUNCTION); 484 or_l(0x03000000, &GPIO_FUNCTION);