aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-09-12 09:53:26 -0400
committerTakashi Iwai <tiwai@suse.de>2012-09-12 09:53:26 -0400
commit7fb6861d62b24fd0056a52275e5f74db0ef66f88 (patch)
tree167f02a0d485067476fc640b76ffa7fd66ba87cd
parent3adc497f98dd062bcf4d832c659a3d706ece5249 (diff)
ALSA: ens1370: Define channel maps
Provide channel maps for individual stereo streams of ENS1370 and ENS1371. Note that the configuration of ENS1370 uses the secondary PCM as the front unlike ENS1371. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/ens1370.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
index 1e615c4d12f8..9d432359d1cb 100644
--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -1260,6 +1260,14 @@ static struct snd_pcm_ops snd_ensoniq_capture_ops = {
1260 .pointer = snd_ensoniq_capture_pointer, 1260 .pointer = snd_ensoniq_capture_pointer,
1261}; 1261};
1262 1262
1263static const struct snd_pcm_chmap_elem surround_map[] = {
1264 { .channels = 1,
1265 .map = { SNDRV_CHMAP_UNKNOWN } },
1266 { .channels = 2,
1267 .map = { SNDRV_CHMAP_RL, SNDRV_CHMAP_RR } },
1268 { }
1269};
1270
1263static int __devinit snd_ensoniq_pcm(struct ensoniq * ensoniq, int device, 1271static int __devinit snd_ensoniq_pcm(struct ensoniq * ensoniq, int device,
1264 struct snd_pcm ** rpcm) 1272 struct snd_pcm ** rpcm)
1265{ 1273{
@@ -1287,6 +1295,16 @@ static int __devinit snd_ensoniq_pcm(struct ensoniq * ensoniq, int device,
1287 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 1295 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
1288 snd_dma_pci_data(ensoniq->pci), 64*1024, 128*1024); 1296 snd_dma_pci_data(ensoniq->pci), 64*1024, 128*1024);
1289 1297
1298#ifdef CHIP1370
1299 err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
1300 surround_map, 2, 0, NULL);
1301#else
1302 err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
1303 snd_pcm_std_chmaps, 2, 0, NULL);
1304#endif
1305 if (err < 0)
1306 return err;
1307
1290 if (rpcm) 1308 if (rpcm)
1291 *rpcm = pcm; 1309 *rpcm = pcm;
1292 return 0; 1310 return 0;
@@ -1317,6 +1335,16 @@ static int __devinit snd_ensoniq_pcm2(struct ensoniq * ensoniq, int device,
1317 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 1335 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
1318 snd_dma_pci_data(ensoniq->pci), 64*1024, 128*1024); 1336 snd_dma_pci_data(ensoniq->pci), 64*1024, 128*1024);
1319 1337
1338#ifdef CHIP1370
1339 err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
1340 snd_pcm_std_chmaps, 2, 0, NULL);
1341#else
1342 err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
1343 surround_map, 2, 0, NULL);
1344#endif
1345 if (err < 0)
1346 return err;
1347
1320 if (rpcm) 1348 if (rpcm)
1321 *rpcm = pcm; 1349 *rpcm = pcm;
1322 return 0; 1350 return 0;