summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gamza <gamzad@yahoo.com>2013-04-05 13:33:51 +0400
committerMarcin Bukat <marcin.bukat@gmail.com>2014-04-02 20:28:37 +0200
commit020f16a1c7d5bc9a302671cef03f56ac735e20c5 (patch)
tree42d5fd51574054caaf673420fca1ec962d62d2f2
parentb4a09868e126b7ff243a27abd729144cef44c9bf (diff)
downloadrockbox-020f16a.tar.gz
rockbox-020f16a.tar.bz2
rockbox-020f16a.zip
optimize Cypress chip power supply for iriver h100 series
Before, the Cypress chip power is always turn on either from internal battery or from usb host. In this regard, the internal battery energy was spend on the inactive chip. Now power of the Cypress chip is enabled only on the external usb host. Change-Id: Iae7cddd1237ea9ed93fee5404575cc01543cb00c Reviewed-on: http://gerrit.rockbox.org/433 Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
-rw-r--r--firmware/target/coldfire/iriver/ata-iriver.c6
-rw-r--r--firmware/target/coldfire/iriver/h100/usb-h100.c10
2 files changed, 13 insertions, 3 deletions
diff --git a/firmware/target/coldfire/iriver/ata-iriver.c b/firmware/target/coldfire/iriver/ata-iriver.c
index 1b8f475c4c..92b953d24e 100644
--- a/firmware/target/coldfire/iriver/ata-iriver.c
+++ b/firmware/target/coldfire/iriver/ata-iriver.c
@@ -55,9 +55,15 @@ bool ata_is_coldstart(void)
void ata_device_init(void)
{
#ifdef HAVE_ATA_LED_CTRL
+#if defined(IRIVER_H100_SERIES) /* For iriver H100 series only */
+ /* Enable disk LED */
+ and_l(~0x00000200, &GPIO_OUT);
+ or_l( 0x00000200, &GPIO_ENABLE);
+#else
/* Enable disk LED & ISD chip power control */
and_l(~0x00000240, &GPIO_OUT);
or_l( 0x00000240, &GPIO_ENABLE);
+#endif /* IRIVER_H100_SERIES */
or_l( 0x00000200, &GPIO_FUNCTION);
#endif
diff --git a/firmware/target/coldfire/iriver/h100/usb-h100.c b/firmware/target/coldfire/iriver/h100/usb-h100.c
index 62e715788d..647c9f8b64 100644
--- a/firmware/target/coldfire/iriver/h100/usb-h100.c
+++ b/firmware/target/coldfire/iriver/h100/usb-h100.c
@@ -28,7 +28,11 @@
void usb_init_device(void)
{
or_l(0x00000080, &GPIO1_FUNCTION); /* GPIO39 is the USB detect input */
- and_l(~0x01000040, &GPIO_OUT); /* GPIO24 is the Cypress chip power */
+
+ /* Turn off all Cypress chip power suppies */
+ and_l(~0x01000000, &GPIO_OUT); /* GPIO24 (USB_EN) - low (controled power from usb host) */
+ or_l(0x40, &GPIO_OUT); /* GPOI6 (USB_POW_ON) - high (controled power from internal battery) */
+
or_l(0x01000040, &GPIO_ENABLE);
or_l(0x01000040, &GPIO_FUNCTION);
}
@@ -43,12 +47,12 @@ void usb_enable(bool on)
if(on)
{
/* Power on the Cypress chip */
- or_l(0x01000040, &GPIO_OUT);
+ or_l(0x01000000, &GPIO_OUT); /* Turn on only GPIO24 (USB_EN). GPOI6 (USB_POW_ON) still at high state (off) */
sleep(2);
}
else
{
/* Power off the Cypress chip */
- and_l(~0x01000040, &GPIO_OUT);
+ and_l(~0x01000000, &GPIO_OUT); /* Turn off only GPIO24 (USB_EN). GPOI6 (USB_POW_ON) still at high state (off) */
}
}