From patchwork Wed Aug 1 21:54:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 10553085 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2AC721708 for ; Wed, 1 Aug 2018 21:54:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 193CD28825 for ; Wed, 1 Aug 2018 21:54:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B3B429138; Wed, 1 Aug 2018 21:54:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3B8628825 for ; Wed, 1 Aug 2018 21:54:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729670AbeHAXmV (ORCPT ); Wed, 1 Aug 2018 19:42:21 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:57898 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725956AbeHAXmU (ORCPT ); Wed, 1 Aug 2018 19:42:20 -0400 Received: from avalon.bb.dnainternet.fi (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 04F9BB82; Wed, 1 Aug 2018 23:54:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1533160467; bh=GD8s+eH4IyWO8NKrKiE1jpxzulvVTnMeO8bOV5GMWls=; h=From:To:Cc:Subject:Date:From; b=BZgRerd+uF8YtbP3L43pQL08jdXweLWfb3BMGoY42YuVGosGQsGpEvG7MetyimccM aIYZnagWgn2nWNU/5gLzWrEZeruZ9eRVNniKm7U0SPQrjlw/3z9ZQTnR+W442a5S5H go7RybpwN0sznICTJB4KdSCdL6vhAc+xYvPqqm5Y= From: Laurent Pinchart To: linux-usb@vger.kernel.org Cc: Felipe Balbi , Joel Pepper , Kieran Bingham , Andrzej Pietrasiewicz Subject: [PATCH v2 0/8] usb: gadget: uvc: Improve configfs support Date: Thu, 2 Aug 2018 00:54:57 +0300 Message-Id: <20180801215505.7658-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.16.4 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello, This patch series reworks the UVC gadget function configfs implementation to support multiple UVC functions in a single device and The first two patches simplify the code (01/08) and improve readability (02/08). The series then moves to dynamically allocating all configfs groups to support multiple instances. It first fixes a config item reference leak (03/08) that would cause a memory leak with dynamic allocation, and then allocate configfs groups dynamically (04/08). As a consequence we have to expose the interface numbers through new configfs attributes (05/08) in order to let the userspace helper application discover them. The next two patches add and document new bFormatIndex (06/08) and bFrameIndex (07/08) configfs attributes to expose indices of UVC format and frame descriptors to userspace, allowing their dynamic discovery. The last patch finally fixes a bug that allowed modification of descriptors after linking them (08/08). Felipe, all this is based on top of your testing/next branch, and is a candidate for v4.20. Please let me know if I should base the patches on a different branch. Changes since v1: - Fix config items reference leak - Free dynamically allocated configfs groups - Squash attribute documentation and attribute creation patches Joel Pepper (2): usb: gadget: uvc: configfs: Add bFrameIndex attributes usb: gadget: uvc: configfs: Prevent format changes after linking header Laurent Pinchart (6): usb: gadget: uvc: configfs: Don't wrap groups unnecessarily usb: gadget: uvc: configfs: Add section header comments usb: gadget: uvc: configfs: Drop leaked references to config items usb: gadget: uvc: configfs: Allocate groups dynamically usb: gadget: uvc: configfs: Add interface number attributes usb: gadget: uvc: configfs: Add bFormatIndex attributes Documentation/ABI/testing/configfs-usb-gadget-uvc | 24 + drivers/usb/gadget/function/f_uvc.c | 10 +- drivers/usb/gadget/function/u_uvc.h | 3 + drivers/usb/gadget/function/uvc_configfs.c | 926 +++++++++++++--------- 4 files changed, 600 insertions(+), 363 deletions(-)