Lines Matching refs:ak4113
26 static void ak4113_init_regs(struct ak4113 *chip);
29 static void reg_write(struct ak4113 *ak4113, unsigned char reg, in reg_write() argument
32 ak4113->write(ak4113->private_data, reg, val); in reg_write()
33 if (reg < sizeof(ak4113->regmap)) in reg_write()
34 ak4113->regmap[reg] = val; in reg_write()
37 static inline unsigned char reg_read(struct ak4113 *ak4113, unsigned char reg) in reg_read() argument
39 return ak4113->read(ak4113->private_data, reg); in reg_read()
42 static void snd_ak4113_free(struct ak4113 *chip) in snd_ak4113_free()
51 struct ak4113 *chip = device->device_data; in snd_ak4113_dev_free()
58 void *private_data, struct ak4113 **r_ak4113) in snd_ak4113_create()
60 struct ak4113 *chip; in snd_ak4113_create()
101 void snd_ak4113_reg_write(struct ak4113 *chip, unsigned char reg, in snd_ak4113_reg_write()
110 static void ak4113_init_regs(struct ak4113 *chip) in ak4113_init_regs()
126 void snd_ak4113_reinit(struct ak4113 *chip) in snd_ak4113_reinit()
186 struct ak4113 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4113_in_error_get()
201 struct ak4113 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4113_in_bit_get()
224 struct ak4113 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4113_rx_get()
234 struct ak4113 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4113_rx_put()
262 struct ak4113 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4113_rate_get()
280 struct ak4113 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4113_spdif_get()
317 struct ak4113 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4113_spdif_pget()
342 struct ak4113 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4113_spdif_qget()
469 struct ak4113 *ak4113 = entry->private_data; in snd_ak4113_proc_regs_read() local
473 val = reg_read(ak4113, reg); in snd_ak4113_proc_regs_read()
478 static void snd_ak4113_proc_init(struct ak4113 *ak4113) in snd_ak4113_proc_init() argument
480 snd_card_ro_proc_new(ak4113->card, "ak4113", ak4113, in snd_ak4113_proc_init()
484 int snd_ak4113_build(struct ak4113 *ak4113, in snd_ak4113_build() argument
493 ak4113->substream = cap_substream; in snd_ak4113_build()
495 kctl = snd_ctl_new1(&snd_ak4113_iec958_controls[idx], ak4113); in snd_ak4113_build()
500 err = snd_ctl_add(ak4113->card, kctl); in snd_ak4113_build()
503 ak4113->kctls[idx] = kctl; in snd_ak4113_build()
505 snd_ak4113_proc_init(ak4113); in snd_ak4113_build()
507 schedule_delayed_work(&ak4113->work, HZ / 10); in snd_ak4113_build()
512 int snd_ak4113_external_rate(struct ak4113 *ak4113) in snd_ak4113_external_rate() argument
516 rcs1 = reg_read(ak4113, AK4113_REG_RCS1); in snd_ak4113_external_rate()
521 int snd_ak4113_check_rate_and_errors(struct ak4113 *ak4113, unsigned int flags) in snd_ak4113_check_rate_and_errors() argument
524 ak4113->substream ? ak4113->substream->runtime : NULL; in snd_ak4113_check_rate_and_errors()
530 rcs1 = reg_read(ak4113, AK4113_REG_RCS1); in snd_ak4113_check_rate_and_errors()
533 rcs0 = reg_read(ak4113, AK4113_REG_RCS0); in snd_ak4113_check_rate_and_errors()
534 rcs2 = reg_read(ak4113, AK4113_REG_RCS2); in snd_ak4113_check_rate_and_errors()
535 spin_lock_irqsave(&ak4113->lock, _flags); in snd_ak4113_check_rate_and_errors()
537 ak4113->errors[AK4113_PARITY_ERRORS]++; in snd_ak4113_check_rate_and_errors()
539 ak4113->errors[AK4113_V_BIT_ERRORS]++; in snd_ak4113_check_rate_and_errors()
541 ak4113->errors[AK4113_CCRC_ERRORS]++; in snd_ak4113_check_rate_and_errors()
543 ak4113->errors[AK4113_QCRC_ERRORS]++; in snd_ak4113_check_rate_and_errors()
544 c0 = (ak4113->rcs0 & (AK4113_QINT | AK4113_CINT | AK4113_STC | in snd_ak4113_check_rate_and_errors()
548 c1 = (ak4113->rcs1 & (AK4113_DTSCD | AK4113_NPCM | AK4113_PEM | in snd_ak4113_check_rate_and_errors()
552 ak4113->rcs0 = rcs0 & ~(AK4113_QINT | AK4113_CINT | AK4113_STC); in snd_ak4113_check_rate_and_errors()
553 ak4113->rcs1 = rcs1; in snd_ak4113_check_rate_and_errors()
554 ak4113->rcs2 = rcs2; in snd_ak4113_check_rate_and_errors()
555 spin_unlock_irqrestore(&ak4113->lock, _flags); in snd_ak4113_check_rate_and_errors()
558 snd_ctl_notify(ak4113->card, SNDRV_CTL_EVENT_MASK_VALUE, in snd_ak4113_check_rate_and_errors()
559 &ak4113->kctls[0]->id); in snd_ak4113_check_rate_and_errors()
561 snd_ctl_notify(ak4113->card, SNDRV_CTL_EVENT_MASK_VALUE, in snd_ak4113_check_rate_and_errors()
562 &ak4113->kctls[1]->id); in snd_ak4113_check_rate_and_errors()
564 snd_ctl_notify(ak4113->card, SNDRV_CTL_EVENT_MASK_VALUE, in snd_ak4113_check_rate_and_errors()
565 &ak4113->kctls[2]->id); in snd_ak4113_check_rate_and_errors()
567 snd_ctl_notify(ak4113->card, SNDRV_CTL_EVENT_MASK_VALUE, in snd_ak4113_check_rate_and_errors()
568 &ak4113->kctls[3]->id); in snd_ak4113_check_rate_and_errors()
572 snd_ctl_notify(ak4113->card, SNDRV_CTL_EVENT_MASK_VALUE, in snd_ak4113_check_rate_and_errors()
573 &ak4113->kctls[4]->id); in snd_ak4113_check_rate_and_errors()
576 snd_ctl_notify(ak4113->card, SNDRV_CTL_EVENT_MASK_VALUE, in snd_ak4113_check_rate_and_errors()
577 &ak4113->kctls[6]->id); in snd_ak4113_check_rate_and_errors()
579 snd_ctl_notify(ak4113->card, SNDRV_CTL_EVENT_MASK_VALUE, in snd_ak4113_check_rate_and_errors()
580 &ak4113->kctls[8]->id); in snd_ak4113_check_rate_and_errors()
583 snd_ctl_notify(ak4113->card, SNDRV_CTL_EVENT_MASK_VALUE, in snd_ak4113_check_rate_and_errors()
584 &ak4113->kctls[9]->id); in snd_ak4113_check_rate_and_errors()
586 snd_ctl_notify(ak4113->card, SNDRV_CTL_EVENT_MASK_VALUE, in snd_ak4113_check_rate_and_errors()
587 &ak4113->kctls[10]->id); in snd_ak4113_check_rate_and_errors()
589 snd_ctl_notify(ak4113->card, SNDRV_CTL_EVENT_MASK_VALUE, in snd_ak4113_check_rate_and_errors()
590 &ak4113->kctls[11]->id); in snd_ak4113_check_rate_and_errors()
592 if (ak4113->change_callback && (c0 | c1) != 0) in snd_ak4113_check_rate_and_errors()
593 ak4113->change_callback(ak4113, c0, c1); in snd_ak4113_check_rate_and_errors()
600 snd_pcm_stream_lock_irqsave(ak4113->substream, _flags); in snd_ak4113_check_rate_and_errors()
601 if (snd_pcm_running(ak4113->substream)) { in snd_ak4113_check_rate_and_errors()
604 snd_pcm_stop(ak4113->substream, in snd_ak4113_check_rate_and_errors()
609 snd_pcm_stream_unlock_irqrestore(ak4113->substream, _flags); in snd_ak4113_check_rate_and_errors()
617 struct ak4113 *chip = container_of(work, struct ak4113, work.work); in ak4113_stats()
627 void snd_ak4113_suspend(struct ak4113 *chip) in snd_ak4113_suspend()
634 void snd_ak4113_resume(struct ak4113 *chip) in snd_ak4113_resume()