summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2010-03-19 23:39:00 +0000
committerJens Arnold <amiconn@rockbox.org>2010-03-19 23:39:00 +0000
commit2bc9b067028eac40780ab6b8138aea4ec23f9eb6 (patch)
tree096371831f306fcc0791dde1af35e313f0929049
parentc28f56076e3edd5a39ca0f74e369da6991509600 (diff)
downloadrockbox-2bc9b067028eac40780ab6b8138aea4ec23f9eb6.tar.gz
rockbox-2bc9b067028eac40780ab6b8138aea4ec23f9eb6.zip
Reset USB bridge properly when selecting bus powered mode. The bridge might have been set to self powered by the cowon loader, and switching the mode requires a reset. Makes USB work on X5s which were set to 'hub mode' in the OF for some reason.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25252 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/coldfire/iaudio/usb-iaudio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/firmware/target/coldfire/iaudio/usb-iaudio.c b/firmware/target/coldfire/iaudio/usb-iaudio.c
index 036cd77828..f03942667d 100644
--- a/firmware/target/coldfire/iaudio/usb-iaudio.c
+++ b/firmware/target/coldfire/iaudio/usb-iaudio.c
@@ -26,9 +26,12 @@
void usb_init_device(void)
{
- or_l(0x00800010, &GPIO_OUT); /* RESET deasserted, VBUS powered */
+ and_l(~0x00800000, &GPIO_OUT); /* RESET asserted */
+ or_l(0x00000010, &GPIO_OUT); /* bus powered */
or_l(0x00800010, &GPIO_ENABLE);
or_l(0x00800010, &GPIO_FUNCTION);
+ sleep(1);
+ or_l(0x00800000, &GPIO_OUT); /* RESET deasserted */
or_l(0x00800000, &GPIO1_FUNCTION); /* USB detect */
}