From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vinod Koul Subject: [PATCH 2/6] core: add support for compressed devices Date: Tue, 22 Nov 2011 14:21:56 +0530 Message-ID: <1321951920-4363-3-git-send-email-vinod.koul@linux.intel.com> References: <1314943585-11670-1-git-send-email-vinod.koul@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by alsa0.perex.cz (Postfix) with ESMTP id 1E6F41039AE for ; Tue, 22 Nov 2011 09:56:11 +0100 (CET) In-Reply-To: <1314943585-11670-1-git-send-email-vinod.koul@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: alsa-devel@alsa-project.org Cc: Vinod Koul , tiwai@suse.de, broonie@opensource.wolfsonmicro.com, pierre-louis.bossart@linux.intel.com, Omair Mohammed Abdullah , lrg@ti.com List-Id: alsa-devel@alsa-project.org From: Omair Mohammed Abdullah Use the two minor numbers 2 and 3 for audio compressed offload devices. Also add support for these devices in core Signed-off-by: Omair Mohammed Abdullah Signed-off-by: Vinod Koul Signed-off-by: Pierre-Louis Bossart --- include/sound/core.h | 1 + include/sound/minors.h | 7 ++++++- sound/core/sound.c | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletions(-) diff --git a/include/sound/core.h b/include/sound/core.h index 1fa2407..9d1e54b 100644 --- a/include/sound/core.h +++ b/include/sound/core.h @@ -62,6 +62,7 @@ typedef int __bitwise snd_device_type_t; #define SNDRV_DEV_BUS ((__force snd_device_type_t) 0x1007) #define SNDRV_DEV_CODEC ((__force snd_device_type_t) 0x1008) #define SNDRV_DEV_JACK ((__force snd_device_type_t) 0x1009) +#define SNDRV_DEV_COMPRESS ((__force snd_device_type_t) 0x100A) #define SNDRV_DEV_LOWLEVEL ((__force snd_device_type_t) 0x2000) typedef int __bitwise snd_device_state_t; diff --git a/include/sound/minors.h b/include/sound/minors.h index 8f76420..faaeb64 100644 --- a/include/sound/minors.h +++ b/include/sound/minors.h @@ -35,7 +35,8 @@ #define SNDRV_MINOR_TIMER 33 /* SNDRV_MINOR_GLOBAL + 1 * 32 */ #ifndef CONFIG_SND_DYNAMIC_MINORS - /* 2 - 3 (reserved) */ +#define SNDRV_MINOR_COMPR_PLAYBACK 2 +#define SNDRV_MINOR_COMPR_CAPTURE 3 #define SNDRV_MINOR_HWDEP 4 /* 4 - 7 */ #define SNDRV_MINOR_RAWMIDI 8 /* 8 - 15 */ #define SNDRV_MINOR_PCM_PLAYBACK 16 /* 16 - 23 */ @@ -49,6 +50,8 @@ #define SNDRV_DEVICE_TYPE_PCM_CAPTURE SNDRV_MINOR_PCM_CAPTURE #define SNDRV_DEVICE_TYPE_SEQUENCER SNDRV_MINOR_SEQUENCER #define SNDRV_DEVICE_TYPE_TIMER SNDRV_MINOR_TIMER +#define SNDRV_DEVICE_TYPE_COMPR_PLAYBACK SNDRV_MINOR_COMPR_PLAYBACK +#define SNDRV_DEVICE_TYPE_COMPR_CAPTURE SNDRV_MINOR_COMPR_CAPTURE #else /* CONFIG_SND_DYNAMIC_MINORS */ @@ -60,6 +63,8 @@ enum { SNDRV_DEVICE_TYPE_RAWMIDI, SNDRV_DEVICE_TYPE_PCM_PLAYBACK, SNDRV_DEVICE_TYPE_PCM_CAPTURE, + SNDRV_DEVICE_TYPE_COMPR_PLAYBACK, + SNDRV_DEVICE_TYPE_COMPR_CAPTURE, }; #endif /* CONFIG_SND_DYNAMIC_MINORS */ diff --git a/sound/core/sound.c b/sound/core/sound.c index 1c7a3ef..9377807 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c @@ -233,6 +233,12 @@ static int snd_kernel_minor(int type, struct snd_card *card, int dev) return -EINVAL; minor = SNDRV_MINOR(card->number, type + dev); break; + case SNDRV_DEVICE_TYPE_COMPR_PLAYBACK: + case SNDRV_DEVICE_TYPE_COMPR_CAPTURE: + if (snd_BUG_ON(!card)) + return -EINVAL; + minor = SNDRV_MINOR(card->number, type); + break; default: return -EINVAL; } -- 1.7.0.4