提交 39c24270 编写于 作者: G Greg Kroah-Hartman

Merge tag 'fixes-for-v3.11-rc1' of...

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: NFelipe Balbi <balbi@ti.com>
config USB_DWC3 config USB_DWC3
tristate "DesignWare USB3 DRD Core Support" 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 select USB_XHCI_PLATFORM if USB_SUPPORT && USB_XHCI_HCD
help help
Say Y or M here if your system has a Dual Role SuperSpeed Say Y or M here if your system has a Dual Role SuperSpeed
......
...@@ -450,7 +450,7 @@ static int dwc3_probe(struct platform_device *pdev) ...@@ -450,7 +450,7 @@ static int dwc3_probe(struct platform_device *pdev)
} }
if (IS_ERR(dwc->usb3_phy)) { 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 * if -ENXIO is returned, it means PHY layer wasn't
......
...@@ -759,8 +759,8 @@ struct dwc3 { ...@@ -759,8 +759,8 @@ struct dwc3 {
struct dwc3_event_type { struct dwc3_event_type {
u32 is_devspec:1; u32 is_devspec:1;
u32 type:6; u32 type:7;
u32 reserved8_31:25; u32 reserved8_31:24;
} __packed; } __packed;
#define DWC3_DEPEVT_XFERCOMPLETE 0x01 #define DWC3_DEPEVT_XFERCOMPLETE 0x01
......
...@@ -1584,6 +1584,7 @@ static int dwc3_gadget_start(struct usb_gadget *g, ...@@ -1584,6 +1584,7 @@ static int dwc3_gadget_start(struct usb_gadget *g,
__dwc3_gadget_ep_disable(dwc->eps[0]); __dwc3_gadget_ep_disable(dwc->eps[0]);
err0: err0:
dwc->gadget_driver = NULL;
spin_unlock_irqrestore(&dwc->lock, flags); spin_unlock_irqrestore(&dwc->lock, flags);
return ret; return ret;
......
...@@ -193,6 +193,7 @@ config USB_FUSB300 ...@@ -193,6 +193,7 @@ config USB_FUSB300
Faraday usb device controller FUSB300 driver Faraday usb device controller FUSB300 driver
config USB_FOTG210_UDC config USB_FOTG210_UDC
depends on HAS_DMA
tristate "Faraday FOTG210 USB Peripheral Controller" tristate "Faraday FOTG210 USB Peripheral Controller"
help help
Faraday USB2.0 OTG controller which can be configured as Faraday USB2.0 OTG controller which can be configured as
...@@ -328,13 +329,14 @@ config USB_S3C_HSUDC ...@@ -328,13 +329,14 @@ config USB_S3C_HSUDC
config USB_MV_UDC config USB_MV_UDC
tristate "Marvell USB2.0 Device Controller" tristate "Marvell USB2.0 Device Controller"
depends on GENERIC_HARDIRQS depends on GENERIC_HARDIRQS && HAS_DMA
help help
Marvell Socs (including PXA and MMP series) include a high speed Marvell Socs (including PXA and MMP series) include a high speed
USB2.0 OTG controller, which can be configured as high speed or USB2.0 OTG controller, which can be configured as high speed or
full speed USB peripheral. full speed USB peripheral.
config USB_MV_U3D config USB_MV_U3D
depends on HAS_DMA
tristate "MARVELL PXA2128 USB 3.0 controller" tristate "MARVELL PXA2128 USB 3.0 controller"
help help
MARVELL PXA2128 Processor series include a super speed USB3.0 device MARVELL PXA2128 Processor series include a super speed USB3.0 device
...@@ -639,6 +641,7 @@ config USB_CONFIGFS_RNDIS ...@@ -639,6 +641,7 @@ config USB_CONFIGFS_RNDIS
depends on USB_CONFIGFS depends on USB_CONFIGFS
depends on NET depends on NET
select USB_U_ETHER select USB_U_ETHER
select USB_U_RNDIS
select USB_F_RNDIS select USB_F_RNDIS
help help
Microsoft Windows XP bundles the "Remote NDIS" (RNDIS) protocol, Microsoft Windows XP bundles the "Remote NDIS" (RNDIS) protocol,
......
...@@ -870,8 +870,8 @@ static void clk_on(struct at91_udc *udc) ...@@ -870,8 +870,8 @@ static void clk_on(struct at91_udc *udc)
if (udc->clocked) if (udc->clocked)
return; return;
udc->clocked = 1; udc->clocked = 1;
clk_enable(udc->iclk); clk_prepare_enable(udc->iclk);
clk_enable(udc->fclk); clk_prepare_enable(udc->fclk);
} }
static void clk_off(struct at91_udc *udc) static void clk_off(struct at91_udc *udc)
...@@ -880,8 +880,8 @@ static void clk_off(struct at91_udc *udc) ...@@ -880,8 +880,8 @@ static void clk_off(struct at91_udc *udc)
return; return;
udc->clocked = 0; udc->clocked = 0;
udc->gadget.speed = USB_SPEED_UNKNOWN; udc->gadget.speed = USB_SPEED_UNKNOWN;
clk_disable(udc->fclk); clk_disable_unprepare(udc->fclk);
clk_disable(udc->iclk); clk_disable_unprepare(udc->iclk);
} }
/* /*
...@@ -1725,7 +1725,7 @@ static int at91udc_probe(struct platform_device *pdev) ...@@ -1725,7 +1725,7 @@ static int at91udc_probe(struct platform_device *pdev)
/* init software state */ /* init software state */
udc = &controller; udc = &controller;
udc->gadget.dev.parent = dev; 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); at91udc_of_init(udc, pdev->dev.of_node);
else else
memcpy(&udc->board, dev->platform_data, memcpy(&udc->board, dev->platform_data,
...@@ -1782,12 +1782,14 @@ static int at91udc_probe(struct platform_device *pdev) ...@@ -1782,12 +1782,14 @@ static int at91udc_probe(struct platform_device *pdev)
} }
/* don't do anything until we have both gadget driver and VBUS */ /* 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_TXVC, AT91_UDP_TXVC_TXVDIS);
at91_udp_write(udc, AT91_UDP_IDR, 0xffffffff); at91_udp_write(udc, AT91_UDP_IDR, 0xffffffff);
/* Clear all pending interrupts - UDP may be used by bootloader. */ /* Clear all pending interrupts - UDP may be used by bootloader. */
at91_udp_write(udc, AT91_UDP_ICR, 0xffffffff); at91_udp_write(udc, AT91_UDP_ICR, 0xffffffff);
clk_disable(udc->iclk); clk_disable_unprepare(udc->iclk);
/* request UDC and maybe VBUS irqs */ /* request UDC and maybe VBUS irqs */
udc->udp_irq = platform_get_irq(pdev, 0); udc->udp_irq = platform_get_irq(pdev, 0);
......
...@@ -1074,7 +1074,7 @@ static struct usb_gadget_ops fotg210_gadget_ops = { ...@@ -1074,7 +1074,7 @@ static struct usb_gadget_ops fotg210_gadget_ops = {
.udc_stop = fotg210_udc_stop, .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); struct fotg210_udc *fotg210 = dev_get_drvdata(&pdev->dev);
...@@ -1088,7 +1088,7 @@ static int __exit fotg210_udc_remove(struct platform_device *pdev) ...@@ -1088,7 +1088,7 @@ static int __exit fotg210_udc_remove(struct platform_device *pdev)
return 0; 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 resource *res, *ires;
struct fotg210_udc *fotg210 = NULL; struct fotg210_udc *fotg210 = NULL;
......
...@@ -1776,7 +1776,7 @@ static int mv_u3d_remove(struct platform_device *dev) ...@@ -1776,7 +1776,7 @@ static int mv_u3d_remove(struct platform_device *dev)
kfree(u3d->eps); kfree(u3d->eps);
if (u3d->irq) if (u3d->irq)
free_irq(u3d->irq, &dev->dev); free_irq(u3d->irq, u3d);
if (u3d->cap_regs) if (u3d->cap_regs)
iounmap(u3d->cap_regs); iounmap(u3d->cap_regs);
...@@ -1974,7 +1974,7 @@ static int mv_u3d_probe(struct platform_device *dev) ...@@ -1974,7 +1974,7 @@ static int mv_u3d_probe(struct platform_device *dev)
return 0; return 0;
err_unregister: err_unregister:
free_irq(u3d->irq, &dev->dev); free_irq(u3d->irq, u3d);
err_request_irq: err_request_irq:
err_get_irq: err_get_irq:
kfree(u3d->status_req); kfree(u3d->status_req);
......
...@@ -50,6 +50,8 @@ static DEFINE_MUTEX(udc_lock); ...@@ -50,6 +50,8 @@ static DEFINE_MUTEX(udc_lock);
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
#ifdef CONFIG_HAS_DMA
int usb_gadget_map_request(struct usb_gadget *gadget, int usb_gadget_map_request(struct usb_gadget *gadget,
struct usb_request *req, int is_in) struct usb_request *req, int is_in)
{ {
...@@ -99,6 +101,8 @@ void usb_gadget_unmap_request(struct usb_gadget *gadget, ...@@ -99,6 +101,8 @@ void usb_gadget_unmap_request(struct usb_gadget *gadget,
} }
EXPORT_SYMBOL_GPL(usb_gadget_unmap_request); EXPORT_SYMBOL_GPL(usb_gadget_unmap_request);
#endif /* CONFIG_HAS_DMA */
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
void usb_gadget_set_state(struct usb_gadget *gadget, 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, ...@@ -194,9 +198,11 @@ int usb_add_gadget_udc_release(struct device *parent, struct usb_gadget *gadget,
dev_set_name(&gadget->dev, "gadget"); dev_set_name(&gadget->dev, "gadget");
gadget->dev.parent = parent; gadget->dev.parent = parent;
#ifdef CONFIG_HAS_DMA
dma_set_coherent_mask(&gadget->dev, parent->coherent_dma_mask); dma_set_coherent_mask(&gadget->dev, parent->coherent_dma_mask);
gadget->dev.dma_parms = parent->dma_parms; gadget->dev.dma_parms = parent->dma_parms;
gadget->dev.dma_mask = parent->dma_mask; gadget->dev.dma_mask = parent->dma_mask;
#endif
if (release) if (release)
gadget->dev.release = release; gadget->dev.release = release;
......
...@@ -71,9 +71,9 @@ static struct usb_dpll_params omap_usb3_dpll_params[NUM_SYS_CLKS] = { ...@@ -71,9 +71,9 @@ static struct usb_dpll_params omap_usb3_dpll_params[NUM_SYS_CLKS] = {
{1250, 5, 4, 20, 0}, /* 12 MHz */ {1250, 5, 4, 20, 0}, /* 12 MHz */
{3125, 20, 4, 20, 0}, /* 16.8 MHz */ {3125, 20, 4, 20, 0}, /* 16.8 MHz */
{1172, 8, 4, 20, 65537}, /* 19.2 MHz */ {1172, 8, 4, 20, 65537}, /* 19.2 MHz */
{1000, 7, 4, 10, 0}, /* 20 MHz */
{1250, 12, 4, 20, 0}, /* 26 MHz */ {1250, 12, 4, 20, 0}, /* 26 MHz */
{3125, 47, 4, 20, 92843}, /* 38.4 MHz */ {3125, 47, 4, 20, 92843}, /* 38.4 MHz */
{1000, 7, 4, 10, 0}, /* 20 MHz */
}; };
......
...@@ -388,7 +388,7 @@ static int samsung_usb2phy_probe(struct platform_device *pdev) ...@@ -388,7 +388,7 @@ static int samsung_usb2phy_probe(struct platform_device *pdev)
clk = devm_clk_get(dev, "otg"); clk = devm_clk_get(dev, "otg");
if (IS_ERR(clk)) { 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); return PTR_ERR(clk);
} }
......
...@@ -855,10 +855,6 @@ static int usbhsg_gadget_stop(struct usb_gadget *gadget, ...@@ -855,10 +855,6 @@ static int usbhsg_gadget_stop(struct usb_gadget *gadget,
struct usbhsg_gpriv *gpriv = usbhsg_gadget_to_gpriv(gadget); struct usbhsg_gpriv *gpriv = usbhsg_gadget_to_gpriv(gadget);
struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv); struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv);
if (!driver ||
!driver->unbind)
return -EINVAL;
usbhsg_try_stop(priv, USBHSG_STATUS_REGISTERD); usbhsg_try_stop(priv, USBHSG_STATUS_REGISTERD);
gpriv->driver = NULL; gpriv->driver = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册