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.zip
rockbox-2612d371db45413f2536e898dfb66e19d7623598.tar.gz
rockbox-2612d371db45413f2536e898dfb66e19d7623598.tar.bz2
rockbox-2612d371db45413f2536e898dfb66e19d7623598.tar.xz
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 d7750a3..e11921e 100644
--- a/firmware/drivers/power.c
+++ b/firmware/drivers/power.c
@@ -71,6 +71,13 @@ void power_init(void)
or_l(0x00080000, &GPIO1_ENABLE);
or_l(0x00080000, &GPIO1_FUNCTION);
+#ifdef IRIVER_H300_SERIES
+ /* ISD300 3.3V ON */
+ or_l(8,&GPIO1_FUNCTION);
+ or_l(8,&GPIO1_OUT);
+ or_l(8,&GPIO1_ENABLE);
+#endif
+
#ifndef BOOTLOADER
/* The boot loader controls the power */
ide_power_enable(true);
@@ -178,6 +185,13 @@ void ide_power_enable(bool on)
and_l(~0x80000000, &GPIO_OUT);
else
or_l(0x80000000, &GPIO_OUT);
+#ifdef IRIVER_H300_SERIES
+ if(on)
+ and_l(~0x00000008,&GPIO1_OUT); /* ISD300 3.3V on */
+ else
+ or_l(0x00000008,&GPIO1_OUT); /* ISD300 3.3V off */
+#endif
+
#elif defined(IAUDIO_X5)
/* X5 TODO */
#elif (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020)
diff --git a/firmware/usb.c b/firmware/usb.c
index 1c90d63..d6a154c 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -151,8 +151,6 @@ void usb_enable(bool on)
/* Power on the Cypress chip */
#ifdef IRIVER_H100_SERIES
or_l(0x01000040, &GPIO_OUT);
-#else
- and_l(~0x00000008,&GPIO1_OUT);
#endif
sleep(2);
}
@@ -161,8 +159,6 @@ void usb_enable(bool on)
/* Power off the Cypress chip */
#ifdef IRIVER_H100_SERIES
and_l(~0x01000040, &GPIO_OUT);
-#else
- or_l(0x00000008,&GPIO1_OUT);
#endif
}
@@ -483,11 +479,6 @@ void usb_init(void)
or_l(0x00000080, &GPIO1_FUNCTION); /* GPIO39 is the USB detect input */
#ifdef IRIVER_H300_SERIES
- /* ISD300 3.3V ON */
- or_l(8,&GPIO1_FUNCTION);
- or_l(8,&GPIO1_OUT);
- or_l(8,&GPIO1_ENABLE);
-
/* Tristate the SCK/SDA to the ISD300 config EEPROM */
and_l(~0x03000000, &GPIO_ENABLE);
or_l(0x03000000, &GPIO_FUNCTION);