Lines Matching +full:0 +full:x33d00000
71 if ((snd_ymfpci_readw(chip, reg) & 0x8000) == 0) in snd_ymfpci_codec_ready()
72 return 0; in snd_ymfpci_codec_ready()
76 "codec_ready: codec %i is not ready [0x%x]\n", in snd_ymfpci_codec_ready()
86 snd_ymfpci_codec_ready(chip, 0); in snd_ymfpci_codec_write()
95 if (snd_ymfpci_codec_ready(chip, 0)) in snd_ymfpci_codec_read()
96 return ~0; in snd_ymfpci_codec_read()
98 if (snd_ymfpci_codec_ready(chip, 0)) in snd_ymfpci_codec_read()
99 return ~0; in snd_ymfpci_codec_read()
102 for (i = 0; i < 600; i++) in snd_ymfpci_codec_read()
115 case 8000: return 0x02aaab00; in snd_ymfpci_calc_delta()
116 case 11025: return 0x03accd00; in snd_ymfpci_calc_delta()
117 case 16000: return 0x05555500; in snd_ymfpci_calc_delta()
118 case 22050: return 0x07599a00; in snd_ymfpci_calc_delta()
119 case 32000: return 0x0aaaab00; in snd_ymfpci_calc_delta()
120 case 44100: return 0x0eb33300; in snd_ymfpci_calc_delta()
133 0x00570000, 0x06AA0000, 0x18B20000, 0x20930000, in snd_ymfpci_calc_lpfK()
134 0x2B9A0000, 0x35A10000, 0x3EAA0000, 0x40000000 in snd_ymfpci_calc_lpfK()
138 return 0x40000000; /* FIXME: What's the right value? */ in snd_ymfpci_calc_lpfK()
139 for (i = 0; i < 8; i++) in snd_ymfpci_calc_lpfK()
142 return val[0]; in snd_ymfpci_calc_lpfK()
149 0x35280000, 0x34A70000, 0x32020000, 0x31770000, in snd_ymfpci_calc_lpfQ()
150 0x31390000, 0x31C90000, 0x33D00000, 0x40000000 in snd_ymfpci_calc_lpfQ()
154 return 0x370A0000; in snd_ymfpci_calc_lpfQ()
155 for (i = 0; i < 8; i++) in snd_ymfpci_calc_lpfQ()
158 return val[0]; in snd_ymfpci_calc_lpfQ()
170 if (chip->start_count++ > 0) in snd_ymfpci_hw_start()
185 if (--chip->start_count > 0) in snd_ymfpci_hw_stop()
189 while (timeout-- > 0) { in snd_ymfpci_hw_stop()
190 if ((snd_ymfpci_readl(chip, YDSXGR_STATUS) & 2) == 0) in snd_ymfpci_hw_stop()
194 atomic_set(&chip->interrupt_sleep_count, 0); in snd_ymfpci_hw_stop()
213 for (idx = 0; idx < YDSXG_PLAYBACK_VOICES; idx += pair ? 2 : 1) { in voice_alloc()
238 return 0; in voice_alloc()
258 if (result == 0 || type != YMFPCI_PCM) in snd_ymfpci_voice_alloc()
277 pvoice->ypcm->use_441_slot = 0; in snd_ymfpci_voice_free()
279 pvoice->use = pvoice->pcm = pvoice->synth = pvoice->midi = 0; in snd_ymfpci_voice_free()
283 return 0; in snd_ymfpci_voice_free()
312 "done - active_bank = 0x%x, start = 0x%x\n", in snd_ymfpci_pcm_interrupt()
365 "done - active_bank = 0x%x, start = 0x%x\n", in snd_ymfpci_pcm_capture_interrupt()
383 int result = 0; in snd_ymfpci_playback_trigger()
386 if (ypcm->voices[0] == NULL) { in snd_ymfpci_playback_trigger()
394 chip->ctrl_playback[ypcm->voices[0]->number + 1] = cpu_to_le32(ypcm->voices[0]->bank_addr); in snd_ymfpci_playback_trigger()
402 kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_INACTIVE; in snd_ymfpci_playback_trigger()
407 chip->ctrl_playback[ypcm->voices[0]->number + 1] = 0; in snd_ymfpci_playback_trigger()
409 chip->ctrl_playback[ypcm->voices[1]->number + 1] = 0; in snd_ymfpci_playback_trigger()
410 ypcm->running = 0; in snd_ymfpci_playback_trigger()
427 int result = 0; in snd_ymfpci_capture_trigger()
444 ypcm->running = 0; in snd_ymfpci_capture_trigger()
462 if (voices == 1 && ypcm->voices[0] != NULL) in snd_ymfpci_pcm_voice_alloc()
463 return 0; /* already allocated */ in snd_ymfpci_pcm_voice_alloc()
464 if (voices == 2 && ypcm->voices[0] != NULL && ypcm->voices[1] != NULL) in snd_ymfpci_pcm_voice_alloc()
465 return 0; /* already allocated */ in snd_ymfpci_pcm_voice_alloc()
467 if (ypcm->voices[0] != NULL && ypcm->voices[1] == NULL) { in snd_ymfpci_pcm_voice_alloc()
468 snd_ymfpci_voice_free(ypcm->chip, ypcm->voices[0]); in snd_ymfpci_pcm_voice_alloc()
469 ypcm->voices[0] = NULL; in snd_ymfpci_pcm_voice_alloc()
472 err = snd_ymfpci_voice_alloc(ypcm->chip, YMFPCI_PCM, voices > 1, &ypcm->voices[0]); in snd_ymfpci_pcm_voice_alloc()
473 if (err < 0) in snd_ymfpci_pcm_voice_alloc()
475 ypcm->voices[0]->ypcm = ypcm; in snd_ymfpci_pcm_voice_alloc()
476 ypcm->voices[0]->interrupt = snd_ymfpci_pcm_interrupt; in snd_ymfpci_pcm_voice_alloc()
478 ypcm->voices[1] = &ypcm->chip->voices[ypcm->voices[0]->number + 1]; in snd_ymfpci_pcm_voice_alloc()
481 return 0; in snd_ymfpci_pcm_voice_alloc()
505 use_left = (voiceidx & 1) == 0; in snd_ymfpci_pcm_init_voice()
514 vol_left = cpu_to_le32(0x40000000); in snd_ymfpci_pcm_init_voice()
515 vol_right = cpu_to_le32(0x40000000); in snd_ymfpci_pcm_init_voice()
518 format = runtime->channels == 2 ? 0x00010000 : 0; in snd_ymfpci_pcm_init_voice()
520 format |= 0x80000000; in snd_ymfpci_pcm_init_voice()
523 voiceidx == 0 && (ypcm->chip->src441_used == -1 || in snd_ymfpci_pcm_init_voice()
527 format |= 0x10000000; in snd_ymfpci_pcm_init_voice()
530 (format & 0x10000000) == 0) { in snd_ymfpci_pcm_init_voice()
532 ypcm->use_441_slot = 0; in snd_ymfpci_pcm_init_voice()
534 if (runtime->channels == 2 && (voiceidx & 1) != 0) in snd_ymfpci_pcm_init_voice()
537 for (nbank = 0; nbank < 2; nbank++) { in snd_ymfpci_pcm_init_voice()
539 memset(bank, 0, sizeof(*bank)); in snd_ymfpci_pcm_init_voice()
549 bank->eg_gain_end = cpu_to_le32(0x40000000); in snd_ymfpci_pcm_init_voice()
592 4096, &chip->ac3_tmp_base) < 0) in snd_ymfpci_ac3_init()
595 chip->bank_effect[3][0]->base = in snd_ymfpci_ac3_init()
597 chip->bank_effect[3][0]->loop_end = in snd_ymfpci_ac3_init()
599 chip->bank_effect[4][0]->base = in snd_ymfpci_ac3_init()
601 chip->bank_effect[4][0]->loop_end = in snd_ymfpci_ac3_init()
608 return 0; in snd_ymfpci_ac3_init()
622 return 0; in snd_ymfpci_ac3_done()
633 if (err < 0) in snd_ymfpci_playback_hw_params()
635 return 0; in snd_ymfpci_playback_hw_params()
645 return 0; in snd_ymfpci_playback_hw_free()
654 if (ypcm->voices[0]) { in snd_ymfpci_playback_hw_free()
655 snd_ymfpci_voice_free(chip, ypcm->voices[0]); in snd_ymfpci_playback_hw_free()
656 ypcm->voices[0] = NULL; in snd_ymfpci_playback_hw_free()
658 return 0; in snd_ymfpci_playback_hw_free()
671 ypcm->period_pos = 0; in snd_ymfpci_playback_prepare()
672 ypcm->last_pos = 0; in snd_ymfpci_playback_prepare()
673 for (nvoice = 0; nvoice < runtime->channels; nvoice++) in snd_ymfpci_playback_prepare()
679 kctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE; in snd_ymfpci_playback_prepare()
682 return 0; in snd_ymfpci_playback_prepare()
691 return 0; in snd_ymfpci_capture_hw_free()
705 ypcm->period_pos = 0; in snd_ymfpci_capture_prepare()
706 ypcm->last_pos = 0; in snd_ymfpci_capture_prepare()
707 ypcm->shift = 0; in snd_ymfpci_capture_prepare()
709 format = 0; in snd_ymfpci_capture_prepare()
719 case 0: in snd_ymfpci_capture_prepare()
728 for (nbank = 0; nbank < 2; nbank++) { in snd_ymfpci_capture_prepare()
732 bank->start = 0; in snd_ymfpci_capture_prepare()
733 bank->num_of_loops = 0; in snd_ymfpci_capture_prepare()
735 return 0; in snd_ymfpci_capture_prepare()
743 struct snd_ymfpci_voice *voice = ypcm->voices[0]; in snd_ymfpci_playback_pointer()
746 return 0; in snd_ymfpci_playback_pointer()
757 return 0; in snd_ymfpci_capture_pointer()
766 while (loops-- > 0) { in snd_ymfpci_irq_wait()
767 if ((snd_ymfpci_readl(chip, YDSXGR_MODE) & 3) == 0) in snd_ymfpci_irq_wait()
784 if (status & 0x80000000) { in snd_ymfpci_interrupt()
787 for (nvoice = 0; nvoice < YDSXG_PLAYBACK_VOICES; nvoice++) { in snd_ymfpci_interrupt()
792 for (nvoice = 0; nvoice < YDSXG_CAPTURE_VOICES; nvoice++) { in snd_ymfpci_interrupt()
796 #if 0 in snd_ymfpci_interrupt()
797 for (nvoice = 0; nvoice < YDSXG_EFFECT_VOICES; nvoice++) { in snd_ymfpci_interrupt()
804 snd_ymfpci_writel(chip, YDSXGR_STATUS, 0x80000000); in snd_ymfpci_interrupt()
810 atomic_set(&chip->interrupt_sleep_count, 0); in snd_ymfpci_interrupt()
846 .fifo_size = 0,
868 .fifo_size = 0,
888 if (err < 0) in snd_ymfpci_playback_open_1()
891 if (err < 0) in snd_ymfpci_playback_open_1()
902 return 0; in snd_ymfpci_playback_open_1()
914 (snd_ymfpci_readw(chip, YDSXGR_SECCONFIG) & ~0x0330) | 0x0010); in ymfpci_open_extension()
926 (snd_ymfpci_readw(chip, YDSXGR_SECCONFIG) & ~0x0330) & ~0x0010); in ymfpci_close_extension()
938 if (err < 0) in snd_ymfpci_playback_open()
942 ypcm->output_rear = chip->mode_dup4ch ? 1 : 0; in snd_ymfpci_playback_open()
943 ypcm->swap_rear = 0; in snd_ymfpci_playback_open()
950 return 0; in snd_ymfpci_playback_open()
961 if (err < 0) in snd_ymfpci_playback_spdif_open()
964 ypcm->output_front = 0; in snd_ymfpci_playback_spdif_open()
976 chip->spdif_pcm_ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE; in snd_ymfpci_playback_spdif_open()
979 return 0; in snd_ymfpci_playback_spdif_open()
990 if (err < 0) in snd_ymfpci_playback_4ch_open()
993 ypcm->output_front = 0; in snd_ymfpci_playback_4ch_open()
995 ypcm->swap_rear = 0; in snd_ymfpci_playback_4ch_open()
1000 return 0; in snd_ymfpci_playback_4ch_open()
1016 if (err < 0) in snd_ymfpci_capture_open()
1019 if (err < 0) in snd_ymfpci_capture_open()
1033 return 0; in snd_ymfpci_capture_open()
1038 return snd_ymfpci_capture_open(substream, 0); in snd_ymfpci_capture_rec_open()
1048 return 0; in snd_ymfpci_playback_close_1()
1057 if (ypcm->output_rear && chip->rear_opened > 0) { in snd_ymfpci_playback_close()
1070 chip->spdif_opened = 0; in snd_ymfpci_playback_spdif_close()
1076 chip->spdif_pcm_ctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_INACTIVE; in snd_ymfpci_playback_spdif_close()
1087 if (chip->rear_opened > 0) { in snd_ymfpci_playback_4ch_close()
1105 return 0; in snd_ymfpci_capture_close()
1133 if (err < 0) in snd_ymfpci_pcm()
1141 pcm->info_flags = 0; in snd_ymfpci_pcm()
1149 snd_pcm_std_chmaps, 2, 0, NULL); in snd_ymfpci_pcm()
1166 err = snd_pcm_new(chip->card, "YMFPCI - PCM2", device, 0, 1, &pcm); in snd_ymfpci_pcm2()
1167 if (err < 0) in snd_ymfpci_pcm2()
1174 pcm->info_flags = 0; in snd_ymfpci_pcm2()
1182 return 0; in snd_ymfpci_pcm2()
1200 err = snd_pcm_new(chip->card, "YMFPCI - IEC958", device, 1, 0, &pcm); in snd_ymfpci_pcm_spdif()
1201 if (err < 0) in snd_ymfpci_pcm_spdif()
1208 pcm->info_flags = 0; in snd_ymfpci_pcm_spdif()
1215 return 0; in snd_ymfpci_pcm_spdif()
1241 err = snd_pcm_new(chip->card, "YMFPCI - Rear", device, 1, 0, &pcm); in snd_ymfpci_pcm_4ch()
1242 if (err < 0) in snd_ymfpci_pcm_4ch()
1249 pcm->info_flags = 0; in snd_ymfpci_pcm_4ch()
1257 surround_map, 2, 0, NULL); in snd_ymfpci_pcm_4ch()
1264 return 0; in snd_ymfpci_spdif_default_info()
1273 ucontrol->value.iec958.status[0] = (chip->spdif_bits >> 0) & 0xff; in snd_ymfpci_spdif_default_get()
1274 ucontrol->value.iec958.status[1] = (chip->spdif_bits >> 8) & 0xff; in snd_ymfpci_spdif_default_get()
1277 return 0; in snd_ymfpci_spdif_default_get()
1287 val = ((ucontrol->value.iec958.status[0] & 0x3e) << 0) | in snd_ymfpci_spdif_default_put()
1311 return 0; in snd_ymfpci_spdif_mask_info()
1320 ucontrol->value.iec958.status[0] = 0x3e; in snd_ymfpci_spdif_mask_get()
1321 ucontrol->value.iec958.status[1] = 0xff; in snd_ymfpci_spdif_mask_get()
1323 return 0; in snd_ymfpci_spdif_mask_get()
1339 return 0; in snd_ymfpci_spdif_stream_info()
1348 ucontrol->value.iec958.status[0] = (chip->spdif_pcm_bits >> 0) & 0xff; in snd_ymfpci_spdif_stream_get()
1349 ucontrol->value.iec958.status[1] = (chip->spdif_pcm_bits >> 8) & 0xff; in snd_ymfpci_spdif_stream_get()
1352 return 0; in snd_ymfpci_spdif_stream_get()
1362 val = ((ucontrol->value.iec958.status[0] & 0x3e) << 0) | in snd_ymfpci_spdif_stream_put()
1398 if (!(reg & 0x100)) in snd_ymfpci_drec_source_get()
1399 value->value.enumerated.item[0] = 0; in snd_ymfpci_drec_source_get()
1401 value->value.enumerated.item[0] = 1 + ((reg & 0x200) != 0); in snd_ymfpci_drec_source_get()
1402 return 0; in snd_ymfpci_drec_source_get()
1412 if (value->value.enumerated.item[0] == 0) in snd_ymfpci_drec_source_put()
1413 reg = old_reg & ~0x100; in snd_ymfpci_drec_source_put()
1415 reg = (old_reg & ~0x300) | 0x100 | ((value->value.enumerated.item[0] == 2) << 9); in snd_ymfpci_drec_source_put()
1446 int reg = kcontrol->private_value & 0xffff; in snd_ymfpci_get_single()
1447 unsigned int shift = (kcontrol->private_value >> 16) & 0xff; in snd_ymfpci_get_single()
1455 ucontrol->value.integer.value[0] = in snd_ymfpci_get_single()
1457 return 0; in snd_ymfpci_get_single()
1464 int reg = kcontrol->private_value & 0xffff; in snd_ymfpci_put_single()
1465 unsigned int shift = (kcontrol->private_value >> 16) & 0xff; in snd_ymfpci_put_single()
1475 val = (ucontrol->value.integer.value[0] & mask); in snd_ymfpci_put_single()
1486 static const DECLARE_TLV_DB_LINEAR(db_scale_native, TLV_DB_GAIN_MUTE, 0);
1500 if (reg < 0x80 || reg >= 0xc0) in snd_ymfpci_info_double()
1504 uinfo->value.integer.min = 0; in snd_ymfpci_info_double()
1506 return 0; in snd_ymfpci_info_double()
1513 unsigned int shift_left = 0, shift_right = 16, mask = 16383; in snd_ymfpci_get_double()
1516 if (reg < 0x80 || reg >= 0xc0) in snd_ymfpci_get_double()
1521 ucontrol->value.integer.value[0] = (val >> shift_left) & mask; in snd_ymfpci_get_double()
1523 return 0; in snd_ymfpci_get_double()
1530 unsigned int shift_left = 0, shift_right = 16, mask = 16383; in snd_ymfpci_put_double()
1534 if (reg < 0x80 || reg >= 0xc0) in snd_ymfpci_put_double()
1536 val1 = ucontrol->value.integer.value[0] & mask; in snd_ymfpci_put_double()
1558 value = ucontrol->value.integer.value[0] & 0x3fff; in snd_ymfpci_put_nativedacvol()
1559 value |= (ucontrol->value.integer.value[1] & 0x3fff) << 16; in snd_ymfpci_put_nativedacvol()
1577 ucontrol->value.integer.value[0] = chip->mode_dup4ch; in snd_ymfpci_get_dup4ch()
1578 return 0; in snd_ymfpci_get_dup4ch()
1585 change = (ucontrol->value.integer.value[0] != chip->mode_dup4ch); in snd_ymfpci_put_dup4ch()
1587 chip->mode_dup4ch = !!ucontrol->value.integer.value[0]; in snd_ymfpci_put_dup4ch()
1612 YMFPCI_DOUBLE("Wave Capture Volume", 0, YDSXGR_NATIVEDACLOOPVOL),
1613 YMFPCI_DOUBLE("Digital Capture Volume", 0, YDSXGR_NATIVEDACINVOL),
1615 YMFPCI_DOUBLE("ADC Playback Volume", 0, YDSXGR_PRIADCOUTVOL),
1616 YMFPCI_DOUBLE("ADC Capture Volume", 0, YDSXGR_PRIADCLOOPVOL),
1619 YMFPCI_DOUBLE("FM Legacy Playback Volume", 0, YDSXGR_LEGACYOUTVOL),
1620 YMFPCI_DOUBLE(SNDRV_CTL_NAME_IEC958("AC97 ", PLAYBACK,VOLUME), 0, YDSXGR_ZVOUTVOL),
1621 YMFPCI_DOUBLE(SNDRV_CTL_NAME_IEC958("", CAPTURE,VOLUME), 0, YDSXGR_ZVLOOPVOL),
1624 YMFPCI_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH), 0, YDSXGR_SPDIFOUTCTRL, 0),
1625 YMFPCI_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), 0, YDSXGR_SPDIFINCTRL, 0),
1626 YMFPCI_SINGLE(SNDRV_CTL_NAME_IEC958("Loop",NONE,NONE), 0, YDSXGR_SPDIFINCTRL, 4),
1668 return 0; in snd_ymfpci_set_gpio_out()
1677 ucontrol->value.integer.value[0] = snd_ymfpci_get_gpio_out(chip, pin); in snd_ymfpci_gpio_sw_get()
1678 return 0; in snd_ymfpci_gpio_sw_get()
1686 if (snd_ymfpci_get_gpio_out(chip, pin) != ucontrol->value.integer.value[0]) { in snd_ymfpci_gpio_sw_put()
1687 snd_ymfpci_set_gpio_out(chip, pin, !!ucontrol->value.integer.value[0]); in snd_ymfpci_gpio_sw_put()
1688 ucontrol->value.integer.value[0] = snd_ymfpci_get_gpio_out(chip, pin); in snd_ymfpci_gpio_sw_put()
1691 return 0; in snd_ymfpci_gpio_sw_put()
1712 uinfo->value.integer.min = 0; in snd_ymfpci_pcm_vol_info()
1713 uinfo->value.integer.max = 0x8000; in snd_ymfpci_pcm_vol_info()
1714 return 0; in snd_ymfpci_pcm_vol_info()
1723 ucontrol->value.integer.value[0] = chip->pcm_mixer[subs].left; in snd_ymfpci_pcm_vol_get()
1725 return 0; in snd_ymfpci_pcm_vol_get()
1736 if (ucontrol->value.integer.value[0] != chip->pcm_mixer[subs].left || in snd_ymfpci_pcm_vol_put()
1738 chip->pcm_mixer[subs].left = ucontrol->value.integer.value[0]; in snd_ymfpci_pcm_vol_put()
1740 if (chip->pcm_mixer[subs].left > 0x8000) in snd_ymfpci_pcm_vol_put()
1741 chip->pcm_mixer[subs].left = 0x8000; in snd_ymfpci_pcm_vol_put()
1742 if (chip->pcm_mixer[subs].right > 0x8000) in snd_ymfpci_pcm_vol_put()
1743 chip->pcm_mixer[subs].right = 0x8000; in snd_ymfpci_pcm_vol_put()
1755 return 0; in snd_ymfpci_pcm_vol_put()
1797 err = snd_ac97_bus(chip->card, 0, &ops, chip, &chip->ac97_bus); in snd_ymfpci_mixer()
1798 if (err < 0) in snd_ymfpci_mixer()
1803 memset(&ac97, 0, sizeof(ac97)); in snd_ymfpci_mixer()
1807 if (err < 0) in snd_ymfpci_mixer()
1812 AC97_EA_VRA|AC97_EA_VRM, 0); in snd_ymfpci_mixer()
1814 for (idx = 0; idx < ARRAY_SIZE(snd_ymfpci_controls); idx++) { in snd_ymfpci_mixer()
1816 if (err < 0) in snd_ymfpci_mixer()
1822 if (err < 0) in snd_ymfpci_mixer()
1831 if (err < 0) in snd_ymfpci_mixer()
1836 if (err < 0) in snd_ymfpci_mixer()
1841 if (err < 0) in snd_ymfpci_mixer()
1850 if (err < 0) in snd_ymfpci_mixer()
1859 if (err < 0) in snd_ymfpci_mixer()
1865 for (idx = 0; idx < 32; ++idx) { in snd_ymfpci_mixer()
1873 if (err < 0) in snd_ymfpci_mixer()
1875 chip->pcm_mixer[idx].left = 0x8000; in snd_ymfpci_mixer()
1876 chip->pcm_mixer[idx].right = 0x8000; in snd_ymfpci_mixer()
1881 return 0; in snd_ymfpci_mixer()
1909 snd_ymfpci_writeb(chip, YDSXGR_TIMERCTRL, 0x03); in snd_ymfpci_timer_start()
1911 return 0; in snd_ymfpci_timer_start()
1921 snd_ymfpci_writeb(chip, YDSXGR_TIMERCTRL, 0x00); in snd_ymfpci_timer_stop()
1923 return 0; in snd_ymfpci_timer_stop()
1931 return 0; in snd_ymfpci_timer_precise_resolution()
1937 .ticks = 0x10000,
1953 tid.subdevice = 0; in snd_ymfpci_timer()
1955 if (err >= 0) { in snd_ymfpci_timer()
1976 for (i = 0; i <= YDSXGR_WORKBASE; i += 4) in snd_ymfpci_proc_read()
1994 #if 0 // force to reset in snd_ymfpci_aclink_reset()
1995 if (cmd & 0x03) { in snd_ymfpci_aclink_reset()
1997 pci_write_config_byte(pci, PCIR_DSXG_CTRL, cmd & 0xfc); in snd_ymfpci_aclink_reset()
1998 pci_write_config_byte(pci, PCIR_DSXG_CTRL, cmd | 0x03); in snd_ymfpci_aclink_reset()
1999 pci_write_config_byte(pci, PCIR_DSXG_CTRL, cmd & 0xfc); in snd_ymfpci_aclink_reset()
2000 pci_write_config_word(pci, PCIR_DSXG_PWRCTRL1, 0); in snd_ymfpci_aclink_reset()
2001 pci_write_config_word(pci, PCIR_DSXG_PWRCTRL2, 0); in snd_ymfpci_aclink_reset()
2002 #if 0 in snd_ymfpci_aclink_reset()
2009 snd_ymfpci_writel(chip, YDSXGR_CONFIG, 0x00000001); in snd_ymfpci_enable_dsp()
2019 snd_ymfpci_writel(chip, YDSXGR_CONFIG, 0x00000000); in snd_ymfpci_disable_dsp()
2020 while (timeout-- > 0) { in snd_ymfpci_disable_dsp()
2022 if ((val & 0x00000002) == 0) in snd_ymfpci_disable_dsp()
2034 if (err >= 0) { in snd_ymfpci_request_firmware()
2041 if (err < 0) in snd_ymfpci_request_firmware()
2050 if (err >= 0) { in snd_ymfpci_request_firmware()
2057 if (err < 0) in snd_ymfpci_request_firmware()
2059 return 0; in snd_ymfpci_request_firmware()
2072 snd_ymfpci_writel(chip, YDSXGR_NATIVEDACOUTVOL, 0x00000000); in snd_ymfpci_download_image()
2074 snd_ymfpci_writel(chip, YDSXGR_MODE, 0x00010000); in snd_ymfpci_download_image()
2075 snd_ymfpci_writel(chip, YDSXGR_MODE, 0x00000000); in snd_ymfpci_download_image()
2076 snd_ymfpci_writel(chip, YDSXGR_MAPOFREC, 0x00000000); in snd_ymfpci_download_image()
2077 snd_ymfpci_writel(chip, YDSXGR_MAPOFEFFECT, 0x00000000); in snd_ymfpci_download_image()
2078 snd_ymfpci_writel(chip, YDSXGR_PLAYCTRLBASE, 0x00000000); in snd_ymfpci_download_image()
2079 snd_ymfpci_writel(chip, YDSXGR_RECCTRLBASE, 0x00000000); in snd_ymfpci_download_image()
2080 snd_ymfpci_writel(chip, YDSXGR_EFFCTRLBASE, 0x00000000); in snd_ymfpci_download_image()
2082 snd_ymfpci_writew(chip, YDSXGR_GLOBALCTRL, ctrl & ~0x0007); in snd_ymfpci_download_image()
2086 for (i = 0; i < YDSXG_DSPLENGTH / 4; i++) in snd_ymfpci_download_image()
2092 for (i = 0; i < YDSXG_CTRLLENGTH / 4; i++) in snd_ymfpci_download_image()
2112 size = ALIGN(playback_ctrl_size, 0x100) + in snd_ymfpci_memalloc()
2113 ALIGN(chip->bank_size_playback * 2 * YDSXG_PLAYBACK_VOICES, 0x100) + in snd_ymfpci_memalloc()
2114 ALIGN(chip->bank_size_capture * 2 * YDSXG_CAPTURE_VOICES, 0x100) + in snd_ymfpci_memalloc()
2115 ALIGN(chip->bank_size_effect * 2 * YDSXG_EFFECT_VOICES, 0x100) + in snd_ymfpci_memalloc()
2125 memset(ptr, 0, size); /* for sure */ in snd_ymfpci_memalloc()
2130 chip->ctrl_playback[0] = cpu_to_le32(YDSXG_PLAYBACK_VOICES); in snd_ymfpci_memalloc()
2131 ptr += ALIGN(playback_ctrl_size, 0x100); in snd_ymfpci_memalloc()
2132 ptr_addr += ALIGN(playback_ctrl_size, 0x100); in snd_ymfpci_memalloc()
2133 for (voice = 0; voice < YDSXG_PLAYBACK_VOICES; voice++) { in snd_ymfpci_memalloc()
2137 for (bank = 0; bank < 2; bank++) { in snd_ymfpci_memalloc()
2143 ptr = (char *)ALIGN((unsigned long)ptr, 0x100); in snd_ymfpci_memalloc()
2144 ptr_addr = ALIGN(ptr_addr, 0x100); in snd_ymfpci_memalloc()
2147 for (voice = 0; voice < YDSXG_CAPTURE_VOICES; voice++) in snd_ymfpci_memalloc()
2148 for (bank = 0; bank < 2; bank++) { in snd_ymfpci_memalloc()
2153 ptr = (char *)ALIGN((unsigned long)ptr, 0x100); in snd_ymfpci_memalloc()
2154 ptr_addr = ALIGN(ptr_addr, 0x100); in snd_ymfpci_memalloc()
2157 for (voice = 0; voice < YDSXG_EFFECT_VOICES; voice++) in snd_ymfpci_memalloc()
2158 for (bank = 0; bank < 2; bank++) { in snd_ymfpci_memalloc()
2163 ptr = (char *)ALIGN((unsigned long)ptr, 0x100); in snd_ymfpci_memalloc()
2164 ptr_addr = ALIGN(ptr_addr, 0x100); in snd_ymfpci_memalloc()
2178 chip->spdif_bits = chip->spdif_pcm_bits = SNDRV_PCM_DEFAULT_CON_SPDIF & 0xffff; in snd_ymfpci_memalloc()
2179 snd_ymfpci_writew(chip, YDSXGR_SPDIFOUTCTRL, 0); in snd_ymfpci_memalloc()
2183 snd_ymfpci_writew(chip, YDSXGR_SPDIFINCTRL, 0); in snd_ymfpci_memalloc()
2186 for (reg = 0x80; reg < 0xc0; reg += 4) in snd_ymfpci_memalloc()
2187 snd_ymfpci_writel(chip, reg, 0); in snd_ymfpci_memalloc()
2188 snd_ymfpci_writel(chip, YDSXGR_NATIVEDACOUTVOL, 0x3fff3fff); in snd_ymfpci_memalloc()
2189 snd_ymfpci_writel(chip, YDSXGR_BUF441OUTVOL, 0x3fff3fff); in snd_ymfpci_memalloc()
2190 snd_ymfpci_writel(chip, YDSXGR_ZVOUTVOL, 0x3fff3fff); in snd_ymfpci_memalloc()
2191 snd_ymfpci_writel(chip, YDSXGR_SPDIFOUTVOL, 0x3fff3fff); in snd_ymfpci_memalloc()
2192 snd_ymfpci_writel(chip, YDSXGR_NATIVEADCINVOL, 0x3fff3fff); in snd_ymfpci_memalloc()
2193 snd_ymfpci_writel(chip, YDSXGR_NATIVEDACINVOL, 0x3fff3fff); in snd_ymfpci_memalloc()
2194 snd_ymfpci_writel(chip, YDSXGR_PRIADCLOOPVOL, 0x3fff3fff); in snd_ymfpci_memalloc()
2195 snd_ymfpci_writel(chip, YDSXGR_LEGACYOUTVOL, 0x3fff3fff); in snd_ymfpci_memalloc()
2197 return 0; in snd_ymfpci_memalloc()
2205 snd_ymfpci_writel(chip, YDSXGR_NATIVEDACOUTVOL, 0); in snd_ymfpci_free()
2206 snd_ymfpci_writel(chip, YDSXGR_BUF441OUTVOL, 0); in snd_ymfpci_free()
2207 snd_ymfpci_writel(chip, YDSXGR_LEGACYOUTVOL, 0); in snd_ymfpci_free()
2208 snd_ymfpci_writel(chip, YDSXGR_STATUS, ~0); in snd_ymfpci_free()
2210 snd_ymfpci_writel(chip, YDSXGR_PLAYCTRLBASE, 0); in snd_ymfpci_free()
2211 snd_ymfpci_writel(chip, YDSXGR_RECCTRLBASE, 0); in snd_ymfpci_free()
2212 snd_ymfpci_writel(chip, YDSXGR_EFFCTRLBASE, 0); in snd_ymfpci_free()
2213 snd_ymfpci_writel(chip, YDSXGR_WORKBASE, 0); in snd_ymfpci_free()
2214 snd_ymfpci_writel(chip, YDSXGR_WORKSIZE, 0); in snd_ymfpci_free()
2216 snd_ymfpci_writew(chip, YDSXGR_GLOBALCTRL, ctrl & ~0x0007); in snd_ymfpci_free()
2222 pci_write_config_word(chip->pci, 0x40, chip->old_legacy_ctrl); in snd_ymfpci_free()
2266 for (i = 0; i < YDSXGR_NUM_SAVED_REGS; i++) in snd_ymfpci_suspend()
2273 snd_ymfpci_writel(chip, YDSXGR_NATIVEDACOUTVOL, 0); in snd_ymfpci_suspend()
2274 snd_ymfpci_writel(chip, YDSXGR_BUF441OUTVOL, 0); in snd_ymfpci_suspend()
2276 return 0; in snd_ymfpci_suspend()
2287 snd_ymfpci_codec_ready(chip, 0); in snd_ymfpci_resume()
2291 for (i = 0; i < YDSXGR_NUM_SAVED_REGS; i++) in snd_ymfpci_resume()
2302 if (chip->start_count > 0) { in snd_ymfpci_resume()
2309 return 0; in snd_ymfpci_resume()
2324 if (err < 0) in snd_ymfpci_create()
2331 atomic_set(&chip->interrupt_sleep_count, 0); in snd_ymfpci_create()
2339 if (err < 0) in snd_ymfpci_create()
2342 chip->reg_area_phys = pci_resource_start(pci, 0); in snd_ymfpci_create()
2343 chip->reg_area_virt = devm_ioremap(&pci->dev, chip->reg_area_phys, 0x8000); in snd_ymfpci_create()
2346 "unable to grab memory region 0x%lx-0x%lx\n", in snd_ymfpci_create()
2347 chip->reg_area_phys, chip->reg_area_phys + 0x8000 - 1); in snd_ymfpci_create()
2363 if (snd_ymfpci_codec_ready(chip, 0) < 0) in snd_ymfpci_create()
2367 if (err < 0) { in snd_ymfpci_create()
2375 if (snd_ymfpci_memalloc(chip) < 0) in snd_ymfpci_create()
2379 if (err < 0) in snd_ymfpci_create()
2391 return 0; in snd_ymfpci_create()