Marek Szyprowski [Mon, 20 Oct 2014 10:45:38 +0000 (12:45 +0200)]
usb: dwc2: gadget: use soft-disconnect udc feature in pullup() method
This patch moves udc initialization from pullup() method to
s3c_hsotg_udc_start(), so that method ends with hardware fully
initialized and left in soft-disconnected state. After this change, the
pullup() method simply clears soft-disconnect start() when called with
is_on=1. For completeness, a call to s3c_hsotg_core_disconnect() has
been added when pullup() method is called with is_on=0, what puts the
udc hardware back to soft-disconnected state.
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Marek Szyprowski [Mon, 20 Oct 2014 10:45:37 +0000 (12:45 +0200)]
usb: dwc2: gadget: move phy control calls out of pullup() method
This patch moves phy enable/disable calls from pullup() method to
udc_start/stop functions. This solves the issue related to limited caller
context for PHY functions, because they cannot be called from non-sleeping
context. This is also a preparation for using soft-disconnect feature of
udc controller in pullup() method.
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Marek Szyprowski [Mon, 20 Oct 2014 10:45:36 +0000 (12:45 +0200)]
usb: dwc2: gadget: decouple setting soft-disconnect from s3c_hsotg_core_init
This patch changes s3c_hsotg_core_init function to leave hardware in
soft disconnect mode, so the moment of coupling the hardware to the usb
bus can be later controlled by the separate functions for enabling and
disabling soft disconnect mode. This patch is a preparation to rework
pullup() method.
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Marek Szyprowski [Mon, 20 Oct 2014 10:45:35 +0000 (12:45 +0200)]
usb: dwc2: gadget: move setting last reset time to s3c_hsotg_core_init
This patch removes duplicated code and sets last_rst variable in the
function which does the hardware reset.
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Varka Bhadram [Wed, 29 Oct 2014 16:00:19 +0000 (21:30 +0530)]
usb: musb: core: remove duplicate check on resource
Sanity check on resource happening with devm_ioremap_resource().
Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Varka Bhadram [Wed, 29 Oct 2014 16:00:18 +0000 (21:30 +0530)]
usb: musb: dsps: remove duplicate check on resource
Sanity check on resource happening with devm_ioremap_resource().
Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Varka Bhadram [Wed, 29 Oct 2014 16:00:17 +0000 (21:30 +0530)]
usb: phy: rcar-usb: remove duplicate check on resource
Sanity check on resource happening with devm_ioremap_resource().
Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Varka Bhadram [Wed, 29 Oct 2014 16:00:16 +0000 (21:30 +0530)]
usb: renesas_usbhs: common: remove duplicate check on resource
Sanity check on resource happening with devm_ioremap_resource().
Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Varka Bhadram [Wed, 29 Oct 2014 16:00:15 +0000 (21:30 +0530)]
usb: dwc3: keystone: remove duplicate check on resource
Sanity check on resource happening with devm_ioremap_resource().
Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Sergei Shtylyov [Thu, 23 Oct 2014 20:34:12 +0000 (00:34 +0400)]
usb: musb: omap2430: use MUSB_DEVCTL_BDEVICE
The OMAP2+ MUSB glue layer still uses a bare number for the DEVCTL.B-Device bit
in one place, while there's #define MUSB_DEVCTL_BDEVICE for that.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Sat, 18 Oct 2014 01:19:41 +0000 (20:19 -0500)]
usb: gadget: udc: pxa27x: do not call usb_gadget_unregister_driver()
that call is completely unnecessary because
usb_del_gadget_udc() already makes sure the
gadget driver is properly unregistered from
the UDC.
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Sat, 18 Oct 2014 01:19:02 +0000 (20:19 -0500)]
usb: gadget: udc: net2272: do not call usb_gadget_unregister_driver()
that call is completely unnecessary because
usb_del_gadget_udc() already makes sure the
gadget driver is properly unregistered from
the UDC.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Sat, 18 Oct 2014 01:18:23 +0000 (20:18 -0500)]
usb: gadget: udc: dummy: do not call usb_gadget_unregister_driver()
that call is completely unnecessary because
usb_del_gadget_udc() already makes sure the
gadget driver is properly unregistered from
the UDC.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Sat, 18 Oct 2014 01:15:08 +0000 (20:15 -0500)]
usb: dwc2: gadget: do not call usb_gadget_unregister_driver()
that call is completely unnecessary because
usb_del_gadget_udc() already makes sure the
gadget driver is properly unregistered from
the UDC.
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Robert Jarzmik [Fri, 17 Oct 2014 20:43:06 +0000 (22:43 +0200)]
usb: gadget: pxa27x_udc: fix clock prepare and enable
As the udc clock controls both the output signals and the internal IP,
it must be enabled before any UDC register is touched.
The bug is revealed when the clock framework disables the clock for a
couple of milliseconds during the boot sequence, and the endpoint
configuration is lost. The bug is hidden when clock framework is not
used, because no "unused clocks disable" occurs.
This patch fixes the wrong behaviour by ensuring that :
- whenever a UDC register is read or written, the clock is enabled
- reworks the endpoints programming to have it done under running clock
- reworks suspend/resume to ensure the same thing
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Robert Jarzmik [Fri, 17 Oct 2014 20:43:05 +0000 (22:43 +0200)]
usb: gadget: pxa27x_udc: use devm_* helpers
Use devm_* helpers in the probe function to simplify the error path and
the remove path.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Robert Jarzmik [Fri, 17 Oct 2014 20:43:04 +0000 (22:43 +0200)]
usb: gadget: pxa27x_udc device-tree documentation
Add documentation for device-tree binding of arm PXA 27x udc (usb
device) driver.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: devicetree@vger.kernel.org
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 23:57:06 +0000 (18:57 -0500)]
usb: gadget: udc: core: prepend udc_attach_driver with usb_
No functional changes, just adding a prefix
which should have been there from the start.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 17:05:12 +0000 (12:05 -0500)]
usb: gadget: remove unnecessary 'driver' argument
now that no UDC driver relies on the extra
'driver' argument to ->udc_stop(), we can
safely remove it.
This commit is based on previous work by
Robert Baldyga <r.baldyga@samsung.com> which
can be found at [1]; however that patch turned
out to have a high probability of regressing
many UDC drivers because of a blind search & replace
s/driver/$udc->driver/ which caused the 'driver'
argument to stop_activity() to be a valid non-NULL
pointer when it should be NULL, thus causing UDCs
to mistakenly call gadget driver's ->disconnect()
callback.
[1] http://markmail.org/message/x5zneg4xea4zntab
Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:54:46 +0000 (11:54 -0500)]
usb: gadget: udc: core: fix unregistering message
Currently, we're printing gadget driver name when
registering and UDC name when unregistering. Standardize
on always printing gadget driver name.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:41:33 +0000 (11:41 -0500)]
usb: musb: gadget: remove bind/unbind messages
now that we provide generic register/unregister
debugging messages from udc-core, we can remove
the same messages from this driver.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:40:56 +0000 (11:40 -0500)]
usb: gadget: udc: s3c-hsudc: remove bind/unbind messages
now that we provide generic register/unregister
debugging messages from udc-core, we can remove
the same messages from this driver.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:40:05 +0000 (11:40 -0500)]
usb: gadget: udc: net2280: remove bind/unbind messages
now that we provide generic register/unregister
debugging messages from udc-core, we can remove
the same messages from this driver.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:39:29 +0000 (11:39 -0500)]
usb: gadget: udc: net2272: remove bind/unbind messages
now that we provide generic register/unregister
debugging messages from udc-core, we can remove
the same messages from this driver.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:38:39 +0000 (11:38 -0500)]
usb: gadget: udc: gr_udc: remove bind/unbind messages
now that we provide generic register/unregister
debugging messages from udc-core, we can remove
the same messages from this driver.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:38:09 +0000 (11:38 -0500)]
usb: gadget: udc: fsl_qe: remove bind/unbind messages
now that we provide generic register/unregister
debugging messages from udc-core, we can remove
the same messages from this driver.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:37:38 +0000 (11:37 -0500)]
usb: gadget: udc: dummy: remove bind/unbind messages
now that we provide generic register/unregister
debugging messages from udc-core, we can remove
the same messages from this driver.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:37:04 +0000 (11:37 -0500)]
usb: gadget: udc: atmel_usba: remove bind/unbind messages
now that we provide generic register/unregister
debugging messages from udc-core, we can remove
the same messages from this driver.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:35:52 +0000 (11:35 -0500)]
usb: gadget: udc: at91: remove bind/unbind messages
now that we provide generic register/unregister
debugging messages from udc-core, we can remove
the same messages from this driver.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:34:07 +0000 (11:34 -0500)]
usb: gadget: udc: pass a single argument to usb_gadget_udc_start/stop
We know that our udc points to our gadget and our
gadget_driver, simplify the interface by passing
a single argument.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:26:46 +0000 (11:26 -0500)]
usb: musb: gadget: do not rely on 'driver' argument
future patches will remove the extra 'driver'
argument to ->udc_stop(), in order to do that,
we must make sure that our UDC does not rely
on it first.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:25:50 +0000 (11:25 -0500)]
usb: gadget: udc: s3c-hsudc: do not rely on 'driver' argument
future patches will remove the extra 'driver'
argument to ->udc_stop(), in order to do that,
we must make sure that our UDC does not rely
on it first.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:25:04 +0000 (11:25 -0500)]
usb: gadget: udc: pxa27x: do not rely on 'driver' argument
future patches will remove the extra 'driver'
argument to ->udc_stop(), in order to do that,
we must make sure that our UDC does not rely
on it first.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:24:37 +0000 (11:24 -0500)]
usb: gadget: udc: pxa25x: do not rely on 'driver' argument
future patches will remove the extra 'driver'
argument to ->udc_stop(), in order to do that,
we must make sure that our UDC does not rely
on it first.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:23:33 +0000 (11:23 -0500)]
usb: gadget: udc: net2280: do not rely on 'driver' argument
future patches will remove the extra 'driver'
argument to ->udc_stop(), in order to do that,
we must make sure that our UDC does not rely
on it first.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:22:52 +0000 (11:22 -0500)]
usb: gadget: udc: net2272: do not rely on 'driver' argument
future patches will remove the extra 'driver'
argument to ->udc_stop(), in order to do that,
we must make sure that our UDC does not rely
on it first.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:22:11 +0000 (11:22 -0500)]
usb: gadget: udc: mv_udc: do not rely on 'driver' argument
future patches will remove the extra 'driver'
argument to ->udc_stop(), in order to do that,
we must make sure that our UDC does not rely
on it first.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:21:34 +0000 (11:21 -0500)]
usb: gadget: udc: mv_u3d: do not rely on 'driver' argument
future patches will remove the extra 'driver'
argument to ->udc_stop(), in order to do that,
we must make sure that our UDC does not rely
on it first.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:21:03 +0000 (11:21 -0500)]
usb: gadget: udc: lpc32xx: do not rely on 'driver' argument
future patches will remove the extra 'driver'
argument to ->udc_stop(), in order to do that,
we must make sure that our UDC does not rely
on it first.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:20:10 +0000 (11:20 -0500)]
usb: gadget: udc: fsl_qe: do not rely on 'driver' argument
future patches will remove the extra 'driver'
argument to ->udc_stop(), in order to do that,
we must make sure that our UDC does not rely
on it first.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:18:29 +0000 (11:18 -0500)]
usb: gadget: udc: dummy: do not rely on 'driver' argument
future patches will remove the extra 'driver'
argument to ->udc_stop(), in order to do that,
we must make sure that our UDC does not rely
on it first.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:17:08 +0000 (11:17 -0500)]
usb: gadget: udc: at91: do not rely on 'driver' argument
future patches will remove the extra 'driver'
argument to ->udc_stop(), in order to do that,
we must make sure that our UDC does not rely
on it first.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 17 Oct 2014 16:16:04 +0000 (11:16 -0500)]
usb: gadget: udc: amd5536: do not rely on 'driver' argument
future patches will remove the extra 'driver'
argument to ->udc_stop(), in order to do that,
we must make sure that our UDC does not rely
on it first.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Vinod Koul [Sat, 11 Oct 2014 15:40:38 +0000 (21:10 +0530)]
usb: musb: ux500_dma: use dmaengine_xxx() APIs
The drivers should use dmaengine_terminate_all() or dmaengine_slave_config()
API instead of accessing the device_control which will be deprecated soon
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Tue, 14 Oct 2014 07:56:19 +0000 (15:56 +0800)]
usb: renesas_usbhs: delete unnecessary 'out of memory' messages
The memory subsystem has already had similar message for it.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Tue, 14 Oct 2014 07:56:18 +0000 (15:56 +0800)]
usb: phy: phy-mv-usb: delete unnecessary 'out of memory' messages
The memory subsystem has already had similar message for it.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Tue, 14 Oct 2014 07:56:17 +0000 (15:56 +0800)]
usb: phy: phy-msm-usb: delete unnecessary 'out of memory' messages
The memory subsystem has already had similar message for it.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Tue, 14 Oct 2014 07:56:16 +0000 (15:56 +0800)]
usb: phy: phy-mxs-usb: delete unnecessary 'out of memory' messages
The memory subsystem has already had similar message for it.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Tue, 14 Oct 2014 07:56:15 +0000 (15:56 +0800)]
usb: phy: phy-rcar-gen2-usb: delete unnecessary 'out of memory' messages
The memory subsystem has already had similar message for it.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Tue, 14 Oct 2014 07:56:14 +0000 (15:56 +0800)]
usb: phy: phy-am335x-control: delete unnecessary 'out of memory' messages
The memory subsystem has already had similar message for it.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Tue, 14 Oct 2014 07:56:13 +0000 (15:56 +0800)]
usb: phy: phy-tegra-usb: delete unnecessary 'out of memory' messages
The memory subsystem has already had similar message for it.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Tue, 14 Oct 2014 07:56:12 +0000 (15:56 +0800)]
usb: phy: phy-rcar-usb: delete unnecessary 'out of memory' messages
The memory subsystem has already had similar message for it.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Tue, 14 Oct 2014 07:56:11 +0000 (15:56 +0800)]
usb: musb: musb_dsps: delete unnecessary 'out of memory' messages
The memory subsystem has already had similar message for it.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Tue, 14 Oct 2014 07:56:10 +0000 (15:56 +0800)]
usb: musb: tusb6010: delete unnecessary 'out of memory' messages
The memory subsystem has already had similar message for it.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Tue, 14 Oct 2014 07:56:09 +0000 (15:56 +0800)]
usb: musb: blackfin: delete unnecessary 'out of memory' messages
The memory subsystem has already had similar message for it.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Tue, 14 Oct 2014 07:56:08 +0000 (15:56 +0800)]
usb: musb: omap2430: delete unnecessary 'out of memory' messages
The memory subsystem has already had similar message for it.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Tue, 14 Oct 2014 07:56:07 +0000 (15:56 +0800)]
usb: musb: ux500: delete unnecessary 'out of memory' messages
The memory subsystem has already had similar message for it.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Tue, 14 Oct 2014 07:56:06 +0000 (15:56 +0800)]
usb: musb: davinci: delete unnecessary 'out of memory' messages
The memory subsystem has already had similar message for it.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Tue, 14 Oct 2014 07:56:00 +0000 (15:56 +0800)]
usb: gadget: s3c-hsudc: delete unnecessary 'out of memory' messages
The memory subsystem has already had similar message for it.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Tue, 14 Oct 2014 07:55:59 +0000 (15:55 +0800)]
usb: gadget: bcm63xx_udc: delete unnecessary 'out of memory' messages
The memory subsystem has already had similar message for it.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Tue, 14 Oct 2014 07:55:58 +0000 (15:55 +0800)]
usb: gadget: fsl_qe_udc: delete unnecessary 'out of memory' messages
The memory subsystem has already had similar message for it.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Tue, 14 Oct 2014 07:55:57 +0000 (15:55 +0800)]
usb: gadget: mv_udc_core: delete unnecessary 'out of memory' messages
The memory subsystem has already had similar message for it.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Mon, 13 Oct 2014 20:36:16 +0000 (15:36 -0500)]
usb: dwc3: gadget: WARN() on bogus usb_ep_queue()
Some gadget/function drivers might want to do
improper request recycling by allocating a single
request from one particular endpoint and queueing
it to another completely unrelated endpoint.
One such case was found with f_loopback.c.
To prevent such cases from happening again, let's
WARN() so we get a loud enough failure and persuade
users to report errors.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 10 Oct 2014 20:24:00 +0000 (15:24 -0500)]
usb: dwc3: gadget: set state to NOT_ATTACHED on disconnect_irq
whenever we get a Disconnect Interrupt, we should
make sure to update out udc state to NOT_ATTACHED,
otherwise sysfs will show wrong values.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 10 Oct 2014 20:21:56 +0000 (15:21 -0500)]
usb: gadget: udc: document our sysfs ABI
I noticed that this has been missing for quite
some time so I decided it was about time to
document it.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Andrzej Pietrasiewicz [Wed, 8 Oct 2014 10:03:36 +0000 (12:03 +0200)]
usb: gadget: configfs: add suspend/resume
USB gadgets composed with configfs lack suspend and resume
methods. This patch uses composite_suspend()/composite_resume()
the same way e.g. composite_setup() or composite_disconnect()
are used in a configfs-based gadget.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Dan Carpenter [Wed, 8 Oct 2014 10:40:37 +0000 (13:40 +0300)]
usb: gadget: f_uac1: remove an unneeded NULL check
This NULL check sets off a static checker warning because we already
dereferenced "card" earlier in the function. However, since "card" is
never NULL so we can just remove the check.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Thu, 9 Oct 2014 15:12:24 +0000 (10:12 -0500)]
usb: gadget: udc-core: call ->disconnect() when soft disconnecting
when disconnecting from host using our soft_connect
sysfs interface, also let the gadget driver know about
it by calling the gadget driver's ->disconnect()
method.
No problems have been found while not calling ->disconnect()
so far, it's just good convention.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Tue, 7 Oct 2014 15:19:23 +0000 (10:19 -0500)]
usb: dwc3: get rid of ->prepare()/->complete()
Using ->prepare()/->complete() to mask/unmask
IRQs is wrong at least for dwc3. We need to
make sure that by the end of ->resume(), IRQs
are working and ready to fire because a child
device may need working IRQs for its own ->resume()
method.
Signed-off-by: Felipe Balbi <balbi@ti.com>
George Cherian [Tue, 17 Dec 2013 13:17:54 +0000 (18:47 +0530)]
usb: dwc3: dwc3-omap: get rid of ->prepare()/->complete()
Enabling the core interrupts in complete is too late for
XHCI, and stops it from proper operation. The root of the
problem is due to a disagreement between dwc3-omap and XHCI
about when IRQs should be enabled.
As it turns out, ->resume's documentation states that:
"... generally the driver is expected to start working
again, responding to hardware events and software requests
(the device itself may be left in a low-power state, waiting
for a runtime resume to occur) ..."
From that we infer that IRQs must be unmasked by the end of
->resume().
Due to that, we will remove ->prepare() and ->complete() and
disable/enable interrupts in ->suspend()/->resume().
Acked-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: George Cherian <george.cherian@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Robert Jarzmik [Wed, 1 Oct 2014 20:06:16 +0000 (22:06 +0200)]
usb: gadget: pxa27x_udc: add devicetree support
Add support for device-tree device discovery. If devicetree is not
provided, fallback to legacy platform data "discovery".
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: devicetree@vger.kernel.org
Signed-off-by: Felipe Balbi <balbi@ti.com>
Robert Jarzmik [Wed, 1 Oct 2014 20:06:15 +0000 (22:06 +0200)]
usb: gadget: pxa27x_udc: transfer mach_info into pxa_udc
Convert the mach info, and store the udc_command in the pxa_udc control
structure.
It is to be noticed that the udc_is_connected() in mach info is not
transfered. This was not used, as mioa701 machine doesn't need it,
balloon3 doesn't really use it, and most importantly the current driver
never uses it.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Robert Jarzmik [Wed, 1 Oct 2014 20:06:14 +0000 (22:06 +0200)]
usb: gadget: pxa27x_udc: prepare device-tree support
For this preparation, a preliminary cleanup is done :
- convert the probing of pxa27x_udc to gpio_desc.
The conversion is partial because :
- the platform data still provides a gpio number, not a gpio desc
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Yoshihiro Shimoda [Tue, 7 Oct 2014 03:43:06 +0000 (12:43 +0900)]
usb: renesas_usbhs: add support for generic PHY
This patch adds support for the generic PHY. The generic PHY will be
used in multiplatform environment.
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Yoshihiro Shimoda [Tue, 7 Oct 2014 03:43:05 +0000 (12:43 +0900)]
usb: renesas_usbhs: clean up rcar2.c to support a generic PHY
To support both usb PHY and generic PHY, this patch cleans up rcar2.c.
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Yoshihiro Shimoda [Tue, 7 Oct 2014 03:43:04 +0000 (12:43 +0900)]
usb: renesas_usbhs: rename phy to usb_phy in usbhs_priv
To support a generic phy driver in this driver later, this patch
renames "struct usb_phy *phy" to "struct usb_phy *usb_phy".
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Wed, 1 Oct 2014 17:20:29 +0000 (12:20 -0500)]
usb: dwc3: ep0: trace ep0 TRBs too
Add TRB tracepoints for ep0 TRBs as that
might help finding bugs with ep0 handling.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Thu, 18 Sep 2014 15:01:55 +0000 (10:01 -0500)]
usb: gadget: composite: conditionally dequeue os_desc and setup requests
In case we unload a gadget driver while any of
os_desc_req or req are still pending, we need
to make sure to dequeue them.
By using our setup_pending and os_desc_pending
flags we achieve that in a way that doesn't
cause any regressions because we won't dequeue
a request which was already completed.
The original idea came from Li Jun's commit
f2267089ea17fa97b796b1b4247e3f8957655df3
(usb: gadget: composite: dequeue cdev->req
before free it in composite_dev_cleanup) which,
unfortunately, caused two regressions (kfree()
being called before usb_ep_dequeue() and calling
usb_ep_dequeue() when the request was already
completed). That commit also didn't take care
of os_desc_req which can fall into the same
situation so we must care for that one too.
Note that in order to make code slightly easier
to read, we introduce composite_ep_queue() which
hides details about how to fiddle with our pending
flags.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Thu, 18 Sep 2014 14:54:54 +0000 (09:54 -0500)]
usb: gadget: composite: set our req->context to cdev
by doing that we will be able to match our
requests against req and os_desc_req and also
clear our pending flags from complete callback.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Thu, 18 Sep 2014 14:51:23 +0000 (09:51 -0500)]
usb: gadget: composite: introduce setup and os_desc pending flags
These flags we be set to true whenever their
matching request is queued. They will be cleared
to false when that request completes.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Heikki Krogerus [Thu, 25 Sep 2014 07:57:02 +0000 (10:57 +0300)]
usb: dwc3: add ACPI support
Adding ACPI ID used on newer Intel SoCs.
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Heikki Krogerus [Wed, 24 Sep 2014 08:00:38 +0000 (11:00 +0300)]
usb: dwc3: core: only setting the dma_mask when needed
If the probe drivers have already set the dma_mask, not
replacing the value.
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Wed, 24 Sep 2014 16:22:23 +0000 (11:22 -0500)]
usb: dwc3: trace: remove unnecessary newline character
tracing infrastructure already adds those for us.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 19 Sep 2014 20:51:11 +0000 (15:51 -0500)]
usb: dwc3: core: write LINUX_VERSION_CODE to our GUID register
DWC3's GUID register is supposed to be used to write
any sort of version we might want. It helps when getting
bug reports for platforms you don't have HW to know
which kernel version of the driver was running on the
platform.
Because we don't really track driver version, but we _do_
track the kernel version, let's write LINUX_VERSION_CODE to
that register and use it for debugging.
Reviewed-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Linus Torvalds [Sun, 2 Nov 2014 23:01:51 +0000 (15:01 -0800)]
Linux 3.18-rc3
Linus Torvalds [Sun, 2 Nov 2014 22:45:52 +0000 (14:45 -0800)]
Merge tag 'for-linus-
20141102' of git://git.infradead.org/linux-mtd
Pull MTD fixes from Brian Norris:
"Three main MTD fixes for 3.18:
- A regression from 3.16 which was noticed in 3.17. With the
restructuring of the m25p80.c driver and the SPI NOR library
framework, we omitted proper listing of the SPI device IDs. This
means m25p80.c wouldn't auto-load (modprobe) properly when built as
a module. For now, we duplicate the device IDs into both modules.
- The OMAP / ELM modules were depending on an implicit link ordering.
Use deferred probing so that the new link order (in 3.18-rc) can
still allow for successful probing.
- Fix suspend/resume support for LH28F640BF NOR flash"
* tag 'for-linus-
20141102' of git://git.infradead.org/linux-mtd:
mtd: cfi_cmdset_0001.c: fix resume for LH28F640BF chips
mtd: omap: fix mtd devices not showing up
mtd: m25p80,spi-nor: Fix module aliases for m25p80
mtd: spi-nor: make spi_nor_scan() take a chip type name, not spi_device_id
mtd: m25p80: get rid of spi_get_device_id
Linus Torvalds [Sun, 2 Nov 2014 22:39:35 +0000 (14:39 -0800)]
Merge tag 'scsi-for-linus' of git://git./linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley:
"This is a set of six patches consisting of:
- two MAINTAINER updates
- two scsi-mq fixs for the old parallel interface (not every request
is tagged and we need to set the right flags to populate the SPI
tag message)
- a fix for a memory leak in scatterlist traversal caused by a
preallocation update in 3.17
- an ipv6 fix for cxgbi"
[ The scatterlist fix also came in separately through the block layer tree ]
* tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
MAINTAINERS: ufs - remove self
MAINTAINERS: change hpsa and cciss maintainer
libcxgbi : support ipv6 address host_param
scsi: set REQ_QUEUE for the blk-mq case
Revert "block: all blk-mq requests are tagged"
lib/scatterlist: fix memory leak with scsi-mq
Linus Torvalds [Sun, 2 Nov 2014 22:27:30 +0000 (14:27 -0800)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie:
"Nothing too astounding or major: radeon, i915, vmwgfx, armada and
exynos.
Biggest ones:
- vmwgfx has one big locking regression fix
- i915 has come displayport fixes
- radeon has some stability and a memory alloc failure
- armada and exynos have some vblank fixes"
* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (24 commits)
drm/exynos: correct connector->dpms field before resuming
drm/exynos: enable vblank after DPMS on
drm/exynos: init kms poll at the end of initialization
drm/exynos: propagate plane initialization errors
drm/exynos: vidi: fix build warning
drm/exynos: remove explicit encoder/connector de-initialization
drm/exynos: init vblank with real number of crtcs
drm/vmwgfx: Filter out modes those cannot be supported by the current VRAM size.
drm/vmwgfx: Fix hash key computation
drm/vmwgfx: fix lock breakage
drm/i915/dp: only use training pattern 3 on platforms that support it
drm/radeon: remove some buggy dead code
drm/i915: Ignore VBT backlight check on Macbook 2, 1
drm/radeon: remove invalid pci id
drm/radeon: dpm fixes for asrock systems
radeon: clean up coding style differences in radeon_get_bios()
drm/radeon: Use drm_malloc_ab instead of kmalloc_array
drm/radeon/dpm: disable ulv support on SI
drm/i915: Fix GMBUSFREQ on vlv/chv
drm/i915: Ignore long hpds on eDP ports
...
Linus Torvalds [Sun, 2 Nov 2014 20:56:20 +0000 (12:56 -0800)]
Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
Pull ARM fixes from Russell King:
- add the new bpf syscall to ARM.
- drop a redundant return statement in __iommu_alloc_remap()
- fix a performance issue noticed by Thomas Petazzoni with
kmap_atomic().
- fix an issue with the L2 cache OF parsing code which caused it to
incorrectly print warnings on each boot, and make the warning text
more consistent with the rest of the code
* 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
ARM: 8180/1: mm: implement no-highmem fast path in kmap_atomic_pfn()
ARM: 8183/1: l2c: Improve l2c310_of_parse() error message
ARM: 8181/1: Drop extra return statement
ARM: 8182/1: l2c: Make l2x0_cache_size_of_parse() return 'int'
ARM: enable bpf syscall
Linus Torvalds [Sun, 2 Nov 2014 20:31:02 +0000 (12:31 -0800)]
Merge tag 'for-linus' of git://git./virt/kvm/kvm
Pull kvm fixes from Paolo Bonzini:
"A small set of x86 fixes. The most serious is an SRCU lockdep fix.
A bit late - needed some time to test the SRCU fix, which only came in
on Friday"
* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
KVM: vmx: defer load of APIC access page address during reset
KVM: nVMX: Disable preemption while reading from shadow VMCS
KVM: x86: Fix far-jump to non-canonical check
KVM: emulator: fix execution close to the segment limit
KVM: emulator: fix error code for __linearize
Dave Airlie [Sun, 2 Nov 2014 19:23:17 +0000 (05:23 +1000)]
Merge branch 'exynos-drm-fixes' of git://git./linux/kernel/git/daeinki/drm-exynos into drm-fixes
This pull-request includes some bug fixes and code cleanups.
Especially, this fixes the bind failure issue occurred when it tries
to re-bind Exynos drm driver after unbound, and the modetest failure
issue incurred by not having a pair to vblank on and off requests.
* 'exynos-drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos:
drm/exynos: correct connector->dpms field before resuming
drm/exynos: enable vblank after DPMS on
drm/exynos: init kms poll at the end of initialization
drm/exynos: propagate plane initialization errors
drm/exynos: vidi: fix build warning
drm/exynos: remove explicit encoder/connector de-initialization
drm/exynos: init vblank with real number of crtcs
Linus Torvalds [Sun, 2 Nov 2014 18:28:43 +0000 (10:28 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/viro/vfs
Pull VFS fixes from Al Viro:
"A bunch of assorted fixes, most of them followups to overlayfs merge"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
ovl: initialize ->is_cursor
Return short read or 0 at end of a raw device, not EIO
isofs: don't bother with ->d_op for normal case
isofs_cmp(): we'll never see a dentry for . or ..
overlayfs: fix lockdep misannotation
ovl: fix check for cursor
overlayfs: barriers for opening upper-layer directory
rcu: Provide counterpart to rcu_dereference() for non-RCU situations
staging: android: logger: Fix log corruption regression
Linus Torvalds [Sun, 2 Nov 2014 18:20:26 +0000 (10:20 -0800)]
irda: stop calling sk_prot->disconnect() on connection failure
The sk_prot is irda's own set of protocol handlers, so irda should
statically know what that function is anyway, without using an indirect
pointer. And as it happens, we know *exactly* what that pointer is
statically: it's NULL, because irda doesn't define a disconnect
operation.
So calling that function is doubly wrong, and will just cause an oops.
Reported-by: Martin Lang <mlg.hessigheim@gmail.com>
Cc: Samuel Ortiz <samuel@sortiz.org>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Andrzej Hajda [Fri, 10 Oct 2014 12:31:56 +0000 (14:31 +0200)]
drm/exynos: correct connector->dpms field before resuming
During system suspend after connector switch off its dpms field
is set to connector previous dpms state. To properly resume dpms field
should be set to its actual state (off) before resuming to previous dpms state.
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Andrzej Hajda [Fri, 10 Oct 2014 12:31:55 +0000 (14:31 +0200)]
drm/exynos: enable vblank after DPMS on
Before DPMS off driver disables vblank.
It should be balanced by vblank enable after DPMS on.
The patch fixes issue with page_flip ioctl not being able
to acquire vblank counter introduced by patch:
drm: Always reject drm_vblank_get() after drm_vblank_off()
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Andrzej Hajda [Fri, 10 Oct 2014 12:31:54 +0000 (14:31 +0200)]
drm/exynos: init kms poll at the end of initialization
HPD events can be generated by components even if drm_dev is not fully
initialized, to skip such events kms poll initialization should
be performed at the end of load callback followed directly by forced
connection detection.
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Andrzej Hajda [Fri, 10 Oct 2014 12:31:53 +0000 (14:31 +0200)]
drm/exynos: propagate plane initialization errors
In case of error during plane initialization load callback
incorrectly return success, this patch fixes it.
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Tue, 7 Oct 2014 15:16:34 +0000 (00:16 +0900)]
drm/exynos: vidi: fix build warning
encoder object isn't used anymore so remove it.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Andrzej Hajda [Mon, 22 Sep 2014 09:30:48 +0000 (11:30 +0200)]
drm/exynos: remove explicit encoder/connector de-initialization
All KMS objects are destroyed by drm_mode_config_cleanup in proper order
so component drivers should not care about it.
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Andrzej Hajda [Tue, 7 Oct 2014 13:09:14 +0000 (22:09 +0900)]
drm/exynos: init vblank with real number of crtcs
Initialization of vblank with MAX_CRTC caused attempts
to disabling vblanks for non-existing crtcs in case
drm used fewer crtcs. The patch fixes it.
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>