summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2009-10-13 09:23:32 +0000
committerDave Chapman <dave@dchapman.com>2009-10-13 09:23:32 +0000
commit745266d309e9434e67bdb81cfe93482bd2b26f86 (patch)
tree21f54983f7979bfe660fc7d91b33fd90b0938ec6 /firmware/target
parent008f01348bf47a153c4463281df071304bea2392 (diff)
downloadrockbox-745266d309e9434e67bdb81cfe93482bd2b26f86.tar.gz
rockbox-745266d309e9434e67bdb81cfe93482bd2b26f86.zip
Re-commit r23070 - reboot to disk mode on the Nano2G when USB is inserted. This was accidentally reverted in r23099
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23148 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/s5l8700/usb-s5l8700.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/firmware/target/arm/s5l8700/usb-s5l8700.c b/firmware/target/arm/s5l8700/usb-s5l8700.c
index 6ad4dcea95..c0bf7a951b 100644
--- a/firmware/target/arm/s5l8700/usb-s5l8700.c
+++ b/firmware/target/arm/s5l8700/usb-s5l8700.c
@@ -20,6 +20,9 @@
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "config.h" 21#include "config.h"
22#include "usb.h" 22#include "usb.h"
23#include "cpu.h"
24#include "system.h"
25#include "string.h"
23 26
24void usb_init_device(void) 27void usb_init_device(void)
25{ 28{
@@ -27,21 +30,27 @@ void usb_init_device(void)
27 30
28void usb_enable(bool on) 31void usb_enable(bool on)
29{ 32{
30 (void)on; 33 /* This device specific code will eventually give way to proper USB
31} 34 handling, which should be the same for all S5L870x targets. */
32 35 if (on)
33void usb_attach(void) 36 {
34{ 37#ifdef IPOD_ARCH
38 /* For iPod, we can only do one thing with USB mode atm - reboot
39 into the flash-based disk-mode. This does not return. */
35 40
36} 41 memcpy((void *)0x0002bf00, "diskmodehotstuff\1\0\0\0", 20);
37 42
38static bool usb_pin_state(void) 43 system_reboot(); /* Reboot */
39{ 44#endif
40 return false; 45 }
41} 46}
42 47
43/* detect host or charger (INSERTED or EXTRACTED) */
44int usb_detect(void) 48int usb_detect(void)
45{ 49{
46 return usb_pin_state() ? USB_INSERTED : USB_EXTRACTED; 50#if defined(IPOD_NANO2G)
51 if ((PDAT14 & 0x8) == 0x0)
52 return USB_INSERTED;
53#endif
54
55 return USB_EXTRACTED;
47} 56}