usb: gadget: always update HS/SS descriptors and create a copy of them
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Mon, 22 Oct 2012 20:15:06 +0000 (22:15 +0200)
committerFelipe Balbi <balbi@ti.com>
Wed, 31 Oct 2012 13:09:44 +0000 (15:09 +0200)
commit10287baec761d33f0a82d84b46e37a44030350d8
treeb769a6dddfd4ccf81a986386bf5771182d1b0c55
parent0f9df939385527049c8062a099fbfa1479fe7ce0
usb: gadget: always update HS/SS descriptors and create a copy of them

HS and SS descriptors are staticaly created. They are updated during the
bind process with the endpoint address, string id or interface numbers.

After that, the descriptor chain is linked to struct usb_function which
is used by composite in order to serve the GET_DESCRIPTOR requests,
number of available configs and so on.

There is no need to assign the HS descriptor only if the UDC supports
HS speed because composite won't report those to the host if HS support
has not been reached. The same reasoning is valid for SS.

This patch makes sure each function updates HS/SS descriptors
unconditionally and uses the newly introduced helper function to create a
copy the descriptors for the speed which is supported by the UDC.

While at that, also rename f->descriptors to f->fs_descriptors in order
to make it more explicit what that means.

Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
24 files changed:
drivers/usb/gadget/composite.c
drivers/usb/gadget/config.c
drivers/usb/gadget/f_acm.c
drivers/usb/gadget/f_ecm.c
drivers/usb/gadget/f_eem.c
drivers/usb/gadget/f_fs.c
drivers/usb/gadget/f_hid.c
drivers/usb/gadget/f_loopback.c
drivers/usb/gadget/f_mass_storage.c
drivers/usb/gadget/f_midi.c
drivers/usb/gadget/f_ncm.c
drivers/usb/gadget/f_obex.c
drivers/usb/gadget/f_phonet.c
drivers/usb/gadget/f_rndis.c
drivers/usb/gadget/f_serial.c
drivers/usb/gadget/f_sourcesink.c
drivers/usb/gadget/f_subset.c
drivers/usb/gadget/f_uac1.c
drivers/usb/gadget/f_uac2.c
drivers/usb/gadget/f_uvc.c
drivers/usb/gadget/printer.c
drivers/usb/gadget/tcm_usb_gadget.c
include/linux/usb/composite.h
include/linux/usb/gadget.h
This page took 0.037947 seconds and 5 git commands to generate.