Lines Matching +full:mc +full:- +full:sid
1 // SPDX-License-Identifier: GPL-2.0-or-later
8 * Tjeerd.Mulder <Tjeerd.Mulder@fujitsu-siemens.com>
16 * - use the DSX channels for the first pcm playback.
19 * multi-channel playback is assigned to the second device
21 * - support the secondary capture (on VIA8233/C,8235)
22 * - SPDIF support
26 * the card config of alsa-lib will assign the correct
28 * - clean up the code, separate low-level initialization
32 * - Optimize position calculation for the 823x chips.
65 static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
82 MODULE_PARM_DESC(mpu_port, "MPU-401 port. (VT82C686x only)");
94 MODULE_PARM_DESC(dxs_init_volume, "initial DXS volume (0-31)");
113 #define VIA_REV_8233C 0x20 /* 2 rec, 4 pb, 1 multi-pb */
114 #define VIA_REV_8233 0x30 /* 2 rec, 4 pb, 1 multi-pb, spdif */
115 #define VIA_REV_8233A 0x40 /* 1 rec, 1 multi-pb, spdf */
116 #define VIA_REV_8235 0x50 /* 2 rec, 4 pb, 1 multi-pb, spdif */
124 #define VIAREG(via, x) ((via)->port + VIA_REG_##x)
125 #define VIADEV_REG(viadev, x) ((viadev)->port + VIA_REG_##x)
128 #define VIA_REG_OFFSET_STATUS 0x00 /* byte - channel status */
136 #define VIA_REG_OFFSET_CONTROL 0x01 /* byte - channel control */
144 #define VIA_REG_CTRL_RESET 0x01 /* RW - probably reset? undocumented */
146 #define VIA_REG_OFFSET_TYPE 0x02 /* byte - channel type (686 only) */
147 #define VIA_REG_TYPE_AUTOSTART 0x80 /* RW - autostart at EOL */
156 #define VIA_REG_OFFSET_TABLE_PTR 0x04 /* dword - channel table pointer */
157 #define VIA_REG_OFFSET_CURR_PTR 0x04 /* dword - channel current pointer */
158 #define VIA_REG_OFFSET_STOP_IDX 0x08 /* dword - stop index, channel type, sample rate */
161 #define VIA_REG_OFFSET_CURR_COUNT 0x0c /* dword - channel current count (24 bit) */
162 #define VIA_REG_OFFSET_CURR_INDEX 0x0f /* byte - channel current index (for via8233 only) */
223 /* multi-channel and capture registers for via8233 */
227 /* via8233-specific registers */
230 #define VIA_REG_OFS_MULTPLAY_FORMAT 0x02 /* byte - format and channels */
234 #define VIA_REG_OFS_CAPTURE_FIFO 0x02 /* byte - bit 6 = fifo enable */
239 #define VIA_REG_CAPTURE_CHANNEL 0x63 /* byte - input select */
252 #define VIA_ACLINK_LOWPOWER 0x02 /* low-power state */
256 #define VIA_ACLINK_CTRL_RESET 0x40 /* 0: assert, 1: de-assert */
419 if (dev->table.area == NULL) { in build_via_table()
423 if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, &chip->pci->dev, in build_via_table()
425 &dev->table) < 0) in build_via_table()
426 return -ENOMEM; in build_via_table()
428 if (! dev->idx_table) { in build_via_table()
429 dev->idx_table = kmalloc_array(VIA_TABLE_SIZE, in build_via_table()
430 sizeof(*dev->idx_table), in build_via_table()
432 if (! dev->idx_table) in build_via_table()
433 return -ENOMEM; in build_via_table()
439 pgtbl = (__le32 *)dev->table.area; in build_via_table()
452 dev_err(&pci->dev, "too much table size!\n"); in build_via_table()
453 return -EINVAL; in build_via_table()
458 rest -= r; in build_via_table()
460 if (i == periods - 1) in build_via_table()
467 dev_dbg(&pci->dev, in build_via_table()
472 dev->idx_table[idx].offset = ofs; in build_via_table()
473 dev->idx_table[idx].size = r; in build_via_table()
478 dev->tbl_entries = idx; in build_via_table()
479 dev->bufsize = periods * fragsize; in build_via_table()
480 dev->bufsize2 = dev->bufsize / 2; in build_via_table()
481 dev->fragsize = fragsize; in build_via_table()
489 if (dev->table.area) { in clean_via_table()
490 snd_dma_free_pages(&dev->table); in clean_via_table()
491 dev->table.area = NULL; in clean_via_table()
493 kfree(dev->idx_table); in clean_via_table()
494 dev->idx_table = NULL; in clean_via_table()
517 while (timeout-- > 0) { in snd_via82xx_codec_ready()
522 dev_err(chip->card->dev, "codec_ready: codec %i is not ready [0x%x]\n", in snd_via82xx_codec_ready()
524 return -EIO; in snd_via82xx_codec_ready()
534 while (timeout-- > 0) { in snd_via82xx_codec_valid()
541 return -EIO; in snd_via82xx_codec_valid()
546 struct via82xx *chip = ac97->private_data; in snd_via82xx_codec_wait()
548 err = snd_via82xx_codec_ready(chip, ac97->num); in snd_via82xx_codec_wait()
558 struct via82xx *chip = ac97->private_data; in snd_via82xx_codec_write()
561 xval = !ac97->num ? VIA_REG_AC97_CODEC_ID_PRIMARY : VIA_REG_AC97_CODEC_ID_SECONDARY; in snd_via82xx_codec_write()
566 snd_via82xx_codec_ready(chip, ac97->num); in snd_via82xx_codec_write()
571 struct via82xx *chip = ac97->private_data; in snd_via82xx_codec_read()
575 xval = ac97->num << VIA_REG_AC97_CODEC_ID_SHIFT; in snd_via82xx_codec_read()
576 xval |= ac97->num ? VIA_REG_AC97_SECONDARY_VALID : VIA_REG_AC97_PRIMARY_VALID; in snd_via82xx_codec_read()
581 dev_err(chip->card->dev, in snd_via82xx_codec_read()
583 ac97->num, snd_via82xx_codec_xread(chip)); in snd_via82xx_codec_read()
588 if (snd_via82xx_codec_valid(chip, ac97->num) >= 0) { in snd_via82xx_codec_read()
609 viadev->lastpos = 0; in snd_via82xx_channel_reset()
610 viadev->hwptr_done = 0; in snd_via82xx_channel_reset()
625 if (! (status & chip->intr_mask)) { in snd_via686_interrupt()
626 if (chip->rmidi) in snd_via686_interrupt()
628 return snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data); in snd_via686_interrupt()
633 spin_lock(&chip->reg_lock); in snd_via686_interrupt()
634 for (i = 0; i < chip->num_devs; i++) { in snd_via686_interrupt()
635 struct viadev *viadev = &chip->devs[i]; in snd_via686_interrupt()
639 if (viadev->substream && viadev->running) { in snd_via686_interrupt()
646 viadev->hwptr_done = 0; in snd_via686_interrupt()
648 viadev->hwptr_done += viadev->fragsize; in snd_via686_interrupt()
649 viadev->in_interrupt = c_status; in snd_via686_interrupt()
650 spin_unlock(&chip->reg_lock); in snd_via686_interrupt()
651 snd_pcm_period_elapsed(viadev->substream); in snd_via686_interrupt()
652 spin_lock(&chip->reg_lock); in snd_via686_interrupt()
653 viadev->in_interrupt = 0; in snd_via686_interrupt()
657 spin_unlock(&chip->reg_lock); in snd_via686_interrupt()
672 spin_lock(&chip->reg_lock); in snd_via8233_interrupt()
675 for (i = 0; i < chip->num_devs; i++) { in snd_via8233_interrupt()
676 struct viadev *viadev = &chip->devs[i]; in snd_via8233_interrupt()
680 shadow_status = (status >> viadev->shadow_shift) & in snd_via8233_interrupt()
687 substream = viadev->substream; in snd_via8233_interrupt()
688 if (substream && viadev->running) { in snd_via8233_interrupt()
695 viadev->hwptr_done = 0; in snd_via8233_interrupt()
697 viadev->hwptr_done += viadev->fragsize; in snd_via8233_interrupt()
698 viadev->in_interrupt = c_status; in snd_via8233_interrupt()
700 viadev->in_interrupt |= VIA_REG_STAT_ACTIVE; in snd_via8233_interrupt()
701 spin_unlock(&chip->reg_lock); in snd_via8233_interrupt()
705 spin_lock(&chip->reg_lock); in snd_via8233_interrupt()
706 viadev->in_interrupt = 0; in snd_via8233_interrupt()
711 spin_unlock(&chip->reg_lock); in snd_via8233_interrupt()
725 struct viadev *viadev = substream->runtime->private_data; in snd_via82xx_pcm_trigger()
728 if (chip->chip_type != TYPE_VIA686) in snd_via82xx_pcm_trigger()
736 viadev->running = 1; in snd_via82xx_pcm_trigger()
741 viadev->running = 0; in snd_via82xx_pcm_trigger()
745 viadev->running = 0; in snd_via82xx_pcm_trigger()
748 viadev->running = 1; in snd_via82xx_pcm_trigger()
751 return -EINVAL; in snd_via82xx_pcm_trigger()
765 * calculate the linear position at the given sg-buffer index and the rest count
769 ((pos) < viadev->lastpos && ((pos) >= viadev->bufsize2 ||\
770 viadev->lastpos < viadev->bufsize2))
779 size = viadev->idx_table[idx].size; in calc_linear_pos()
780 base = viadev->idx_table[idx].offset; in calc_linear_pos()
781 res = base + size - count; in calc_linear_pos()
782 if (res >= viadev->bufsize) in calc_linear_pos()
783 res -= viadev->bufsize; in calc_linear_pos()
787 dev_dbg(chip->card->dev, in calc_linear_pos()
790 res = viadev->lastpos; in calc_linear_pos()
797 int delta = res - viadev->lastpos; in calc_linear_pos()
799 delta += viadev->bufsize; in calc_linear_pos()
800 if ((unsigned int)delta > viadev->fragsize) in calc_linear_pos()
805 dev_dbg(chip->card->dev, in calc_linear_pos()
807 idx, viadev->tbl_entries, in calc_linear_pos()
808 viadev->lastpos, viadev->bufsize2, in calc_linear_pos()
809 viadev->idx_table[idx].offset, in calc_linear_pos()
810 viadev->idx_table[idx].size, count); in calc_linear_pos()
815 dev_dbg(chip->card->dev, in calc_linear_pos()
817 res = viadev->lastpos; in calc_linear_pos()
830 struct viadev *viadev = substream->runtime->private_data; in snd_via686_pcm_pointer()
833 if (snd_BUG_ON(!viadev->tbl_entries)) in snd_via686_pcm_pointer()
838 spin_lock(&chip->reg_lock); in snd_via686_pcm_pointer()
844 if (ptr <= (unsigned int)viadev->table.addr) in snd_via686_pcm_pointer()
847 idx = ((ptr - (unsigned int)viadev->table.addr) / 8 - 1) % viadev->tbl_entries; in snd_via686_pcm_pointer()
849 viadev->lastpos = res; /* remember the last position */ in snd_via686_pcm_pointer()
850 spin_unlock(&chip->reg_lock); in snd_via686_pcm_pointer()
852 return bytes_to_frames(substream->runtime, res); in snd_via686_pcm_pointer()
861 struct viadev *viadev = substream->runtime->private_data; in snd_via8233_pcm_pointer()
865 if (snd_BUG_ON(!viadev->tbl_entries)) in snd_via8233_pcm_pointer()
868 spin_lock(&chip->reg_lock); in snd_via8233_pcm_pointer()
870 status = viadev->in_interrupt; in snd_via8233_pcm_pointer()
876 if (chip->revision == VIA_REV_8251 && (status & VIA_REG_STAT_EOL)) in snd_via8233_pcm_pointer()
885 if (idx >= viadev->tbl_entries) { in snd_via8233_pcm_pointer()
887 dev_dbg(chip->card->dev, in snd_via8233_pcm_pointer()
889 viadev->tbl_entries); in snd_via8233_pcm_pointer()
891 res = viadev->lastpos; in snd_via8233_pcm_pointer()
897 res = viadev->hwptr_done; in snd_via8233_pcm_pointer()
898 if (!viadev->in_interrupt) { in snd_via8233_pcm_pointer()
903 res += viadev->fragsize; in snd_via8233_pcm_pointer()
908 viadev->lastpos = res; in snd_via8233_pcm_pointer()
909 spin_unlock(&chip->reg_lock); in snd_via8233_pcm_pointer()
911 return bytes_to_frames(substream->runtime, res); in snd_via8233_pcm_pointer()
923 struct viadev *viadev = substream->runtime->private_data; in snd_via82xx_hw_params()
925 return build_via_table(viadev, substream, chip->pci, in snd_via82xx_hw_params()
937 struct viadev *viadev = substream->runtime->private_data; in snd_via82xx_hw_free()
939 clean_via_table(viadev, substream, chip->pci); in snd_via82xx_hw_free()
950 outl((u32)viadev->table.addr, VIADEV_REG(viadev, OFFSET_TABLE_PTR)); in snd_via82xx_set_table_ptr()
965 (runtime->format == SNDRV_PCM_FORMAT_S16_LE ? VIA_REG_TYPE_16BIT : 0) | in via686_setup_format()
966 (runtime->channels > 1 ? VIA_REG_TYPE_STEREO : 0) | in via686_setup_format()
967 ((viadev->reg_offset & 0x10) == 0 ? VIA_REG_TYPE_INT_LSAMPLE : 0) | in via686_setup_format()
975 struct viadev *viadev = substream->runtime->private_data; in snd_via686_playback_prepare()
976 struct snd_pcm_runtime *runtime = substream->runtime; in snd_via686_playback_prepare()
978 snd_ac97_set_rate(chip->ac97, AC97_PCM_FRONT_DAC_RATE, runtime->rate); in snd_via686_playback_prepare()
979 snd_ac97_set_rate(chip->ac97, AC97_SPDIF, runtime->rate); in snd_via686_playback_prepare()
987 struct viadev *viadev = substream->runtime->private_data; in snd_via686_capture_prepare()
988 struct snd_pcm_runtime *runtime = substream->runtime; in snd_via686_capture_prepare()
990 snd_ac97_set_rate(chip->ac97, AC97_PCM_LR_ADC_RATE, runtime->rate); in snd_via686_capture_prepare()
1002 spin_lock_irq(&rec->lock); in via_lock_rate()
1003 if (rec->rate != rate) { in via_lock_rate()
1004 if (rec->rate && rec->used > 1) /* already set */ in via_lock_rate()
1005 changed = -EINVAL; in via_lock_rate()
1007 rec->rate = rate; in via_lock_rate()
1011 spin_unlock_irq(&rec->lock); in via_lock_rate()
1021 struct viadev *viadev = substream->runtime->private_data; in snd_via8233_playback_prepare()
1022 struct snd_pcm_runtime *runtime = substream->runtime; in snd_via8233_playback_prepare()
1023 int ac97_rate = chip->dxs_src ? 48000 : runtime->rate; in snd_via8233_playback_prepare()
1027 if ((rate_changed = via_lock_rate(&chip->rates[0], ac97_rate)) < 0) in snd_via8233_playback_prepare()
1030 snd_ac97_set_rate(chip->ac97, AC97_PCM_FRONT_DAC_RATE, in snd_via8233_playback_prepare()
1031 chip->no_vra ? 48000 : runtime->rate); in snd_via8233_playback_prepare()
1032 if (chip->spdif_on && viadev->reg_offset == 0x30) in snd_via8233_playback_prepare()
1033 snd_ac97_set_rate(chip->ac97, AC97_SPDIF, runtime->rate); in snd_via8233_playback_prepare()
1035 if (runtime->rate == 48000) in snd_via8233_playback_prepare()
1038 rbits = (0x100000 / 48000) * runtime->rate + in snd_via8233_playback_prepare()
1039 ((0x100000 % 48000) * runtime->rate) / 48000; in snd_via8233_playback_prepare()
1043 outb(chip->playback_volume[viadev->reg_offset / 0x10][0], in snd_via8233_playback_prepare()
1045 outb(chip->playback_volume[viadev->reg_offset / 0x10][1], in snd_via8233_playback_prepare()
1047 outl((runtime->format == SNDRV_PCM_FORMAT_S16_LE ? VIA8233_REG_TYPE_16BIT : 0) | /* format */ in snd_via8233_playback_prepare()
1048 (runtime->channels > 1 ? VIA8233_REG_TYPE_STEREO : 0) | /* stereo */ in snd_via8233_playback_prepare()
1058 * prepare callback for multi-channel playback on via823x
1063 struct viadev *viadev = substream->runtime->private_data; in snd_via8233_multi_prepare()
1064 struct snd_pcm_runtime *runtime = substream->runtime; in snd_via8233_multi_prepare()
1068 if (via_lock_rate(&chip->rates[0], runtime->rate) < 0) in snd_via8233_multi_prepare()
1069 return -EINVAL; in snd_via8233_multi_prepare()
1070 snd_ac97_set_rate(chip->ac97, AC97_PCM_FRONT_DAC_RATE, runtime->rate); in snd_via8233_multi_prepare()
1071 snd_ac97_set_rate(chip->ac97, AC97_PCM_SURR_DAC_RATE, runtime->rate); in snd_via8233_multi_prepare()
1072 snd_ac97_set_rate(chip->ac97, AC97_PCM_LFE_DAC_RATE, runtime->rate); in snd_via8233_multi_prepare()
1073 snd_ac97_set_rate(chip->ac97, AC97_SPDIF, runtime->rate); in snd_via8233_multi_prepare()
1077 fmt = (runtime->format == SNDRV_PCM_FORMAT_S16_LE) ? in snd_via8233_multi_prepare()
1079 fmt |= runtime->channels << 4; in snd_via8233_multi_prepare()
1082 if (chip->revision == VIA_REV_8233A) in snd_via8233_multi_prepare()
1089 switch (runtime->channels) { in snd_via8233_multi_prepare()
1112 struct viadev *viadev = substream->runtime->private_data; in snd_via8233_capture_prepare()
1113 struct snd_pcm_runtime *runtime = substream->runtime; in snd_via8233_capture_prepare()
1115 if (via_lock_rate(&chip->rates[1], runtime->rate) < 0) in snd_via8233_capture_prepare()
1116 return -EINVAL; in snd_via8233_capture_prepare()
1117 snd_ac97_set_rate(chip->ac97, AC97_PCM_LR_ADC_RATE, runtime->rate); in snd_via8233_capture_prepare()
1121 outl((runtime->format == SNDRV_PCM_FORMAT_S16_LE ? VIA8233_REG_TYPE_16BIT : 0) | in snd_via8233_capture_prepare()
1122 (runtime->channels > 1 ? VIA8233_REG_TYPE_STEREO : 0) | in snd_via8233_capture_prepare()
1162 struct snd_pcm_runtime *runtime = substream->runtime; in snd_via82xx_pcm_open()
1167 runtime->hw = snd_via82xx_hw; in snd_via82xx_pcm_open()
1170 ratep = &chip->rates[viadev->direction]; in snd_via82xx_pcm_open()
1171 spin_lock_irq(&ratep->lock); in snd_via82xx_pcm_open()
1172 ratep->used++; in snd_via82xx_pcm_open()
1173 if (chip->spdif_on && viadev->reg_offset == 0x30) { in snd_via82xx_pcm_open()
1175 runtime->hw.rates = chip->ac97->rates[AC97_RATES_SPDIF]; in snd_via82xx_pcm_open()
1177 } else if (chip->dxs_fixed && viadev->reg_offset < 0x40) { in snd_via82xx_pcm_open()
1179 runtime->hw.rates = SNDRV_PCM_RATE_48000; in snd_via82xx_pcm_open()
1180 runtime->hw.rate_min = runtime->hw.rate_max = 48000; in snd_via82xx_pcm_open()
1181 } else if (chip->dxs_src && viadev->reg_offset < 0x40) { in snd_via82xx_pcm_open()
1183 runtime->hw.rates = (SNDRV_PCM_RATE_CONTINUOUS | in snd_via82xx_pcm_open()
1185 runtime->hw.rate_min = 8000; in snd_via82xx_pcm_open()
1186 runtime->hw.rate_max = 48000; in snd_via82xx_pcm_open()
1188 } else if (! ratep->rate) { in snd_via82xx_pcm_open()
1189 int idx = viadev->direction ? AC97_RATES_ADC : AC97_RATES_FRONT_DAC; in snd_via82xx_pcm_open()
1190 runtime->hw.rates = chip->ac97->rates[idx]; in snd_via82xx_pcm_open()
1194 runtime->hw.rates = SNDRV_PCM_RATE_KNOT; in snd_via82xx_pcm_open()
1195 runtime->hw.rate_max = runtime->hw.rate_min = ratep->rate; in snd_via82xx_pcm_open()
1197 spin_unlock_irq(&ratep->lock); in snd_via82xx_pcm_open()
1210 runtime->private_data = viadev; in snd_via82xx_pcm_open()
1211 viadev->substream = substream; in snd_via82xx_pcm_open()
1223 struct viadev *viadev = &chip->devs[chip->playback_devno + substream->number]; in snd_via686_playback_open()
1241 viadev = &chip->devs[chip->playback_devno + substream->number]; in snd_via8233_playback_open()
1244 stream = viadev->reg_offset / 0x10; in snd_via8233_playback_open()
1245 if (chip->dxs_controls[stream]) { in snd_via8233_playback_open()
1246 chip->playback_volume[stream][0] = in snd_via8233_playback_open()
1247 VIA_DXS_MAX_VOLUME - (dxs_init_volume & 31); in snd_via8233_playback_open()
1248 chip->playback_volume[stream][1] = in snd_via8233_playback_open()
1249 VIA_DXS_MAX_VOLUME - (dxs_init_volume & 31); in snd_via8233_playback_open()
1250 chip->dxs_controls[stream]->vd[0].access &= in snd_via8233_playback_open()
1252 snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE | in snd_via8233_playback_open()
1254 &chip->dxs_controls[stream]->id); in snd_via8233_playback_open()
1260 * open callback for playback on via823x multi-channel
1265 struct viadev *viadev = &chip->devs[chip->multi_devno]; in snd_via8233_multi_open()
1281 substream->runtime->hw.channels_max = 6; in snd_via8233_multi_open()
1282 if (chip->revision == VIA_REV_8233A) in snd_via8233_multi_open()
1283 snd_pcm_hw_constraint_list(substream->runtime, 0, in snd_via8233_multi_open()
1295 struct viadev *viadev = &chip->devs[chip->capture_devno + substream->pcm->device]; in snd_via82xx_capture_open()
1306 struct viadev *viadev = substream->runtime->private_data; in snd_via82xx_pcm_close()
1310 ratep = &chip->rates[viadev->direction]; in snd_via82xx_pcm_close()
1311 spin_lock_irq(&ratep->lock); in snd_via82xx_pcm_close()
1312 ratep->used--; in snd_via82xx_pcm_close()
1313 if (! ratep->used) in snd_via82xx_pcm_close()
1314 ratep->rate = 0; in snd_via82xx_pcm_close()
1315 spin_unlock_irq(&ratep->lock); in snd_via82xx_pcm_close()
1316 if (! ratep->rate) { in snd_via82xx_pcm_close()
1317 if (! viadev->direction) { in snd_via82xx_pcm_close()
1318 snd_ac97_update_power(chip->ac97, in snd_via82xx_pcm_close()
1320 snd_ac97_update_power(chip->ac97, in snd_via82xx_pcm_close()
1322 snd_ac97_update_power(chip->ac97, in snd_via82xx_pcm_close()
1325 snd_ac97_update_power(chip->ac97, in snd_via82xx_pcm_close()
1328 viadev->substream = NULL; in snd_via82xx_pcm_close()
1335 struct viadev *viadev = substream->runtime->private_data; in snd_via8233_playback_close()
1338 stream = viadev->reg_offset / 0x10; in snd_via8233_playback_close()
1339 if (chip->dxs_controls[stream]) { in snd_via8233_playback_close()
1340 chip->dxs_controls[stream]->vd[0].access |= in snd_via8233_playback_close()
1342 snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_INFO, in snd_via8233_playback_close()
1343 &chip->dxs_controls[stream]->id); in snd_via8233_playback_close()
1382 /* via823x multi-channel playback callbacks */
1408 chip->devs[idx].reg_offset = reg_offset; in init_viadev()
1409 chip->devs[idx].shadow_shift = shadow_pos * 4; in init_viadev()
1410 chip->devs[idx].direction = direction; in init_viadev()
1411 chip->devs[idx].port = chip->port + reg_offset; in init_viadev()
1423 chip->playback_devno = 0; /* x 4 */ in snd_via8233_pcm_new()
1424 chip->multi_devno = 4; /* x 1 */ in snd_via8233_pcm_new()
1425 chip->capture_devno = 5; /* x 2 */ in snd_via8233_pcm_new()
1426 chip->num_devs = 7; in snd_via8233_pcm_new()
1427 chip->intr_mask = 0x33033333; /* FLAG|EOL for rec0-1, mc, sdx0-3 */ in snd_via8233_pcm_new()
1430 err = snd_pcm_new(chip->card, chip->card->shortname, 0, 4, 1, &pcm); in snd_via8233_pcm_new()
1435 pcm->private_data = chip; in snd_via8233_pcm_new()
1436 strcpy(pcm->name, chip->card->shortname); in snd_via8233_pcm_new()
1437 chip->pcms[0] = pcm; in snd_via8233_pcm_new()
1442 init_viadev(chip, chip->capture_devno, VIA_REG_CAPTURE_8233_STATUS, 6, 1); in snd_via8233_pcm_new()
1445 &chip->pci->dev, in snd_via8233_pcm_new()
1454 /* PCM #1: multi-channel playback and 2nd capture */ in snd_via8233_pcm_new()
1455 err = snd_pcm_new(chip->card, chip->card->shortname, 1, 1, 1, &pcm); in snd_via8233_pcm_new()
1460 pcm->private_data = chip; in snd_via8233_pcm_new()
1461 strcpy(pcm->name, chip->card->shortname); in snd_via8233_pcm_new()
1462 chip->pcms[1] = pcm; in snd_via8233_pcm_new()
1464 init_viadev(chip, chip->multi_devno, VIA_REG_MULTPLAY_STATUS, 4, 0); in snd_via8233_pcm_new()
1466 init_viadev(chip, chip->capture_devno + 1, VIA_REG_CAPTURE_8233_STATUS + 0x10, 7, 1); in snd_via8233_pcm_new()
1469 &chip->pci->dev, in snd_via8233_pcm_new()
1477 chip->ac97->chmaps[SNDRV_PCM_STREAM_PLAYBACK] = chmap; in snd_via8233_pcm_new()
1491 chip->multi_devno = 0; in snd_via8233a_pcm_new()
1492 chip->playback_devno = 1; in snd_via8233a_pcm_new()
1493 chip->capture_devno = 2; in snd_via8233a_pcm_new()
1494 chip->num_devs = 3; in snd_via8233a_pcm_new()
1495 chip->intr_mask = 0x03033000; /* FLAG|EOL for rec0, mc, sdx3 */ in snd_via8233a_pcm_new()
1497 /* PCM #0: multi-channel playback and capture */ in snd_via8233a_pcm_new()
1498 err = snd_pcm_new(chip->card, chip->card->shortname, 0, 1, 1, &pcm); in snd_via8233a_pcm_new()
1503 pcm->private_data = chip; in snd_via8233a_pcm_new()
1504 strcpy(pcm->name, chip->card->shortname); in snd_via8233a_pcm_new()
1505 chip->pcms[0] = pcm; in snd_via8233a_pcm_new()
1507 init_viadev(chip, chip->multi_devno, VIA_REG_MULTPLAY_STATUS, 4, 0); in snd_via8233a_pcm_new()
1509 init_viadev(chip, chip->capture_devno, VIA_REG_CAPTURE_8233_STATUS, 6, 1); in snd_via8233a_pcm_new()
1512 &chip->pci->dev, in snd_via8233a_pcm_new()
1520 chip->ac97->chmaps[SNDRV_PCM_STREAM_PLAYBACK] = chmap; in snd_via8233a_pcm_new()
1523 if (! ac97_can_spdif(chip->ac97)) in snd_via8233a_pcm_new()
1527 err = snd_pcm_new(chip->card, chip->card->shortname, 1, 1, 0, &pcm); in snd_via8233a_pcm_new()
1531 pcm->private_data = chip; in snd_via8233a_pcm_new()
1532 strcpy(pcm->name, chip->card->shortname); in snd_via8233a_pcm_new()
1533 chip->pcms[1] = pcm; in snd_via8233a_pcm_new()
1535 init_viadev(chip, chip->playback_devno, 0x30, 3, 0); in snd_via8233a_pcm_new()
1538 &chip->pci->dev, in snd_via8233a_pcm_new()
1551 chip->playback_devno = 0; in snd_via686_pcm_new()
1552 chip->capture_devno = 1; in snd_via686_pcm_new()
1553 chip->num_devs = 2; in snd_via686_pcm_new()
1554 chip->intr_mask = 0x77; /* FLAG | EOL for PB, CP, FM */ in snd_via686_pcm_new()
1556 err = snd_pcm_new(chip->card, chip->card->shortname, 0, 1, 1, &pcm); in snd_via686_pcm_new()
1561 pcm->private_data = chip; in snd_via686_pcm_new()
1562 strcpy(pcm->name, chip->card->shortname); in snd_via686_pcm_new()
1563 chip->pcms[0] = pcm; in snd_via686_pcm_new()
1568 &chip->pci->dev, in snd_via686_pcm_new()
1594 …unsigned long port = chip->port + (kcontrol->id.index ? (VIA_REG_CAPTURE_CHANNEL + 0x10) : VIA_REG… in snd_via8233_capture_source_get()
1595 ucontrol->value.enumerated.item[0] = inb(port) & VIA_REG_CAPTURE_CHANNEL_MIC ? 1 : 0; in snd_via8233_capture_source_get()
1603 …unsigned long port = chip->port + (kcontrol->id.index ? (VIA_REG_CAPTURE_CHANNEL + 0x10) : VIA_REG… in snd_via8233_capture_source_put()
1606 spin_lock_irq(&chip->reg_lock); in snd_via8233_capture_source_put()
1609 if (ucontrol->value.enumerated.item[0]) in snd_via8233_capture_source_put()
1613 spin_unlock_irq(&chip->reg_lock); in snd_via8233_capture_source_put()
1633 pci_read_config_byte(chip->pci, VIA8233_SPDIF_CTRL, &val); in snd_via8233_dxs3_spdif_get()
1634 ucontrol->value.integer.value[0] = (val & VIA8233_SPDIF_DX3) ? 1 : 0; in snd_via8233_dxs3_spdif_get()
1644 pci_read_config_byte(chip->pci, VIA8233_SPDIF_CTRL, &oval); in snd_via8233_dxs3_spdif_put()
1646 if (ucontrol->value.integer.value[0]) in snd_via8233_dxs3_spdif_put()
1649 chip->spdif_on = ucontrol->value.integer.value[0] ? 1 : 0; in snd_via8233_dxs3_spdif_put()
1651 pci_write_config_byte(chip->pci, VIA8233_SPDIF_CTRL, val); in snd_via8233_dxs3_spdif_put()
1668 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in snd_via8233_dxs_volume_info()
1669 uinfo->count = 2; in snd_via8233_dxs_volume_info()
1670 uinfo->value.integer.min = 0; in snd_via8233_dxs_volume_info()
1671 uinfo->value.integer.max = VIA_DXS_MAX_VOLUME; in snd_via8233_dxs_volume_info()
1679 unsigned int idx = kcontrol->id.subdevice; in snd_via8233_dxs_volume_get()
1681 ucontrol->value.integer.value[0] = VIA_DXS_MAX_VOLUME - chip->playback_volume[idx][0]; in snd_via8233_dxs_volume_get()
1682 ucontrol->value.integer.value[1] = VIA_DXS_MAX_VOLUME - chip->playback_volume[idx][1]; in snd_via8233_dxs_volume_get()
1690 ucontrol->value.integer.value[0] = VIA_DXS_MAX_VOLUME - chip->playback_volume_c[0]; in snd_via8233_pcmdxs_volume_get()
1691 ucontrol->value.integer.value[1] = VIA_DXS_MAX_VOLUME - chip->playback_volume_c[1]; in snd_via8233_pcmdxs_volume_get()
1699 unsigned int idx = kcontrol->id.subdevice; in snd_via8233_dxs_volume_put()
1700 unsigned long port = chip->port + 0x10 * idx; in snd_via8233_dxs_volume_put()
1705 val = ucontrol->value.integer.value[i]; in snd_via8233_dxs_volume_put()
1708 val = VIA_DXS_MAX_VOLUME - val; in snd_via8233_dxs_volume_put()
1709 change |= val != chip->playback_volume[idx][i]; in snd_via8233_dxs_volume_put()
1711 chip->playback_volume[idx][i] = val; in snd_via8233_dxs_volume_put()
1727 val = ucontrol->value.integer.value[i]; in snd_via8233_pcmdxs_volume_put()
1730 val = VIA_DXS_MAX_VOLUME - val; in snd_via8233_pcmdxs_volume_put()
1731 if (val != chip->playback_volume_c[i]) { in snd_via8233_pcmdxs_volume_put()
1733 chip->playback_volume_c[i] = val; in snd_via8233_pcmdxs_volume_put()
1735 unsigned long port = chip->port + 0x10 * idx; in snd_via8233_pcmdxs_volume_put()
1736 chip->playback_volume[idx][i] = val; in snd_via8233_pcmdxs_volume_put()
1744 static const DECLARE_TLV_DB_SCALE(db_scale_dxs, -4650, 150, 1);
1776 struct via82xx *chip = bus->private_data; in snd_via82xx_mixer_free_ac97_bus()
1777 chip->ac97_bus = NULL; in snd_via82xx_mixer_free_ac97_bus()
1782 struct via82xx *chip = ac97->private_data; in snd_via82xx_mixer_free_ac97()
1783 chip->ac97 = NULL; in snd_via82xx_mixer_free_ac97()
1791 .name = "Soltek SL-75DRV5",
1879 if ((err = snd_ac97_bus(chip->card, 0, &ops, chip, &chip->ac97_bus)) < 0) in snd_via82xx_mixer_new()
1881 chip->ac97_bus->private_free = snd_via82xx_mixer_free_ac97_bus; in snd_via82xx_mixer_new()
1882 chip->ac97_bus->clock = chip->ac97_clock; in snd_via82xx_mixer_new()
1887 ac97.pci = chip->pci; in snd_via82xx_mixer_new()
1889 if ((err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97)) < 0) in snd_via82xx_mixer_new()
1892 snd_ac97_tune_hardware(chip->ac97, ac97_quirks, quirk_override); in snd_via82xx_mixer_new()
1894 if (chip->chip_type != TYPE_VIA686) { in snd_via82xx_mixer_new()
1896 snd_ac97_update_bits(chip->ac97, AC97_EXTENDED_STATUS, 0x03 << 4, 0x03 << 4); in snd_via82xx_mixer_new()
1910 return -ENODEV; in snd_via686_create_gameport()
1914 dev_warn(chip->card->dev, "cannot reserve joystick port %#x\n", in snd_via686_create_gameport()
1916 return -EBUSY; in snd_via686_create_gameport()
1919 chip->gameport = gp = gameport_allocate_port(); in snd_via686_create_gameport()
1921 dev_err(chip->card->dev, in snd_via686_create_gameport()
1924 return -ENOMEM; in snd_via686_create_gameport()
1928 gameport_set_phys(gp, "pci%s/gameport0", pci_name(chip->pci)); in snd_via686_create_gameport()
1929 gameport_set_dev_parent(gp, &chip->pci->dev); in snd_via686_create_gameport()
1930 gp->io = JOYSTICK_ADDR; in snd_via686_create_gameport()
1935 pci_write_config_byte(chip->pci, VIA_FUNC_ENABLE, *legacy); in snd_via686_create_gameport()
1937 gameport_register_port(chip->gameport); in snd_via686_create_gameport()
1944 if (chip->gameport) { in snd_via686_free_gameport()
1945 struct resource *r = gameport_get_port_data(chip->gameport); in snd_via686_free_gameport()
1947 gameport_unregister_port(chip->gameport); in snd_via686_free_gameport()
1948 chip->gameport = NULL; in snd_via686_free_gameport()
1955 return -ENOSYS; in snd_via686_create_gameport()
1970 caps = chip->chip_type == TYPE_VIA8233A ? 1 : 2; in snd_via8233_init_misc()
1973 err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_via8233_capture_source, chip)); in snd_via8233_init_misc()
1977 if (ac97_can_spdif(chip->ac97)) { in snd_via8233_init_misc()
1978 err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_via8233_dxs3_spdif_control, chip)); in snd_via8233_init_misc()
1982 if (chip->chip_type != TYPE_VIA8233A) { in snd_via8233_init_misc()
1986 struct snd_ctl_elem_id sid; in snd_via8233_init_misc() local
1987 memset(&sid, 0, sizeof(sid)); in snd_via8233_init_misc()
1988 strcpy(sid.name, "PCM Playback Volume"); in snd_via8233_init_misc()
1989 sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER; in snd_via8233_init_misc()
1990 if (! snd_ctl_find_id(chip->card, &sid)) { in snd_via8233_init_misc()
1991 dev_info(chip->card->dev, in snd_via8233_init_misc()
1993 err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_via8233_pcmdxs_volume_control, chip)); in snd_via8233_init_misc()
2005 return -ENOMEM; in snd_via8233_init_misc()
2006 kctl->id.subdevice = i; in snd_via8233_init_misc()
2007 err = snd_ctl_add(chip->card, kctl); in snd_via8233_init_misc()
2010 chip->dxs_controls[i] = kctl; in snd_via8233_init_misc()
2015 pci_read_config_byte(chip->pci, VIA8233_SPDIF_CTRL, &val); in snd_via8233_init_misc()
2018 pci_write_config_byte(chip->pci, VIA8233_SPDIF_CTRL, val); in snd_via8233_init_misc()
2028 legacy = chip->old_legacy; in snd_via686_init_misc()
2029 legacy_cfg = chip->old_legacy_cfg; in snd_via686_init_misc()
2032 if (chip->revision >= VIA_REV_686_H) { in snd_via686_init_misc()
2036 pci_write_config_dword(chip->pci, 0x18, mpu_port | 0x01); in snd_via686_init_misc()
2038 chip->mpu_port_saved = mpu_port; in snd_via686_init_misc()
2041 mpu_port = pci_resource_start(chip->pci, 2); in snd_via686_init_misc()
2059 (chip->mpu_res = request_region(mpu_port, 2, "VIA82xx MPU401")) in snd_via686_init_misc()
2071 pci_write_config_byte(chip->pci, VIA_FUNC_ENABLE, legacy); in snd_via686_init_misc()
2072 pci_write_config_byte(chip->pci, VIA_PNP_CONTROL, legacy_cfg); in snd_via686_init_misc()
2073 if (chip->mpu_res) { in snd_via686_init_misc()
2074 if (snd_mpu401_uart_new(chip->card, 0, MPU401_HW_VIA686A, in snd_via686_init_misc()
2076 MPU401_INFO_IRQ_HOOK, -1, in snd_via686_init_misc()
2077 &chip->rmidi) < 0) { in snd_via686_init_misc()
2078 dev_warn(chip->card->dev, in snd_via686_init_misc()
2079 "unable to initialize MPU-401 at 0x%lx, skipping\n", in snd_via686_init_misc()
2085 pci_write_config_byte(chip->pci, VIA_FUNC_ENABLE, legacy); in snd_via686_init_misc()
2091 chip->legacy_saved = legacy; in snd_via686_init_misc()
2092 chip->legacy_cfg_saved = legacy_cfg; in snd_via686_init_misc()
2105 struct via82xx *chip = entry->private_data; in snd_via82xx_proc_read()
2108 snd_iprintf(buffer, "%s\n\n", chip->card->longname); in snd_via82xx_proc_read()
2110 snd_iprintf(buffer, "%02x: %08x\n", i, inl(chip->port + i)); in snd_via82xx_proc_read()
2116 snd_card_ro_proc_new(chip->card, "via82xx", chip, in snd_via82xx_proc_init()
2131 if (chip->chip_type == TYPE_VIA686) in snd_via82xx_chip_init()
2133 pci_write_config_byte(chip->pci, VIA_FUNC_ENABLE, 0); in snd_via82xx_chip_init()
2135 pci_read_config_byte(chip->pci, VIA_ACLINK_STAT, &pval); in snd_via82xx_chip_init()
2138 pci_write_config_byte(chip->pci, VIA_ACLINK_CTRL, in snd_via82xx_chip_init()
2144 pci_write_config_byte(chip->pci, VIA_ACLINK_CTRL, 0x00); in snd_via82xx_chip_init()
2148 pci_write_config_byte(chip->pci, VIA_ACLINK_CTRL, in snd_via82xx_chip_init()
2153 /* note - FM data out has trouble with non VRA codecs !! */ in snd_via82xx_chip_init()
2154 pci_write_config_byte(chip->pci, VIA_ACLINK_CTRL, VIA_ACLINK_CTRL_INIT); in snd_via82xx_chip_init()
2160 pci_read_config_byte(chip->pci, VIA_ACLINK_CTRL, &pval); in snd_via82xx_chip_init()
2163 /* note - FM data out has trouble with non VRA codecs !! */ in snd_via82xx_chip_init()
2164 pci_write_config_byte(chip->pci, VIA_ACLINK_CTRL, VIA_ACLINK_CTRL_INIT); in snd_via82xx_chip_init()
2171 pci_read_config_byte(chip->pci, VIA_ACLINK_STAT, &pval); in snd_via82xx_chip_init()
2178 dev_err(chip->card->dev, in snd_via82xx_chip_init()
2191 chip->ac97_secondary = 1; in snd_via82xx_chip_init()
2201 if (chip->chip_type == TYPE_VIA686) { in snd_via82xx_chip_init()
2203 pci_write_config_byte(chip->pci, VIA_FM_NMI_CTRL, 0); in snd_via82xx_chip_init()
2208 if (chip->chip_type != TYPE_VIA686) { in snd_via82xx_chip_init()
2222 if (chip->chip_type != TYPE_VIA8233A) { in snd_via82xx_chip_init()
2225 unsigned long port = chip->port + 0x10 * idx; in snd_via82xx_chip_init()
2227 chip->playback_volume[idx][i]=chip->playback_volume_c[i]; in snd_via82xx_chip_init()
2228 outb(chip->playback_volume_c[i], in snd_via82xx_chip_init()
2244 struct via82xx *chip = card->private_data; in snd_via82xx_suspend()
2248 for (i = 0; i < chip->num_devs; i++) in snd_via82xx_suspend()
2249 snd_via82xx_channel_reset(chip, &chip->devs[i]); in snd_via82xx_suspend()
2250 snd_ac97_suspend(chip->ac97); in snd_via82xx_suspend()
2253 if (chip->chip_type != TYPE_VIA686) { in snd_via82xx_suspend()
2254 pci_read_config_byte(chip->pci, VIA8233_SPDIF_CTRL, &chip->spdif_ctrl_saved); in snd_via82xx_suspend()
2255 chip->capture_src_saved[0] = inb(chip->port + VIA_REG_CAPTURE_CHANNEL); in snd_via82xx_suspend()
2256 chip->capture_src_saved[1] = inb(chip->port + VIA_REG_CAPTURE_CHANNEL + 0x10); in snd_via82xx_suspend()
2265 struct via82xx *chip = card->private_data; in snd_via82xx_resume()
2270 if (chip->chip_type == TYPE_VIA686) { in snd_via82xx_resume()
2271 if (chip->mpu_port_saved) in snd_via82xx_resume()
2272 pci_write_config_dword(chip->pci, 0x18, chip->mpu_port_saved | 0x01); in snd_via82xx_resume()
2273 pci_write_config_byte(chip->pci, VIA_FUNC_ENABLE, chip->legacy_saved); in snd_via82xx_resume()
2274 pci_write_config_byte(chip->pci, VIA_PNP_CONTROL, chip->legacy_cfg_saved); in snd_via82xx_resume()
2276 pci_write_config_byte(chip->pci, VIA8233_SPDIF_CTRL, chip->spdif_ctrl_saved); in snd_via82xx_resume()
2277 outb(chip->capture_src_saved[0], chip->port + VIA_REG_CAPTURE_CHANNEL); in snd_via82xx_resume()
2278 outb(chip->capture_src_saved[1], chip->port + VIA_REG_CAPTURE_CHANNEL + 0x10); in snd_via82xx_resume()
2281 snd_ac97_resume(chip->ac97); in snd_via82xx_resume()
2283 for (i = 0; i < chip->num_devs; i++) in snd_via82xx_resume()
2284 snd_via82xx_channel_reset(chip, &chip->devs[i]); in snd_via82xx_resume()
2300 if (chip->irq < 0) in snd_via82xx_free()
2303 for (i = 0; i < chip->num_devs; i++) in snd_via82xx_free()
2304 snd_via82xx_channel_reset(chip, &chip->devs[i]); in snd_via82xx_free()
2306 if (chip->irq >= 0) in snd_via82xx_free()
2307 free_irq(chip->irq, chip); in snd_via82xx_free()
2309 release_and_free_resource(chip->mpu_res); in snd_via82xx_free()
2310 pci_release_regions(chip->pci); in snd_via82xx_free()
2312 if (chip->chip_type == TYPE_VIA686) { in snd_via82xx_free()
2314 pci_write_config_byte(chip->pci, VIA_FUNC_ENABLE, chip->old_legacy); in snd_via82xx_free()
2315 pci_write_config_byte(chip->pci, VIA_PNP_CONTROL, chip->old_legacy_cfg); in snd_via82xx_free()
2317 pci_disable_device(chip->pci); in snd_via82xx_free()
2324 struct via82xx *chip = device->device_data; in snd_via82xx_dev_free()
2346 return -ENOMEM; in snd_via82xx_create()
2349 chip->chip_type = chip_type; in snd_via82xx_create()
2350 chip->revision = revision; in snd_via82xx_create()
2352 spin_lock_init(&chip->reg_lock); in snd_via82xx_create()
2353 spin_lock_init(&chip->rates[0].lock); in snd_via82xx_create()
2354 spin_lock_init(&chip->rates[1].lock); in snd_via82xx_create()
2355 chip->card = card; in snd_via82xx_create()
2356 chip->pci = pci; in snd_via82xx_create()
2357 chip->irq = -1; in snd_via82xx_create()
2359 pci_read_config_byte(pci, VIA_FUNC_ENABLE, &chip->old_legacy); in snd_via82xx_create()
2360 pci_read_config_byte(pci, VIA_PNP_CONTROL, &chip->old_legacy_cfg); in snd_via82xx_create()
2361 pci_write_config_byte(chip->pci, VIA_FUNC_ENABLE, in snd_via82xx_create()
2362 chip->old_legacy & ~(VIA_FUNC_ENABLE_SB|VIA_FUNC_ENABLE_FM)); in snd_via82xx_create()
2364 if ((err = pci_request_regions(pci, card->driver)) < 0) { in snd_via82xx_create()
2369 chip->port = pci_resource_start(pci, 0); in snd_via82xx_create()
2370 if (request_irq(pci->irq, in snd_via82xx_create()
2375 dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq); in snd_via82xx_create()
2377 return -EBUSY; in snd_via82xx_create()
2379 chip->irq = pci->irq; in snd_via82xx_create()
2380 card->sync_irq = chip->irq; in snd_via82xx_create()
2382 chip->ac97_clock = ac97_clock; in snd_via82xx_create()
2409 { VIA_REV_PRE_8233, "VIA 8233-Pre", TYPE_VIA8233 },
2428 SND_PCI_QUIRK(0x1019, 0xaa01, "ESC K8T890-A", VIA_DXS_SRC),
2438 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte GA-7VAXP", VIA_DXS_ENABLE),
2441 SND_PCI_QUIRK(0x1462, 0x7142, "MSI K8MM-V", VIA_DXS_ENABLE),
2443 SND_PCI_QUIRK(0x147b, 0x1401, "ABIT KD7(-RAID)", VIA_DXS_ENABLE),
2444 SND_PCI_QUIRK(0x147b, 0x1411, "ABIT VA-20", VIA_DXS_ENABLE),
2455 SND_PCI_QUIRK(0x1695, 0x3005, "EPoX EP-8K9A", VIA_DXS_ENABLE),
2461 SND_PCI_QUIRK(0x1919, 0x200a, "Soltek SL-K8", VIA_DXS_NO_VRA),
2472 dev_dbg(&pci->dev, "DXS allow list for %s found\n", in check_dxs_list()
2474 return w->value; in check_dxs_list()
2484 dev_info(&pci->dev, "Assuming DXS channels with 48k fixed sample rate.\n"); in check_dxs_list()
2485 dev_info(&pci->dev, " Please try dxs_support=5 option\n"); in check_dxs_list()
2486 dev_info(&pci->dev, " and report if it works on your machine.\n"); in check_dxs_list()
2487 dev_info(&pci->dev, " For more details, read ALSA-Configuration.txt.\n"); in check_dxs_list()
2500 err = snd_card_new(&pci->dev, index, id, THIS_MODULE, 0, &card); in snd_via82xx_probe()
2504 card_type = pci_id->driver_data; in snd_via82xx_probe()
2507 strcpy(card->driver, "VIA686A"); in snd_via82xx_probe()
2508 sprintf(card->shortname, "VIA 82C686A/B rev%x", pci->revision); in snd_via82xx_probe()
2513 sprintf(card->shortname, "VIA 823x rev%x", pci->revision); in snd_via82xx_probe()
2515 if (pci->revision == via823x_cards[i].revision) { in snd_via82xx_probe()
2517 strcpy(card->shortname, via823x_cards[i].name); in snd_via82xx_probe()
2523 dxs_support = check_dxs_list(pci, pci->revision); in snd_via82xx_probe()
2533 strcpy(card->driver, "VIA8233A"); in snd_via82xx_probe()
2534 else if (pci->revision >= VIA_REV_8237) in snd_via82xx_probe()
2535 strcpy(card->driver, "VIA8237"); /* no slog assignment */ in snd_via82xx_probe()
2537 strcpy(card->driver, "VIA8233"); in snd_via82xx_probe()
2540 dev_err(card->dev, "invalid card type %d\n", card_type); in snd_via82xx_probe()
2541 err = -EINVAL; in snd_via82xx_probe()
2545 if ((err = snd_via82xx_create(card, pci, chip_type, pci->revision, in snd_via82xx_probe()
2548 card->private_data = chip; in snd_via82xx_probe()
2560 // chip->dxs_fixed = 1; /* FIXME: use 48k for DXS #3? */ in snd_via82xx_probe()
2565 chip->dxs_fixed = 1; in snd_via82xx_probe()
2567 chip->no_vra = 1; in snd_via82xx_probe()
2569 chip->no_vra = 1; in snd_via82xx_probe()
2570 chip->dxs_src = 1; in snd_via82xx_probe()
2578 for (i = 0; i < chip->num_devs; i++) in snd_via82xx_probe()
2579 snd_via82xx_channel_reset(chip, &chip->devs[i]); in snd_via82xx_probe()
2581 snprintf(card->longname, sizeof(card->longname), in snd_via82xx_probe()
2582 "%s with %s at %#lx, irq %d", card->shortname, in snd_via82xx_probe()
2583 snd_ac97_get_short_name(chip->ac97), chip->port, chip->irq); in snd_via82xx_probe()