forked from len0rd/rockbox
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>
This commit is contained in:
parent
b4a09868e1
commit
020f16a1c7
2 changed files with 13 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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) */
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue