From patchwork Fri Nov 2 00:31:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah X-Patchwork-Id: 10665811 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 B8C994DB2 for ; Fri, 2 Nov 2018 16:07:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0CFF2A99A for ; Fri, 2 Nov 2018 16:07:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 953E72C2DD; Fri, 2 Nov 2018 16:07:05 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CEA5F2C2F8 for ; Fri, 2 Nov 2018 16:07:04 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 1EDF7267929; Fri, 2 Nov 2018 16:41:55 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 728AC267928; Fri, 2 Nov 2018 01:31:44 +0100 (CET) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by alsa0.perex.cz (Postfix) with ESMTP id C11B22678EB for ; Fri, 2 Nov 2018 01:31:40 +0100 (CET) Received: from localhost.localdomain (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5D56420666; Fri, 2 Nov 2018 00:31:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541118698; bh=r8b2BOJ4Li1ARaz6/8zSjU5qNUXyec07Uoy+zT/pmRI=; h=From:To:Cc:Subject:Date:From; b=xiDkQLq9/Qc8YEf6l8xB16NWrLlXoGynfQOSirYH9aQO6ZMc3Ooi2wgGAFQ+esKeR gVg526rHGcolmvkJbnf6hSxdQ+hhldfKh9pRIDw8sctlg6F0lsTLMzJXrH8LtcnB1f NEmI2ukLZDLm0dxbMWNd7jhE9CmQ0OLj3O/+FxwA= From: shuah@kernel.org To: mchehab@kernel.org, perex@perex.cz, tiwai@suse.com Date: Thu, 1 Nov 2018 18:31:29 -0600 Message-Id: X-Mailer: git-send-email 2.17.1 X-Mailman-Approved-At: Fri, 02 Nov 2018 16:41:51 +0100 Cc: alsa-devel@alsa-project.org, Shuah Khan , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [alsa-devel] [RFC PATCH v8 0/4] Media Device Allocator API X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Shuah Khan This patch series has been on the ice for the last couple of years. Mauro asked me to restart the discussion on this and see if we can make progress. I rebased the series to Linux 4.19. It has been surprisingly well preserved with one small merge conflict resolved in 0004. Media Device Allocator API to allows multiple drivers share a media device. Using this API, drivers can allocate a media device with the shared struct device as the key. Once the media device is allocated by a driver, other drivers can get a reference to it. The media device is released when all the references are released. - No changes to 0001,0002 code since the v7 referenced below. - 0003 is a new patch to enable ALSA defines that have been disabled for kernel between 4.9 and 4.19. - Minor merge conflict resolution in 0004. - Added SPDX to new files. References: https://www.mail-archive.com/linux-media@vger.kernel.org/msg105854.html Please review. I am sending this as RFC even though it has been tested several times prior to this non-event rebased v8. I ran sanity tests. Shuah Khan (4): media: Media Device Allocator API media: change au0828 to use Media Device Allocator API media: media.h: Enable ALSA MEDIA_INTF_T* interface types sound/usb: Use Media Controller API to share media resources Documentation/media/kapi/mc-core.rst | 37 +++ drivers/media/Makefile | 3 +- drivers/media/media-dev-allocator.c | 132 ++++++++++ drivers/media/usb/au0828/au0828-core.c | 12 +- drivers/media/usb/au0828/au0828.h | 1 + include/media/media-dev-allocator.h | 53 ++++ include/uapi/linux/media.h | 25 +- sound/usb/Kconfig | 4 + sound/usb/Makefile | 2 + sound/usb/card.c | 14 ++ sound/usb/card.h | 3 + sound/usb/media.c | 320 +++++++++++++++++++++++++ sound/usb/media.h | 73 ++++++ sound/usb/mixer.h | 3 + sound/usb/pcm.c | 29 ++- sound/usb/quirks-table.h | 1 + sound/usb/stream.c | 2 + sound/usb/usbaudio.h | 6 + 18 files changed, 692 insertions(+), 28 deletions(-) create mode 100644 drivers/media/media-dev-allocator.c create mode 100644 include/media/media-dev-allocator.h create mode 100644 sound/usb/media.c create mode 100644 sound/usb/media.h