• Laurent Pinchart's avatar
    usb: gadget: uvc: configfs: Add bFormatIndex attributes · 61ff10e0
    Laurent Pinchart authored
    The UVC format description are numbered using the descriptor's
    bFormatIndex field. The index is used in UVC requests, and is thus
    needed to handle requests in userspace. Make it dynamically discoverable
    by exposing it in a bFormatIndex configfs attribute of the uncompressed
    and mjpeg format config items.
    
    The bFormatIndex value exposed through the attribute is stored in the
    config item private data. However, that value is never set: the driver
    instead computes the bFormatIndex value when linking the stream class
    header in the configfs hierarchy and stores it directly in the class
    descriptors in a separate structure. In order to expose the value
    through the configfs attribute, store it in the config item private data
    as well. This results in a small code simplification.
    Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
    Reviewed-by: default avatarKieran Bingham <kieran.bingham@ideasonboard.com>
    61ff10e0
uvc_configfs.c 65.7 KB