From c922ad55965ee65fbbd6eb5ef0e600205fddb13f Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 16 Dec 2010 00:33:12 +0000 Subject: [PATCH] Changes to get USB host driver compile git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3184 42af7a65-404d-4744-a932-0658087f49c3 --- arch/arm/src/lpc17xx/lpc17_usbhost.c | 14 ++++++++++---- include/nuttx/usb/ohci.h | 10 +++++----- include/nuttx/usb/usbhost.h | 8 ++++---- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/arch/arm/src/lpc17xx/lpc17_usbhost.c b/arch/arm/src/lpc17xx/lpc17_usbhost.c index 26bbb07589..c65415ca11 100755 --- a/arch/arm/src/lpc17xx/lpc17_usbhost.c +++ b/arch/arm/src/lpc17xx/lpc17_usbhost.c @@ -50,8 +50,8 @@ #include #include -#include #include +#include #include #include @@ -86,7 +86,7 @@ # define usbhost_dumpgpio() \ do { \ lpc17_dumpgpio(GPIO_USB_DP, "D+ P0.29; D- P0.30"); \ - lpc17_dumpgpio(GPIO_USB_UPLED, "LED P1:18; PPWR P1:19 PWRD P1:22 PVRCR P1:27); \ + lpc17_dumpgpio(GPIO_USB_UPLED, "LED P1:18; PPWR P1:19 PWRD P1:22 PVRCR P1:27"); \ } while (0); #else # define usbhost_dumpgpio() @@ -188,6 +188,12 @@ static int lpc17_usbinterrupt(int irq, FAR void *context); /* USB host controller operations **********************************************/ +/* Initializaion ***************************************************************/ + +static void usbhost_tdinit(volatile struct usbhost_hctd_s *td); +static void usbhost_edinit(volatile struct usbhost_hced_s *); +static void usbhost_hccainit(volatile struct usbhost_hcca_s *hcca); + /******************************************************************************* * Private Data *******************************************************************************/ @@ -421,7 +427,7 @@ void up_usbhostinitialize(void) usbhost_edinit(EDBulkOut); usbhost_tdinit(TDHead); usbhost_tdinit(TDTail); - usbhost_hccanit(Hcca); + usbhost_hccainit(Hcca); /* Wait 50MS then perform hardware reset */ @@ -457,7 +463,7 @@ void up_usbhostinitialize(void) /* Clear pending interrupts */ regval = lpc17_getreg(LPC17_USBHOST_INTST); - lpc17_putreg(revgval, LPC17_USBHOST_INTST); + lpc17_putreg(regval, LPC17_USBHOST_INTST); /* Enable OHCI interrupts */ diff --git a/include/nuttx/usb/ohci.h b/include/nuttx/usb/ohci.h index dd714c7c1c..d23e1aa673 100755 --- a/include/nuttx/usb/ohci.h +++ b/include/nuttx/usb/ohci.h @@ -118,11 +118,11 @@ #define OHCI_CTRL_CLE (1 << 4) /* Bit 3: Control list enable */ #define OHCI_CTRL_BLE (1 << 5) /* Bit 4: Bulk list enable */ #define OHCI_CTRL_HCFS_SHIFT (6) /* Bits 6-7: Host controller functional state */ -#define OHCI_CTRL_HCFS_MASK (3 << OHCI_CTRL_HCFS_MASK) -# define OHCI_CTRL_HCFS_RESET (0 << OHCI_CTRL_HCFS_MASK) -# define OHCI_CTRL_HCFS_RESUME (1 << OHCI_CTRL_HCFS_MASK) -# define OHCI_CTRL_HCFS_OPER (2 << OHCI_CTRL_HCFS_MASK) -# define OHCI_CTRL_HCFS_SUSPEND (3 << OHCI_CTRL_HCFS_MASK) +#define OHCI_CTRL_HCFS_MASK (3 << OHCI_CTRL_HCFS_SHIFT) +# define OHCI_CTRL_HCFS_RESET (0 << OHCI_CTRL_HCFS_SHIFT) +# define OHCI_CTRL_HCFS_RESUME (1 << OHCI_CTRL_HCFS_SHIFT) +# define OHCI_CTRL_HCFS_OPER (2 << OHCI_CTRL_HCFS_SHIFT) +# define OHCI_CTRL_HCFS_SUSPEND (3 << OHCI_CTRL_HCFS_SHIFT) #define OHCI_CTRL_IR (1 << 8) /* Bit 8: Interrupt routing */ #define OHCI_CTRL_RWC (1 << 9) /* Bit 9: Remote wakeup connected */ #define OHCI_CTRL_RWE (1 << 10) /* Bit 10: Remote wakeup enable */ diff --git a/include/nuttx/usb/usbhost.h b/include/nuttx/usb/usbhost.h index a3a356df5d..7043c65e76 100644 --- a/include/nuttx/usb/usbhost.h +++ b/include/nuttx/usb/usbhost.h @@ -105,7 +105,7 @@ * ************************************************************************************/ -#definei CLASS_CONFIGDESC(class, configdesc, desclen) ((class)->configdesc(class, configdesc, desclen)) +#define CLASS_CONFIGDESC(class, configdesc, desclen) ((class)->configdesc(class, configdesc, desclen)) /************************************************************************************ * Name: CLASS_DISCONNECTED @@ -124,7 +124,7 @@ * ************************************************************************************/ -#definei CLASS_DISCONNECTED(class) ((class)->disconnected(class)) +#define CLASS_DISCONNECTED(class) ((class)->disconnected(class)) /************************************************************************************ * Public Types @@ -158,7 +158,7 @@ struct usbhost_registry_s * provide those instances in write-able memory (RAM). */ - struct usbhost_registry_s flink; + struct usbhost_registry_s *flink; /* This is a callback into the class implementation. It is used to (1) create * a new instance of the USB host class state and to (2) bind a USB host driver @@ -168,7 +168,7 @@ struct usbhost_registry_s */ FAR struct usbhost_class_s *(*create)(FAR struct usbhost_driver_s *drvr, - FAR const struct usbhost_id_s *id) + FAR const struct usbhost_id_s *id); /* This information uniquely identifies the USB host class implementation that * goes with a specific USB device.