linux/drivers/usb/gadget
Bhupesh Sharma 41837c352f usb: gadget: uvc: Delay the status stage when setting alternate setting 1
This patch adds the support in UVC webcam gadget design for providing
USB_GADGET_DELAYED_STATUS in response to a set_interface(alt setting 1)
command issue by the Host.

The current UVC webcam gadget design generates a STREAMON event
corresponding to a set_interface(alt setting 1) command from the Host.
This STREAMON event will eventually be routed to a real V4L2 device.

To start video streaming, it may be required to perform some register
writes to a camera sensor device over slow external busses like I2C or
SPI. So, it makes sense to ensure that we delay the STATUS stage of the
set_interface (alt setting 1) command.

Otherwise, a lot of ISOC IN tokens sent by the Host will be replied to
by zero-length packets by the webcam device. On certain Hosts this may
even lead to ISOC URBs been cancelled from the Host side.

So, as soon as we finish doing all the "streaming" related stuff on the
real V4L2 device, we call a STREAMON ioctl on the UVC side and from here
we call the 'usb_composite_setup_continue' function to complete the
status stage of the set_interface(alt setting 1) command.

Further, we need to ensure that we queue no video buffers on the UVC
webcam gadget, until we de-queue a video buffer from the V4L2 device.
So, the application should call the STREAMON on UVC side only when it
has dequeued sufficient buffers from the V4L2 side and queued them to
the UVC gadget.

Signed-off-by: Bhupesh Sharma <bhupesh.sharma@st.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Bhupesh Sharma <bhupesh.sharma@st.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:18:21 +02:00
..
acm_ms.c usb: gadget: acm_ms: use function framework for ACM 2013-01-21 20:52:44 +02:00
amd5536udc.c usb: gadget: amd5536udc: don't assign gadget.dev.release directly 2013-03-18 11:17:46 +02:00
amd5536udc.h usb: gadget: amd5536udc: remove unused structure member 2013-03-18 11:16:56 +02:00
at91_udc.c usb: gadget: at91_udc: don't touch gadget.dev.driver 2013-03-18 11:17:32 +02:00
at91_udc.h
atmel_usba_udc.c usb: gadget: atmel_usba_udc: don't touch gadget.dev.driver 2013-03-18 11:17:33 +02:00
atmel_usba_udc.h usb: gadget: atmel: remove unused DMA_ADDR_INVALID 2013-03-18 11:18:11 +02:00
audio.c usb: gadget: remove usb_gadget_controller_number() 2012-09-10 16:43:24 +03:00
bcm63xx_udc.c usb: gadget: bcm63xx_udc: don't assign gadget.dev.release directly 2013-03-18 11:17:46 +02:00
cdc2.c usb: gadget: cdc2: use function framework for ACM 2013-01-21 20:52:45 +02:00
composite.c usb: gadget: composite: fix kernel-doc warnings 2013-03-05 13:15:00 +02:00
config.c usb: gadget: always update HS/SS descriptors and create a copy of them 2012-10-31 15:09:44 +02:00
dbgp.c usb: gadget: allocate & giveback serial ports instead hard code them 2013-01-21 20:52:43 +02:00
dummy_hcd.c usb: gadget: dummy_hcd: don't assign gadget.dev.release directly 2013-03-18 11:17:47 +02:00
epautoconf.c usb: gadget: libcomposite: add epautoconf.c to libcomposite 2012-09-10 15:37:51 +03:00
ether.c usb: gadget: remove usb_gadget_controller_number() 2012-09-10 16:43:24 +03:00
f_acm.c usb: gadget: f_acm: use usb_gstrings_attach() 2013-01-21 20:52:48 +02:00
f_ecm.c usb: gadget: let f_* use usb_string_ids_tab() where it makes sense 2012-10-31 15:11:47 +02:00
f_eem.c usb: gadget: always update HS/SS descriptors and create a copy of them 2012-10-31 15:09:44 +02:00
f_fs.c fs: Limit sys_mount to only request filesystem modules. 2013-03-03 19:36:31 -08:00
f_hid.c usb: gadget: always update HS/SS descriptors and create a copy of them 2012-10-31 15:09:44 +02:00
f_loopback.c usb: gadget: convert source sink and loopback to new function interface 2013-01-21 20:52:40 +02:00
f_mass_storage.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
f_midi.c usb: gadget: always update HS/SS descriptors and create a copy of them 2012-10-31 15:09:44 +02:00
f_ncm.c usb: gadget: ncm: make global variable ndp*_opts read only 2013-01-10 12:25:12 +02:00
f_obex.c usb: gadget: allocate & giveback serial ports instead hard code them 2013-01-21 20:52:43 +02:00
f_phonet.c usb: gadget: always update HS/SS descriptors and create a copy of them 2012-10-31 15:09:44 +02:00
f_rndis.c usb: gadget: let f_* use usb_string_ids_tab() where it makes sense 2012-10-31 15:11:47 +02:00
f_serial.c usb: gadget: allocate & giveback serial ports instead hard code them 2013-01-21 20:52:43 +02:00
f_sourcesink.c usb: gadget: convert source sink and loopback to new function interface 2013-01-21 20:52:40 +02:00
f_subset.c usb: gadget: let f_* use usb_string_ids_tab() where it makes sense 2012-10-31 15:11:47 +02:00
f_uac1.c usb: gadget: f_uac1: silence an info leak warning 2013-03-04 13:13:58 +02:00
f_uac2.c usb: gadget: f_uac2: fix compile warning 2013-01-21 20:52:49 +02:00
f_uvc.c usb: gadget: uvc: Delay the status stage when setting alternate setting 1 2013-03-18 11:18:21 +02:00
f_uvc.h usb: gadget: uvc: Fix coding style issues introduced by SS support 2013-03-18 11:18:18 +02:00
fsl_mxc_udc.c usb: gadget: fsl_mxc_udc: replace MX35_IO_ADDRESS to ioremap 2013-01-18 14:08:21 +02:00
fsl_qe_udc.c usb: gadget: fsl_qe_udc: don't assign gadget.dev.release directly 2013-03-18 11:17:47 +02:00
fsl_qe_udc.h usb: gadget: Complete fsl qe/udc driver conversion 2012-06-12 13:32:29 +03:00
fsl_udc_core.c usb: gadget: fsl_udc_core: Use module_platform_driver_probe macro 2013-03-18 11:18:00 +02:00
fsl_usb2_udc.h usb: gadget: fsl_mxc_udc: replace MX35_IO_ADDRESS to ioremap 2013-01-18 14:08:21 +02:00
functions.c usb: gadget: add a forward pointer from usb_function to its "instance" 2013-01-21 20:52:46 +02:00
fusb300_udc.c usb: gadget: fusb300_udc: don't assign gadget.dev.release directly 2013-03-18 11:17:48 +02:00
fusb300_udc.h usb: gadget: fusb300_udc: convert to udc_start/udc_stop 2013-01-24 21:11:28 +02:00
g_ffs.c usb: gadget: libcomposite: move composite.c into libcomposite 2012-09-10 16:13:03 +03:00
g_zero.h usb: gadget: convert source sink and loopback to new function interface 2013-01-21 20:52:40 +02:00
gadget_chips.h usb: gadget: remove usb_gadget_controller_number() 2012-09-10 16:43:24 +03:00
gmidi.c usb: gadget: consider link speed for bMaxPower 2013-01-10 12:38:52 +02:00
goku_udc.c usb: gadget: goku_udc: don't assign gadget.dev.release directly 2013-03-18 11:17:49 +02:00
goku_udc.h usb: gadget: goku_udc: let udc-core manage gadget->dev 2013-03-18 11:16:45 +02:00
hid.c usb: remove use of __devexit 2012-11-21 13:27:17 -08:00
imx_udc.c usb: gadget: imx_udc: don't touch gadget.dev.driver 2013-03-18 11:17:36 +02:00
imx_udc.h
inode.c fs: Limit sys_mount to only request filesystem modules. 2013-03-03 19:36:31 -08:00
Kconfig usb: phy: remove CONFIG_USB_OTG_UTILS 2013-03-18 11:18:08 +02:00
lpc32xx_udc.c usb: gadget: lpc32xx_udc: don't touch gadget.dev.driver 2013-03-18 11:17:37 +02:00
m66592-udc.c usb: gadget: m66592-udc: don't assign gadget.dev.release directly 2013-03-18 11:17:49 +02:00
m66592-udc.h usb: gadget: m66592-udc: convert to udc_start/udc_stop 2013-01-24 21:11:29 +02:00
Makefile usb: gadget: make usb functions to load before gadget driver 2013-03-04 09:33:26 +02:00
mass_storage.c usb: gadget: libcomposite: move composite.c into libcomposite 2012-09-10 16:13:03 +03:00
multi.c usb: gadget: multi: use function framework for ACM 2013-01-21 20:52:45 +02:00
mv_u3d_core.c usb: gadget: mv_u3d_core: don't assign gadget.dev.release directly 2013-03-18 11:17:50 +02:00
mv_u3d.h usb: gadget: mv: Add USB 3.0 device driver for Marvell PXA2128 chip. 2012-06-22 13:08:21 +03:00
mv_udc_core.c usb: gadget: mv_udc_core: check against CONFIG_USB_PHY 2013-03-18 11:18:06 +02:00
mv_udc.h
ncm.c usb: gadget: remove usb_gadget_controller_number() 2012-09-10 16:43:24 +03:00
ndis.h
net2272.c usb: gadget: net2272: remove unused DMA_ADDR_INVALID 2013-03-18 11:18:11 +02:00
net2272.h
net2280.c usb: gadget: net2280: remove unused DMA_ADDR_INVALID 2013-03-18 11:18:12 +02:00
net2280.h
nokia.c usb: gadget: f_acm: convert to new function interface with backwards compatibility 2013-01-21 20:52:43 +02:00
omap_udc.c usb: gadget: omap_udc: don't assign gadget.dev.release directly 2013-03-18 11:17:53 +02:00
omap_udc.h
pch_udc.c usb: gadget: pch_udc: don't assign gadget.dev.release directly 2013-03-18 11:17:53 +02:00
printer.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
pxa25x_udc.c usb: gadget: pxa25x_udc: don't touch gadget.dev.driver 2013-03-18 11:17:41 +02:00
pxa25x_udc.h usb: gadget: pxa25x_udc: convert to udc_start/udc_stop 2013-01-24 21:11:31 +02:00
pxa27x_udc.c usb: gadget: pxa27x_udc: don't touch gadget.dev.driver 2013-03-18 11:17:41 +02:00
pxa27x_udc.h usb: gadget: pxa27x_udc: convert to udc_start/udc_stop 2013-01-24 21:11:31 +02:00
r8a66597-udc.c usb: gadget: r8a66597-udc: don't assign gadget.dev.release directly 2013-03-18 11:17:54 +02:00
r8a66597-udc.h gadget/r8a66597: remove conditional compilation of clk code 2012-07-30 17:25:12 -07:00
rndis.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
rndis.h
s3c2410_udc.c usb: gadget: s3c2410_udc: don't touch gadget.dev.driver 2013-03-18 11:17:43 +02:00
s3c2410_udc.h usb: gadget: s3c2410: convert to udc_start/udc_stop 2013-01-24 21:11:32 +02:00
s3c-hsotg.c usb: gadget: s3c-hsotg: don't assign gadget.dev.release directly 2013-03-18 11:17:54 +02:00
s3c-hsotg.h
s3c-hsudc.c usb: gadget: s3c-hsudc: delete outdated comment 2013-03-18 11:18:10 +02:00
serial.c usb: gadget: f_acm: convert to new function interface with backwards compatibility 2013-01-21 20:52:43 +02:00
storage_common.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
tcm_usb_gadget.c usb: gadget: tcm_usb_gadge: fix to return error or 0 in tcm_usbg_drop_nexus() 2012-12-13 12:04:00 +02:00
tcm_usb_gadget.h usb: gadget: make sure each gadget is using same index for Product, Serial,… 2012-09-10 16:13:00 +03:00
u_ether.c ethtool: fix drvinfo strings set in drivers 2013-01-06 21:06:31 -08:00
u_ether.h
u_phonet.h
u_serial.c tty/serial patches for 3.9-rc1 2013-02-21 13:41:04 -08:00
u_serial.h usb: gadget: f_acm: convert to new function interface with backwards compatibility 2013-01-21 20:52:43 +02:00
u_uac1.c usb: gadget: u_uac1: NULL dereference on error path 2013-03-04 13:16:45 +02:00
u_uac1.h
udc-core.c usb: gadget: udc-core: anywone can read 'speed' attributes 2013-03-18 11:17:56 +02:00
usbstring.c usb: gadget: libcomposite: move MODULE_VERSION to composite.c 2012-09-10 16:13:03 +03:00
uvc_queue.c
uvc_queue.h
uvc_v4l2.c usb: gadget: uvc: Delay the status stage when setting alternate setting 1 2013-03-18 11:18:21 +02:00
uvc_video.c usb: gadget: uvc: remove references to DMA_ADDR_INVALID 2013-03-18 11:18:12 +02:00
uvc.h usb: gadget: uvc: Delay the status stage when setting alternate setting 1 2013-03-18 11:18:21 +02:00
webcam.c usb: gadget: consider link speed for bMaxPower 2013-01-10 12:38:52 +02:00
zero.c usb: gadget: fix two sparse warnings 2013-01-21 20:52:49 +02:00