From 2d3391ec0ecca37efb6bc995906292f47522b471 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 27 Jul 2012 18:27:00 +0200 Subject: ALSA: PCM: channel mapping API implementation This patch implements the basic data types for the standard channel mapping API handling. - The definitions of the channel positions and the new TLV types are added in sound/asound.h and sound/tlv.h, so that they can be referred from user-space. - Introduced a new helper function snd_pcm_add_chmap_ctls() to create control elements representing the channel maps for each PCM (sub)stream. - Some standard pre-defined channel maps are provided for convenience. Signed-off-by: Takashi Iwai --- sound/core/pcm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sound/core/pcm.c') diff --git a/sound/core/pcm.c b/sound/core/pcm.c index 1a3070b4e5b5..f2991940b271 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c @@ -1105,6 +1105,10 @@ static int snd_pcm_dev_disconnect(struct snd_device *device) break; } snd_unregister_device(devtype, pcm->card, pcm->device); + if (pcm->streams[cidx].chmap_kctl) { + snd_ctl_remove(pcm->card, pcm->streams[cidx].chmap_kctl); + pcm->streams[cidx].chmap_kctl = NULL; + } } unlock: mutex_unlock(®ister_mutex); -- cgit v1.2.3