Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <omair.m.abdullah@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Omair Mohammed Abdullah and committed by
Takashi Iwai
3eafc959 57bd9b8d

+5 -1
+1
include/sound/core.h
··· 62 62 #define SNDRV_DEV_BUS ((__force snd_device_type_t) 0x1007) 63 63 #define SNDRV_DEV_CODEC ((__force snd_device_type_t) 0x1008) 64 64 #define SNDRV_DEV_JACK ((__force snd_device_type_t) 0x1009) 65 + #define SNDRV_DEV_COMPRESS ((__force snd_device_type_t) 0x100A) 65 66 #define SNDRV_DEV_LOWLEVEL ((__force snd_device_type_t) 0x2000) 66 67 67 68 typedef int __bitwise snd_device_state_t;
+3 -1
include/sound/minors.h
··· 35 35 #define SNDRV_MINOR_TIMER 33 /* SNDRV_MINOR_GLOBAL + 1 * 32 */ 36 36 37 37 #ifndef CONFIG_SND_DYNAMIC_MINORS 38 - /* 2 - 3 (reserved) */ 38 + #define SNDRV_MINOR_COMPRESS 2 /* 2 - 3 */ 39 39 #define SNDRV_MINOR_HWDEP 4 /* 4 - 7 */ 40 40 #define SNDRV_MINOR_RAWMIDI 8 /* 8 - 15 */ 41 41 #define SNDRV_MINOR_PCM_PLAYBACK 16 /* 16 - 23 */ ··· 49 49 #define SNDRV_DEVICE_TYPE_PCM_CAPTURE SNDRV_MINOR_PCM_CAPTURE 50 50 #define SNDRV_DEVICE_TYPE_SEQUENCER SNDRV_MINOR_SEQUENCER 51 51 #define SNDRV_DEVICE_TYPE_TIMER SNDRV_MINOR_TIMER 52 + #define SNDRV_DEVICE_TYPE_COMPRESS SNDRV_MINOR_COMPRESS 52 53 53 54 #else /* CONFIG_SND_DYNAMIC_MINORS */ 54 55 ··· 61 60 SNDRV_DEVICE_TYPE_RAWMIDI, 62 61 SNDRV_DEVICE_TYPE_PCM_PLAYBACK, 63 62 SNDRV_DEVICE_TYPE_PCM_CAPTURE, 63 + SNDRV_DEVICE_TYPE_COMPRESS, 64 64 }; 65 65 66 66 #endif /* CONFIG_SND_DYNAMIC_MINORS */
+1
sound/core/sound.c
··· 229 229 case SNDRV_DEVICE_TYPE_RAWMIDI: 230 230 case SNDRV_DEVICE_TYPE_PCM_PLAYBACK: 231 231 case SNDRV_DEVICE_TYPE_PCM_CAPTURE: 232 + case SNDRV_DEVICE_TYPE_COMPRESS: 232 233 if (snd_BUG_ON(!card)) 233 234 return -EINVAL; 234 235 minor = SNDRV_MINOR(card->number, type + dev);