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

Lines Matching refs:chip

90 	struct snd_vx222 *chip = (struct snd_vx222 *)_chip;
91 return chip->port[vx2_reg_index[reg]] + vx2_reg_offset[reg];
98 static unsigned char vx2_inb(struct vx_core *chip, int offset)
100 return inb(vx2_reg_addr(chip, offset));
108 static void vx2_outb(struct vx_core *chip, int offset, unsigned char val)
110 outb(val, vx2_reg_addr(chip, offset));
111 //printk("outb: %x -> %x\n", val, vx2_reg_addr(chip, offset));
118 static unsigned int vx2_inl(struct vx_core *chip, int offset)
120 return inl(vx2_reg_addr(chip, offset));
128 static void vx2_outl(struct vx_core *chip, int offset, unsigned int val)
130 // printk("outl: %x -> %x\n", val, vx2_reg_addr(chip, offset));
131 outl(val, vx2_reg_addr(chip, offset));
138 #define vx_inb(chip,reg) vx2_inb((struct vx_core*)(chip), VX_##reg)
140 #define vx_outb(chip,reg,val) vx2_outb((struct vx_core*)(chip), VX_##reg, val)
142 #define vx_inl(chip,reg) vx2_inl((struct vx_core*)(chip), VX_##reg)
144 #define vx_outl(chip,reg,val) vx2_outl((struct vx_core*)(chip), VX_##reg, val)
155 struct snd_vx222 *chip = (struct snd_vx222 *)_chip;
158 vx_outl(chip, CDSP, chip->regCDSP & ~VX_CDSP_DSP_RESET_MASK);
162 chip->regCDSP |= VX_CDSP_DSP_RESET_MASK;
164 vx_outl(chip, CDSP, chip->regCDSP);
170 struct snd_vx222 *chip = (struct snd_vx222 *)_chip;
179 vx_outl(chip, CDSP, chip->regCDSP | VX_CDSP_TEST0_MASK);
180 vx_inl(chip, ISR);
181 data = vx_inl(chip, STATUS);
188 vx_outl(chip, CDSP, chip->regCDSP & ~VX_CDSP_TEST0_MASK);
189 vx_inl(chip, ISR);
190 data = vx_inl(chip, STATUS);
199 vx_outl(chip, CDSP, chip->regCDSP | VX_CDSP_TEST1_MASK);
200 vx_inl(chip, ISR);
201 data = vx_inl(chip, STATUS);
208 vx_outl(chip, CDSP, chip->regCDSP & ~VX_CDSP_TEST1_MASK);
209 vx_inl(chip, ISR);
210 data = vx_inl(chip, STATUS);
225 static void vx2_setup_pseudo_dma(struct vx_core *chip, int do_write)
230 vx_outl(chip, ICR, do_write ? ICR_TREQ : ICR_RREQ);
235 vx_outl(chip, RESET_DMA, 0);
241 static inline void vx2_release_pseudo_dma(struct vx_core *chip)
244 vx_outl(chip, ICR, 0);
250 static void vx2_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime,
253 unsigned long port = vx2_reg_addr(chip, VX_DMA);
259 vx2_setup_pseudo_dma(chip, 1);
283 vx2_release_pseudo_dma(chip);
288 static void vx2_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime,
293 unsigned long port = vx2_reg_addr(chip, VX_DMA);
297 vx2_setup_pseudo_dma(chip, 0);
316 vx2_release_pseudo_dma(chip);
327 static int put_xilinx_data(struct vx_core *chip, unsigned int port, unsigned int counts, unsigned char data)
336 vx2_outl(chip, port, val);
337 vx2_inl(chip, port);
344 vx2_outl(chip, port, val);
345 vx2_inl(chip, port);
349 vx2_outl(chip, port, val);
350 vx2_inl(chip, port);
359 static int vx2_load_xilinx_binary(struct vx_core *chip, const struct firmware *xilinx)
366 vx_outl(chip, CNTRL, VX_CNTRL_REGISTER_VALUE | VX_XILINX_RESET_MASK);
367 vx_inl(chip, CNTRL);
369 vx_outl(chip, CNTRL, VX_CNTRL_REGISTER_VALUE);
370 vx_inl(chip, CNTRL);
373 if (chip->type == VX_TYPE_BOARD)
380 if (put_xilinx_data(chip, port, 8, *image) < 0)
385 put_xilinx_data(chip, port, 4, 0xff); /* end signature */
390 if (chip->type != VX_TYPE_BOARD) {
392 i = vx_inl(chip, GPIOC);
438 static int vx2_test_and_ack(struct vx_core *chip)
441 if (! (chip->chip_status & VX_STAT_XILINX_LOADED))
444 if (! (vx_inl(chip, STATUS) & VX_STATUS_MEMIRQ_MASK))
449 vx_outl(chip, STATUS, 0);
453 vx_inl(chip, STATUS);
455 vx_outl(chip, STATUS, VX_STATUS_MEMIRQ_MASK);
458 vx_inl(chip, STATUS);
460 vx_outl(chip, STATUS, 0);
471 struct snd_vx222 *chip = (struct snd_vx222 *)_chip;
476 vx_outl(chip, INTCSR, VX_INTCSR_VALUE|VX_PCI_INTERRUPT_MASK);
477 chip->regCDSP |= VX_CDSP_VALID_IRQ_MASK;
480 vx_outl(chip, INTCSR, VX_INTCSR_VALUE&~VX_PCI_INTERRUPT_MASK);
481 chip->regCDSP &= ~VX_CDSP_VALID_IRQ_MASK;
483 vx_outl(chip, CDSP, chip->regCDSP);
490 static void vx2_write_codec_reg(struct vx_core *chip, unsigned int data)
494 vx_inl(chip, HIFREQ);
498 vx_outl(chip, DATA, ((data & 0x800000) ? VX_DATA_CODEC_MASK : 0));
500 vx_inl(chip, RUER);
666 static void vx2_write_akm(struct vx_core *chip, int reg, unsigned int data)
671 vx2_write_codec_reg(chip, data ? AKM_CODEC_MUTE_CMD : AKM_CODEC_UNMUTE_CMD);
694 vx2_write_codec_reg(chip, val);
701 static void vx2_old_write_codec_bit(struct vx_core *chip, int codec, unsigned int data)
706 vx_inl(chip, HIFREQ);
709 vx_outl(chip, DATA, ((data & 0x800000) ? VX_DATA_CODEC_MASK : 0));
712 vx_inl(chip, RUER);
721 struct snd_vx222 *chip = (struct snd_vx222 *)_chip;
724 vx_outl(chip, CDSP, chip->regCDSP &~ VX_CDSP_CODEC_RESET_MASK);
725 vx_inl(chip, CDSP);
728 chip->regCDSP |= VX_CDSP_CODEC_RESET_MASK;
729 vx_outl(chip, CDSP, chip->regCDSP);
730 vx_inl(chip, CDSP);
746 chip->regSELMIC = MICRO_SELECT_INPUT_NORM |
751 chip->regSELMIC &= ~MICRO_SELECT_PHANTOM_ALIM;
753 vx_outl(_chip, SELMIC, chip->regSELMIC);
763 struct snd_vx222 *chip = (struct snd_vx222 *)_chip;
767 chip->regCFG |= VX_CFG_DATAIN_SEL_MASK;
770 chip->regCFG &= ~VX_CFG_DATAIN_SEL_MASK;
773 vx_outl(chip, CFG, chip->regCFG);
782 struct snd_vx222 *chip = (struct snd_vx222 *)_chip;
785 chip->regCFG &= ~VX_CFG_CLOCKIN_SEL_MASK;
787 chip->regCFG |= VX_CFG_CLOCKIN_SEL_MASK;
788 vx_outl(chip, CFG, chip->regCFG);
796 struct snd_vx222 *chip = (struct snd_vx222 *)_chip;
799 chip->regCDSP = VX_CDSP_CODEC_RESET_MASK | VX_CDSP_DSP_RESET_MASK ;
800 chip->regCFG = 0;
815 static void vx2_set_input_level(struct snd_vx222 *chip)
820 miclevel = chip->mic_level;
830 chip->regSELMIC &= ~MICRO_SELECT_PREAMPLI_MASK;
831 chip->regSELMIC |= (preamp << MICRO_SELECT_PREAMPLI_OFFSET) & MICRO_SELECT_PREAMPLI_MASK;
832 vx_outl(chip, SELMIC, chip->regSELMIC);
835 (unsigned int)chip->input_level[1] << 8 |
836 (unsigned int)chip->input_level[0];
837 vx_inl(chip, DATA); /* Activate input level programming */
841 vx_outl(chip, DATA, ((data & 0x80000000) ? VX_DATA_CODEC_MASK : 0));
843 vx_inl(chip, RUER); /* Terminate input level programming */
868 struct snd_vx222 *chip = (struct snd_vx222 *)_chip;
870 ucontrol->value.integer.value[0] = chip->input_level[0];
871 ucontrol->value.integer.value[1] = chip->input_level[1];
879 struct snd_vx222 *chip = (struct snd_vx222 *)_chip;
881 if (chip->input_level[0] != ucontrol->value.integer.value[0] ||
882 chip->input_level[1] != ucontrol->value.integer.value[1]) {
883 chip->input_level[0] = ucontrol->value.integer.value[0];
884 chip->input_level[1] = ucontrol->value.integer.value[1];
885 vx2_set_input_level(chip);
906 struct snd_vx222 *chip = (struct snd_vx222 *)_chip;
907 ucontrol->value.integer.value[0] = chip->mic_level;
914 struct snd_vx222 *chip = (struct snd_vx222 *)_chip;
916 if (chip->mic_level != ucontrol->value.integer.value[0]) {
917 chip->mic_level = ucontrol->value.integer.value[0];
918 vx2_set_input_level(chip);
951 struct snd_vx222 *chip = (struct snd_vx222 *)_chip;
958 chip->input_level[0] = chip->input_level[1] = 0;
959 chip->mic_level = 0;
960 vx2_set_input_level(chip);
963 if ((err = snd_ctl_add(_chip->card, snd_ctl_new1(&vx_control_input_level, chip))) < 0)
965 if ((err = snd_ctl_add(_chip->card, snd_ctl_new1(&vx_control_mic_level, chip))) < 0)