Lines Matching defs:ak4114

14 #include <sound/ak4114.h>
25 static void ak4114_init_regs(struct ak4114 *chip);
27 static void reg_write(struct ak4114 *ak4114, unsigned char reg, unsigned char val)
29 ak4114->write(ak4114->private_data, reg, val);
31 ak4114->regmap[reg] = val;
33 ak4114->txcsb[reg-AK4114_REG_TXCSB0] = val;
36 static inline unsigned char reg_read(struct ak4114 *ak4114, unsigned char reg)
38 return ak4114->read(ak4114->private_data, reg);
41 static void snd_ak4114_free(struct ak4114 *chip)
50 struct ak4114 *chip = device->device_data;
58 void *private_data, struct ak4114 **r_ak4114)
60 struct ak4114 *chip;
103 void snd_ak4114_reg_write(struct ak4114 *chip, unsigned char reg, unsigned char mask, unsigned char val)
113 static void ak4114_init_regs(struct ak4114 *chip)
131 void snd_ak4114_reinit(struct ak4114 *chip)
171 struct ak4114 *chip = snd_kcontrol_chip(kcontrol);
185 struct ak4114 *chip = snd_kcontrol_chip(kcontrol);
207 struct ak4114 *chip = snd_kcontrol_chip(kcontrol);
223 struct ak4114 *chip = snd_kcontrol_chip(kcontrol);
234 struct ak4114 *chip = snd_kcontrol_chip(kcontrol);
245 struct ak4114 *chip = snd_kcontrol_chip(kcontrol);
279 struct ak4114 *chip = snd_kcontrol_chip(kcontrol);
301 struct ak4114 *chip = snd_kcontrol_chip(kcontrol);
431 struct ak4114 *ak4114 = entry->private_data;
433 /* all ak4114 registers 0x00 - 0x1f */
435 val = reg_read(ak4114, reg);
440 static void snd_ak4114_proc_init(struct ak4114 *ak4114)
442 snd_card_ro_proc_new(ak4114->card, "ak4114", ak4114,
446 int snd_ak4114_build(struct ak4114 *ak4114,
456 ak4114->playback_substream = ply_substream;
457 ak4114->capture_substream = cap_substream;
459 kctl = snd_ctl_new1(&snd_ak4114_iec958_controls[idx], ak4114);
465 ak4114->kctls[idx] = NULL;
474 err = snd_ctl_add(ak4114->card, kctl);
477 ak4114->kctls[idx] = kctl;
479 snd_ak4114_proc_init(ak4114);
481 schedule_delayed_work(&ak4114->work, HZ / 10);
487 static void ak4114_notify(struct ak4114 *ak4114,
491 if (!ak4114->kctls[0])
495 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE,
496 &ak4114->kctls[0]->id);
498 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE,
499 &ak4114->kctls[1]->id);
501 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE,
502 &ak4114->kctls[2]->id);
504 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE,
505 &ak4114->kctls[3]->id);
509 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE,
510 &ak4114->kctls[4]->id);
513 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE,
514 &ak4114->kctls[9]->id);
516 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE,
517 &ak4114->kctls[10]->id);
520 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE,
521 &ak4114->kctls[11]->id);
523 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE,
524 &ak4114->kctls[12]->id);
526 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE,
527 &ak4114->kctls[13]->id);
529 snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE,
530 &ak4114->kctls[14]->id);
533 int snd_ak4114_external_rate(struct ak4114 *ak4114)
537 rcs1 = reg_read(ak4114, AK4114_REG_RCS1);
542 int snd_ak4114_check_rate_and_errors(struct ak4114 *ak4114, unsigned int flags)
544 struct snd_pcm_runtime *runtime = ak4114->capture_substream ? ak4114->capture_substream->runtime : NULL;
550 rcs1 = reg_read(ak4114, AK4114_REG_RCS1);
553 rcs0 = reg_read(ak4114, AK4114_REG_RCS0);
554 scoped_guard(spinlock_irqsave, &ak4114->lock) {
556 ak4114->errors[AK4114_PARITY_ERRORS]++;
558 ak4114->errors[AK4114_V_BIT_ERRORS]++;
560 ak4114->errors[AK4114_CCRC_ERRORS]++;
562 ak4114->errors[AK4114_QCRC_ERRORS]++;
563 c0 = (ak4114->rcs0 & (AK4114_QINT | AK4114_CINT | AK4114_PEM | AK4114_AUDION | AK4114_AUTO | AK4114_UNLCK)) ^
565 c1 = (ak4114->rcs1 & 0xf0) ^ (rcs1 & 0xf0);
566 ak4114->rcs0 = rcs0 & ~(AK4114_QINT | AK4114_CINT);
567 ak4114->rcs1 = rcs1;
570 ak4114_notify(ak4114, rcs0, rcs1, c0, c1);
571 if (ak4114->change_callback && (c0 | c1) != 0)
572 ak4114->change_callback(ak4114, c0, c1);
578 snd_pcm_stream_lock_irqsave(ak4114->capture_substream, _flags);
579 if (snd_pcm_running(ak4114->capture_substream)) {
580 snd_pcm_stop(ak4114->capture_substream, SNDRV_PCM_STATE_DRAINING);
583 snd_pcm_stream_unlock_irqrestore(ak4114->capture_substream, _flags);
591 struct ak4114 *chip = container_of(work, struct ak4114, work.work);
600 void snd_ak4114_suspend(struct ak4114 *chip)
607 void snd_ak4114_resume(struct ak4114 *chip)