Commit graph

5 commits

Author SHA1 Message Date
Bhupesh Sharma
326b0e613b usb: gadget: uvc: Make video streaming buffer size comply with USB3.0 SS
As per the USB3.0 specs, the bandwidth requirements of a UVC's video
streaming endpoint will change to support super-speed. These changes
will be dependent on whether the UVC video streaming endpoint is Bulk or
Isochronous:

- If video streaming endpoint is Isochronous:
  As per Section 4.4.8.2 (Isochronous Transfer Bandwidth Requirements)
  of the USB3.0 specs:

    A SuperSpeed isochronous endpoint can move up to three burst
    transactions of up to 16 maximum sized packets (3 * 16 * 1024 bytes)
    per service interval.

- If video streaming endpoint is Bulk:
  As per 4.4.6.1 (Bulk Transfer Data Packet Size) of the USB3.0 specs:

    An endpoint for bulk transfers shall set the maximum data packet
    payload size in its endpoint descriptor to 1024 bytes. It also
    specifies the burst size that the endpoint can accept from or
    transmit on the SuperSpeed bus. The allowable burst size for a bulk
    endpoint shall be in the range of 1 to 16.

So, in the Isochronous case, we can define the USB request's buffer to
be equal to = (Maximum packet size) * (bMaxBurst + 1) * (Mult + 1), so
that the UDC driver can try to send out this buffer in one Isochronous
service interval.

The same computation will hold good for the Bulk case as the Mult
value is 0 here and we can have a USB request buffer of maximum
16 * 1024 bytes size, which can be sent out by the UDC driver as
per the Bulk bandwidth allocation on the USB3 bus.

This patch adds the above-mentioned support and is also USB2.0 backward
compliant.

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:22 +02:00
Felipe Balbi
482ef1d2fe usb: gadget: uvc: remove references to DMA_ADDR_INVALID
gadget drivers shouldn't touch req->dma at all,
since UDC drivers are the ones required to handle
mapping and unmapping of the request buffer.

Remove references to DMA_ADDR_INVALID so we don't
creat false expectations to gadget driver writers.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:18:12 +02:00
Klaus Schwarzkopf
28c9fc68eb usb gadget: clean up FSF boilerplate text
remove the following two paragraphs as they are not needed:

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
License for more details.

You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,59
Temple Place - Suite 330, Boston, MA  02111-1307, USA.

Signed-off-by: Klaus Schwarzkopf <schwarzkopf@sensortherm.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-09 16:00:09 -07:00
Laurent Pinchart
5d9955f8a9 V4L/DVB: uvc: Fix multiple symbols definitions with UVC gadget and host drivers
The UVC gadget driver borrowed code from the UVC host driver without
changing the symbol names. This results in a namespace clash with
multiple definitions of several symbols when compiling both drivers in
the kernel.

Make all generic UVC functions and variables static in the UVC gadget
driver, as the symbols are not referenced outside of the gadget driver.
Rename the uvc_trace_param global variable to uvc_gadget_trace_param.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-07-11 17:45:10 -03:00
Laurent Pinchart
cdda479f15 USB gadget: video class function driver
This USB video class function driver implements a video capture device from the
host's point of view. It creates a V4L2 output device on the gadget's side to
transfer data from a userspace application over USB.

The UVC-specific descriptors are passed by the gadget driver to the UVC
function driver, making them completely configurable without any modification
to the function's driver code.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:41 -07:00