2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-29 15:43:59 +08:00

usb: fixes for v3.11-rc1

Quite a few changes going on here. They have been
 boot tested on OMAP5 and compile tested on ARM and x86
 with different defconfigs.
 
 Many gadget drivers got a depends on HAS_DMA in order
 to prevent build failures on !HAS_DMA architectures.
 
 DWC3 learned how to allow a gadget driver to be modprobed
 after an unsuccessful modprobe of another gadget driver. It
 also got a fix to a wrong bit mask in dwc3_event_type, and
 learns to return proper error codes from failed usb3_phy
 initialization.
 
 RNDIS function driver can now be built with configfs.
 
 at91_udc now knows that we need to prepare the clock
 before enabling it.
 
 renesas_usbhs now lets gadget drivers be modprobed
 multiple times.
 
 phy-omap-usb3 got a fix for the DPLL settings.
 
 mv_u3d_core now passes the correct cookie to free_irq().
 
 fotg210-udc got Section mismatch fixes.
 
 Signed-of-by: Felipe Balbi <balbi@ti.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJR5QV3AAoJEIaOsuA1yqREt68P/iMIp4mKr1bTndydwl+Q856I
 XZlSu5RT0XAS9uyNqUbbQ4Qv70Wljon1BcvKYUD9wOFN+Xmj+ir5Lff38loKgBdG
 GpL6NFcdrCEiijEfZvVZ4c7D3SvoAU4IiA8hfN9pRnacF4X3LvdekVU1De5bgiK5
 mPdRLpCACtTwgUfX8umY3A41m3lDiUEP9nNG3XE5sAbkf77dwcKbGLjAqgi6ps0G
 gOMv9siVP3rjcBj1cgjfuBU9BM0Wd4xOepT1zVBnd4D4uG12pKLFN3gSRpp8JQGS
 M489Mgqt7uJEMxWn41IAZEKrDS/TtNLpr89xqjWpcxMZkJbfZAPbAwO7eK3oit2Q
 RwFx9bRWD+ifQIzsjbgp3bMIkh1AHevRF2foxrD5DFjx+hVjHUnCG0EZMd8SRaru
 OgTX02nkYw/a8IhWEgcJmtOw3QV8/tjRQMw/eZFsqw19anBWS+NiMExnRBGlFm4h
 X5SwydTDr3bAg5HpbZMbaF/z7uZpL78xXQaEghjFNptARFXjcWDgHVH/1SbyjYjw
 WvsPVtLUUs7fOvFVZxntzX6iuJLr2TwELBK24zyQ/p00HFl5PP+AESZpQo37UfSG
 KOK3kxL2fI7+0+6YGDqOw73OXk5TbxSgbsrizK9lU0pmCaEWVa0qgsyqQzW92W+a
 /TYmt/6btcd38O5EsIQu
 =Xioz
 -----END PGP SIGNATURE-----

Merge tag 'fixes-for-v3.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus

Felipe writes:

usb: fixes for v3.11-rc1

Quite a few changes going on here. They have been
boot tested on OMAP5 and compile tested on ARM and x86
with different defconfigs.

Many gadget drivers got a depends on HAS_DMA in order
to prevent build failures on !HAS_DMA architectures.

DWC3 learned how to allow a gadget driver to be modprobed
after an unsuccessful modprobe of another gadget driver. It
also got a fix to a wrong bit mask in dwc3_event_type, and
learns to return proper error codes from failed usb3_phy
initialization.

RNDIS function driver can now be built with configfs.

at91_udc now knows that we need to prepare the clock
before enabling it.

renesas_usbhs now lets gadget drivers be modprobed
multiple times.

phy-omap-usb3 got a fix for the DPLL settings.

mv_u3d_core now passes the correct cookie to free_irq().

fotg210-udc got Section mismatch fixes.

Signed-of-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
Greg Kroah-Hartman 2013-07-16 11:17:01 -07:00
commit 39c242704c
12 changed files with 30 additions and 22 deletions

View File

@ -1,6 +1,6 @@
config USB_DWC3
tristate "DesignWare USB3 DRD Core Support"
depends on (USB || USB_GADGET) && GENERIC_HARDIRQS
depends on (USB || USB_GADGET) && GENERIC_HARDIRQS && HAS_DMA
select USB_XHCI_PLATFORM if USB_SUPPORT && USB_XHCI_HCD
help
Say Y or M here if your system has a Dual Role SuperSpeed

View File

@ -450,7 +450,7 @@ static int dwc3_probe(struct platform_device *pdev)
}
if (IS_ERR(dwc->usb3_phy)) {
ret = PTR_ERR(dwc->usb2_phy);
ret = PTR_ERR(dwc->usb3_phy);
/*
* if -ENXIO is returned, it means PHY layer wasn't

View File

@ -759,8 +759,8 @@ struct dwc3 {
struct dwc3_event_type {
u32 is_devspec:1;
u32 type:6;
u32 reserved8_31:25;
u32 type:7;
u32 reserved8_31:24;
} __packed;
#define DWC3_DEPEVT_XFERCOMPLETE 0x01

View File

@ -1584,6 +1584,7 @@ err1:
__dwc3_gadget_ep_disable(dwc->eps[0]);
err0:
dwc->gadget_driver = NULL;
spin_unlock_irqrestore(&dwc->lock, flags);
return ret;

View File

@ -193,6 +193,7 @@ config USB_FUSB300
Faraday usb device controller FUSB300 driver
config USB_FOTG210_UDC
depends on HAS_DMA
tristate "Faraday FOTG210 USB Peripheral Controller"
help
Faraday USB2.0 OTG controller which can be configured as
@ -328,13 +329,14 @@ config USB_S3C_HSUDC
config USB_MV_UDC
tristate "Marvell USB2.0 Device Controller"
depends on GENERIC_HARDIRQS
depends on GENERIC_HARDIRQS && HAS_DMA
help
Marvell Socs (including PXA and MMP series) include a high speed
USB2.0 OTG controller, which can be configured as high speed or
full speed USB peripheral.
config USB_MV_U3D
depends on HAS_DMA
tristate "MARVELL PXA2128 USB 3.0 controller"
help
MARVELL PXA2128 Processor series include a super speed USB3.0 device
@ -639,6 +641,7 @@ config USB_CONFIGFS_RNDIS
depends on USB_CONFIGFS
depends on NET
select USB_U_ETHER
select USB_U_RNDIS
select USB_F_RNDIS
help
Microsoft Windows XP bundles the "Remote NDIS" (RNDIS) protocol,

View File

@ -870,8 +870,8 @@ static void clk_on(struct at91_udc *udc)
if (udc->clocked)
return;
udc->clocked = 1;
clk_enable(udc->iclk);
clk_enable(udc->fclk);
clk_prepare_enable(udc->iclk);
clk_prepare_enable(udc->fclk);
}
static void clk_off(struct at91_udc *udc)
@ -880,8 +880,8 @@ static void clk_off(struct at91_udc *udc)
return;
udc->clocked = 0;
udc->gadget.speed = USB_SPEED_UNKNOWN;
clk_disable(udc->fclk);
clk_disable(udc->iclk);
clk_disable_unprepare(udc->fclk);
clk_disable_unprepare(udc->iclk);
}
/*
@ -1725,7 +1725,7 @@ static int at91udc_probe(struct platform_device *pdev)
/* init software state */
udc = &controller;
udc->gadget.dev.parent = dev;
if (pdev->dev.of_node)
if (IS_ENABLED(CONFIG_OF) && pdev->dev.of_node)
at91udc_of_init(udc, pdev->dev.of_node);
else
memcpy(&udc->board, dev->platform_data,
@ -1782,12 +1782,14 @@ static int at91udc_probe(struct platform_device *pdev)
}
/* don't do anything until we have both gadget driver and VBUS */
clk_enable(udc->iclk);
retval = clk_prepare_enable(udc->iclk);
if (retval)
goto fail1;
at91_udp_write(udc, AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS);
at91_udp_write(udc, AT91_UDP_IDR, 0xffffffff);
/* Clear all pending interrupts - UDP may be used by bootloader. */
at91_udp_write(udc, AT91_UDP_ICR, 0xffffffff);
clk_disable(udc->iclk);
clk_disable_unprepare(udc->iclk);
/* request UDC and maybe VBUS irqs */
udc->udp_irq = platform_get_irq(pdev, 0);

View File

@ -1074,7 +1074,7 @@ static struct usb_gadget_ops fotg210_gadget_ops = {
.udc_stop = fotg210_udc_stop,
};
static int __exit fotg210_udc_remove(struct platform_device *pdev)
static int fotg210_udc_remove(struct platform_device *pdev)
{
struct fotg210_udc *fotg210 = dev_get_drvdata(&pdev->dev);
@ -1088,7 +1088,7 @@ static int __exit fotg210_udc_remove(struct platform_device *pdev)
return 0;
}
static int __init fotg210_udc_probe(struct platform_device *pdev)
static int fotg210_udc_probe(struct platform_device *pdev)
{
struct resource *res, *ires;
struct fotg210_udc *fotg210 = NULL;

View File

@ -1776,7 +1776,7 @@ static int mv_u3d_remove(struct platform_device *dev)
kfree(u3d->eps);
if (u3d->irq)
free_irq(u3d->irq, &dev->dev);
free_irq(u3d->irq, u3d);
if (u3d->cap_regs)
iounmap(u3d->cap_regs);
@ -1974,7 +1974,7 @@ static int mv_u3d_probe(struct platform_device *dev)
return 0;
err_unregister:
free_irq(u3d->irq, &dev->dev);
free_irq(u3d->irq, u3d);
err_request_irq:
err_get_irq:
kfree(u3d->status_req);

View File

@ -50,6 +50,8 @@ static DEFINE_MUTEX(udc_lock);
/* ------------------------------------------------------------------------- */
#ifdef CONFIG_HAS_DMA
int usb_gadget_map_request(struct usb_gadget *gadget,
struct usb_request *req, int is_in)
{
@ -99,6 +101,8 @@ void usb_gadget_unmap_request(struct usb_gadget *gadget,
}
EXPORT_SYMBOL_GPL(usb_gadget_unmap_request);
#endif /* CONFIG_HAS_DMA */
/* ------------------------------------------------------------------------- */
void usb_gadget_set_state(struct usb_gadget *gadget,
@ -194,9 +198,11 @@ int usb_add_gadget_udc_release(struct device *parent, struct usb_gadget *gadget,
dev_set_name(&gadget->dev, "gadget");
gadget->dev.parent = parent;
#ifdef CONFIG_HAS_DMA
dma_set_coherent_mask(&gadget->dev, parent->coherent_dma_mask);
gadget->dev.dma_parms = parent->dma_parms;
gadget->dev.dma_mask = parent->dma_mask;
#endif
if (release)
gadget->dev.release = release;

View File

@ -71,9 +71,9 @@ static struct usb_dpll_params omap_usb3_dpll_params[NUM_SYS_CLKS] = {
{1250, 5, 4, 20, 0}, /* 12 MHz */
{3125, 20, 4, 20, 0}, /* 16.8 MHz */
{1172, 8, 4, 20, 65537}, /* 19.2 MHz */
{1000, 7, 4, 10, 0}, /* 20 MHz */
{1250, 12, 4, 20, 0}, /* 26 MHz */
{3125, 47, 4, 20, 92843}, /* 38.4 MHz */
{1000, 7, 4, 10, 0}, /* 20 MHz */
};

View File

@ -388,7 +388,7 @@ static int samsung_usb2phy_probe(struct platform_device *pdev)
clk = devm_clk_get(dev, "otg");
if (IS_ERR(clk)) {
dev_err(dev, "Failed to get otg clock\n");
dev_err(dev, "Failed to get usbhost/otg clock\n");
return PTR_ERR(clk);
}

View File

@ -855,10 +855,6 @@ static int usbhsg_gadget_stop(struct usb_gadget *gadget,
struct usbhsg_gpriv *gpriv = usbhsg_gadget_to_gpriv(gadget);
struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv);
if (!driver ||
!driver->unbind)
return -EINVAL;
usbhsg_try_stop(priv, USBHSG_STATUS_REGISTERD);
gpriv->driver = NULL;