From patchwork Wed Feb 12 10:52:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 3636971 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5AE3A9F38B for ; Wed, 12 Feb 2014 11:07:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7BBF4201D5 for ; Wed, 12 Feb 2014 11:07:23 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 47A1B20158 for ; Wed, 12 Feb 2014 11:07:22 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5458D2650F2; Wed, 12 Feb 2014 12:07:21 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 6FA9C265079; Wed, 12 Feb 2014 12:04:34 +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 075FD264FDF; Wed, 12 Feb 2014 12:04:32 +0100 (CET) Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id CA178265079 for ; Wed, 12 Feb 2014 11:52:47 +0100 (CET) Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id BD074ABB2 for ; Wed, 12 Feb 2014 10:52:47 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Wed, 12 Feb 2014 11:52:09 +0100 Message-Id: <1392202347-11774-3-git-send-email-tiwai@suse.de> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1392202347-11774-1-git-send-email-tiwai@suse.de> References: <1392202347-11774-1-git-send-email-tiwai@suse.de> Subject: [alsa-devel] [PATCH 02/20] ALSA: Add SNDRV_DEV_CARD type 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 Define the new SNDRV_DEV_CARD that is used for managing the top-level card (chip) object. So far, we used SNDRV_DEV_LOWLEVEL for this purpose, but it doesn't fit properly; the "lowlevel" doesn't match with the object it's assigned (where the card/chip object is rather a top-level one). And since the device register/free order will be more strictly ordered in the later patch, we should place this object in the right order position. This patch alone just adds SNDRV_DEV_CARD as equivalent as SNDRV_DEV_LOWLEVEL. In the later patch, the value will be adjusted appropriately. Signed-off-by: Takashi Iwai --- Documentation/DocBook/writing-an-alsa-driver.tmpl | 10 +++++----- include/sound/core.h | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Documentation/DocBook/writing-an-alsa-driver.tmpl b/Documentation/DocBook/writing-an-alsa-driver.tmpl index d0056a4e9c53..c6119a30169b 100644 --- a/Documentation/DocBook/writing-an-alsa-driver.tmpl +++ b/Documentation/DocBook/writing-an-alsa-driver.tmpl @@ -462,7 +462,7 @@ */ .... - err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); + err = snd_device_new(card, SNDRV_DEV_CARD, chip, &ops); if (err < 0) { snd_mychip_free(chip); return err; @@ -870,8 +870,8 @@ callback pointers (&ops). The device-level defines the type of components and the order of registration and de-registration. For most components, the - device-level is already defined. For a user-defined component, - you can use SNDRV_DEV_LOWLEVEL. + device-level is already defined. For a user-defined card component, + you can use SNDRV_DEV_CARD. @@ -1018,7 +1018,7 @@ .dev_free = snd_mychip_dev_free, }; .... - snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); + snd_device_new(card, SNDRV_DEV_CARD, chip, &ops); ]]> @@ -1171,7 +1171,7 @@ /* (2) initialization of the chip hardware */ .... /* (not implemented in this document) */ - err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); + err = snd_device_new(card, SNDRV_DEV_CARD, chip, &ops); if (err < 0) { snd_mychip_free(chip); return err; diff --git a/include/sound/core.h b/include/sound/core.h index 7c407b588697..127b908a2422 100644 --- a/include/sound/core.h +++ b/include/sound/core.h @@ -64,6 +64,7 @@ enum snd_device_type { SNDRV_DEV_JACK, SNDRV_DEV_COMPRESS, SNDRV_DEV_LOWLEVEL = 0x2000, + SNDRV_DEV_CARD = SNDRV_DEV_LOWLEVEL, }; enum snd_device_state {