Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1515641imd; Thu, 1 Nov 2018 17:32:18 -0700 (PDT) X-Google-Smtp-Source: AJdET5cKlPL4t772dP/7tpRGW52AAreWWFzY0iMtxIjNZLyLhl2tKWIFWvHU9YgKcx0H747o9iPt X-Received: by 2002:a63:ae01:: with SMTP id q1mr8914255pgf.402.1541118738169; Thu, 01 Nov 2018 17:32:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541118738; cv=none; d=google.com; s=arc-20160816; b=nDOvu2RMtatz5fs4f3LAl2faQt9mACyjmlzNJdTZYX4tFg+2HvD3plsVIp9uxw8d8z ViBqiJIXT8uttJyFizPsgZjXSNfxIlIhkLdIzENB8FlytQXPjH1KRNr5brz/2C4Epppv s10daSwW4nDwyinKsefGoNKbreU7Ha1YO1CwM+aTIhN4C5OPnyaPlwvfMt8l2fbO3bfJ gPxwMIIU5AJLRDkbBNAXXWgEOTT7Tk5fO41bx1ZCpK7iiA6ErJT4yZs/Tzq3dYGzuolK ubTgw5PZrExCiqajK5/bt3Oi8778HBF6JFA/IlR6YUeMhXOKVVgF2mtrkc9AXTpiYtSA +4fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=f0B4rVqvcVMn2501IEyJub9gvKO40b7WPYUIw5IoCfo=; b=t1VeUJ3DGKM/NfYmg9mpsO5DaMe+RFmJHkr5Ef+VdGG5Vqurem2yzxm8JoHk+t+M/Z 6woAhtV4d6/Kor+AygsZywnUgVyWyaaEQYbJMdUHARG5A128jGXuUkqw/lQ3u5DQp5jS faaexJV9wq6ImKMxPNrCIvtAo+J7unOLwYkt9zqLmPf4D2gU7CvNl94H4Dv0GINVCxqw iMNu5AKlwu6rOqxTxreu79+GNb4tAk436WNC34CuHfOtH24bE5P6vYqbw/V6QD3PZTvh jlE1OK/TMd8CedTigD3XfIAnojtcsqwq+lzlYU0TPe0XwlkkZPMy91uclcGuzIeMMxIt Bf/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xiDkQLq9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f11-v6si28984036pgh.156.2018.11.01.17.32.02; Thu, 01 Nov 2018 17:32:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xiDkQLq9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728343AbeKBJgv (ORCPT + 99 others); Fri, 2 Nov 2018 05:36:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:41764 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728058AbeKBJgv (ORCPT ); Fri, 2 Nov 2018 05:36:51 -0400 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 Cc: Shuah Khan , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [RFC PATCH v8 0/4] Media Device Allocator API Date: Thu, 1 Nov 2018 18:31:29 -0600 Message-Id: X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.17.0