Lines Matching +full:aux +full:- +full:output +full:- +full:source

1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * Copyright 2003 Vivien Chappelier <vivien.chappelier@linux-mips.org>
35 ad1843_PDNO = { 0, 14, 1 }, /* Converter Power-Down Flag */
39 ad1843_RSS = { 2, 5, 3 }, /* Right ADC Source Select */
42 ad1843_LSS = { 2, 13, 3 }, /* Left ADC Source Select */
47 ad1843_RX1M = { 4, 0, 5 }, /* Right Aux 1 Mix Gain/Atten */
48 ad1843_RX1MM = { 4, 7, 1 }, /* Right Aux 1 Mix Mute */
49 ad1843_LX1M = { 4, 8, 5 }, /* Left Aux 1 Mix Gain/Atten */
50 ad1843_LX1MM = { 4, 15, 1 }, /* Left Aux 1 Mix Mute */
51 ad1843_RX2M = { 5, 0, 5 }, /* Right Aux 2 Mix Gain/Atten */
52 ad1843_RX2MM = { 5, 7, 1 }, /* Right Aux 2 Mix Mute */
53 ad1843_LX2M = { 5, 8, 5 }, /* Left Aux 2 Mix Gain/Atten */
54 ad1843_LX2MM = { 5, 15, 1 }, /* Left Aux 2 Mix Mute */
59 ad1843_HPOS = { 8, 4, 1 }, /* Headphone Output Voltage Swing */
60 ad1843_HPOM = { 8, 5, 1 }, /* Headphone Output Mute */
61 ad1843_MPOM = { 8, 6, 1 }, /* Mono Output Mute */
74 ad1843_ADLC = { 15, 0, 2 }, /* ADC Left Sample Rate Source */
75 ad1843_ADRC = { 15, 2, 2 }, /* ADC Right Sample Rate Source */
76 ad1843_DA1C = { 15, 8, 2 }, /* DAC1 Sample Rate Source */
77 ad1843_DA2C = { 15, 10, 2 }, /* DAC2 Sample Rate Source */
81 ad1843_DAADL = { 25, 4, 2 }, /* Digital ADC Left Source Select */
82 ad1843_DAADR = { 25, 6, 2 }, /* Digital ADC Right Source Select */
177 w = ad1843->read(ad1843->chip, field->reg); in ad1843_read_bits()
178 return w >> field->lo_bit & ((1 << field->nbits) - 1); in ad1843_read_bits()
191 w = ad1843->read(ad1843->chip, field->reg); in ad1843_write_bits()
192 mask = ((1 << field->nbits) - 1) << field->lo_bit; in ad1843_write_bits()
193 oldval = (w & mask) >> field->lo_bit; in ad1843_write_bits()
194 newbits = (newval << field->lo_bit) & mask; in ad1843_write_bits()
196 ad1843->write(ad1843->chip, field->reg, w); in ad1843_write_bits()
218 int w = 0, mask, *value, reg = -1; in ad1843_read_multi()
221 while (--argcount >= 0) { in ad1843_read_multi()
224 if (reg == -1) { in ad1843_read_multi()
225 reg = fp->reg; in ad1843_read_multi()
226 w = ad1843->read(ad1843->chip, reg); in ad1843_read_multi()
229 mask = (1 << fp->nbits) - 1; in ad1843_read_multi()
230 *value = w >> fp->lo_bit & mask; in ad1843_read_multi()
256 reg = -1; in ad1843_write_multi()
259 while (--argcount >= 0) { in ad1843_write_multi()
262 if (reg == -1) in ad1843_write_multi()
263 reg = fp->reg; in ad1843_write_multi()
265 WARN_ON(reg != fp->reg); in ad1843_write_multi()
266 m = ((1 << fp->nbits) - 1) << fp->lo_bit; in ad1843_write_multi()
268 bits |= (value << fp->lo_bit) & m; in ad1843_write_multi()
273 w = ad1843->read(ad1843->chip, reg); in ad1843_write_multi()
277 ad1843->write(ad1843->chip, reg, w); in ad1843_write_multi()
285 ret = (1 << gp->lfield->nbits); in ad1843_get_gain_max()
286 if (!gp->lmute) in ad1843_get_gain_max()
287 ret -= 1; in ad1843_get_gain_max()
300 unsigned short mask = (1 << gp->lfield->nbits) - 1; in ad1843_get_gain()
302 ad1843_read_multi(ad1843, 2, gp->lfield, &lg, gp->rfield, &rg); in ad1843_get_gain()
303 if (gp->negative) { in ad1843_get_gain()
304 lg = mask - lg; in ad1843_get_gain()
305 rg = mask - rg; in ad1843_get_gain()
307 if (gp->lmute) { in ad1843_get_gain()
308 ad1843_read_multi(ad1843, 2, gp->lmute, &lm, gp->rmute, &rm); in ad1843_get_gain()
326 unsigned short mask = (1 << gp->lfield->nbits) - 1; in ad1843_set_gain()
333 if (gp->negative) { in ad1843_set_gain()
334 lg = mask - lg; in ad1843_set_gain()
335 rg = mask - rg; in ad1843_set_gain()
337 if (gp->lmute) in ad1843_set_gain()
338 ad1843_write_multi(ad1843, 2, gp->lmute, lm, gp->rmute, rm); in ad1843_set_gain()
339 ad1843_write_multi(ad1843, 2, gp->lfield, lg, gp->rfield, rg); in ad1843_set_gain()
343 /* Returns the current recording source */
358 * Set recording source.
360 * Returns newsrc on success, -errno on failure.
366 return -EINVAL; in ad1843_set_recsrc()
462 * sheet, section "START-UP SEQUENCE". The numbered comments are
464 * 52-54, for more info.
466 * return 0 on success, -errno on failure. */
474 return -EIO; in ad1843_init()
487 return -EIO; in ad1843_init()
492 /* 5. Power up the clock generators and enable clock output pins. */ in ad1843_init()
500 /* DAC1/2 use clock 1/2 as source, ADC uses clock 3. Always. */ in ad1843_init()
534 /* Set default recording source to Line In and set in ad1843_init()
540 /* Set Speaker Out level to +/- 4V and unmute it. */ in ad1843_init()