Lines Matching refs:ak4114
40 static void ak4114_init_regs(struct ak4114 *chip);
42 static void reg_write(struct ak4114 *ak4114, unsigned char reg, unsigned char val) in reg_write() argument
44 ak4114->write(ak4114->private_data, reg, val); in reg_write()
46 ak4114->regmap[reg] = val; in reg_write()
48 ak4114->txcsb[reg-AK4114_REG_TXCSB0] = val; in reg_write()
51 static inline unsigned char reg_read(struct ak4114 *ak4114, unsigned char reg) in reg_read() argument
53 return ak4114->read(ak4114->private_data, reg); in reg_read()
57 static void reg_dump(struct ak4114 *ak4114)
63 …ERN_DEBUG "reg[%02x] = %02x (%02x)\n", i, reg_read(ak4114, i), i < ARRAY_SIZE(ak4114->regmap) ? ak…
67 static void snd_ak4114_free(struct ak4114 *chip) in snd_ak4114_free()
76 struct ak4114 *chip = device->device_data; in snd_ak4114_dev_free()
84 void *private_data, struct ak4114 **r_ak4114) in snd_ak4114_create()
86 struct ak4114 *chip; in snd_ak4114_create()
128 void snd_ak4114_reg_write(struct ak4114 *chip, unsigned char reg, unsigned char mask, unsigned char… in snd_ak4114_reg_write()
138 static void ak4114_init_regs(struct ak4114 *chip) in ak4114_init_regs()
156 void snd_ak4114_reinit(struct ak4114 *chip) in snd_ak4114_reinit()
196 struct ak4114 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4114_in_error_get()
212 struct ak4114 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4114_in_bit_get()
234 struct ak4114 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4114_rate_get()
250 struct ak4114 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4114_spdif_get()
261 struct ak4114 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4114_spdif_playback_get()
272 struct ak4114 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4114_spdif_playback_put()
306 struct ak4114 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4114_spdif_pget()
328 struct ak4114 *chip = snd_kcontrol_chip(kcontrol); in snd_ak4114_spdif_qget()
344 .private_value = offsetof(struct ak4114, parity_errors),
352 .private_value = offsetof(struct ak4114, v_bit_errors),
360 .private_value = offsetof(struct ak4114, ccrc_errors),
368 .private_value = offsetof(struct ak4114, qcrc_errors),
458 struct ak4114 *ak4114 = entry->private_data; in snd_ak4114_proc_regs_read() local
462 val = reg_read(ak4114, reg); in snd_ak4114_proc_regs_read()
467 static void snd_ak4114_proc_init(struct ak4114 *ak4114) in snd_ak4114_proc_init() argument
470 if (!snd_card_proc_new(ak4114->card, "ak4114", &entry)) in snd_ak4114_proc_init()
471 snd_info_set_text_ops(entry, ak4114, snd_ak4114_proc_regs_read); in snd_ak4114_proc_init()
474 int snd_ak4114_build(struct ak4114 *ak4114, in snd_ak4114_build() argument
484 ak4114->playback_substream = ply_substream; in snd_ak4114_build()
485 ak4114->capture_substream = cap_substream; in snd_ak4114_build()
487 kctl = snd_ctl_new1(&snd_ak4114_iec958_controls[idx], ak4114); in snd_ak4114_build()
493 ak4114->kctls[idx] = NULL; in snd_ak4114_build()
502 err = snd_ctl_add(ak4114->card, kctl); in snd_ak4114_build()
505 ak4114->kctls[idx] = kctl; in snd_ak4114_build()
507 snd_ak4114_proc_init(ak4114); in snd_ak4114_build()
509 schedule_delayed_work(&ak4114->work, HZ / 10); in snd_ak4114_build()
515 static void ak4114_notify(struct ak4114 *ak4114, in ak4114_notify() argument
519 if (!ak4114->kctls[0]) in ak4114_notify()
523 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, in ak4114_notify()
524 &ak4114->kctls[0]->id); in ak4114_notify()
526 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, in ak4114_notify()
527 &ak4114->kctls[1]->id); in ak4114_notify()
529 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, in ak4114_notify()
530 &ak4114->kctls[2]->id); in ak4114_notify()
532 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, in ak4114_notify()
533 &ak4114->kctls[3]->id); in ak4114_notify()
537 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, in ak4114_notify()
538 &ak4114->kctls[4]->id); in ak4114_notify()
541 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, in ak4114_notify()
542 &ak4114->kctls[9]->id); in ak4114_notify()
544 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, in ak4114_notify()
545 &ak4114->kctls[10]->id); in ak4114_notify()
548 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, in ak4114_notify()
549 &ak4114->kctls[11]->id); in ak4114_notify()
551 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, in ak4114_notify()
552 &ak4114->kctls[12]->id); in ak4114_notify()
554 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, in ak4114_notify()
555 &ak4114->kctls[13]->id); in ak4114_notify()
557 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, in ak4114_notify()
558 &ak4114->kctls[14]->id); in ak4114_notify()
561 int snd_ak4114_external_rate(struct ak4114 *ak4114) in snd_ak4114_external_rate() argument
565 rcs1 = reg_read(ak4114, AK4114_REG_RCS1); in snd_ak4114_external_rate()
570 int snd_ak4114_check_rate_and_errors(struct ak4114 *ak4114, unsigned int flags) in snd_ak4114_check_rate_and_errors() argument
572 …struct snd_pcm_runtime *runtime = ak4114->capture_substream ? ak4114->capture_substream->runtime :… in snd_ak4114_check_rate_and_errors()
578 rcs1 = reg_read(ak4114, AK4114_REG_RCS1); in snd_ak4114_check_rate_and_errors()
581 rcs0 = reg_read(ak4114, AK4114_REG_RCS0); in snd_ak4114_check_rate_and_errors()
582 spin_lock_irqsave(&ak4114->lock, _flags); in snd_ak4114_check_rate_and_errors()
584 ak4114->parity_errors++; in snd_ak4114_check_rate_and_errors()
586 ak4114->v_bit_errors++; in snd_ak4114_check_rate_and_errors()
588 ak4114->ccrc_errors++; in snd_ak4114_check_rate_and_errors()
590 ak4114->qcrc_errors++; in snd_ak4114_check_rate_and_errors()
591 …c0 = (ak4114->rcs0 & (AK4114_QINT | AK4114_CINT | AK4114_PEM | AK4114_AUDION | AK4114_AUTO | AK411… in snd_ak4114_check_rate_and_errors()
593 c1 = (ak4114->rcs1 & 0xf0) ^ (rcs1 & 0xf0); in snd_ak4114_check_rate_and_errors()
594 ak4114->rcs0 = rcs0 & ~(AK4114_QINT | AK4114_CINT); in snd_ak4114_check_rate_and_errors()
595 ak4114->rcs1 = rcs1; in snd_ak4114_check_rate_and_errors()
596 spin_unlock_irqrestore(&ak4114->lock, _flags); in snd_ak4114_check_rate_and_errors()
598 ak4114_notify(ak4114, rcs0, rcs1, c0, c1); in snd_ak4114_check_rate_and_errors()
599 if (ak4114->change_callback && (c0 | c1) != 0) in snd_ak4114_check_rate_and_errors()
600 ak4114->change_callback(ak4114, c0, c1); in snd_ak4114_check_rate_and_errors()
606 snd_pcm_stream_lock_irqsave(ak4114->capture_substream, _flags); in snd_ak4114_check_rate_and_errors()
607 if (snd_pcm_running(ak4114->capture_substream)) { in snd_ak4114_check_rate_and_errors()
609 snd_pcm_stop(ak4114->capture_substream, SNDRV_PCM_STATE_DRAINING); in snd_ak4114_check_rate_and_errors()
612 snd_pcm_stream_unlock_irqrestore(ak4114->capture_substream, _flags); in snd_ak4114_check_rate_and_errors()
620 struct ak4114 *chip = container_of(work, struct ak4114, work.work); in ak4114_stats()
629 void snd_ak4114_suspend(struct ak4114 *chip) in snd_ak4114_suspend()
636 void snd_ak4114_resume(struct ak4114 *chip) in snd_ak4114_resume()