• Home
  • Raw
  • Download

Lines Matching refs:chip

20 static int vx_modify_board_clock(struct vx_core *chip, int sync)  in vx_modify_board_clock()  argument
28 return vx_send_msg(chip, &rmh); in vx_modify_board_clock()
34 static int vx_modify_board_inputs(struct vx_core *chip) in vx_modify_board_inputs() argument
40 return vx_send_msg(chip, &rmh); in vx_modify_board_inputs()
48 static int vx_read_one_cbit(struct vx_core *chip, int index) in vx_read_one_cbit() argument
52 mutex_lock(&chip->lock); in vx_read_one_cbit()
53 if (chip->type >= VX_TYPE_VXPOCKET) { in vx_read_one_cbit()
54 vx_outb(chip, CSUER, 1); /* read */ in vx_read_one_cbit()
55 vx_outb(chip, RUER, index & XX_UER_CBITS_OFFSET_MASK); in vx_read_one_cbit()
56 val = (vx_inb(chip, RUER) >> 7) & 0x01; in vx_read_one_cbit()
58 vx_outl(chip, CSUER, 1); /* read */ in vx_read_one_cbit()
59 vx_outl(chip, RUER, index & XX_UER_CBITS_OFFSET_MASK); in vx_read_one_cbit()
60 val = (vx_inl(chip, RUER) >> 7) & 0x01; in vx_read_one_cbit()
62 mutex_unlock(&chip->lock); in vx_read_one_cbit()
71 static void vx_write_one_cbit(struct vx_core *chip, int index, int val) in vx_write_one_cbit() argument
74 mutex_lock(&chip->lock); in vx_write_one_cbit()
75 if (vx_is_pcmcia(chip)) { in vx_write_one_cbit()
76 vx_outb(chip, CSUER, 0); /* write */ in vx_write_one_cbit()
77 vx_outb(chip, RUER, (val << 7) | (index & XX_UER_CBITS_OFFSET_MASK)); in vx_write_one_cbit()
79 vx_outl(chip, CSUER, 0); /* write */ in vx_write_one_cbit()
80 vx_outl(chip, RUER, (val << 7) | (index & XX_UER_CBITS_OFFSET_MASK)); in vx_write_one_cbit()
82 mutex_unlock(&chip->lock); in vx_write_one_cbit()
92 static int vx_read_uer_status(struct vx_core *chip, unsigned int *mode) in vx_read_uer_status() argument
100 if (vx_is_pcmcia(chip)) in vx_read_uer_status()
101 val = vx_inb(chip, CSUER); in vx_read_uer_status()
103 val = vx_inl(chip, CSUER); in vx_read_uer_status()
122 *mode = vx_read_one_cbit(chip, 0) ? in vx_read_uer_status()
148 static int vx_calc_clock_from_freq(struct vx_core *chip, int freq) in vx_calc_clock_from_freq() argument
177 static void vx_change_clock_source(struct vx_core *chip, int source) in vx_change_clock_source() argument
180 vx_toggle_dac_mute(chip, 1); in vx_change_clock_source()
181 mutex_lock(&chip->lock); in vx_change_clock_source()
182 chip->ops->set_clock_source(chip, source); in vx_change_clock_source()
183 chip->clock_source = source; in vx_change_clock_source()
184 mutex_unlock(&chip->lock); in vx_change_clock_source()
186 vx_toggle_dac_mute(chip, 0); in vx_change_clock_source()
193 void vx_set_internal_clock(struct vx_core *chip, unsigned int freq) in vx_set_internal_clock() argument
198 clock = vx_calc_clock_from_freq(chip, freq); in vx_set_internal_clock()
200 mutex_lock(&chip->lock); in vx_set_internal_clock()
201 if (vx_is_pcmcia(chip)) { in vx_set_internal_clock()
202 vx_outb(chip, HIFREQ, (clock >> 8) & 0x0f); in vx_set_internal_clock()
203 vx_outb(chip, LOFREQ, clock & 0xff); in vx_set_internal_clock()
205 vx_outl(chip, HIFREQ, (clock >> 8) & 0x0f); in vx_set_internal_clock()
206 vx_outl(chip, LOFREQ, clock & 0xff); in vx_set_internal_clock()
208 mutex_unlock(&chip->lock); in vx_set_internal_clock()
216 void vx_set_iec958_status(struct vx_core *chip, unsigned int bits) in vx_set_iec958_status() argument
220 if (chip->chip_status & VX_STAT_IS_STALE) in vx_set_iec958_status()
224 vx_write_one_cbit(chip, i, bits & (1 << i)); in vx_set_iec958_status()
231 int vx_set_clock(struct vx_core *chip, unsigned int freq) in vx_set_clock() argument
235 if (chip->chip_status & VX_STAT_IS_STALE) in vx_set_clock()
239 vx_sync_audio_source(chip); in vx_set_clock()
241 if (chip->clock_mode == VX_CLOCK_MODE_EXTERNAL || in vx_set_clock()
242 (chip->clock_mode == VX_CLOCK_MODE_AUTO && in vx_set_clock()
243 chip->audio_source == VX_AUDIO_SRC_DIGITAL)) { in vx_set_clock()
244 if (chip->clock_source != UER_SYNC) { in vx_set_clock()
245 vx_change_clock_source(chip, UER_SYNC); in vx_set_clock()
249 } else if (chip->clock_mode == VX_CLOCK_MODE_INTERNAL || in vx_set_clock()
250 (chip->clock_mode == VX_CLOCK_MODE_AUTO && in vx_set_clock()
251 chip->audio_source != VX_AUDIO_SRC_DIGITAL)) { in vx_set_clock()
252 if (chip->clock_source != INTERNAL_QUARTZ) { in vx_set_clock()
253 vx_change_clock_source(chip, INTERNAL_QUARTZ); in vx_set_clock()
256 if (chip->freq == freq) in vx_set_clock()
258 vx_set_internal_clock(chip, freq); in vx_set_clock()
260 vx_modify_board_inputs(chip); in vx_set_clock()
262 if (chip->freq == freq) in vx_set_clock()
264 chip->freq = freq; in vx_set_clock()
265 vx_modify_board_clock(chip, 1); in vx_set_clock()
273 int vx_change_frequency(struct vx_core *chip) in vx_change_frequency() argument
277 if (chip->chip_status & VX_STAT_IS_STALE) in vx_change_frequency()
280 if (chip->clock_source == INTERNAL_QUARTZ) in vx_change_frequency()
285 freq = vx_read_uer_status(chip, &chip->uer_detected); in vx_change_frequency()
293 chip->freq_detected = freq; in vx_change_frequency()