Skip to content

Commit

Permalink
Merge tag 'fixes-for-v3.11-rc1' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/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 <[email protected]>
  • Loading branch information
gregkh committed Jul 16, 2013
2 parents ad81f05 + 690c70b commit 39c2427
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 22 deletions.
2 changes: 1 addition & 1 deletion drivers/usb/dwc3/Kconfig
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/dwc3/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/dwc3/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -1584,6 +1584,7 @@ static int dwc3_gadget_start(struct usb_gadget *g,
__dwc3_gadget_ep_disable(dwc->eps[0]);

err0:
dwc->gadget_driver = NULL;
spin_unlock_irqrestore(&dwc->lock, flags);

return ret;
Expand Down
5 changes: 4 additions & 1 deletion drivers/usb/gadget/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
16 changes: 9 additions & 7 deletions drivers/usb/gadget/at91_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}

/*
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/gadget/fotg210-udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/gadget/mv_u3d_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions drivers/usb/gadget/udc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/phy/phy-omap-usb3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

};

Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/phy/phy-samsung-usb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 0 additions & 4 deletions drivers/usb/renesas_usbhs/mod_gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 39c2427

Please sign in to comment.