summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-05-17 21:17:46 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-05-17 21:17:46 +0000
commit7dd0297a4d11ef880623f460fc19a7bde242cb8d (patch)
treec793ab7e7f0af04db9d46ca150889c32c9c73c18
parent949d99546e764a0c6802feb9b1d60124258137af (diff)
as3525: correctly detect usb status if we boot with USB plugged
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26118 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/as3525/ascodec-as3525.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/firmware/target/arm/as3525/ascodec-as3525.c b/firmware/target/arm/as3525/ascodec-as3525.c
index 52d50ef077..adc9b7f9a8 100644
--- a/firmware/target/arm/as3525/ascodec-as3525.c
+++ b/firmware/target/arm/as3525/ascodec-as3525.c
@@ -190,6 +190,12 @@ void ascodec_init(void)
VIC_INT_ENABLE = INTERRUPT_AUDIO;
#endif
+ /* detect if USB was connected at startup since there is no transition */
+ if(ascodec_read(AS3514_IRQ_ENRD0) & USB_STATUS)
+ usb_insert_int();
+ else
+ usb_remove_int();
+
/* Generate irq for usb+charge status change */
ascodec_write(AS3514_IRQ_ENRD0,
#ifdef CONFIG_CHARGING /* m200v4 can't charge */