• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/sound/pci/emu10k1/

Lines Matching refs:emu

57 	struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
61 spin_lock_irqsave(&emu->reg_lock, flags);
62 ucontrol->value.iec958.status[0] = (emu->spdif_bits[idx] >> 0) & 0xff;
63 ucontrol->value.iec958.status[1] = (emu->spdif_bits[idx] >> 8) & 0xff;
64 ucontrol->value.iec958.status[2] = (emu->spdif_bits[idx] >> 16) & 0xff;
65 ucontrol->value.iec958.status[3] = (emu->spdif_bits[idx] >> 24) & 0xff;
66 spin_unlock_irqrestore(&emu->reg_lock, flags);
258 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
262 ucontrol->value.enumerated.item[0] = emu->emu1010.output_source[channel];
269 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
275 if (emu->emu1010.output_source[channel] != ucontrol->value.enumerated.item[0]) {
276 val = emu->emu1010.output_source[channel] = ucontrol->value.enumerated.item[0];
278 snd_emu1010_fpga_link_dst_src_write(emu,
287 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
291 ucontrol->value.enumerated.item[0] = emu->emu1010.input_source[channel];
298 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
304 if (emu->emu1010.input_source[channel] != ucontrol->value.enumerated.item[0]) {
305 val = emu->emu1010.input_source[channel] = ucontrol->value.enumerated.item[0];
307 snd_emu1010_fpga_link_dst_src_write(emu,
399 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
401 ucontrol->value.integer.value[0] = (emu->emu1010.adc_pads & mask) ? 1 : 0;
407 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
411 cache = emu->emu1010.adc_pads;
416 if (cache != emu->emu1010.adc_pads) {
417 snd_emu1010_fpga_write(emu, EMU_HANA_ADC_PADS, cache );
418 emu->emu1010.adc_pads = cache;
454 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
456 ucontrol->value.integer.value[0] = (emu->emu1010.dac_pads & mask) ? 1 : 0;
462 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
466 cache = emu->emu1010.dac_pads;
471 if (cache != emu->emu1010.dac_pads) {
472 snd_emu1010_fpga_write(emu, EMU_HANA_DAC_PADS, cache );
473 emu->emu1010.dac_pads = cache;
519 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
521 ucontrol->value.enumerated.item[0] = emu->emu1010.internal_clock;
528 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
533 change = (emu->emu1010.internal_clock != val);
535 emu->emu1010.internal_clock = val;
540 snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE );
542 snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_44_1K );
544 snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK,
547 snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2,
552 snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE );
557 snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE );
559 snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_48K );
561 snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK,
564 snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2,
569 snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE );
606 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
608 ucontrol->value.enumerated.item[0] = emu->i2c_capture_source;
615 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
627 change = (emu->i2c_capture_source != source_id);
629 snd_emu10k1_i2c_write(emu, ADC_MUX, 0); /* Mute input */
630 spin_lock_irqsave(&emu->emu_lock, flags);
631 gpio = inl(emu->port + A_IOCFG);
633 outl(gpio | 0x4, emu->port + A_IOCFG);
635 outl(gpio & ~0x4, emu->port + A_IOCFG);
636 spin_unlock_irqrestore(&emu->emu_lock, flags);
638 ngain = emu->i2c_capture_volume[source_id][0]; /* Left */
639 ogain = emu->i2c_capture_volume[emu->i2c_capture_source][0]; /* Left */
641 snd_emu10k1_i2c_write(emu, ADC_ATTEN_ADCL, ((ngain) & 0xff));
642 ngain = emu->i2c_capture_volume[source_id][1]; /* Right */
643 ogain = emu->i2c_capture_volume[emu->i2c_capture_source][1]; /* Right */
645 snd_emu10k1_i2c_write(emu, ADC_ATTEN_ADCR, ((ngain) & 0xff));
648 snd_emu10k1_i2c_write(emu, ADC_MUX, source); /* Set source */
649 emu->i2c_capture_source = source_id;
676 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
681 ucontrol->value.integer.value[0] = emu->i2c_capture_volume[source_id][0];
682 ucontrol->value.integer.value[1] = emu->i2c_capture_volume[source_id][1];
689 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
696 ogain = emu->i2c_capture_volume[source_id][0]; /* Left */
701 if (emu->i2c_capture_source == source_id)
702 snd_emu10k1_i2c_write(emu, ADC_ATTEN_ADCL, ((ngain) & 0xff) );
703 emu->i2c_capture_volume[source_id][0] = ucontrol->value.integer.value[0];
706 ogain = emu->i2c_capture_volume[source_id][1]; /* Right */
711 if (emu->i2c_capture_source == source_id)
712 snd_emu10k1_i2c_write(emu, ADC_ATTEN_ADCR, ((ngain) & 0xff));
713 emu->i2c_capture_volume[source_id][1] = ucontrol->value.integer.value[1];
742 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
752 spin_lock_irqsave(&emu->reg_lock, flags);
753 change = val != emu->spdif_bits[idx];
755 snd_emu10k1_ptr_write(emu, SPCS0 + idx, 0, val);
756 emu->spdif_bits[idx] = val;
758 spin_unlock_irqrestore(&emu->reg_lock, flags);
783 static void update_emu10k1_fxrt(struct snd_emu10k1 *emu, int voice, unsigned char *route)
785 if (emu->audigy) {
786 snd_emu10k1_ptr_write(emu, A_FXRT1, voice,
788 snd_emu10k1_ptr_write(emu, A_FXRT2, voice,
791 snd_emu10k1_ptr_write(emu, FXRT, voice,
796 static void update_emu10k1_send_volume(struct snd_emu10k1 *emu, int voice, unsigned char *volume)
798 snd_emu10k1_ptr_write(emu, PTRX_FXSENDAMOUNT_A, voice, volume[0]);
799 snd_emu10k1_ptr_write(emu, PTRX_FXSENDAMOUNT_B, voice, volume[1]);
800 snd_emu10k1_ptr_write(emu, PSST_FXSENDAMOUNT_C, voice, volume[2]);
801 snd_emu10k1_ptr_write(emu, DSL_FXSENDAMOUNT_D, voice, volume[3]);
802 if (emu->audigy) {
807 snd_emu10k1_ptr_write(emu, A_SENDAMOUNTS, voice, val);
815 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
817 uinfo->count = emu->audigy ? 3*8 : 3*4;
819 uinfo->value.integer.max = emu->audigy ? 0x3f : 0x0f;
827 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
829 &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
831 int num_efx = emu->audigy ? 8 : 4;
832 int mask = emu->audigy ? 0x3f : 0x0f;
834 spin_lock_irqsave(&emu->reg_lock, flags);
839 spin_unlock_irqrestore(&emu->reg_lock, flags);
847 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
849 &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
851 int num_efx = emu->audigy ? 8 : 4;
852 int mask = emu->audigy ? 0x3f : 0x0f;
854 spin_lock_irqsave(&emu->reg_lock, flags);
865 update_emu10k1_fxrt(emu, mix->epcm->voices[0]->number,
867 update_emu10k1_fxrt(emu, mix->epcm->voices[1]->number,
870 update_emu10k1_fxrt(emu, mix->epcm->voices[0]->number,
874 spin_unlock_irqrestore(&emu->reg_lock, flags);
891 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
893 uinfo->count = emu->audigy ? 3*8 : 3*4;
903 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
905 &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
907 int num_efx = emu->audigy ? 8 : 4;
909 spin_lock_irqsave(&emu->reg_lock, flags);
912 spin_unlock_irqrestore(&emu->reg_lock, flags);
920 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
922 &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
924 int num_efx = emu->audigy ? 8 : 4;
926 spin_lock_irqsave(&emu->reg_lock, flags);
936 update_emu10k1_send_volume(emu, mix->epcm->voices[0]->number,
938 update_emu10k1_send_volume(emu, mix->epcm->voices[1]->number,
941 update_emu10k1_send_volume(emu, mix->epcm->voices[0]->number,
945 spin_unlock_irqrestore(&emu->reg_lock, flags);
972 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
974 &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
978 spin_lock_irqsave(&emu->reg_lock, flags);
981 spin_unlock_irqrestore(&emu->reg_lock, flags);
989 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
991 &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
994 spin_lock_irqsave(&emu->reg_lock, flags);
1004 snd_emu10k1_ptr_write(emu, VTFT_VOLUMETARGET, mix->epcm->voices[0]->number, mix->attn[1]);
1005 snd_emu10k1_ptr_write(emu, VTFT_VOLUMETARGET, mix->epcm->voices[1]->number, mix->attn[2]);
1007 snd_emu10k1_ptr_write(emu, VTFT_VOLUMETARGET, mix->epcm->voices[0]->number, mix->attn[0]);
1010 spin_unlock_irqrestore(&emu->reg_lock, flags);
1029 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1031 uinfo->count = emu->audigy ? 8 : 4;
1033 uinfo->value.integer.max = emu->audigy ? 0x3f : 0x0f;
1041 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1043 &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
1045 int num_efx = emu->audigy ? 8 : 4;
1046 int mask = emu->audigy ? 0x3f : 0x0f;
1048 spin_lock_irqsave(&emu->reg_lock, flags);
1052 spin_unlock_irqrestore(&emu->reg_lock, flags);
1060 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1062 struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[ch];
1064 int num_efx = emu->audigy ? 8 : 4;
1065 int mask = emu->audigy ? 0x3f : 0x0f;
1067 spin_lock_irqsave(&emu->reg_lock, flags);
1078 update_emu10k1_fxrt(emu, mix->epcm->voices[ch]->number,
1082 spin_unlock_irqrestore(&emu->reg_lock, flags);
1099 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1101 uinfo->count = emu->audigy ? 8 : 4;
1111 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1113 &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
1115 int num_efx = emu->audigy ? 8 : 4;
1117 spin_lock_irqsave(&emu->reg_lock, flags);
1120 spin_unlock_irqrestore(&emu->reg_lock, flags);
1128 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1130 struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[ch];
1132 int num_efx = emu->audigy ? 8 : 4;
1134 spin_lock_irqsave(&emu->reg_lock, flags);
1144 update_emu10k1_send_volume(emu, mix->epcm->voices[ch]->number,
1148 spin_unlock_irqrestore(&emu->reg_lock, flags);
1176 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1178 &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
1181 spin_lock_irqsave(&emu->reg_lock, flags);
1183 spin_unlock_irqrestore(&emu->reg_lock, flags);
1191 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1193 struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[ch];
1196 spin_lock_irqsave(&emu->reg_lock, flags);
1204 snd_emu10k1_ptr_write(emu, VTFT_VOLUMETARGET, mix->epcm->voices[ch]->number, mix->attn[0]);
1207 spin_unlock_irqrestore(&emu->reg_lock, flags);
1234 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1236 if (emu->audigy)
1237 ucontrol->value.integer.value[0] = inl(emu->port + A_IOCFG) & A_IOCFG_GPOUT0 ? 1 : 0;
1239 ucontrol->value.integer.value[0] = inl(emu->port + HCFG) & HCFG_GPOUT0 ? 1 : 0;
1247 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1251 spin_lock_irqsave(&emu->reg_lock, flags);
1252 if ( emu->card_capabilities->i2c_adc) {
1254 } else if (emu->audigy) {
1255 reg = inl(emu->port + A_IOCFG);
1261 outl(reg | val, emu->port + A_IOCFG);
1264 reg = inl(emu->port + HCFG);
1270 outl(reg | val, emu->port + HCFG);
1272 spin_unlock_irqrestore(&emu->reg_lock, flags);
1298 struct snd_emu10k1 *emu = ac97->private_data;
1299 emu->ac97 = NULL;
1332 int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
1337 struct snd_card *card = emu->card;
1452 if (emu->card_capabilities->ac97_chip) {
1460 if ((err = snd_ac97_bus(emu->card, 0, &ops, NULL, &pbus)) < 0)
1465 ac97.private_data = emu;
1468 if ((err = snd_ac97_mixer(pbus, &ac97, &emu->ac97)) < 0) {
1469 if (emu->card_capabilities->ac97_chip == 1)
1473 snd_device_free(emu->card, pbus);
1476 if (emu->audigy) {
1478 snd_ac97_write_cache(emu->ac97, AC97_MASTER, 0x0000);
1480 snd_ac97_write_cache(emu->ac97, AC97_REC_SEL, 0x0000);
1481 if (emu->card_capabilities->adc_1361t)
1491 if (emu->ac97->id == AC97_ID_STAC9758) {
1492 emu->rear_ac97 = 1;
1493 snd_emu10k1_ptr_write(emu, AC97SLOT, 0, AC97SLOT_CNTR|AC97SLOT_LFE|AC97SLOT_REAR_LEFT|AC97SLOT_REAR_RIGHT);
1494 snd_ac97_write_cache(emu->ac97, AC97_HEADPHONE, 0x0202);
1497 snd_ac97_write_cache(emu->ac97, AC97_SURROUND_MASTER, 0x0202);
1498 snd_ac97_write_cache(emu->ac97, AC97_CENTER_LFE_MASTER, 0x0202);
1503 } else if (emu->card_capabilities->i2c_adc) {
1509 if (emu->card_capabilities->ecard)
1510 strcpy(emu->card->mixername, "EMU APS");
1511 else if (emu->audigy)
1512 strcpy(emu->card->mixername, "SB Audigy");
1514 strcpy(emu->card->mixername, "Emu10k1");
1517 if (emu->audigy)
1518 if (emu->card_capabilities->adc_1361t)
1520 else if (emu->card_capabilities->i2c_adc)
1529 if (emu->card_capabilities->subsystem == 0x20071102) { /* Audigy 4 Pro */
1540 if ((kctl = emu->ctl_send_routing = snd_ctl_new1(&snd_emu10k1_send_routing_control, emu)) == NULL)
1545 if ((kctl = emu->ctl_send_volume = snd_ctl_new1(&snd_emu10k1_send_volume_control, emu)) == NULL)
1550 if ((kctl = emu->ctl_attn = snd_ctl_new1(&snd_emu10k1_attn_control, emu)) == NULL)
1556 if ((kctl = emu->ctl_efx_send_routing = snd_ctl_new1(&snd_emu10k1_efx_send_routing_control, emu)) == NULL)
1562 if ((kctl = emu->ctl_efx_send_volume = snd_ctl_new1(&snd_emu10k1_efx_send_volume_control, emu)) == NULL)
1568 if ((kctl = emu->ctl_efx_attn = snd_ctl_new1(&snd_emu10k1_efx_attn_control, emu)) == NULL)
1579 mix = &emu->pcm_mixer[pcm];
1599 mix = &emu->efx_pcm_mixer[pcm];
1606 if (emu->audigy)
1616 if (! emu->card_capabilities->ecard) {
1618 if ((kctl = snd_ctl_new1(&snd_emu10k1_spdif_mask_control, emu)) == NULL)
1620 if (!emu->audigy)
1621 kctl->id.device = emu->pcm_efx->device;
1624 if ((kctl = snd_ctl_new1(&snd_emu10k1_spdif_control, emu)) == NULL)
1626 if (!emu->audigy)
1627 kctl->id.device = emu->pcm_efx->device;
1632 if ( emu->card_capabilities->emu1010) {
1634 } else if (emu->audigy) {
1635 if ((kctl = snd_ctl_new1(&snd_audigy_shared_spdif, emu)) == NULL)
1639 } else if (! emu->card_capabilities->ecard) {
1641 if ((kctl = snd_ctl_new1(&snd_emu10k1_shared_spdif, emu)) == NULL)
1646 if (emu->card_capabilities->ca0151_chip) { /* P16V */
1647 if ((err = snd_p16v_mixer(emu)))
1651 if ( emu->card_capabilities->emu1010) {
1655 err = snd_ctl_add(card, snd_ctl_new1(&snd_emu1010_output_enum_ctls[i], emu));
1660 err = snd_ctl_add(card, snd_ctl_new1(&snd_emu1010_input_enum_ctls[i], emu));
1665 err = snd_ctl_add(card, snd_ctl_new1(&snd_emu1010_adc_pads[i], emu));
1670 err = snd_ctl_add(card, snd_ctl_new1(&snd_emu1010_dac_pads[i], emu));
1674 err = snd_ctl_add(card, snd_ctl_new1(&snd_emu1010_internal_clock, emu));
1679 if ( emu->card_capabilities->i2c_adc) {
1682 err = snd_ctl_add(card, snd_ctl_new1(&snd_audigy_i2c_capture_source, emu));
1687 err = snd_ctl_add(card, snd_ctl_new1(&snd_audigy_i2c_volume_ctls[i], emu));