]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/log
mirror_ubuntu-zesty-kernel.git
9 years agousb: dwc3: pci: code cleanup
Heikki Krogerus [Mon, 12 Jan 2015 12:20:14 +0000 (14:20 +0200)]
usb: dwc3: pci: code cleanup

Removing a few items that are not needed anymore and
adding separate function for quirks.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc3: pci: rely on default PM callbacks from PCI driver utility
Heikki Krogerus [Mon, 12 Jan 2015 12:20:13 +0000 (14:20 +0200)]
usb: dwc3: pci: rely on default PM callbacks from PCI driver utility

There is nothing specific being done in the suspend and
resume callbacks that is not already taken care of in PCI
driver core, so dropping the functions.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc3: pci: remove registration of NOP PHYs
Heikki Krogerus [Mon, 12 Jan 2015 12:20:12 +0000 (14:20 +0200)]
usb: dwc3: pci: remove registration of NOP PHYs

None of the PCI platforms need the NOP transceivers, and
since we can now live without the PHYs, removing
registration of the platform devices for them.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: uvc: to_uvcg_control_header() can be static
kbuild test robot [Tue, 13 Jan 2015 08:55:38 +0000 (16:55 +0800)]
usb: gadget: uvc: to_uvcg_control_header() can be static

drivers/usb/gadget/function/uvc_configfs.c:46:28: sparse: symbol 'to_uvcg_control_header' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:138:25: sparse: symbol 'uvcg_control_header_type' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:164:6: sparse: symbol 'uvcg_control_header_drop' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:721:20: sparse: symbol 'to_uvcg_format' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:798:30: sparse: symbol 'to_uvcg_streaming_header' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:950:25: sparse: symbol 'uvcg_streaming_header_type' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:976:6: sparse: symbol 'uvcg_streaming_header_drop' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:1020:19: sparse: symbol 'to_uvcg_frame' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:1265:25: sparse: symbol 'uvcg_frame_type' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:1315:6: sparse: symbol 'uvcg_frame_drop' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:1338:26: sparse: symbol 'to_uvcg_uncompressed' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:1548:25: sparse: symbol 'uvcg_uncompressed_type' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:1586:6: sparse: symbol 'uvcg_uncompressed_drop' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:1610:19: sparse: symbol 'to_uvcg_mjpeg' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:1761:25: sparse: symbol 'uvcg_mjpeg_type' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:1793:6: sparse: symbol 'uvcg_mjpeg_drop' was not declared. Should it be static?

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agotools: ffs-aio-example: use endpoint addresses from descriptors
Robert Baldyga [Tue, 13 Jan 2015 13:56:28 +0000 (14:56 +0100)]
tools: ffs-aio-example: use endpoint addresses from descriptors

This makes examples more platform independent and more compatible with
USB standard, as endpoint addresses in given interface may differ
between hardware platforms or even between configurations in single
USB device.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: net2280: Dont use 0 as NULL pointer
Ricardo Ribalda Delgado [Tue, 13 Jan 2015 09:54:58 +0000 (10:54 +0100)]
usb: gadget: net2280: Dont use 0 as NULL pointer

Fix sparse warning

Fixes: cb442ee1592d2681 (usb: gadget: udc: net2280: Re-enable dynamic debug messages)
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: u_uac1: fix one code style problem
Peter Chen [Mon, 1 Dec 2014 08:09:29 +0000 (16:09 +0800)]
usb: gadget: u_uac1: fix one code style problem

Fix one code style problem.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: uac1: struct gaudio is useless for struct f_uac1_opts
Peter Chen [Mon, 1 Dec 2014 08:09:28 +0000 (16:09 +0800)]
usb: gadget: uac1: struct gaudio is useless for struct f_uac1_opts

Since we call gaudio_cleanup at f_audio_free, the f_uac1_opts
doesn't need to use gaudio any more.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: renesas_usbhs: add OTG ID signal sensing
Sergei Shtylyov [Mon, 15 Dec 2014 22:42:13 +0000 (01:42 +0300)]
usb: renesas_usbhs: add OTG ID signal sensing

On the Renesas R8A7791 SoC based boards there's MAX3355 USB OTG chip and mini-AB
USB connector corresponding to USB port 0 driven either by EHCI/OHCI or  Renesas
USBHS gadget controller. And we'd like the host/gadget  drivers to work based on
the cable type connected. An 'extcon' driver for MAX3355 has been written, so we
only need to bind  to it via device tree which I'm doing in this patch.

(Perhaps, it would also make sense to use OTG HNP when the USBHS host mode is
active and a B-cable is connected but I don't have access to host-capable USBHS,
so  wouldn't be able to test it.)

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: report disconnection after reset
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:39:10 +0000 (13:39 +0100)]
usb: dwc2: gadget: report disconnection after reset

If usb bus is reset without a physical disconnection, all endpoints
will remain open. Call s3c_hsotg_disconnect() from reset handler to
report a disconnect to gadget framework. hsotg->connected is checked
in s3c_hsotg_disconnect() before processing disconnect.

In some cases, USBRst is seen before EnumDone and after it as well.
So move setting of hsotg->connected to set-address to avoid reporting
extra disconnection in this case.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: force gadget initialization in dev mode
Gregory Herrero [Fri, 9 Jan 2015 12:39:09 +0000 (13:39 +0100)]
usb: dwc2: gadget: force gadget initialization in dev mode

When booting with id pin grounded, dwc2 default to host mode.
Thus, force device mode prior initializing gadget part.
Else fifo init will fail since fifo values are not correct
in host mode.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: add vbus_draw support
Gregory Herrero [Fri, 9 Jan 2015 12:39:08 +0000 (13:39 +0100)]
usb: dwc2: gadget: add vbus_draw support

This callback informs the driver about the total amount of current it
is allowed to draw. Share this information with the phy so that
current limits can be set for charging for example.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: fix pullup handling
Gregory Herrero [Fri, 9 Jan 2015 12:39:07 +0000 (13:39 +0100)]
usb: dwc2: gadget: fix pullup handling

Gadget must be informed about disconnection when pullup is
removed.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: reset fifo_map when initializing fifos
Gregory Herrero [Fri, 9 Jan 2015 12:39:06 +0000 (13:39 +0100)]
usb: dwc2: gadget: reset fifo_map when initializing fifos

After all endpoints are disabled, fifo_map should have reached 0.
Its a bug if if didn't, so warn about it and reset it to 0 so that
driver can continue using all the fifos.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: fix fifo allocation leak
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:39:05 +0000 (13:39 +0100)]
usb: dwc2: gadget: fix fifo allocation leak

When selecting different alt setting, s3c_hsotg_ep_enable can be
called with fifo already allocated. Allocate fifo again only if
required and after deallocating the previous fifo.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: pick smallest acceptable fifo
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:39:04 +0000 (13:39 +0100)]
usb: dwc2: gadget: pick smallest acceptable fifo

Current algorithm picks the first fifo which is equal to or greater
than the required size. This can result in bigger fifos assigned to
endpoints with smaller maxps. Change the algorithm to pick the
smallest fifo which is greater than or equal to the required size.

Moreover, only use signed variables when required.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: rename sent_zlp to send_zlp
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:39:03 +0000 (13:39 +0100)]
usb: dwc2: gadget: rename sent_zlp to send_zlp

This flag is set before sending the zlp. So use present tense instead
of the past tense.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: add vbus_session support
Gregory Herrero [Fri, 9 Jan 2015 12:39:02 +0000 (13:39 +0100)]
usb: dwc2: gadget: add vbus_session support

Enable phy driver to report vbus session. This allows us to remove
D+ pullup when vbus is not present.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: don't block after fifo flush timeout
Gregory Herrero [Fri, 9 Jan 2015 12:39:01 +0000 (13:39 +0100)]
usb: dwc2: gadget: don't block after fifo flush timeout

Can't stay in the loop forever. Break it after timeout.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: dont warn if endpoint is not enabled
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:39:00 +0000 (13:39 +0100)]
usb: dwc2: gadget: dont warn if endpoint is not enabled

The warning is probably good but it has false positives in both dma and non-dma
cases. So its not very helpful in either.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: fix zero length packet transfers
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:59 +0000 (13:38 +0100)]
usb: dwc2: gadget: fix zero length packet transfers

According to programming guide, zero length packet should be
programmed on its own and should not be counted in DIEPTSIZ.PktCnt
with other packets.

For ep0, this is the zlp for DATA IN stage (if required) and not for
the STATUS stage.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: manage ep0 state in software
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:58 +0000 (13:38 +0100)]
usb: dwc2: gadget: manage ep0 state in software

Manage ep0 state in software to add handling of status OUT stage.
Just toggling hsotg->setup in s3c_hsotg_handle_outdone leaves it in
wrong state in 2-stage control transfers.
Moreover, ensure that for setup-packet s3c_hsotg_handle_outdone is
called either from SetupDone or OutDone but not both. Dwc2 ip v3.00a
generates both SetupDone and OutDone on setup packets.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: kill requests after disabling ep
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:57 +0000 (13:38 +0100)]
usb: dwc2: gadget: kill requests after disabling ep

kill_all_requests() can flush the fifo. Call it after disabling the
endpoint.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: consider all tx fifos
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:56 +0000 (13:38 +0100)]
usb: dwc2: gadget: consider all tx fifos

When matching tx fifo to endpoint, consider all fifos instead of
hard limiting to 8
Moreover, print error in case no fifo could be found.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: fix debug loop limits
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:55 +0000 (13:38 +0100)]
usb: dwc2: gadget: fix debug loop limits

< 15 check doesn't show debug information for endpoint 15.
It is possible to have less than 15 endpoints so use limit
provided by hardware configuration.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: remove unused members from hsotg_req
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:54 +0000 (13:38 +0100)]
usb: dwc2: gadget: remove unused members from hsotg_req

These members are only occupying space.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agoDocumentation: dt-bindings: add dt binding info for dwc2 fifo resizing
Gregory Herrero [Fri, 9 Jan 2015 12:38:53 +0000 (13:38 +0100)]
Documentation: dt-bindings: add dt binding info for dwc2 fifo resizing

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: configure fifos from device tree
Gregory Herrero [Fri, 9 Jan 2015 12:38:52 +0000 (13:38 +0100)]
usb: dwc2: gadget: configure fifos from device tree

As fifo size can vary between SOCs, add possibility to configure
them from device tree. Fifo sizes used by the legacy driver will
be used If they are not provided by the device tree.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Reviewed-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: check interrupts for all endpoints
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:51 +0000 (13:38 +0100)]
usb: dwc2: gadget: check interrupts for all endpoints

Current code does not check endpoint 15 interrupt. Use number
of endpoint configured in hardware instead of the hardcoded value.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: add bi-directional endpoint support
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:50 +0000 (13:38 +0100)]
usb: dwc2: gadget: add bi-directional endpoint support

GHWCFG1 provides hardware configuration of each endpoint. Use
it to configure the endpoints instead of assuming all even
endpoint are OUT and all odd endpoints are IN.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agoDocumentation: dt-bindings: add dt binding info for dwc2 g-use-dma
Gregory Herrero [Fri, 9 Jan 2015 12:38:49 +0000 (13:38 +0100)]
Documentation: dt-bindings: add dt binding info for dwc2 g-use-dma

Indicate if gadget driver must use dma for usb transfers.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: add device tree property to enable dma
Gregory Herrero [Fri, 9 Jan 2015 12:38:48 +0000 (13:38 +0100)]
usb: dwc2: gadget: add device tree property to enable dma

* Add an of specific function to parse device node properties.
* Enable dma usage only if device tree property 'g_use_dma' is present.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: don't erase gahbcfg register when enabling dma
Gregory Herrero [Fri, 9 Jan 2015 12:38:47 +0000 (13:38 +0100)]
usb: dwc2: gadget: don't erase gahbcfg register when enabling dma

Do a read-modify-write instead of only setting DMAEn bit.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: write correct value in ahbcfg register
Gregory Herrero [Fri, 9 Jan 2015 12:38:46 +0000 (13:38 +0100)]
usb: dwc2: gadget: write correct value in ahbcfg register

HBstLen is GAHBCFG[4:1]. Use GAHBCFG_HBSTLEN_SHIFT to write burst-
length at correct position.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: fix error path in dwc2_gadget_init
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:45 +0000 (13:38 +0100)]
usb: dwc2: gadget: fix error path in dwc2_gadget_init

In the error path, s3c_hsotg_phy_disable should be called after a
call to s3c_hsotg_phy_enable is made.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: don't embed ep0 buffers
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:44 +0000 (13:38 +0100)]
usb: dwc2: gadget: don't embed ep0 buffers

When using DMA, data of the previous setup packet can be read back
from cache because ep0 and ctrl buffers are embedded in struct s3c_hsotg.
Allocate buffers instead of embedding them.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Reviewed-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: don't process XferCompl on setup packet
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:43 +0000 (13:38 +0100)]
usb: dwc2: gadget: don't process XferCompl on setup packet

Only process DOEPINT.XferCompl on data packet as DOEPINTn.SetUp can
occur with or without DOEPINT.XferCompl. When DOEPINT.SetUp occurs
with DOEPINT.XferCompl, only DOEPINT.SetUp needs to be handled.

Moreover, ignore DOEPINT.XferCompl when it occurs with
DOEPINT.StupPktRcvd as driver needs to wait for DOEPINT.SetUp to
continue.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: mask fifo empty irq with dma
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:42 +0000 (13:38 +0100)]
usb: dwc2: gadget: mask fifo empty irq with dma

When using DMA, keep fifo empty interrupt disabled. Otherwise
core is flooded by interrupts.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: register gadget handle to the phy
Gregory Herrero [Fri, 9 Jan 2015 12:38:41 +0000 (13:38 +0100)]
usb: dwc2: gadget: register gadget handle to the phy

Bind peripheral controller to the phy on udc_start. Unbind on
udc_stop.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: mv_udc_core: delete pullup operation at .udc_start
Peter Chen [Mon, 12 Jan 2015 08:37:57 +0000 (16:37 +0800)]
usb: gadget: mv_udc_core: delete pullup operation at .udc_start

UDC core has already done it after .udc_start.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: pxa27x_udc: delete pullup operation at .udc_start and .udc_stop
Peter Chen [Mon, 12 Jan 2015 08:37:56 +0000 (16:37 +0800)]
usb: gadget: pxa27x_udc: delete pullup operation at .udc_start and .udc_stop

UDC core has already done it before .udc_stop and after .udc_start.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: pxa27x_udc: delete pullup operation at .udc_start and .udc_stop
Peter Chen [Mon, 12 Jan 2015 08:37:55 +0000 (16:37 +0800)]
usb: gadget: pxa27x_udc: delete pullup operation at .udc_start and .udc_stop

UDC core has already done it before .udc_stop and after .udc_start.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: f_fs: refactor and document __ffs_ep0_read_events better
Michal Nazarewicz [Wed, 10 Sep 2014 15:50:24 +0000 (17:50 +0200)]
usb: gadget: f_fs: refactor and document __ffs_ep0_read_events better

Instead of using variable length array, use a static length equal to
the size of the ffs->ev.types array.  This gets rid of a sparse warning:

drivers/usb/gadget/function/f_fs.c:401:44: warning:
Variable length array is used.

and makes it more explicit that the array has a very tight upper size
limit.  Also add some more documentation about the ev.types array and
how its size is limited and affects the rest of the code.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reported-by: Rohith Seelaboyina <rseelaboyina@nvidia.com>
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agotools: ffs-aio-example: add missing wMaxPacketSize for HS descs
Robert Baldyga [Mon, 5 Jan 2015 09:44:44 +0000 (10:44 +0100)]
tools: ffs-aio-example: add missing wMaxPacketSize for HS descs

It's needed, to have more than 64 bytes of maxpacketsize.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: phy: generic: add vbus support
Robert Jarzmik [Sat, 6 Dec 2014 21:05:15 +0000 (22:05 +0100)]
usb: phy: generic: add vbus support

Add support for vbus detection and power supply. This code is more or
less stolen from phy-gpio-vbus-usb.c, and aims at providing a detection
mechanism for VBus (ie. usb cable plug) based on a GPIO line, and a
power supply activation which draws current from the VBus.

[ balbi@ti.com : fix build break ]

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: phy: nop: device tree documentation for vbus
Robert Jarzmik [Sat, 6 Dec 2014 21:05:14 +0000 (22:05 +0100)]
usb: phy: nop: device tree documentation for vbus

Enhance the phy documentation by adding 2 new optional bindings :
 - the vbus gpio, which detects usb insertion
 - the vbus regulator, which provides current drawn from the usb cable

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: phy: generic: migrate to gpio_desc
Robert Jarzmik [Sat, 6 Dec 2014 21:05:13 +0000 (22:05 +0100)]
usb: phy: generic: migrate to gpio_desc

Change internal gpio handling from integer gpios into gpio
descriptors. This change only addresses the internal API and
device-tree/ACPI, while the legacy platform data remains integer space
based.

This change is only build compile tested, and very prone to error. I
leave this comment for now in the commit message so that this patch gets
some testing as I'm pretty sure it's buggy.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: atmel_usba: Cache INT_ENB register value
Boris Brezillon [Tue, 6 Jan 2015 13:47:02 +0000 (14:47 +0100)]
usb: gadget: atmel_usba: Cache INT_ENB register value

Cache INT_ENB register value in order to avoid uncached iomem access, and
thus improve access time to INT_ENB value.

Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: atmel_usba_udc: Mask status with enabled irqs
Boris Brezillon [Tue, 6 Jan 2015 13:47:01 +0000 (14:47 +0100)]
usb: atmel_usba_udc: Mask status with enabled irqs

Avoid interpreting useless status flags when we're not waiting for such
events by masking the status variable with the interrupt enabled register
value.

Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Reported-by: Patrice VILCHEZ <patrice.vilchez@atmel.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: atmel_usba_udc: Add at91sam9g45 and at91sam9x5 errata handling
Boris Brezillon [Tue, 6 Jan 2015 13:46:59 +0000 (14:46 +0100)]
usb: atmel_usba_udc: Add at91sam9g45 and at91sam9x5 errata handling

at91sam9g45 and at91sam9x5 SoCs have an hardware bug forcing us to
generate a pulse on the BIAS signal on "USB end of reset” and
“USB end of resume" events.

Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Reported-by: Patrice VILCHEZ <patrice.vilchez@atmel.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: atmel_usba_udc: Rework at91sam9rl errata handling
Boris Brezillon [Tue, 6 Jan 2015 13:46:58 +0000 (14:46 +0100)]
usb: atmel_usba_udc: Rework at91sam9rl errata handling

at91sam9rl SoC has an erratum forcing us to toggle the BIAS on USB
suspend/resume events.

This specific handling is only activated when CONFIG_ARCH_AT91SAM9RL is
set and this option is only set when building a non-DT kernel, which is
problematic since non-DT support for at91sam9rl SoC has been removed.

Rework the toggle_bias implementation to attach it to the "at91sam9rl-udc"
compatible string.

Add new compatible strings to avoid executing at91sam9rl erratum handling
on other SoCs.

Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: phy: phy-fsl-usb: Remove some unused functions
Rickard Strandqvist [Thu, 1 Jan 2015 19:15:34 +0000 (20:15 +0100)]
usb: phy: phy-fsl-usb: Remove some unused functions

Removes some functions that are not used anywhere:
fsl_otg_tick_timer() view_ulpi()

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: phy: change some comments
Peter Chen [Tue, 30 Dec 2014 06:02:28 +0000 (14:02 +0800)]
usb: phy: change some comments

- Delete the OTG stuffs
- .set_suspend is for controller, not for A-device or B-device.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: phy: phy-mxs-usb: do not depend on speed for disconnect notifier
Peter Chen [Wed, 24 Dec 2014 05:48:03 +0000 (13:48 +0800)]
usb: phy: phy-mxs-usb: do not depend on speed for disconnect notifier

For some user cases, like plug out and replug in usb device during
the system suspend, the speed negotiation will be error due to host
doesn't know the device's disconnection, and it still hopes the
high speed device, but the device backs to "powered" state which
its high speed termination is not enabled, the usb core calls
the PHY's disconnect notifier with "full speed", it will NOT
take effect at all.

If the usb core calls disconnect notifer, the port change must happen,
so it is safe to disable high speed disconenct detector, since
connect notifier will be called soon if the device is still connected
on the port, and we will enable high speed disconnect detector at that
time.

Acked-by: Li Jun <b47624@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: phy: phy-mxs-usb: add power down and disable wakeup for .shutdown
Peter Chen [Wed, 24 Dec 2014 05:48:02 +0000 (13:48 +0800)]
usb: phy: phy-mxs-usb: add power down and disable wakeup for .shutdown

When we shut down the PHY, we need to power down all PHY's functions
as well as disable wakeup, it is the opposite operation we do at .init.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agodrivers: usb: dwc2: remove 'force' parameter from kill_all_requests()
Robert Baldyga [Tue, 16 Dec 2014 10:51:44 +0000 (11:51 +0100)]
drivers: usb: dwc2: remove 'force' parameter from kill_all_requests()

This patch fixes in simpler way the bug described in [1] and [2]. It
looks like DWC2 is the only UDC driver that doesn't force usb requests
to complete in ep_disable() function. This causes described problem,
because we have no guarantee that all requests will be completed before
unbind of usb function.

To fix this problem we force all requests of disabled endpoint to complete.
Also currently running request is not handled. This allowed to simplify
code of kill_all_requests() function, because 'force' parameter is always
set to true, so we don't need it anymore.

In s3c_hsotg_rx_data() we change function used to print message when active
request is NULL from dev_warn() to dev_dbg(), because such situation is
harmless for driver and now it can take place during normal endpoint
disabling.

[1] https://lkml.org/lkml/2014/12/9/283
[2] https://lkml.org/lkml/2014/12/12/360

Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: udc: net2280: Re-enable dynamic debug messages
Ricardo Ribalda Delgado [Fri, 28 Nov 2014 13:51:02 +0000 (14:51 +0100)]
usb: gadget: udc: net2280: Re-enable dynamic debug messages

Some debug messages were not build due to unconditional #if 0.

These messages are very useful for debugging and the user can enable
them on demand via dynamic debug.

If they are not enabled the performance is not affected.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: udc: net2280: Move ASSERT_OUT_NAKING into out_flush
Ricardo Ribalda Delgado [Fri, 28 Nov 2014 13:51:01 +0000 (14:51 +0100)]
usb: gadget: udc: net2280: Move ASSERT_OUT_NAKING into out_flush

ASSERT_OUT_NAKING was only called by out_flush and was hidden behind a
ifdef.

This patch moves the inline function into out_flush and remove the
ifdef. The user can decide to print the debug message or not via dynamic
printk

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: udc: net2280: Simplify scan_dma_completions
Ricardo Ribalda Delgado [Fri, 28 Nov 2014 13:51:00 +0000 (14:51 +0100)]
usb: gadget: udc: net2280: Simplify scan_dma_completions

After fix superspeed dma_done was applied we can simplify the code by
removing the duplicated dma_done and letting the function check if there
are more completed dma transactions.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: udc: net2280: Declare allow_status_338x as inline
Ricardo Ribalda Delgado [Fri, 28 Nov 2014 13:50:59 +0000 (14:50 +0100)]
usb: gadget: udc: net2280: Declare allow_status_338x as inline

The function is very simple, does not declare any variable and it is
called in the irq path.

The counterpart for net228x is already declared as inline.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: udc: net2280: Remove function resume_dma
Ricardo Ribalda Delgado [Fri, 28 Nov 2014 13:50:58 +0000 (14:50 +0100)]
usb: gadget: udc: net2280: Remove function resume_dma

Function resume_dma is not used, remove it.

The reason the compiler did not catch this dead code is the inline
modifier.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: udc: net2280: Improve patching of defect 7374
Ricardo Ribalda Delgado [Fri, 28 Nov 2014 13:50:57 +0000 (14:50 +0100)]
usb: gadget: udc: net2280: Improve patching of defect 7374

Once the defect 7374 is patched, there is no reason the keep reading the
idx scratch register.

Cache the content of the scratch idx register on device flag.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: udc: net2280: Clean function net2280_queue
Ricardo Ribalda Delgado [Fri, 28 Nov 2014 13:50:56 +0000 (14:50 +0100)]
usb: gadget: udc: net2280: Clean function net2280_queue

Do not duplicate the code for the else branch of the condition.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: udc: net2280: Merge abort_dma for 228x and 338x
Ricardo Ribalda Delgado [Fri, 28 Nov 2014 13:50:55 +0000 (14:50 +0100)]
usb: gadget: udc: net2280: Merge abort_dma for 228x and 338x

We can use the same function for both families of chips and also remove
the ep_stop_dma() function.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: udc: net2280: Remove function ep_stall
Ricardo Ribalda Delgado [Fri, 28 Nov 2014 13:50:54 +0000 (14:50 +0100)]
usb: gadget: udc: net2280: Remove function ep_stall

irqs_superspeed calls ep_stall instead of set/clear_halt, due to a
workaround for SS seqnum. Create a function with the workaround and
call set/clear_halt instead.

This way we can compare the code of super/normal speed and it is easier
to follow the code.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: udc: net2280: Remove field is_halt
Ricardo Ribalda Delgado [Fri, 28 Nov 2014 13:50:53 +0000 (14:50 +0100)]
usb: gadget: udc: net2280: Remove field is_halt

Field is_halt is never used by any function.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: udc: net2280: Code cleanout remove ep_stdrsp function
Ricardo Ribalda Delgado [Fri, 28 Nov 2014 13:50:52 +0000 (14:50 +0100)]
usb: gadget: udc: net2280: Code cleanout remove ep_stdrsp function

ep_stdrsp was only called by handle_stat0_irqs_superspeed and with
always the same flags.

Remove the function and replace the call by the code inside the
function, since it is very simple once the dead code is removed.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: udc: net2280: Remove restart_dma inline function definition
Ricardo Ribalda Delgado [Fri, 28 Nov 2014 13:50:51 +0000 (14:50 +0100)]
usb: gadget: udc: net2280: Remove restart_dma inline function definition

restart_dma is not used before it is declaration. Therefore we can
remove this definition.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: udc: net2280: Remove dma_started field
Ricardo Ribalda Delgado [Fri, 28 Nov 2014 13:50:50 +0000 (14:50 +0100)]
usb: gadget: udc: net2280: Remove dma_started field

Remove dma_started field from net2280_ep structure, since it is not used
by any function.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: udc: net2280: Remove use_dma module parameter
Ricardo Ribalda Delgado [Fri, 28 Nov 2014 13:50:49 +0000 (14:50 +0100)]
usb: gadget: udc: net2280: Remove use_dma module parameter

use_dma parameter was designed to enable the dma on the chip. It was
enabled by default.

It comes from the time when the dma was not reliable. Now it has been
working ok in production.

This patch removes this parameter.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: udc: net2280: Remove module parameter use_msi
Ricardo Ribalda Delgado [Fri, 28 Nov 2014 13:50:48 +0000 (14:50 +0100)]
usb: gadget: udc: net2280: Remove module parameter use_msi

Parameter use_msi was used to enable msi irq on usb338x chips, it was
enabled by default.

There is no reason to prefer non-msi irq on usb338x, and it falls back
to non msi on error.

Therefore remove this option.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: udc: net2280: remove full_speed module parameter
Ricardo Ribalda Delgado [Fri, 28 Nov 2014 13:50:47 +0000 (14:50 +0100)]
usb: gadget: udc: net2280: remove full_speed module parameter

This patch removes the full_speed parameter used force full-speed
operation.

It was designed exclusively for testing purposes, and there is no
reason to maintain this in a production kernel.

Reverts: 2f0760774711c957c395b31131b848043af98edf
Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: udc: net2280: Remove obsolete module param use_dma_chaining
Ricardo Ribalda Delgado [Fri, 28 Nov 2014 13:50:46 +0000 (14:50 +0100)]
usb: gadget: udc: net2280: Remove obsolete module param use_dma_chaining

use_dma_chaining module parameter was designed to avoid creating one irq
per package on a group of packages (with the help of the driver's flag
no_interrupt).

Unfortunately, when this parameter is enabled, the driver fails to work
on both net2280 and 3380 chips.

This patch removes this parameter, which was disabled by default.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: renesas_usbhs: fix platform init error message
Sergei Shtylyov [Tue, 4 Nov 2014 22:48:48 +0000 (01:48 +0300)]
usb: renesas_usbhs: fix platform init error message

There is a typo ("prove" instead of "probe") in the error message printed when
the platform initialization fails. Replace that word with more fitting "init".

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: cleanup on stack DECLARE_COMPLETIONs
Nicholas Mc Guire [Tue, 23 Dec 2014 18:50:14 +0000 (19:50 +0100)]
usb: gadget: cleanup on stack DECLARE_COMPLETIONs

fixups for incorrect use of DECLARE_COMPLETION. see also commit
6e9a4738 ("completions: lockdep annotate on stack completions")

patch is against 3.18.0 linux-next

This was only code reviewed and compile tested

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: f_uac1: update Class-Specific AudioControl Interface Header Descriptor
Xuebing Wang [Wed, 10 Dec 2014 08:28:15 +0000 (16:28 +0800)]
usb: gadget: f_uac1: update Class-Specific AudioControl Interface Header Descriptor

Update this according to USB Audio Class 1.0 spec. This fixes the Windows 7
detection issue.

Cc: Rafael Brune <mail@rbrune.de>
Signed-off-by: Xuebing Wang <xbing6@gmail.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
(Fixed some code style issues)
Tested-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: f_uac1: configure endpoint before using it
Xuebing Wang [Wed, 10 Dec 2014 08:28:14 +0000 (16:28 +0800)]
usb: gadget: f_uac1: configure endpoint before using it

UAC1 forget to do it.

Signed-off-by: Xuebing Wang <xbing6@gmail.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: fix platform_no_drv_owner.cocci warnings
Julia Lawall [Wed, 26 Nov 2014 06:00:45 +0000 (07:00 +0100)]
usb: gadget: fix platform_no_drv_owner.cocci warnings

Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: udc: remove bogus NULL check
Dan Carpenter [Tue, 25 Nov 2014 15:56:22 +0000 (18:56 +0300)]
usb: gadget: udc: remove bogus NULL check

"ep" isn't NULL here, and static checkers complain because we
dereferenced it on the previous line.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: udc: clean up a printk
Dan Carpenter [Tue, 25 Nov 2014 15:55:57 +0000 (18:55 +0300)]
usb: gadget: udc: clean up a printk

We already know what "value" is, so there is no need to check.  It
puzzles static checkers to have the unneeded condition.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: platform: add generic PHY framework support
Yunzhi Li [Mon, 8 Dec 2014 09:46:26 +0000 (17:46 +0800)]
usb: dwc2: platform: add generic PHY framework support

Get PHY parameters from devicetree and power off usb PHY during
system suspend.

Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Yunzhi Li <lyz@rock-chips.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: uvc: configfs support in uvc function
Andrzej Pietrasiewicz [Wed, 10 Dec 2014 11:34:02 +0000 (12:34 +0100)]
usb: gadget: uvc: configfs support in uvc function

Add support for using the uvc function as a component of USB gadgets composed
with configfs.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: uvc: verify descriptors presence
Andrzej Pietrasiewicz [Wed, 10 Dec 2014 11:34:01 +0000 (12:34 +0100)]
usb: gadget: uvc: verify descriptors presence

If the caller of uvc_alloc() does not provide enough
descriptors, binding the function should fail, so appropriate
code is returned from uvc_copy_descriptors().

uvc_function_bind() is modified accordingly to account for possible
errors from uvc_copy_descriptors().

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: f_uvc: rename a macro to avoid conflicts
Andrzej Pietrasiewicz [Wed, 10 Dec 2014 11:34:00 +0000 (12:34 +0100)]
usb: gadget: f_uvc: rename a macro to avoid conflicts

When configfs is integrated, CONFIGFS_ATTR_STRUCT and CONFIGFS_ATTR_OPS
macros should be used, but the latter expects that tere is a to_f_uvc_opts
function accepting a config_item, whereas the macro being changed
can be applied to a different type of argument.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agoDocumentation: usb: phy: nop: Fix the description of 'vcc-supply'
Fabio Estevam [Fri, 12 Dec 2014 15:08:26 +0000 (13:08 -0200)]
Documentation: usb: phy: nop: Fix the description of 'vcc-supply'

Since bd27fa44e13830d2b ("usb: phy: generic: Don't use regulator framework for
RESET line") we no longer model the reset line as a regulator supply, so
adapt the documentation accordingly.

Acked-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: renesas_usbhs: kill dead code in usbhs_probe()
Sergei Shtylyov [Fri, 12 Dec 2014 19:53:18 +0000 (22:53 +0300)]
usb: renesas_usbhs: kill dead code in usbhs_probe()

usbhsc_drvcllbck_notify_hotplug() always returns 0, so it's rather pointless to
store and check its result for being < 0.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: hid: consistently use 2^n - 1 for max values
Andrzej Pietrasiewicz [Mon, 15 Dec 2014 12:50:05 +0000 (13:50 +0100)]
usb: gadget: hid: consistently use 2^n - 1 for max values

A maximum value which fits in 16 bits, unsigned, is 65535.

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agoDocumentation: usb: UVC function testing
Andrzej Pietrasiewicz [Tue, 16 Dec 2014 13:56:42 +0000 (14:56 +0100)]
Documentation: usb: UVC function testing

Summary of how to test UVC function of USB gadget.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agoDocumentation: usb: UAC2 function testing
Andrzej Pietrasiewicz [Tue, 16 Dec 2014 13:56:41 +0000 (14:56 +0100)]
Documentation: usb: UAC2 function testing

Summary of how to test UAC2 function of USB gadget.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agoDocumentation: usb: UAC1 function testing
Andrzej Pietrasiewicz [Tue, 16 Dec 2014 13:56:40 +0000 (14:56 +0100)]
Documentation: usb: UAC1 function testing

Summary of how to test UAC1 function of USB gadget.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agoDocumentation: usb: SOURCESINK function testing
Andrzej Pietrasiewicz [Tue, 16 Dec 2014 13:56:39 +0000 (14:56 +0100)]
Documentation: usb: SOURCESINK function testing

Summary of how to test SOURCESINK function of USB gadget.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agoDocumentation: usb: SERIAL function testing
Andrzej Pietrasiewicz [Tue, 16 Dec 2014 13:56:38 +0000 (14:56 +0100)]
Documentation: usb: SERIAL function testing

Summary of how to test SERIAL function of USB gadget.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agoDocumentation: usb: RNDIS function testing
Andrzej Pietrasiewicz [Tue, 16 Dec 2014 13:56:37 +0000 (14:56 +0100)]
Documentation: usb: RNDIS function testing

Summary of how to test RNDIS function of USB gadget.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agoDocumentation: usb: PHONET function testing
Andrzej Pietrasiewicz [Tue, 16 Dec 2014 13:56:36 +0000 (14:56 +0100)]
Documentation: usb: PHONET function testing

Summary of how to test PHONET function of USB gadget.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agoDocumentation: usb: OBEX function testing
Andrzej Pietrasiewicz [Tue, 16 Dec 2014 13:56:35 +0000 (14:56 +0100)]
Documentation: usb: OBEX function testing

Summary of how to test OBEX function of USB gadget.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agoDocumentation: usb: NCM function testing
Andrzej Pietrasiewicz [Tue, 16 Dec 2014 13:56:34 +0000 (14:56 +0100)]
Documentation: usb: NCM function testing

Summary of how to test NCM function of USB gadget.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agoDocumentation: usb: MIDI function testing
Andrzej Pietrasiewicz [Tue, 16 Dec 2014 13:56:33 +0000 (14:56 +0100)]
Documentation: usb: MIDI function testing

Summary of how to test MIDI function of USB gadget.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agoDocumentation: usb: MASS STORAGE function testing
Andrzej Pietrasiewicz [Tue, 16 Dec 2014 13:56:32 +0000 (14:56 +0100)]
Documentation: usb: MASS STORAGE function testing

Summary of how to test MASS STORAGE function of USB gadget.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agoDocumentation: usb: LOOPBACK function testing
Andrzej Pietrasiewicz [Tue, 16 Dec 2014 13:56:31 +0000 (14:56 +0100)]
Documentation: usb: LOOPBACK function testing

Summary of how to test LOOPBACK function of USB gadget.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agoDocumentation: usb: HID function testing
Andrzej Pietrasiewicz [Tue, 16 Dec 2014 13:56:30 +0000 (14:56 +0100)]
Documentation: usb: HID function testing

Summary of how to test HID function of USB gadget.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>