From patchwork Sun May 30 22:22:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Grzeschik X-Patchwork-Id: 12288453 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEC0CC47094 for ; Sun, 30 May 2021 22:22:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 860ED60BBB for ; Sun, 30 May 2021 22:22:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229873AbhE3WYb (ORCPT ); Sun, 30 May 2021 18:24:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229887AbhE3WY3 (ORCPT ); Sun, 30 May 2021 18:24:29 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5329FC06174A for ; Sun, 30 May 2021 15:22:50 -0700 (PDT) Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lnTpW-0000Es-36; Mon, 31 May 2021 00:22:46 +0200 Received: from mgr by dude.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1lnTpV-0002ce-7t; Mon, 31 May 2021 00:22:45 +0200 From: Michael Grzeschik Cc: linux-usb@vger.kernel.org, laurent.pinchart@ideasonboard.com, caleb.connolly@ideasonboard.com, paul.elder@ideasonboard.com, balbi@kernel.org, kernel@pengutronix.de Subject: [PATCH 0/3] usb: gadget: uvc: use configfs entries for negotiation and v4l2 VIDIOCS Date: Mon, 31 May 2021 00:22:36 +0200 Message-Id: <20210530222239.8793-1-m.grzeschik@pengutronix.de> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: mgr@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-usb@vger.kernel.org To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org This series improves the uvc video gadget by parsing the configfs entries. With the configfs data, the driver now is able to negotiate the format with the usb host in the kernel and also exports the supported frames/formats/intervals via the v4l2 VIDIOC interface. Michael Grzeschik (3): usb: gadget: uvc: move structs to common header usb: gadget: uvc: add VIDIOC function usb: gadget: uvc: add format/frame handling code drivers/usb/gadget/function/f_uvc.c | 324 +++++++++++++++++++- drivers/usb/gadget/function/uvc.h | 32 +- drivers/usb/gadget/function/uvc_configfs.c | 116 +------ drivers/usb/gadget/function/uvc_configfs.h | 121 ++++++++ drivers/usb/gadget/function/uvc_queue.c | 4 +- drivers/usb/gadget/function/uvc_v4l2.c | 335 ++++++++++++++++++--- drivers/usb/gadget/function/uvc_v4l2.h | 1 + drivers/usb/gadget/function/uvc_video.c | 23 +- 8 files changed, 781 insertions(+), 175 deletions(-)