From 173b611921db2d353d977dc617a8288345f5e6ed Mon Sep 17 00:00:00 2001 From: Karl Kurbjun Date: Mon, 7 May 2007 19:34:34 +0000 Subject: Basic gigabeat buttonlight support outside of debug menu FS#7112. Also disables USB PLL and the USB device clock (uneeded to connect to computer) - May offer some power savings. Changed how some pins are initialized. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13346 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/s3c2440/gigabeat-fx/usb-meg-fx.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'firmware/target/arm/s3c2440/gigabeat-fx/usb-meg-fx.c') diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/usb-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/usb-meg-fx.c index af66e2a60c..374fb21136 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/usb-meg-fx.c +++ b/firmware/target/arm/s3c2440/gigabeat-fx/usb-meg-fx.c @@ -17,7 +17,6 @@ * ****************************************************************************/ #include "config.h" -#include #include "cpu.h" #include "system.h" #include "kernel.h" @@ -46,14 +45,14 @@ void usb_init_device(void) /* Input is the default configuration, only pullups need to be disabled */ /* GPFUP|=0x02; */ - USB_VPLUS_PWR_ASSERT; GPBCON=( GPBCON&~(1<<13) ) | (1 << 12); + USB_VPLUS_PWR_ASSERT; sleep(HZ/20); /* Reset the usb port */ - USB_RST_ASSERT; GPBCON = (GPBCON & ~0x200) | 0x100; /* Make sure reset line is an output */ + USB_RST_ASSERT; sleep(HZ/25); USB_RST_DEASSERT; @@ -75,6 +74,9 @@ void usb_init_device(void) void usb_enable(bool on) { + GPHCON=( GPHCON&~(1<<17) ) | (1<<16); /* Make the pin an output */ + GPHUP|=1<<8; /* Disable pullup in SOC as we are now driving */ + if (on) { USB_VPLUS_PWR_ASSERT; @@ -86,9 +88,5 @@ void usb_enable(bool on) USB_VPLUS_PWR_DEASSERT; } - /* Make sure USB_CRADLE_BUS pin is an output */ - GPHCON=( GPHCON&~(1<<17) ) | (1<<16); /* Make the pin an output */ - GPHUP|=1<<8; /* Disable pullup in SOC as we are now driving */ - sleep(HZ/20); // > 50ms for detecting the enable state change } -- cgit v1.2.3