diff options
Diffstat (limited to 'sound/pci/ice1712/ice1724.c')
-rw-r--r-- | sound/pci/ice1712/ice1724.c | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index c3ce8f93740b..a1133c53412f 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 */ |