47 static int vx_modify_board_inputs(
struct vx_core *chip)
61 static int vx_read_one_cbit(
struct vx_core *chip,
int index)
69 val = (
vx_inb(chip, RUER) >> 7) & 0x01;
73 val = (
vx_inl(chip, RUER) >> 7) & 0x01;
75 spin_unlock_irqrestore(&chip->
lock, flags);
84 static void vx_write_one_cbit(
struct vx_core *chip,
int index,
int val)
96 spin_unlock_irqrestore(&chip->
lock, flags);
106 static int vx_read_uer_status(
struct vx_core *chip,
unsigned int *
mode)
115 val =
vx_inb(chip, CSUER);
117 val =
vx_inl(chip, CSUER);
136 *mode = vx_read_one_cbit(chip, 0) ?
162 static int vx_calc_clock_from_freq(
struct vx_core *chip,
int freq)
169 hexfreq = (28224000 * 10) / freq;
170 hexfreq = (hexfreq + 5) / 10;
176 if (hexfreq <= 0x03ff)
177 return hexfreq - 0x00000201;
178 if (hexfreq <= 0x07ff)
179 return (hexfreq / 2) - 1;
180 if (hexfreq <= 0x0fff)
181 return (hexfreq / 4) + 0x000001ff;
191 static void vx_change_clock_source(
struct vx_core *chip,
int source)
198 chip->
ops->set_clock_source(chip, source);
200 spin_unlock_irqrestore(&chip->
lock, flags);
214 clock = vx_calc_clock_from_freq(chip, freq);
218 vx_outb(chip, HIFREQ, (clock >> 8) & 0x0f);
219 vx_outb(chip, LOFREQ, clock & 0xff);
221 vx_outl(chip, HIFREQ, (clock >> 8) & 0x0f);
222 vx_outl(chip, LOFREQ, clock & 0xff);
224 spin_unlock_irqrestore(&chip->
lock, flags);
239 for (i = 0; i < 32; i++)
240 vx_write_one_cbit(chip, i, bits & (1 << i));
261 vx_change_clock_source(chip,
UER_SYNC);
272 if (chip->
freq == freq)
276 vx_modify_board_inputs(chip);
278 if (chip->
freq == freq)
281 vx_modify_board_clock(chip, 1);
308 if (freq == 48000 || freq == 44100 || freq == 32000)