From a119c44c7ec7a383dafbb391f052aaade0b6c981 Mon Sep 17 00:00:00 2001 From: Maurus Cuelenaere Date: Thu, 4 Dec 2008 18:26:19 +0000 Subject: Ingenic targets: * Clean up codec & PCM + functional changes * LCD: Don't wait on DMAC in lcd_unlock() * SADC: add battery mutex + other changes * NAND: add mutex * USB rework (still not working) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19327 a1c6a512-1295-4272-9138-f99709370657 --- .../mips/ingenic_jz47xx/onda_vx747/usb-target.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'firmware/target/mips/ingenic_jz47xx/onda_vx747/usb-target.h') diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/usb-target.h b/firmware/target/mips/ingenic_jz47xx/onda_vx747/usb-target.h index c681bdaa12..09b563fd14 100644 --- a/firmware/target/mips/ingenic_jz47xx/onda_vx747/usb-target.h +++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/usb-target.h @@ -24,23 +24,19 @@ #include "config.h" -#define __gpio_as_usb_detect() \ -do { \ - REG_GPIO_PXFUNS(3) = 0x10000000; \ - REG_GPIO_PXSELS(3) = 0x10000000; \ - REG_GPIO_PXPES(3) = 0x10000000; \ -} while (0) - #define GPIO_UDC_DETE (32 * 3 + 28) #define IRQ_GPIO_UDC_DETE (IRQ_GPIO_0 + GPIO_UDC_DETE) -static inline void usb_init_gpio(void) -{ - __gpio_as_usb_detect(); - system_enable_irq(IRQ_UDC); - __gpio_as_input(GPIO_UDC_DETE); +#define USB_INIT_GPIO() \ +{ \ + REG_GPIO_PXFUNS(3) = 0x10000000; \ + REG_GPIO_PXSELS(3) = 0x10000000; \ + REG_GPIO_PXPES(3) = 0x10000000; \ + __gpio_as_input(GPIO_UDC_DETE); \ } +#define USB_DRV_CONNECTED() (__gpio_get_pin(GPIO_UDC_DETE) == 1) + int usb_detect(void); void usb_init_device(void); bool usb_drv_connected(void); -- cgit v1.2.3