Browse Source

USB: fsl_usb2_udc: Fix UMTI_WIDE support and a compile warning

Change PORT_WIDTH bit for UMTI_WIDE mode and fix a compile warning
introduced in last revision.

Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Li Yang 18 years ago
parent
commit
fcbd963912
1 changed files with 5 additions and 3 deletions
  1. 5 3
      drivers/usb/gadget/fsl_usb2_udc.c

+ 5 - 3
drivers/usb/gadget/fsl_usb2_udc.c

@@ -228,13 +228,15 @@ static int dr_controller_setup(struct fsl_udc *udc)
 
 
 	/* Config PHY interface */
 	/* Config PHY interface */
 	portctrl = fsl_readl(&dr_regs->portsc1);
 	portctrl = fsl_readl(&dr_regs->portsc1);
-	portctrl &= ~PORTSCX_PHY_TYPE_SEL;
+	portctrl &= ~(PORTSCX_PHY_TYPE_SEL & PORTSCX_PORT_WIDTH);
 	switch (udc->phy_mode) {
 	switch (udc->phy_mode) {
 	case FSL_USB2_PHY_ULPI:
 	case FSL_USB2_PHY_ULPI:
 		portctrl |= PORTSCX_PTS_ULPI;
 		portctrl |= PORTSCX_PTS_ULPI;
 		break;
 		break;
-	case FSL_USB2_PHY_UTMI:
 	case FSL_USB2_PHY_UTMI_WIDE:
 	case FSL_USB2_PHY_UTMI_WIDE:
+		portctrl |= PORTSCX_PTW_16BIT;
+		/* fall through */
+	case FSL_USB2_PHY_UTMI:
 		portctrl |= PORTSCX_PTS_UTMI;
 		portctrl |= PORTSCX_PTS_UTMI;
 		break;
 		break;
 	case FSL_USB2_PHY_SERIAL:
 	case FSL_USB2_PHY_SERIAL:
@@ -625,7 +627,7 @@ static void fsl_free_buffer(struct usb_ep *_ep, void *buf,
 	struct fsl_ep *ep;
 	struct fsl_ep *ep;
 
 
 	if (!_ep)
 	if (!_ep)
-		return NULL;
+		return;
 
 
 	ep = container_of(_ep, struct fsl_ep, ep);
 	ep = container_of(_ep, struct fsl_ep, ep);