H A D | ad1843.c | 31 #include <sound/ad1843.h> 186 static int ad1843_read_bits(struct snd_ad1843 *ad1843, ad1843_read_bits() argument 191 w = ad1843->read(ad1843->chip, field->reg); ad1843_read_bits() 199 static int ad1843_write_bits(struct snd_ad1843 *ad1843, ad1843_write_bits() argument 205 w = ad1843->read(ad1843->chip, field->reg); ad1843_write_bits() 210 ad1843->write(ad1843->chip, field->reg, w); ad1843_write_bits() 218 * ad1843 requires 256 bit times at 12.288 MHz, or nearly 20 223 * ad1843_read_multi(ad1843, nfields, 228 static void ad1843_read_multi(struct snd_ad1843 *ad1843, int argcount, ...) ad1843_read_multi() argument 240 w = ad1843->read(ad1843->chip, reg); ad1843_read_multi() 255 * ad1843_write_multi(ad1843, nfields, 260 static void ad1843_write_multi(struct snd_ad1843 *ad1843, int argcount, ...) ad1843_write_multi() argument 287 w = ad1843->read(ad1843->chip, reg); ad1843_write_multi() 291 ad1843->write(ad1843->chip, reg, w); ad1843_write_multi() 294 int ad1843_get_gain_max(struct snd_ad1843 *ad1843, int id) ad1843_get_gain_max() argument 310 int ad1843_get_gain(struct snd_ad1843 *ad1843, int id) ad1843_get_gain() argument 316 ad1843_read_multi(ad1843, 2, gp->lfield, &lg, gp->rfield, &rg); ad1843_get_gain() 322 ad1843_read_multi(ad1843, 2, gp->lmute, &lm, gp->rmute, &rm); ad1843_get_gain() 337 int ad1843_set_gain(struct snd_ad1843 *ad1843, int id, int newval) ad1843_set_gain() argument 352 ad1843_write_multi(ad1843, 2, gp->lmute, lm, gp->rmute, rm); ad1843_set_gain() 353 ad1843_write_multi(ad1843, 2, gp->lfield, lg, gp->rfield, rg); ad1843_set_gain() 354 return ad1843_get_gain(ad1843, id); ad1843_set_gain() 359 int ad1843_get_recsrc(struct snd_ad1843 *ad1843) ad1843_get_recsrc() argument 361 int val = ad1843_read_bits(ad1843, &ad1843_LSS); ad1843_get_recsrc() 365 ad1843_write_multi(ad1843, 2, ad1843_get_recsrc() 377 int ad1843_set_recsrc(struct snd_ad1843 *ad1843, int newsrc) ad1843_set_recsrc() argument 382 ad1843_write_multi(ad1843, 2, &ad1843_LSS, newsrc, &ad1843_RSS, newsrc); ad1843_set_recsrc() 386 /* Setup ad1843 for D/A conversion. */ 388 void ad1843_setup_dac(struct snd_ad1843 *ad1843, ad1843_setup_dac() argument 428 ad1843_write_bits(ad1843, &ad1843_C2C, framerate); ad1843_setup_dac() 429 ad1843_write_multi(ad1843, 2, ad1843_setup_dac() 433 ad1843_write_bits(ad1843, &ad1843_C1C, framerate); ad1843_setup_dac() 434 ad1843_write_multi(ad1843, 2, ad1843_setup_dac() 440 void ad1843_shutdown_dac(struct snd_ad1843 *ad1843, unsigned int id) ad1843_shutdown_dac() argument 443 ad1843_write_bits(ad1843, &ad1843_DA2F, 1); ad1843_shutdown_dac() 445 ad1843_write_bits(ad1843, &ad1843_DA1F, 1); ad1843_shutdown_dac() 448 void ad1843_setup_adc(struct snd_ad1843 *ad1843, ad1843_setup_adc() argument 464 ad1843_write_bits(ad1843, &ad1843_C3C, framerate); ad1843_setup_adc() 465 ad1843_write_multi(ad1843, 2, ad1843_setup_adc() 469 void ad1843_shutdown_adc(struct snd_ad1843 *ad1843) ad1843_shutdown_adc() argument 475 * Fully initialize the ad1843. As described in the AD1843 data 482 int ad1843_init(struct snd_ad1843 *ad1843) ad1843_init() argument 486 if (ad1843_read_bits(ad1843, &ad1843_INIT) != 0) { ad1843_init() 487 printk(KERN_ERR "ad1843: AD1843 won't initialize\n"); ad1843_init() 491 ad1843_write_bits(ad1843, &ad1843_SCF, 1); ad1843_init() 494 ad1843_write_bits(ad1843, &ad1843_PDNI, 0); ad1843_init() 497 while (ad1843_read_bits(ad1843, &ad1843_PDNO)) { ad1843_init() 500 "ad1843: AD1843 won't power up\n"); ad1843_init() 507 ad1843_write_multi(ad1843, 3, ad1843_init() 515 ad1843_write_multi(ad1843, 4, ad1843_init() 522 ad1843_write_bits(ad1843, &ad1843_ADTLK, 1); ad1843_init() 523 ad1843_write_multi(ad1843, 7, ad1843_init() 535 ad1843_set_gain(ad1843, AD1843_GAIN_RECLEV, 0); ad1843_init() 536 ad1843_set_gain(ad1843, AD1843_GAIN_LINE, 0); ad1843_init() 537 ad1843_set_gain(ad1843, AD1843_GAIN_LINE_2, 0); ad1843_init() 538 ad1843_set_gain(ad1843, AD1843_GAIN_MIC, 0); ad1843_init() 539 ad1843_set_gain(ad1843, AD1843_GAIN_PCM_0, 0); ad1843_init() 540 ad1843_set_gain(ad1843, AD1843_GAIN_PCM_1, 0); ad1843_init() 544 ad1843_write_multi(ad1843, 2, &ad1843_LDA1GM, 0, &ad1843_RDA1GM, 0); ad1843_init() 546 ad1843_write_multi(ad1843, 2, &ad1843_LDA2GM, 0, &ad1843_RDA2GM, 0); ad1843_init() 551 ad1843_set_recsrc(ad1843, 2); ad1843_init() 552 ad1843_write_multi(ad1843, 2, &ad1843_LMGE, 1, &ad1843_RMGE, 1); ad1843_init() 555 ad1843_write_multi(ad1843, 3, ad1843_init()
|