usb: gadget: uvc: default the ctrl request interface offsets
authorMichael Grzeschik <m.grzeschik@pengutronix.de>
Tue, 11 Oct 2022 07:53:48 +0000 (09:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Oct 2022 11:22:40 +0000 (13:22 +0200)
commitd182bf156c4cb8b08ce4a75e82b3357b14a4382d
treeaf1a50ae21bbe3aa75742933cc841726406a3a78
parent9b6447e04bc2a4d06f2ef74a583848c573a25dbc
usb: gadget: uvc: default the ctrl request interface offsets

For the userspace it is needed to distinguish between requests for the
control or streaming interface. The userspace would have to parse the
configfs to know which interface index it has to compare the ctrl
requests against. Since the interface numbers are not fixed, e.g. for
composite gadgets, the interface offset depends on the setup.

The kernel has this information when handing over the ctrl request to
the userspace. This patch removes the offset from the interface numbers
and expose the default interface defines in the uapi g_uvc.h.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20221011075348.1786897-1-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/f_uvc.c
include/uapi/linux/usb/g_uvc.h