From: Omair Mohammed Abdullah Date: Fri, 23 Dec 2011 05:06:36 +0000 (+0530) Subject: ALSA: core: add support for compressed devices X-Git-Tag: v3.3-rc1~32^2~7^2~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3eafc959b32f71d3fe6b27c9eae7495a23acfc3a;p=platform%2Fupstream%2Fkernel-adaptation-pc.git ALSA: core: add support for compressed devices Use the 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: Pierre-Louis Bossart Signed-off-by: Vinod Koul Reviewed-by: Mark Brown Signed-off-by: Takashi Iwai --- diff --git a/include/sound/core.h b/include/sound/core.h index 3be5ab7..5ab255f 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..5978f9a 100644 --- a/include/sound/minors.h +++ b/include/sound/minors.h @@ -35,7 +35,7 @@ #define SNDRV_MINOR_TIMER 33 /* SNDRV_MINOR_GLOBAL + 1 * 32 */ #ifndef CONFIG_SND_DYNAMIC_MINORS - /* 2 - 3 (reserved) */ +#define SNDRV_MINOR_COMPRESS 2 /* 2 - 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 +49,7 @@ #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_COMPRESS SNDRV_MINOR_COMPRESS #else /* CONFIG_SND_DYNAMIC_MINORS */ @@ -60,6 +61,7 @@ enum { SNDRV_DEVICE_TYPE_RAWMIDI, SNDRV_DEVICE_TYPE_PCM_PLAYBACK, SNDRV_DEVICE_TYPE_PCM_CAPTURE, + SNDRV_DEVICE_TYPE_COMPRESS, }; #endif /* CONFIG_SND_DYNAMIC_MINORS */ diff --git a/sound/core/sound.c b/sound/core/sound.c index 828af35..28f3559 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c @@ -229,6 +229,7 @@ static int snd_kernel_minor(int type, struct snd_card *card, int dev) case SNDRV_DEVICE_TYPE_RAWMIDI: case SNDRV_DEVICE_TYPE_PCM_PLAYBACK: case SNDRV_DEVICE_TYPE_PCM_CAPTURE: + case SNDRV_DEVICE_TYPE_COMPRESS: if (snd_BUG_ON(!card)) return -EINVAL; minor = SNDRV_MINOR(card->number, type + dev);