We never set CMDIOC bit for Start Transfer
command, so that code will never be used.
Tested-by: Pratyush Anand <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
A few quoted includes start with a superfluous "./". Clean up those
quoted includes.
Signed-off-by: Paul Bolle <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Resolve this build warning:
drivers/usb/otg/isp1301_omap.c: In function 'isp1301_set_peripheral':
drivers/usb/otg/isp1301_omap.c:1340:6: warning: unused variable 'l'
This shows up when building with the 'omap1_defconfig' and
'5912osk_testconfig' configs from git://git.pwsan.com/omap_kconfigs.
Compile-tested only.
Cc: Heikki Krogerus <[email protected]>
Cc: Felipe Balbi <[email protected]>
Signed-off-by: Paul Walmsley <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Currently in case of MUSB DMA channel request failure we are not
clearing MUSB_RXCSR_DMAENAB, MUSB_RXCSR_H_AUTOREQ and
MUSB_RXCSR_AUTOCLEAR bits of MUSB RXCSR of MUSB DMA. Which is
causing failure in receipt of data packets in next transfer.
Fix is to disable the MUSB DMA mode and related bits incase of
DMA channel request fails
Signed-off-by: Mantesh Sarashetti <[email protected]>
Signed-off-by: Ruslan Bilovol <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
usb_ep_ops.disable must clear external copy of the endpoint descriptor,
otherwise musb crashes after loading/unloading several gadget modules
in a row:
Unable to handle kernel paging request at virtual address bf013730
pgd = c0004000
[bf013730] *pgd=8f26d811, *pte=00000000, *ppte=00000000
Internal error: Oops: 7 [#1]
Modules linked in: g_cdc [last unloaded: g_file_storage]
CPU: 0 Not tainted (3.2.17 #647)
PC is at musb_gadget_enable+0x4c/0x24c
LR is at _raw_spin_lock_irqsave+0x4c/0x58
[<c027c030>] (musb_gadget_enable+0x4c/0x24c) from [<bf01b760>] (gether_connect+0x3c/0x19c [g_cdc])
[<bf01b760>] (gether_connect+0x3c/0x19c [g_cdc]) from [<bf01ba1c>] (ecm_set_alt+0x15c/0x180 [g_cdc])
[<bf01ba1c>] (ecm_set_alt+0x15c/0x180 [g_cdc]) from [<bf01ecd4>] (composite_setup+0x85c/0xac4 [g_cdc])
[<bf01ecd4>] (composite_setup+0x85c/0xac4 [g_cdc]) from [<c027b744>] (musb_g_ep0_irq+0x844/0x924)
[<c027b744>] (musb_g_ep0_irq+0x844/0x924) from [<c027a97c>] (musb_interrupt+0x79c/0x864)
[<c027a97c>] (musb_interrupt+0x79c/0x864) from [<c027aaa8>] (generic_interrupt+0x64/0x7c)
[<c027aaa8>] (generic_interrupt+0x64/0x7c) from [<c00797cc>] (handle_irq_event_percpu+0x28/0x178)
...
Cc: [email protected] # v3.1+
Signed-off-by: Grazvydas Ignotas <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
This appears to have been broken by
commit 5cfb19ac60
(ARM: davinci: streamline sysmod access)
For now, fix by hardcoding USB_PHY_CTRL and DM355_DEEPSLEEP
Tested on DM365 with defconfig changes.
Signed-off-by: Jon Povey <[email protected]>
Acked-by: Sekhar Nori <[email protected]>
CC: Felipe Balbi <[email protected]>
Cc: <[email protected]> # v3.4.x
Signed-off-by: Felipe Balbi <[email protected]>
User can trigger disabling of gadget at run time while the
transfers are going on.
Eg: 1: rmmod of musb driver while transfers are going on
Eg: 2: On android doing:
echo 0 > /sys/class/android_usb/android0/enable
While a big file transfer is going on via PTP/MTP.
In such a case, musb_gadget_disable() calls nuke()
but the dma interrupt may still happen for an endpoint since hw
would raise the interrupt in anycase.
This can result in a NULL pointer access crash:
[ 314.030426] PC is at txstate+0x74/0x20c
[ 314.034759] LR is at musb_g_tx+0x140/0x204
[ 314.039489] pc : [<c03506f4>] lr : [<c0350bcc>] psr: 20000193
[ 314.039520] sp : c783bc68 ip : 00000002 fp : c783bc9c
[ 314.052429] r10: 00000018 r9 : 00000000 r8 : 00000200
[ 314.058258] r7 : 00000000 r6 : fc0ab130 r5 : c781a410 r4 : c6caf640
[ 314.065643] r3 : 00000000 r2 : 00000000 r1 : 00000000 r0 : c781a000
[ 315.083251] Backtrace:
[ 315.086242] [<c0350680>] (txstate+0x0/0x20c) from [<c0350bcc>] (musb_g_tx+0x140/0x204)
[ 315.095123] [<c0350a8c>] (musb_g_tx+0x0/0x204) from [<c034eb00>] (musb_dma_completion+0x40/0x54)
[ 315.104980] [<c034eac0>] (musb_dma_completion+0x0/0x54) from [<c0351e6c>] (dma_controller_irq+0x118/0x184)
[ 315.115661] [<c0351d54>] (dma_controller_irq+0x0/0x184) from [<c00d86b8>] (handle_irq_event_percpu+0x54/0x188)
So put protection in code to handle possiblity of getting an interrupt for an
endpoint that might have been already nuked.
Reported-by: Todd Poynor <[email protected]>
Signed-off-by: Vikram Pandita <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
This patch removes redundant pointer to struct usb_endpoint_descriptor which
were missed in commit 79149b8:
usb: gadget: Update fsl_udc_core to use usb_endpoint_descriptor inside the
struct usb_ep
Due to clock framework regressions, this patch is only compile tested!
Signed-off-by: Christoph Fritz <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
If event status says that its last completed TRB but TRB is still owned
by HW then break from the loop, because we are not going to get correct
TRB status from trb control/size register.
Signed-off-by: Pratyush Anand <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
If an IN transfer is missed on isoc endpoint, then driver must insure
that next ep_queue is properly handled.
This patch fixes this issue by starting a new transfer for next queued
request.
Signed-off-by: Pratyush Anand <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
SOF Number is bit16:3 of DSTS. Correct the mask accordingly.
Signed-off-by: Pratyush Anand <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Currently in case of isoc, interrupt is programmed after each
TRB_NUM/4 ie 8th TRB. A TRB is programmed against each submitted
request from gadget. If we do not want to limit the minimum number of
necessary request to be submitted from gadget then we must receive
interrupt on each TRB submission. There can be such situation with a
gadget working with ping-pong buffer.
If a gadget does not want to receive interrupt after each request
completion then it may set no_interrupt flag.
Signed-off-by: Pratyush Anand <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
The removed condition is always true, since the endpoint descriptor is
set prior to calling the enable endpoint.
Signed-off-by: Ido Shayevitz <[email protected]>
Acked-by: Heiko Stuebner <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
The removed condition is always true, since the endpoint descriptor is
set prior to calling the enable endpoint.
Signed-off-by: Ido Shayevitz <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
The removed condition is always true, since the endpoint descriptor is
set prior to calling the enable endpoint.
Signed-off-by: Ido Shayevitz <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
The removed condition is always true, since the endpoint descriptor is
set prior to calling the enable endpoint.
Signed-off-by: Ido Shayevitz <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
The removed condition is always true, since the endpoint descriptor is
set prior to calling the enable endpoint.
Signed-off-by: Ido Shayevitz <[email protected]>
Acked-by: Yu Xu <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
The removed condition is always true, since the endpoint descriptor is
set prior to calling the enable endpoint.
Signed-off-by: Ido Shayevitz <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
The removed condition is always true, since the endpoint descriptor is
set prior to calling the enable endpoint.
Signed-off-by: Ido Shayevitz <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
The removed condition is always true, since the endpoint descriptor is
set prior to calling the enable endpoint.
Signed-off-by: Ido Shayevitz <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
The removed condition is always true, since the endpoint descriptor is
set prior to calling the enable endpoint.
Signed-off-by: Ido Shayevitz <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
This patch adds super-speed support to UVC webcam gadget.
Also in this patch:
- We add the configurability to pass bInterval, bMaxBurst, mult
factors for video streaming endpoint (ISOC IN) through module
parameters.
- We use config_ep_by_speed helper routine to configure video
streaming endpoint.
Signed-off-by: Bhupesh Sharma <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
This patch adds a MACRO for the UVC video control status (interrupt) endpoint and
removes the magic number which was being used earlier.
Some UDCs have issues supporting an interrupt IN endpoint having a max packet
size less than a particular value (say 32). It is easier in that case to simply
change the MACRO value instead of changing the max packet size value at a
number of locations.
Signed-off-by: Bhupesh Sharma <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
This patch solved the string descriptor STALL issue when we add multiple UVC
functions in a single configuration using a 'webcam.c' like composite driver.
Signed-off-by: Bhupesh Sharma <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Using | with a constant is always true.
Likely this should have be &.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
When writing the descriptors to the ep0 file of functionfs, the HID descriptors where not recognized which caused the initialization from user space to fail.
Signed-off-by: Koen Beel <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
This commit changes the default value of the removable module parameter
from “y” to “n”. This comes with line with file_storag's default and
seems to be a better default.
Signed-off-by: Michal Nazarewicz <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
devm_* functions are used to replace kzalloc, request_mem_region, ioremap
and request_irq functions in probe call. With the usage of devm_* functions
explicit freeing and unmapping is not required.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
As the FS USB code is not being actively used for omap2+
there's no point keeping it around for omap2+.
Let's make the FS USB platform init code omap1 only so
we can remove the last user of omap_read/write for omap2+,
and simplify things for further USB, DMA, and device tree
related work.
While at it, also group the mach includes for the related
drivers.
Cc: [email protected]
Cc: Kyungmin Park <[email protected]>
Acked-by: Felipe Balbi <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
This patch makes use of the generic map/unmap
routines on the omap_udc driver. Removes
some useless and duplicated code.
Signed-off-by: Felipe Balbi <[email protected]>
we don't need to check for _req because
kfree(NULL) is safe. Also, if someone
actually passes a NULL pointer to be freed
by usb_ep_free_request(), he deserves any
issue he faces.
Signed-off-by: Felipe Balbi <[email protected]>
when allocating a request, it's better programming
practice to make sure we return NULL if allocation
failed.
This will ensure that, if struct usb_request isn't
the first member on our structure, we don't cheat
the gadget driver into thinking allocating worked
because pointer isn't 0.
Signed-off-by: Felipe Balbi <[email protected]>
that print isn't needed at all. Remove it
and move the use_dma reinitialization to
probe() function.
Note that ideally we would drop all
cpu_is_* and machine_is_* checks from
this driver instead. Later patches will
come to get rid of those.
Signed-off-by: Felipe Balbi <[email protected]>
This patch is just a cleanup patch to make
checkpatch.pl a little happier with the
omap_udc.c driver.
No functional changes.
Signed-off-by: Felipe Balbi <[email protected]>
There are no active users of this code for omap2 as
the boards in use have either TUSB or MUSB controller.
While at it, also fix warnings related to uninitialized
dc_clk and hhc_clk.
Cc: [email protected]
Cc: Kyungmin Park <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
That's a much more intuitive name as that function
is only called at the completion of a Status Phase.
It also matches dwc3_ep0_complete_data() for
the completion of Data Phase.
Signed-off-by: Felipe Balbi <[email protected]>
USB is always little endian, but this driver
could run on non little endian cpus. Let's
be carefull with that.
Signed-off-by: Felipe Balbi <[email protected]>
According to the databook, the DWC3 Core will
reset those bits to 0 on USB Bus Reset. This
means we must re-enable those bits on every
reset interrupt.
Because we will always get a Reset interrupt
after loading a gadget driver, we can, instead
of re-enabling something that was just lost,
move the handling of those bits to the Reset
Interrupt.
This patch fixes USB30CV U1/U2 Test.
Signed-off-by: Gerard CAUVY <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
If we get a disconnect IRQ, we should take
the core out of low power mode so we can
reconnect afterwards.
Signed-off-by: Felipe Balbi <[email protected]>
If we don't read out the contents of the register
(in order to reinitialize 'reg' variable) we will
be writing unknown contents to the DCTL register
whenever we try to use dwc3_gadget_wakeup() function.
Signed-off-by: Felipe Balbi <[email protected]>
The same event buffers will be reused when coming
out of hibernation, so we must reinitialize them
properly to avoid any mistakes.
While at that, also take dwc3_event_buffers_setup()
out of __devinit section.
Signed-off-by: Felipe Balbi <[email protected]>
Recent cores (>= 1.94a) have a set of new features,
commands and a slightly different programming model.
This patch aims to support those changes.
Signed-off-by: Paul Zimmerman <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
those two functions don't power PHYs, they simply
put them in suspend state. Rename to reflect better
what functions actually do.
Signed-off-by: Paul Zimmerman <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
This patch adds definitions for some new registers that have been
added to later versions of the controller, up to v2.10a.
Signed-off-by: Paul Zimmerman <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>