From patchwork Thu Sep 13 06:05:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 10598737 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 6CA63112B for ; Thu, 13 Sep 2018 07:00:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C4802A499 for ; Thu, 13 Sep 2018 07:00:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 505ED2A49C; Thu, 13 Sep 2018 07:00:29 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham 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 D72352A499 for ; Thu, 13 Sep 2018 07:00:28 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5AB2A26779A; Thu, 13 Sep 2018 08:05:36 +0200 (CEST) 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 CB44D267821; Thu, 13 Sep 2018 08:05:33 +0200 (CEST) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id F2C292676EB for ; Thu, 13 Sep 2018 08:05:31 +0200 (CEST) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D7A2DAFE2 for ; Thu, 13 Sep 2018 06:05:30 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Thu, 13 Sep 2018 08:05:22 +0200 Message-Id: <20180913060527.24694-1-tiwai@suse.de> X-Mailer: git-send-email 2.18.0 Subject: [alsa-devel] [PATCH RFC 0/5] Add devres support to card resources 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 Hi, the devres or device-managed resource allocation is a popular method among many drivers but we didn't have such a mechanism for the core sound card objects. Here is an attempt to implement that. The first patch gives the devm-version of page allocator helper, and the second patch provides the devm-version of snd_card_new(). The rest patches are examples of the new API usages. As of now, this patch series is still an RFC. The usefulness of this is still unclear, but I believe this can be used in all legacy ALSA drivers pretty well. For ASoC, this would help very little, supposedly, though. The latest patches are found in topic/devres branch of my sound.git tree, too. thanks, Takashi === Takashi Iwai (5): ALSA: core: Add device-managed page allocator helper ALSA: core: Add managed card creation ALSA: intel8x0: Allocate resources with device-managed APIs ALSA: atiixp: Allocate resources with device-managed APIs ALSA: hda: Allocate resources with device-managed APIs include/sound/core.h | 5 ++ include/sound/memalloc.h | 4 + sound/core/init.c | 95 +++++++++++++++++++++- sound/core/memalloc.c | 88 +++++++++++++++----- sound/pci/atiixp.c | 104 +++++++----------------- sound/pci/atiixp_modem.c | 104 +++++++----------------- sound/pci/hda/hda_controller.h | 1 - sound/pci/hda/hda_intel.c | 43 +++------- sound/pci/intel8x0.c | 143 +++++++++++---------------------- sound/pci/intel8x0m.c | 143 +++++++++++---------------------- 10 files changed, 332 insertions(+), 398 deletions(-)