From dcf6bd23f3e40530ecbb9987f758b34bf35c7423 Mon Sep 17 00:00:00 2001 From: Karl Kurbjun Date: Thu, 12 Apr 2007 07:21:51 +0000 Subject: Fix the backlight and led bugs from my last commit git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13119 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/gigabeat/meg-fx/ata-meg-fx.c | 10 +--------- firmware/target/arm/gigabeat/meg-fx/usb-meg-fx.c | 23 ++++++++++------------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/firmware/target/arm/gigabeat/meg-fx/ata-meg-fx.c b/firmware/target/arm/gigabeat/meg-fx/ata-meg-fx.c index 3c6374f0cd..bc2b53d776 100644 --- a/firmware/target/arm/gigabeat/meg-fx/ata-meg-fx.c +++ b/firmware/target/arm/gigabeat/meg-fx/ata-meg-fx.c @@ -53,15 +53,7 @@ void ata_enable(bool on) USB_ATA_ENABLE; GPBCON=( GPGCON&~(1<<11) ) | (1<<10); /* Make the pin an output */ - GPBUP|=1<<5; /* Disable pullup in SOC as we are now driving */ - -/* Code was originally: (Does not seem that GPG12 is connected in the F series) - if(on) - GPGDAT &= 1<<12; - else - GPGDAT |= 1<<12; -*/ - +// GPBUP|=1<<5; /* Disable pullup in SOC as we are now driving */ } bool ata_is_coldstart(void) diff --git a/firmware/target/arm/gigabeat/meg-fx/usb-meg-fx.c b/firmware/target/arm/gigabeat/meg-fx/usb-meg-fx.c index ead286cec4..3aed8c3256 100644 --- a/firmware/target/arm/gigabeat/meg-fx/usb-meg-fx.c +++ b/firmware/target/arm/gigabeat/meg-fx/usb-meg-fx.c @@ -44,35 +44,32 @@ inline bool usb_detect(void) void usb_init_device(void) { /* Input is the default configuration, only pullups need to be disabled */ - GPFUP|=0x03; - GPGUP|= 1<<14; + GPFUP|=0x02; USB_VPLUS_PWR_ASSERT; GPBCON=( GPBCON&~(1<<13) ) | (1 << 12); - GPBUP|= 1<<6; sleep(HZ/20); - + /* Reset the usb port */ USB_RST_ASSERT; GPBCON = (GPBCON & ~0x200) | 0x100; /* Make sure reset line is an output */ - GPBUP |= 1<<4; /* Make sure pullup is disabled */ sleep(HZ/25); USB_RST_DEASSERT; - + /* needed to complete the reset */ ata_enable(false); - + sleep(HZ/15); /* 66ms */ - + ata_enable(true); - + sleep(HZ/25); - + /* leave chip in low power mode */ USB_VPLUS_PWR_DEASSERT; - + sleep(HZ/25); } @@ -90,8 +87,8 @@ void usb_enable(bool on) } /* Make sure USB_CRADLE_BUS pin is an output */ - GPHCON=( GPGCON&~(1<<17) ) | (1<<16); /* Make the pin an output */ - GPBUP|=1<<8; /* Disable pullup in SOC as we are now driving */ + 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