Lines Matching +full:0 +full:x33d00000
66 if ((snd_ymfpci_readw(chip, reg) & 0x8000) == 0) in snd_ymfpci_codec_ready()
67 return 0; in snd_ymfpci_codec_ready()
71 "codec_ready: codec %i is not ready [0x%x]\n", in snd_ymfpci_codec_ready()
81 snd_ymfpci_codec_ready(chip, 0); in snd_ymfpci_codec_write()
90 if (snd_ymfpci_codec_ready(chip, 0)) in snd_ymfpci_codec_read()
91 return ~0; in snd_ymfpci_codec_read()
93 if (snd_ymfpci_codec_ready(chip, 0)) in snd_ymfpci_codec_read()
94 return ~0; in snd_ymfpci_codec_read()
97 for (i = 0; i < 600; i++) in snd_ymfpci_codec_read()
110 case 8000: return 0x02aaab00; in snd_ymfpci_calc_delta()
111 case 11025: return 0x03accd00; in snd_ymfpci_calc_delta()
112 case 16000: return 0x05555500; in snd_ymfpci_calc_delta()
113 case 22050: return 0x07599a00; in snd_ymfpci_calc_delta()
114 case 32000: return 0x0aaaab00; in snd_ymfpci_calc_delta()
115 case 44100: return 0x0eb33300; in snd_ymfpci_calc_delta()
128 0x00570000, 0x06AA0000, 0x18B20000, 0x20930000, in snd_ymfpci_calc_lpfK()
129 0x2B9A0000, 0x35A10000, 0x3EAA0000, 0x40000000 in snd_ymfpci_calc_lpfK()
133 return 0x40000000; /* FIXME: What's the right value? */ in snd_ymfpci_calc_lpfK()
134 for (i = 0; i < 8; i++) in snd_ymfpci_calc_lpfK()
137 return val[0]; in snd_ymfpci_calc_lpfK()
144 0x35280000, 0x34A70000, 0x32020000, 0x31770000, in snd_ymfpci_calc_lpfQ()
145 0x31390000, 0x31C90000, 0x33D00000, 0x40000000 in snd_ymfpci_calc_lpfQ()
149 return 0x370A0000; in snd_ymfpci_calc_lpfQ()
150 for (i = 0; i < 8; i++) in snd_ymfpci_calc_lpfQ()
153 return val[0]; in snd_ymfpci_calc_lpfQ()
165 if (chip->start_count++ > 0) in snd_ymfpci_hw_start()
180 if (--chip->start_count > 0) in snd_ymfpci_hw_stop()
184 while (timeout-- > 0) { in snd_ymfpci_hw_stop()
185 if ((snd_ymfpci_readl(chip, YDSXGR_STATUS) & 2) == 0) in snd_ymfpci_hw_stop()
189 atomic_set(&chip->interrupt_sleep_count, 0); in snd_ymfpci_hw_stop()
208 for (idx = 0; idx < YDSXG_PLAYBACK_VOICES; idx += pair ? 2 : 1) { in voice_alloc()
233 return 0; in voice_alloc()
253 if (result == 0 || type != YMFPCI_PCM) in snd_ymfpci_voice_alloc()
272 pvoice->ypcm->use_441_slot = 0; in snd_ymfpci_voice_free()
274 pvoice->use = pvoice->pcm = pvoice->synth = pvoice->midi = 0; in snd_ymfpci_voice_free()
278 return 0; in snd_ymfpci_voice_free()
307 "done - active_bank = 0x%x, start = 0x%x\n", in snd_ymfpci_pcm_interrupt()
360 "done - active_bank = 0x%x, start = 0x%x\n", in snd_ymfpci_pcm_capture_interrupt()
378 int result = 0; in snd_ymfpci_playback_trigger()
381 if (ypcm->voices[0] == NULL) { in snd_ymfpci_playback_trigger()
389 chip->ctrl_playback[ypcm->voices[0]->number + 1] = cpu_to_le32(ypcm->voices[0]->bank_addr); in snd_ymfpci_playback_trigger()
397 kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_INACTIVE; in snd_ymfpci_playback_trigger()
402 chip->ctrl_playback[ypcm->voices[0]->number + 1] = 0; in snd_ymfpci_playback_trigger()
404 chip->ctrl_playback[ypcm->voices[1]->number + 1] = 0; in snd_ymfpci_playback_trigger()
405 ypcm->running = 0; in snd_ymfpci_playback_trigger()
422 int result = 0; in snd_ymfpci_capture_trigger()
439 ypcm->running = 0; in snd_ymfpci_capture_trigger()
457 if (voices == 1 && ypcm->voices[0] != NULL) in snd_ymfpci_pcm_voice_alloc()
458 return 0; /* already allocated */ in snd_ymfpci_pcm_voice_alloc()
459 if (voices == 2 && ypcm->voices[0] != NULL && ypcm->voices[1] != NULL) in snd_ymfpci_pcm_voice_alloc()
460 return 0; /* already allocated */ in snd_ymfpci_pcm_voice_alloc()
462 if (ypcm->voices[0] != NULL && ypcm->voices[1] == NULL) { in snd_ymfpci_pcm_voice_alloc()
463 snd_ymfpci_voice_free(ypcm->chip, ypcm->voices[0]); in snd_ymfpci_pcm_voice_alloc()
464 ypcm->voices[0] = NULL; in snd_ymfpci_pcm_voice_alloc()
467 err = snd_ymfpci_voice_alloc(ypcm->chip, YMFPCI_PCM, voices > 1, &ypcm->voices[0]); in snd_ymfpci_pcm_voice_alloc()
468 if (err < 0) in snd_ymfpci_pcm_voice_alloc()
470 ypcm->voices[0]->ypcm = ypcm; in snd_ymfpci_pcm_voice_alloc()
471 ypcm->voices[0]->interrupt = snd_ymfpci_pcm_interrupt; in snd_ymfpci_pcm_voice_alloc()
473 ypcm->voices[1] = &ypcm->chip->voices[ypcm->voices[0]->number + 1]; in snd_ymfpci_pcm_voice_alloc()
476 return 0; in snd_ymfpci_pcm_voice_alloc()
500 use_left = (voiceidx & 1) == 0; in snd_ymfpci_pcm_init_voice()
509 vol_left = cpu_to_le32(0x40000000); in snd_ymfpci_pcm_init_voice()
510 vol_right = cpu_to_le32(0x40000000); in snd_ymfpci_pcm_init_voice()
513 format = runtime->channels == 2 ? 0x00010000 : 0; in snd_ymfpci_pcm_init_voice()
515 format |= 0x80000000; in snd_ymfpci_pcm_init_voice()
518 voiceidx == 0 && (ypcm->chip->src441_used == -1 || in snd_ymfpci_pcm_init_voice()
522 format |= 0x10000000; in snd_ymfpci_pcm_init_voice()
525 (format & 0x10000000) == 0) { in snd_ymfpci_pcm_init_voice()
527 ypcm->use_441_slot = 0; in snd_ymfpci_pcm_init_voice()
529 if (runtime->channels == 2 && (voiceidx & 1) != 0) in snd_ymfpci_pcm_init_voice()
532 for (nbank = 0; nbank < 2; nbank++) { in snd_ymfpci_pcm_init_voice()
534 memset(bank, 0, sizeof(*bank)); in snd_ymfpci_pcm_init_voice()
544 bank->eg_gain_end = cpu_to_le32(0x40000000); in snd_ymfpci_pcm_init_voice()
587 4096, &chip->ac3_tmp_base) < 0) in snd_ymfpci_ac3_init()
590 chip->bank_effect[3][0]->base = in snd_ymfpci_ac3_init()
592 chip->bank_effect[3][0]->loop_end = in snd_ymfpci_ac3_init()
594 chip->bank_effect[4][0]->base = in snd_ymfpci_ac3_init()
596 chip->bank_effect[4][0]->loop_end = in snd_ymfpci_ac3_init()
603 return 0; in snd_ymfpci_ac3_init()
617 return 0; in snd_ymfpci_ac3_done()
628 if (err < 0) in snd_ymfpci_playback_hw_params()
630 return 0; in snd_ymfpci_playback_hw_params()
640 return 0; in snd_ymfpci_playback_hw_free()
649 if (ypcm->voices[0]) { in snd_ymfpci_playback_hw_free()
650 snd_ymfpci_voice_free(chip, ypcm->voices[0]); in snd_ymfpci_playback_hw_free()
651 ypcm->voices[0] = NULL; in snd_ymfpci_playback_hw_free()
653 return 0; in snd_ymfpci_playback_hw_free()
666 ypcm->period_pos = 0; in snd_ymfpci_playback_prepare()
667 ypcm->last_pos = 0; in snd_ymfpci_playback_prepare()
668 for (nvoice = 0; nvoice < runtime->channels; nvoice++) in snd_ymfpci_playback_prepare()
674 kctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE; in snd_ymfpci_playback_prepare()
677 return 0; in snd_ymfpci_playback_prepare()
686 return 0; in snd_ymfpci_capture_hw_free()
700 ypcm->period_pos = 0; in snd_ymfpci_capture_prepare()
701 ypcm->last_pos = 0; in snd_ymfpci_capture_prepare()
702 ypcm->shift = 0; in snd_ymfpci_capture_prepare()
704 format = 0; in snd_ymfpci_capture_prepare()
714 case 0: in snd_ymfpci_capture_prepare()
723 for (nbank = 0; nbank < 2; nbank++) { in snd_ymfpci_capture_prepare()
727 bank->start = 0; in snd_ymfpci_capture_prepare()
728 bank->num_of_loops = 0; in snd_ymfpci_capture_prepare()
730 return 0; in snd_ymfpci_capture_prepare()
738 struct snd_ymfpci_voice *voice = ypcm->voices[0]; in snd_ymfpci_playback_pointer()
741 return 0; in snd_ymfpci_playback_pointer()
752 return 0; in snd_ymfpci_capture_pointer()
761 while (loops-- > 0) { in snd_ymfpci_irq_wait()
762 if ((snd_ymfpci_readl(chip, YDSXGR_MODE) & 3) == 0) in snd_ymfpci_irq_wait()
779 if (status & 0x80000000) { in snd_ymfpci_interrupt()
782 for (nvoice = 0; nvoice < YDSXG_PLAYBACK_VOICES; nvoice++) { in snd_ymfpci_interrupt()
787 for (nvoice = 0; nvoice < YDSXG_CAPTURE_VOICES; nvoice++) { in snd_ymfpci_interrupt()
791 #if 0 in snd_ymfpci_interrupt()
792 for (nvoice = 0; nvoice < YDSXG_EFFECT_VOICES; nvoice++) { in snd_ymfpci_interrupt()
799 snd_ymfpci_writel(chip, YDSXGR_STATUS, 0x80000000); in snd_ymfpci_interrupt()
805 atomic_set(&chip->interrupt_sleep_count, 0); in snd_ymfpci_interrupt()
841 .fifo_size = 0,
863 .fifo_size = 0,
883 if (err < 0) in snd_ymfpci_playback_open_1()
886 if (err < 0) in snd_ymfpci_playback_open_1()
897 return 0; in snd_ymfpci_playback_open_1()
909 (snd_ymfpci_readw(chip, YDSXGR_SECCONFIG) & ~0x0330) | 0x0010); in ymfpci_open_extension()
921 (snd_ymfpci_readw(chip, YDSXGR_SECCONFIG) & ~0x0330) & ~0x0010); in ymfpci_close_extension()
933 if (err < 0) in snd_ymfpci_playback_open()
937 ypcm->output_rear = chip->mode_dup4ch ? 1 : 0; in snd_ymfpci_playback_open()
938 ypcm->swap_rear = 0; in snd_ymfpci_playback_open()
945 return 0; in snd_ymfpci_playback_open()
956 if (err < 0) in snd_ymfpci_playback_spdif_open()
959 ypcm->output_front = 0; in snd_ymfpci_playback_spdif_open()
971 chip->spdif_pcm_ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE; in snd_ymfpci_playback_spdif_open()
974 return 0; in snd_ymfpci_playback_spdif_open()
985 if (err < 0) in snd_ymfpci_playback_4ch_open()
988 ypcm->output_front = 0; in snd_ymfpci_playback_4ch_open()
990 ypcm->swap_rear = 0; in snd_ymfpci_playback_4ch_open()
995 return 0; in snd_ymfpci_playback_4ch_open()
1011 if (err < 0) in snd_ymfpci_capture_open()
1014 if (err < 0) in snd_ymfpci_capture_open()
1028 return 0; in snd_ymfpci_capture_open()
1033 return snd_ymfpci_capture_open(substream, 0); in snd_ymfpci_capture_rec_open()
1043 return 0; in snd_ymfpci_playback_close_1()
1052 if (ypcm->output_rear && chip->rear_opened > 0) { in snd_ymfpci_playback_close()
1065 chip->spdif_opened = 0; in snd_ymfpci_playback_spdif_close()
1071 chip->spdif_pcm_ctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_INACTIVE; in snd_ymfpci_playback_spdif_close()
1082 if (chip->rear_opened > 0) { in snd_ymfpci_playback_4ch_close()
1100 return 0; in snd_ymfpci_capture_close()
1128 if (err < 0) in snd_ymfpci_pcm()
1136 pcm->info_flags = 0; in snd_ymfpci_pcm()
1144 snd_pcm_std_chmaps, 2, 0, NULL); in snd_ymfpci_pcm()
1161 err = snd_pcm_new(chip->card, "YMFPCI - PCM2", device, 0, 1, &pcm); in snd_ymfpci_pcm2()
1162 if (err < 0) in snd_ymfpci_pcm2()
1169 pcm->info_flags = 0; in snd_ymfpci_pcm2()
1177 return 0; in snd_ymfpci_pcm2()
1195 err = snd_pcm_new(chip->card, "YMFPCI - IEC958", device, 1, 0, &pcm); in snd_ymfpci_pcm_spdif()
1196 if (err < 0) in snd_ymfpci_pcm_spdif()
1203 pcm->info_flags = 0; in snd_ymfpci_pcm_spdif()
1210 return 0; in snd_ymfpci_pcm_spdif()
1236 err = snd_pcm_new(chip->card, "YMFPCI - Rear", device, 1, 0, &pcm); in snd_ymfpci_pcm_4ch()
1237 if (err < 0) in snd_ymfpci_pcm_4ch()
1244 pcm->info_flags = 0; in snd_ymfpci_pcm_4ch()
1252 surround_map, 2, 0, NULL); in snd_ymfpci_pcm_4ch()
1259 return 0; in snd_ymfpci_spdif_default_info()
1268 ucontrol->value.iec958.status[0] = (chip->spdif_bits >> 0) & 0xff; in snd_ymfpci_spdif_default_get()
1269 ucontrol->value.iec958.status[1] = (chip->spdif_bits >> 8) & 0xff; in snd_ymfpci_spdif_default_get()
1272 return 0; in snd_ymfpci_spdif_default_get()
1282 val = ((ucontrol->value.iec958.status[0] & 0x3e) << 0) | in snd_ymfpci_spdif_default_put()
1306 return 0; in snd_ymfpci_spdif_mask_info()
1315 ucontrol->value.iec958.status[0] = 0x3e; in snd_ymfpci_spdif_mask_get()
1316 ucontrol->value.iec958.status[1] = 0xff; in snd_ymfpci_spdif_mask_get()
1318 return 0; in snd_ymfpci_spdif_mask_get()
1334 return 0; in snd_ymfpci_spdif_stream_info()
1343 ucontrol->value.iec958.status[0] = (chip->spdif_pcm_bits >> 0) & 0xff; in snd_ymfpci_spdif_stream_get()
1344 ucontrol->value.iec958.status[1] = (chip->spdif_pcm_bits >> 8) & 0xff; in snd_ymfpci_spdif_stream_get()
1347 return 0; in snd_ymfpci_spdif_stream_get()
1357 val = ((ucontrol->value.iec958.status[0] & 0x3e) << 0) | in snd_ymfpci_spdif_stream_put()
1393 if (!(reg & 0x100)) in snd_ymfpci_drec_source_get()
1394 value->value.enumerated.item[0] = 0; in snd_ymfpci_drec_source_get()
1396 value->value.enumerated.item[0] = 1 + ((reg & 0x200) != 0); in snd_ymfpci_drec_source_get()
1397 return 0; in snd_ymfpci_drec_source_get()
1407 if (value->value.enumerated.item[0] == 0) in snd_ymfpci_drec_source_put()
1408 reg = old_reg & ~0x100; in snd_ymfpci_drec_source_put()
1410 reg = (old_reg & ~0x300) | 0x100 | ((value->value.enumerated.item[0] == 2) << 9); in snd_ymfpci_drec_source_put()
1441 int reg = kcontrol->private_value & 0xffff; in snd_ymfpci_get_single()
1442 unsigned int shift = (kcontrol->private_value >> 16) & 0xff; in snd_ymfpci_get_single()
1450 ucontrol->value.integer.value[0] = in snd_ymfpci_get_single()
1452 return 0; in snd_ymfpci_get_single()
1459 int reg = kcontrol->private_value & 0xffff; in snd_ymfpci_put_single()
1460 unsigned int shift = (kcontrol->private_value >> 16) & 0xff; in snd_ymfpci_put_single()
1470 val = (ucontrol->value.integer.value[0] & mask); in snd_ymfpci_put_single()
1481 static const DECLARE_TLV_DB_LINEAR(db_scale_native, TLV_DB_GAIN_MUTE, 0);
1495 if (reg < 0x80 || reg >= 0xc0) in snd_ymfpci_info_double()
1499 uinfo->value.integer.min = 0; in snd_ymfpci_info_double()
1501 return 0; in snd_ymfpci_info_double()
1508 unsigned int shift_left = 0, shift_right = 16, mask = 16383; in snd_ymfpci_get_double()
1511 if (reg < 0x80 || reg >= 0xc0) in snd_ymfpci_get_double()
1516 ucontrol->value.integer.value[0] = (val >> shift_left) & mask; in snd_ymfpci_get_double()
1518 return 0; in snd_ymfpci_get_double()
1525 unsigned int shift_left = 0, shift_right = 16, mask = 16383; in snd_ymfpci_put_double()
1529 if (reg < 0x80 || reg >= 0xc0) in snd_ymfpci_put_double()
1531 val1 = ucontrol->value.integer.value[0] & mask; in snd_ymfpci_put_double()
1553 value = ucontrol->value.integer.value[0] & 0x3fff; in snd_ymfpci_put_nativedacvol()
1554 value |= (ucontrol->value.integer.value[1] & 0x3fff) << 16; in snd_ymfpci_put_nativedacvol()
1572 ucontrol->value.integer.value[0] = chip->mode_dup4ch; in snd_ymfpci_get_dup4ch()
1573 return 0; in snd_ymfpci_get_dup4ch()
1580 change = (ucontrol->value.integer.value[0] != chip->mode_dup4ch); in snd_ymfpci_put_dup4ch()
1582 chip->mode_dup4ch = !!ucontrol->value.integer.value[0]; in snd_ymfpci_put_dup4ch()
1607 YMFPCI_DOUBLE("Wave Capture Volume", 0, YDSXGR_NATIVEDACLOOPVOL),
1608 YMFPCI_DOUBLE("Digital Capture Volume", 0, YDSXGR_NATIVEDACINVOL),
1610 YMFPCI_DOUBLE("ADC Playback Volume", 0, YDSXGR_PRIADCOUTVOL),
1611 YMFPCI_DOUBLE("ADC Capture Volume", 0, YDSXGR_PRIADCLOOPVOL),
1614 YMFPCI_DOUBLE("FM Legacy Playback Volume", 0, YDSXGR_LEGACYOUTVOL),
1615 YMFPCI_DOUBLE(SNDRV_CTL_NAME_IEC958("AC97 ", PLAYBACK,VOLUME), 0, YDSXGR_ZVOUTVOL),
1616 YMFPCI_DOUBLE(SNDRV_CTL_NAME_IEC958("", CAPTURE,VOLUME), 0, YDSXGR_ZVLOOPVOL),
1619 YMFPCI_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH), 0, YDSXGR_SPDIFOUTCTRL, 0),
1620 YMFPCI_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), 0, YDSXGR_SPDIFINCTRL, 0),
1621 YMFPCI_SINGLE(SNDRV_CTL_NAME_IEC958("Loop",NONE,NONE), 0, YDSXGR_SPDIFINCTRL, 4),
1663 return 0; in snd_ymfpci_set_gpio_out()
1672 ucontrol->value.integer.value[0] = snd_ymfpci_get_gpio_out(chip, pin); in snd_ymfpci_gpio_sw_get()
1673 return 0; in snd_ymfpci_gpio_sw_get()
1681 if (snd_ymfpci_get_gpio_out(chip, pin) != ucontrol->value.integer.value[0]) { in snd_ymfpci_gpio_sw_put()
1682 snd_ymfpci_set_gpio_out(chip, pin, !!ucontrol->value.integer.value[0]); in snd_ymfpci_gpio_sw_put()
1683 ucontrol->value.integer.value[0] = snd_ymfpci_get_gpio_out(chip, pin); in snd_ymfpci_gpio_sw_put()
1686 return 0; in snd_ymfpci_gpio_sw_put()
1707 uinfo->value.integer.min = 0; in snd_ymfpci_pcm_vol_info()
1708 uinfo->value.integer.max = 0x8000; in snd_ymfpci_pcm_vol_info()
1709 return 0; in snd_ymfpci_pcm_vol_info()
1718 ucontrol->value.integer.value[0] = chip->pcm_mixer[subs].left; in snd_ymfpci_pcm_vol_get()
1720 return 0; in snd_ymfpci_pcm_vol_get()
1731 if (ucontrol->value.integer.value[0] != chip->pcm_mixer[subs].left || in snd_ymfpci_pcm_vol_put()
1733 chip->pcm_mixer[subs].left = ucontrol->value.integer.value[0]; in snd_ymfpci_pcm_vol_put()
1735 if (chip->pcm_mixer[subs].left > 0x8000) in snd_ymfpci_pcm_vol_put()
1736 chip->pcm_mixer[subs].left = 0x8000; in snd_ymfpci_pcm_vol_put()
1737 if (chip->pcm_mixer[subs].right > 0x8000) in snd_ymfpci_pcm_vol_put()
1738 chip->pcm_mixer[subs].right = 0x8000; in snd_ymfpci_pcm_vol_put()
1750 return 0; in snd_ymfpci_pcm_vol_put()
1792 err = snd_ac97_bus(chip->card, 0, &ops, chip, &chip->ac97_bus); in snd_ymfpci_mixer()
1793 if (err < 0) in snd_ymfpci_mixer()
1798 memset(&ac97, 0, sizeof(ac97)); in snd_ymfpci_mixer()
1802 if (err < 0) in snd_ymfpci_mixer()
1807 AC97_EA_VRA|AC97_EA_VRM, 0); in snd_ymfpci_mixer()
1809 for (idx = 0; idx < ARRAY_SIZE(snd_ymfpci_controls); idx++) { in snd_ymfpci_mixer()
1811 if (err < 0) in snd_ymfpci_mixer()
1817 if (err < 0) in snd_ymfpci_mixer()
1827 if (err < 0) in snd_ymfpci_mixer()
1832 if (err < 0) in snd_ymfpci_mixer()
1837 if (err < 0) in snd_ymfpci_mixer()
1845 if (err < 0) in snd_ymfpci_mixer()
1854 if (err < 0) in snd_ymfpci_mixer()
1860 for (idx = 0; idx < 32; ++idx) { in snd_ymfpci_mixer()
1868 if (err < 0) in snd_ymfpci_mixer()
1870 chip->pcm_mixer[idx].left = 0x8000; in snd_ymfpci_mixer()
1871 chip->pcm_mixer[idx].right = 0x8000; in snd_ymfpci_mixer()
1876 return 0; in snd_ymfpci_mixer()
1904 snd_ymfpci_writeb(chip, YDSXGR_TIMERCTRL, 0x03); in snd_ymfpci_timer_start()
1906 return 0; in snd_ymfpci_timer_start()
1916 snd_ymfpci_writeb(chip, YDSXGR_TIMERCTRL, 0x00); in snd_ymfpci_timer_stop()
1918 return 0; in snd_ymfpci_timer_stop()
1926 return 0; in snd_ymfpci_timer_precise_resolution()
1932 .ticks = 0x10000,
1948 tid.subdevice = 0; in snd_ymfpci_timer()
1950 if (err >= 0) { in snd_ymfpci_timer()
1971 for (i = 0; i <= YDSXGR_WORKBASE; i += 4) in snd_ymfpci_proc_read()
1989 #if 0 // force to reset in snd_ymfpci_aclink_reset()
1990 if (cmd & 0x03) { in snd_ymfpci_aclink_reset()
1992 pci_write_config_byte(pci, PCIR_DSXG_CTRL, cmd & 0xfc); in snd_ymfpci_aclink_reset()
1993 pci_write_config_byte(pci, PCIR_DSXG_CTRL, cmd | 0x03); in snd_ymfpci_aclink_reset()
1994 pci_write_config_byte(pci, PCIR_DSXG_CTRL, cmd & 0xfc); in snd_ymfpci_aclink_reset()
1995 pci_write_config_word(pci, PCIR_DSXG_PWRCTRL1, 0); in snd_ymfpci_aclink_reset()
1996 pci_write_config_word(pci, PCIR_DSXG_PWRCTRL2, 0); in snd_ymfpci_aclink_reset()
1997 #if 0 in snd_ymfpci_aclink_reset()
2004 snd_ymfpci_writel(chip, YDSXGR_CONFIG, 0x00000001); in snd_ymfpci_enable_dsp()
2014 snd_ymfpci_writel(chip, YDSXGR_CONFIG, 0x00000000); in snd_ymfpci_disable_dsp()
2015 while (timeout-- > 0) { in snd_ymfpci_disable_dsp()
2017 if ((val & 0x00000002) == 0) in snd_ymfpci_disable_dsp()
2029 if (err >= 0) { in snd_ymfpci_request_firmware()
2036 if (err < 0) in snd_ymfpci_request_firmware()
2045 if (err >= 0) { in snd_ymfpci_request_firmware()
2052 if (err < 0) in snd_ymfpci_request_firmware()
2054 return 0; in snd_ymfpci_request_firmware()
2067 snd_ymfpci_writel(chip, YDSXGR_NATIVEDACOUTVOL, 0x00000000); in snd_ymfpci_download_image()
2069 snd_ymfpci_writel(chip, YDSXGR_MODE, 0x00010000); in snd_ymfpci_download_image()
2070 snd_ymfpci_writel(chip, YDSXGR_MODE, 0x00000000); in snd_ymfpci_download_image()
2071 snd_ymfpci_writel(chip, YDSXGR_MAPOFREC, 0x00000000); in snd_ymfpci_download_image()
2072 snd_ymfpci_writel(chip, YDSXGR_MAPOFEFFECT, 0x00000000); in snd_ymfpci_download_image()
2073 snd_ymfpci_writel(chip, YDSXGR_PLAYCTRLBASE, 0x00000000); in snd_ymfpci_download_image()
2074 snd_ymfpci_writel(chip, YDSXGR_RECCTRLBASE, 0x00000000); in snd_ymfpci_download_image()
2075 snd_ymfpci_writel(chip, YDSXGR_EFFCTRLBASE, 0x00000000); in snd_ymfpci_download_image()
2077 snd_ymfpci_writew(chip, YDSXGR_GLOBALCTRL, ctrl & ~0x0007); in snd_ymfpci_download_image()
2081 for (i = 0; i < YDSXG_DSPLENGTH / 4; i++) in snd_ymfpci_download_image()
2087 for (i = 0; i < YDSXG_CTRLLENGTH / 4; i++) in snd_ymfpci_download_image()
2107 size = ALIGN(playback_ctrl_size, 0x100) + in snd_ymfpci_memalloc()
2108 ALIGN(chip->bank_size_playback * 2 * YDSXG_PLAYBACK_VOICES, 0x100) + in snd_ymfpci_memalloc()
2109 ALIGN(chip->bank_size_capture * 2 * YDSXG_CAPTURE_VOICES, 0x100) + in snd_ymfpci_memalloc()
2110 ALIGN(chip->bank_size_effect * 2 * YDSXG_EFFECT_VOICES, 0x100) + in snd_ymfpci_memalloc()
2120 memset(ptr, 0, size); /* for sure */ in snd_ymfpci_memalloc()
2125 chip->ctrl_playback[0] = cpu_to_le32(YDSXG_PLAYBACK_VOICES); in snd_ymfpci_memalloc()
2126 ptr += ALIGN(playback_ctrl_size, 0x100); in snd_ymfpci_memalloc()
2127 ptr_addr += ALIGN(playback_ctrl_size, 0x100); in snd_ymfpci_memalloc()
2128 for (voice = 0; voice < YDSXG_PLAYBACK_VOICES; voice++) { in snd_ymfpci_memalloc()
2132 for (bank = 0; bank < 2; bank++) { in snd_ymfpci_memalloc()
2138 ptr = (char *)ALIGN((unsigned long)ptr, 0x100); in snd_ymfpci_memalloc()
2139 ptr_addr = ALIGN(ptr_addr, 0x100); in snd_ymfpci_memalloc()
2142 for (voice = 0; voice < YDSXG_CAPTURE_VOICES; voice++) in snd_ymfpci_memalloc()
2143 for (bank = 0; bank < 2; bank++) { in snd_ymfpci_memalloc()
2148 ptr = (char *)ALIGN((unsigned long)ptr, 0x100); in snd_ymfpci_memalloc()
2149 ptr_addr = ALIGN(ptr_addr, 0x100); in snd_ymfpci_memalloc()
2152 for (voice = 0; voice < YDSXG_EFFECT_VOICES; voice++) in snd_ymfpci_memalloc()
2153 for (bank = 0; bank < 2; bank++) { in snd_ymfpci_memalloc()
2158 ptr = (char *)ALIGN((unsigned long)ptr, 0x100); in snd_ymfpci_memalloc()
2159 ptr_addr = ALIGN(ptr_addr, 0x100); in snd_ymfpci_memalloc()
2173 chip->spdif_bits = chip->spdif_pcm_bits = SNDRV_PCM_DEFAULT_CON_SPDIF & 0xffff; in snd_ymfpci_memalloc()
2174 snd_ymfpci_writew(chip, YDSXGR_SPDIFOUTCTRL, 0); in snd_ymfpci_memalloc()
2178 snd_ymfpci_writew(chip, YDSXGR_SPDIFINCTRL, 0); in snd_ymfpci_memalloc()
2181 for (reg = 0x80; reg < 0xc0; reg += 4) in snd_ymfpci_memalloc()
2182 snd_ymfpci_writel(chip, reg, 0); in snd_ymfpci_memalloc()
2183 snd_ymfpci_writel(chip, YDSXGR_NATIVEDACOUTVOL, 0x3fff3fff); in snd_ymfpci_memalloc()
2184 snd_ymfpci_writel(chip, YDSXGR_BUF441OUTVOL, 0x3fff3fff); in snd_ymfpci_memalloc()
2185 snd_ymfpci_writel(chip, YDSXGR_ZVOUTVOL, 0x3fff3fff); in snd_ymfpci_memalloc()
2186 snd_ymfpci_writel(chip, YDSXGR_SPDIFOUTVOL, 0x3fff3fff); in snd_ymfpci_memalloc()
2187 snd_ymfpci_writel(chip, YDSXGR_NATIVEADCINVOL, 0x3fff3fff); in snd_ymfpci_memalloc()
2188 snd_ymfpci_writel(chip, YDSXGR_NATIVEDACINVOL, 0x3fff3fff); in snd_ymfpci_memalloc()
2189 snd_ymfpci_writel(chip, YDSXGR_PRIADCLOOPVOL, 0x3fff3fff); in snd_ymfpci_memalloc()
2190 snd_ymfpci_writel(chip, YDSXGR_LEGACYOUTVOL, 0x3fff3fff); in snd_ymfpci_memalloc()
2192 return 0; in snd_ymfpci_memalloc()
2200 snd_ymfpci_writel(chip, YDSXGR_NATIVEDACOUTVOL, 0); in snd_ymfpci_free()
2201 snd_ymfpci_writel(chip, YDSXGR_BUF441OUTVOL, 0); in snd_ymfpci_free()
2202 snd_ymfpci_writel(chip, YDSXGR_LEGACYOUTVOL, 0); in snd_ymfpci_free()
2203 snd_ymfpci_writel(chip, YDSXGR_STATUS, ~0); in snd_ymfpci_free()
2205 snd_ymfpci_writel(chip, YDSXGR_PLAYCTRLBASE, 0); in snd_ymfpci_free()
2206 snd_ymfpci_writel(chip, YDSXGR_RECCTRLBASE, 0); in snd_ymfpci_free()
2207 snd_ymfpci_writel(chip, YDSXGR_EFFCTRLBASE, 0); in snd_ymfpci_free()
2208 snd_ymfpci_writel(chip, YDSXGR_WORKBASE, 0); in snd_ymfpci_free()
2209 snd_ymfpci_writel(chip, YDSXGR_WORKSIZE, 0); in snd_ymfpci_free()
2211 snd_ymfpci_writew(chip, YDSXGR_GLOBALCTRL, ctrl & ~0x0007); in snd_ymfpci_free()
2229 if (chip->pci->device >= 0x0010) /* YMF 744/754 */ in snd_ymfpci_suspend()
2235 for (i = 0; i < YDSXGR_NUM_SAVED_REGS; i++) in snd_ymfpci_suspend()
2240 for (i = 0; i < legacy_reg_count; i++) in snd_ymfpci_suspend()
2244 snd_ymfpci_writel(chip, YDSXGR_NATIVEDACOUTVOL, 0); in snd_ymfpci_suspend()
2245 snd_ymfpci_writel(chip, YDSXGR_BUF441OUTVOL, 0); in snd_ymfpci_suspend()
2247 return 0; in snd_ymfpci_suspend()
2257 if (chip->pci->device >= 0x0010) /* YMF 744/754 */ in snd_ymfpci_resume()
2261 snd_ymfpci_codec_ready(chip, 0); in snd_ymfpci_resume()
2265 for (i = 0; i < YDSXGR_NUM_SAVED_REGS; i++) in snd_ymfpci_resume()
2270 for (i = 0; i < legacy_reg_count; i++) in snd_ymfpci_resume()
2275 if (chip->start_count > 0) { in snd_ymfpci_resume()
2282 return 0; in snd_ymfpci_resume()
2296 if (err < 0) in snd_ymfpci_create()
2303 atomic_set(&chip->interrupt_sleep_count, 0); in snd_ymfpci_create()
2311 if (err < 0) in snd_ymfpci_create()
2314 chip->reg_area_phys = pci_resource_start(pci, 0); in snd_ymfpci_create()
2315 chip->reg_area_virt = devm_ioremap(&pci->dev, chip->reg_area_phys, 0x8000); in snd_ymfpci_create()
2318 "unable to grab memory region 0x%lx-0x%lx\n", in snd_ymfpci_create()
2319 chip->reg_area_phys, chip->reg_area_phys + 0x8000 - 1); in snd_ymfpci_create()
2335 if (snd_ymfpci_codec_ready(chip, 0) < 0) in snd_ymfpci_create()
2339 if (err < 0) { in snd_ymfpci_create()
2347 if (snd_ymfpci_memalloc(chip) < 0) in snd_ymfpci_create()
2351 if (err < 0) in snd_ymfpci_create()
2356 return 0; in snd_ymfpci_create()