diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 11:09:02 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 11:09:02 -0500 |
commit | 8f0cb147b2fb12427bf6abef7fed2b604557a41e (patch) | |
tree | fb5ba437ee74b900fab9686c8c7df18abcd7640b /sound/pci/ice1712/ice1724.c | |
parent | 8e33ba49765484bc6de3a2f8143733713fa93bc1 (diff) | |
parent | b00e8443c3eece823052d06ae1c7cb797ab0ddf5 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa
Diffstat (limited to 'sound/pci/ice1712/ice1724.c')
-rw-r--r-- | sound/pci/ice1712/ice1724.c | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index c3ce8f93740b..5b4293f5a652 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c | |||
@@ -675,9 +675,12 @@ static snd_pcm_hardware_t snd_vt1724_spdif = | |||
675 | SNDRV_PCM_INFO_MMAP_VALID | | 675 | SNDRV_PCM_INFO_MMAP_VALID | |
676 | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_SYNC_START), | 676 | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_SYNC_START), |
677 | .formats = SNDRV_PCM_FMTBIT_S32_LE, | 677 | .formats = SNDRV_PCM_FMTBIT_S32_LE, |
678 | .rates = SNDRV_PCM_RATE_32000|SNDRV_PCM_RATE_44100|SNDRV_PCM_RATE_48000, | 678 | .rates = (SNDRV_PCM_RATE_32000|SNDRV_PCM_RATE_44100| |
679 | SNDRV_PCM_RATE_48000|SNDRV_PCM_RATE_88200| | ||
680 | SNDRV_PCM_RATE_96000|SNDRV_PCM_RATE_176400| | ||
681 | SNDRV_PCM_RATE_192000), | ||
679 | .rate_min = 32000, | 682 | .rate_min = 32000, |
680 | .rate_max = 48000, | 683 | .rate_max = 192000, |
681 | .channels_min = 2, | 684 | .channels_min = 2, |
682 | .channels_max = 2, | 685 | .channels_max = 2, |
683 | .buffer_bytes_max = (1UL << 18), /* 16bits dword */ | 686 | .buffer_bytes_max = (1UL << 18), /* 16bits dword */ |
@@ -905,6 +908,10 @@ static void update_spdif_rate(ice1712_t *ice, unsigned int rate) | |||
905 | case 44100: break; | 908 | case 44100: break; |
906 | case 48000: nval |= 2 << 12; break; | 909 | case 48000: nval |= 2 << 12; break; |
907 | case 32000: nval |= 3 << 12; break; | 910 | case 32000: nval |= 3 << 12; break; |
911 | case 88200: nval |= 4 << 12; break; | ||
912 | case 96000: nval |= 5 << 12; break; | ||
913 | case 192000: nval |= 6 << 12; break; | ||
914 | case 176400: nval |= 7 << 12; break; | ||
908 | } | 915 | } |
909 | if (val != nval) | 916 | if (val != nval) |
910 | update_spdif_bits(ice, nval); | 917 | update_spdif_bits(ice, nval); |
@@ -1292,22 +1299,32 @@ static int snd_vt1724_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * | |||
1292 | 1299 | ||
1293 | static unsigned int encode_spdif_bits(snd_aes_iec958_t *diga) | 1300 | static unsigned int encode_spdif_bits(snd_aes_iec958_t *diga) |
1294 | { | 1301 | { |
1295 | unsigned int val; | 1302 | unsigned int val, rbits; |
1296 | 1303 | ||
1297 | val = diga->status[0] & 0x03; /* professional, non-audio */ | 1304 | val = diga->status[0] & 0x03; /* professional, non-audio */ |
1298 | if (val & 0x01) { | 1305 | if (val & 0x01) { |
1299 | /* professional */ | 1306 | /* professional */ |
1300 | if ((diga->status[0] & IEC958_AES0_PRO_EMPHASIS) == IEC958_AES0_PRO_EMPHASIS_5015) | 1307 | if ((diga->status[0] & IEC958_AES0_PRO_EMPHASIS) == IEC958_AES0_PRO_EMPHASIS_5015) |
1301 | val |= 1U << 3; | 1308 | val |= 1U << 3; |
1302 | switch (diga->status[0] & IEC958_AES0_PRO_FS) { | 1309 | rbits = (diga->status[4] >> 3) & 0x0f; |
1303 | case IEC958_AES0_PRO_FS_44100: | 1310 | if (rbits) { |
1304 | break; | 1311 | switch (rbits) { |
1305 | case IEC958_AES0_PRO_FS_32000: | 1312 | case 2: val |= 5 << 12; break; /* 96k */ |
1306 | val |= 3U << 12; | 1313 | case 3: val |= 6 << 12; break; /* 192k */ |
1307 | break; | 1314 | case 10: val |= 4 << 12; break; /* 88.2k */ |
1308 | default: | 1315 | case 11: val |= 7 << 12; break; /* 176.4k */ |
1309 | val |= 2U << 12; | 1316 | } |
1310 | break; | 1317 | } else { |
1318 | switch (diga->status[0] & IEC958_AES0_PRO_FS) { | ||
1319 | case IEC958_AES0_PRO_FS_44100: | ||
1320 | break; | ||
1321 | case IEC958_AES0_PRO_FS_32000: | ||
1322 | val |= 3U << 12; | ||
1323 | break; | ||
1324 | default: | ||
1325 | val |= 2U << 12; | ||
1326 | break; | ||
1327 | } | ||
1311 | } | 1328 | } |
1312 | } else { | 1329 | } else { |
1313 | /* consumer */ | 1330 | /* consumer */ |
@@ -2154,7 +2171,7 @@ static int __devinit snd_vt1724_create(snd_card_t * card, | |||
2154 | ice->profi_port = pci_resource_start(pci, 1); | 2171 | ice->profi_port = pci_resource_start(pci, 1); |
2155 | 2172 | ||
2156 | if (request_irq(pci->irq, snd_vt1724_interrupt, SA_INTERRUPT|SA_SHIRQ, "ICE1724", (void *) ice)) { | 2173 | if (request_irq(pci->irq, snd_vt1724_interrupt, SA_INTERRUPT|SA_SHIRQ, "ICE1724", (void *) ice)) { |
2157 | snd_printk("unable to grab IRQ %d\n", pci->irq); | 2174 | snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); |
2158 | snd_vt1724_free(ice); | 2175 | snd_vt1724_free(ice); |
2159 | return -EIO; | 2176 | return -EIO; |
2160 | } | 2177 | } |