Lines Matching refs:ak4117

25 static void reg_write(struct ak4117 *ak4117, unsigned char reg, unsigned char val)  in reg_write()  argument
27 ak4117->write(ak4117->private_data, reg, val); in reg_write()
28 if (reg < sizeof(ak4117->regmap)) in reg_write()
29 ak4117->regmap[reg] = val; in reg_write()
32 static inline unsigned char reg_read(struct ak4117 *ak4117, unsigned char reg) in reg_read() argument
34 return ak4117->read(ak4117->private_data, reg); in reg_read()
38 static void reg_dump(struct ak4117 *ak4117)
44 …(KERN_DEBUG "reg[%02x] = %02x (%02x)\n", i, reg_read(ak4117, i), i < sizeof(ak4117->regmap) ? ak41…
48 static void snd_ak4117_free(struct ak4117 *chip) in snd_ak4117_free()
56 struct ak4117 *chip = device->device_data; in snd_ak4117_dev_free()
62 const unsigned char pgm[5], void *private_data, struct ak4117 **r_ak4117) in snd_ak4117_create()
64 struct ak4117 *chip; in snd_ak4117_create()
102 void snd_ak4117_reg_write(struct ak4117 *chip, unsigned char reg, unsigned char mask, unsigned char… in snd_ak4117_reg_write()
109 void snd_ak4117_reinit(struct ak4117 *chip) in snd_ak4117_reinit()
156 struct ak4117 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4117_in_error_get()
171 struct ak4117 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4117_in_bit_get()
193 struct ak4117 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4117_rx_get()
202 struct ak4117 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4117_rx_put()
228 struct ak4117 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4117_rate_get()
244 struct ak4117 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4117_spdif_get()
278 struct ak4117 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4117_spdif_pget()
300 struct ak4117 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4117_spdif_qget()
411 int snd_ak4117_build(struct ak4117 *ak4117, struct snd_pcm_substream *cap_substream) in snd_ak4117_build() argument
419 ak4117->substream = cap_substream; in snd_ak4117_build()
421 kctl = snd_ctl_new1(&snd_ak4117_iec958_controls[idx], ak4117); in snd_ak4117_build()
426 err = snd_ctl_add(ak4117->card, kctl); in snd_ak4117_build()
429 ak4117->kctls[idx] = kctl; in snd_ak4117_build()
434 int snd_ak4117_external_rate(struct ak4117 *ak4117) in snd_ak4117_external_rate() argument
438 rcs1 = reg_read(ak4117, AK4117_REG_RCS1); in snd_ak4117_external_rate()
442 int snd_ak4117_check_rate_and_errors(struct ak4117 *ak4117, unsigned int flags) in snd_ak4117_check_rate_and_errors() argument
444 struct snd_pcm_runtime *runtime = ak4117->substream ? ak4117->substream->runtime : NULL; in snd_ak4117_check_rate_and_errors()
450 rcs1 = reg_read(ak4117, AK4117_REG_RCS1); in snd_ak4117_check_rate_and_errors()
453 rcs0 = reg_read(ak4117, AK4117_REG_RCS0); in snd_ak4117_check_rate_and_errors()
454 rcs2 = reg_read(ak4117, AK4117_REG_RCS2); in snd_ak4117_check_rate_and_errors()
456 spin_lock_irqsave(&ak4117->lock, _flags); in snd_ak4117_check_rate_and_errors()
458 ak4117->errors[AK4117_PARITY_ERRORS]++; in snd_ak4117_check_rate_and_errors()
460 ak4117->errors[AK4117_V_BIT_ERRORS]++; in snd_ak4117_check_rate_and_errors()
462 ak4117->errors[AK4117_CCRC_ERRORS]++; in snd_ak4117_check_rate_and_errors()
464 ak4117->errors[AK4117_QCRC_ERRORS]++; in snd_ak4117_check_rate_and_errors()
465 …c0 = (ak4117->rcs0 & (AK4117_QINT | AK4117_CINT | AK4117_STC | AK4117_AUDION | AK4117_AUTO | AK411… in snd_ak4117_check_rate_and_errors()
467 c1 = (ak4117->rcs1 & (AK4117_DTSCD | AK4117_NPCM | AK4117_PEM | 0x0f)) ^ in snd_ak4117_check_rate_and_errors()
469 ak4117->rcs0 = rcs0 & ~(AK4117_QINT | AK4117_CINT | AK4117_STC); in snd_ak4117_check_rate_and_errors()
470 ak4117->rcs1 = rcs1; in snd_ak4117_check_rate_and_errors()
471 ak4117->rcs2 = rcs2; in snd_ak4117_check_rate_and_errors()
472 spin_unlock_irqrestore(&ak4117->lock, _flags); in snd_ak4117_check_rate_and_errors()
475 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[0]->id); in snd_ak4117_check_rate_and_errors()
477 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[1]->id); in snd_ak4117_check_rate_and_errors()
479 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[2]->id); in snd_ak4117_check_rate_and_errors()
481 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[3]->id); in snd_ak4117_check_rate_and_errors()
485 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[4]->id); in snd_ak4117_check_rate_and_errors()
488 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[6]->id); in snd_ak4117_check_rate_and_errors()
490 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[8]->id); in snd_ak4117_check_rate_and_errors()
493 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[9]->id); in snd_ak4117_check_rate_and_errors()
495 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[10]->id); in snd_ak4117_check_rate_and_errors()
497 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[11]->id); in snd_ak4117_check_rate_and_errors()
499 if (ak4117->change_callback && (c0 | c1) != 0) in snd_ak4117_check_rate_and_errors()
500 ak4117->change_callback(ak4117, c0, c1); in snd_ak4117_check_rate_and_errors()
506 snd_pcm_stream_lock_irqsave(ak4117->substream, _flags); in snd_ak4117_check_rate_and_errors()
507 if (snd_pcm_running(ak4117->substream)) { in snd_ak4117_check_rate_and_errors()
509 snd_pcm_stop(ak4117->substream, SNDRV_PCM_STATE_DRAINING); in snd_ak4117_check_rate_and_errors()
513 snd_pcm_stream_unlock_irqrestore(ak4117->substream, _flags); in snd_ak4117_check_rate_and_errors()
520 struct ak4117 *chip = from_timer(chip, t, timer); in snd_ak4117_timer()