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

Lines Matching refs:chip

34 static int vx_modify_board_clock(struct vx_core *chip, int sync)
42 return vx_send_msg(chip, &rmh);
48 static int vx_modify_board_inputs(struct vx_core *chip)
54 return vx_send_msg(chip, &rmh);
62 static int vx_read_one_cbit(struct vx_core *chip, int index)
66 spin_lock_irqsave(&chip->lock, flags);
67 if (chip->type >= VX_TYPE_VXPOCKET) {
68 vx_outb(chip, CSUER, 1); /* read */
69 vx_outb(chip, RUER, index & XX_UER_CBITS_OFFSET_MASK);
70 val = (vx_inb(chip, RUER) >> 7) & 0x01;
72 vx_outl(chip, CSUER, 1); /* read */
73 vx_outl(chip, RUER, index & XX_UER_CBITS_OFFSET_MASK);
74 val = (vx_inl(chip, RUER) >> 7) & 0x01;
76 spin_unlock_irqrestore(&chip->lock, flags);
85 static void vx_write_one_cbit(struct vx_core *chip, int index, int val)
89 spin_lock_irqsave(&chip->lock, flags);
90 if (vx_is_pcmcia(chip)) {
91 vx_outb(chip, CSUER, 0); /* write */
92 vx_outb(chip, RUER, (val << 7) | (index & XX_UER_CBITS_OFFSET_MASK));
94 vx_outl(chip, CSUER, 0); /* write */
95 vx_outl(chip, RUER, (val << 7) | (index & XX_UER_CBITS_OFFSET_MASK));
97 spin_unlock_irqrestore(&chip->lock, flags);
107 static int vx_read_uer_status(struct vx_core *chip, int *mode)
115 if (vx_is_pcmcia(chip))
116 val = vx_inb(chip, CSUER);
118 val = vx_inl(chip, CSUER);
137 *mode = vx_read_one_cbit(chip, 0) ?
163 static int vx_calc_clock_from_freq(struct vx_core *chip, int freq)
190 static void vx_change_clock_source(struct vx_core *chip, int source)
195 vx_toggle_dac_mute(chip, 1);
196 spin_lock_irqsave(&chip->lock, flags);
197 chip->ops->set_clock_source(chip, source);
198 chip->clock_source = source;
199 spin_unlock_irqrestore(&chip->lock, flags);
201 vx_toggle_dac_mute(chip, 0);
208 void vx_set_internal_clock(struct vx_core *chip, unsigned int freq)
213 clock = vx_calc_clock_from_freq(chip, freq);
215 spin_lock_irqsave(&chip->lock, flags);
216 if (vx_is_pcmcia(chip)) {
217 vx_outb(chip, HIFREQ, (clock >> 8) & 0x0f);
218 vx_outb(chip, LOFREQ, clock & 0xff);
220 vx_outl(chip, HIFREQ, (clock >> 8) & 0x0f);
221 vx_outl(chip, LOFREQ, clock & 0xff);
223 spin_unlock_irqrestore(&chip->lock, flags);
231 void vx_set_iec958_status(struct vx_core *chip, unsigned int bits)
235 if (chip->chip_status & VX_STAT_IS_STALE)
239 vx_write_one_cbit(chip, i, bits & (1 << i));
246 int vx_set_clock(struct vx_core *chip, unsigned int freq)
250 if (chip->chip_status & VX_STAT_IS_STALE)
254 vx_sync_audio_source(chip);
256 if (chip->clock_mode == VX_CLOCK_MODE_EXTERNAL ||
257 (chip->clock_mode == VX_CLOCK_MODE_AUTO &&
258 chip->audio_source == VX_AUDIO_SRC_DIGITAL)) {
259 if (chip->clock_source != UER_SYNC) {
260 vx_change_clock_source(chip, UER_SYNC);
264 } else if (chip->clock_mode == VX_CLOCK_MODE_INTERNAL ||
265 (chip->clock_mode == VX_CLOCK_MODE_AUTO &&
266 chip->audio_source != VX_AUDIO_SRC_DIGITAL)) {
267 if (chip->clock_source != INTERNAL_QUARTZ) {
268 vx_change_clock_source(chip, INTERNAL_QUARTZ);
271 if (chip->freq == freq)
273 vx_set_internal_clock(chip, freq);
275 vx_modify_board_inputs(chip);
277 if (chip->freq == freq)
279 chip->freq = freq;
280 vx_modify_board_clock(chip, 1);
288 int vx_change_frequency(struct vx_core *chip)
292 if (chip->chip_status & VX_STAT_IS_STALE)
295 if (chip->clock_source == INTERNAL_QUARTZ)
300 freq = vx_read_uer_status(chip, &chip->uer_detected);
308 chip->freq_detected = freq;