diff options
author | Dmitry Gamza <gamzad@yahoo.com> | 2013-04-05 13:33:51 +0400 |
---|---|---|
committer | Marcin Bukat <marcin.bukat@gmail.com> | 2014-04-02 20:28:37 +0200 |
commit | 020f16a1c7d5bc9a302671cef03f56ac735e20c5 (patch) | |
tree | 42d5fd51574054caaf673420fca1ec962d62d2f2 /firmware/target/coldfire/iriver/h100/usb-h100.c | |
parent | b4a09868e126b7ff243a27abd729144cef44c9bf (diff) |
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>
Diffstat (limited to 'firmware/target/coldfire/iriver/h100/usb-h100.c')
-rw-r--r-- | firmware/target/coldfire/iriver/h100/usb-h100.c | 10 |
1 files changed, 7 insertions, 3 deletions
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) */ } } |