ak4113
void (*change_callback)(struct ak4113 *ak4113, unsigned char c0,
void *private_data, struct ak4113 **r_ak4113);
void snd_ak4113_reg_write(struct ak4113 *ak4113, unsigned char reg,
void snd_ak4113_reinit(struct ak4113 *ak4113);
int snd_ak4113_build(struct ak4113 *ak4113,
int snd_ak4113_external_rate(struct ak4113 *ak4113);
int snd_ak4113_check_rate_and_errors(struct ak4113 *ak4113, unsigned int flags);
void snd_ak4113_suspend(struct ak4113 *chip);
void snd_ak4113_resume(struct ak4113 *chip);
static inline void snd_ak4113_suspend(struct ak4113 *chip) {}
static inline void snd_ak4113_resume(struct ak4113 *chip) {}
void snd_ak4113_reg_write(struct ak4113 *chip, unsigned char reg,
static void ak4113_init_regs(struct ak4113 *chip)
void snd_ak4113_reinit(struct ak4113 *chip)
struct ak4113 *chip = snd_kcontrol_chip(kcontrol);
struct ak4113 *chip = snd_kcontrol_chip(kcontrol);
struct ak4113 *chip = snd_kcontrol_chip(kcontrol);
struct ak4113 *chip = snd_kcontrol_chip(kcontrol);
static void ak4113_init_regs(struct ak4113 *chip);
struct ak4113 *chip = snd_kcontrol_chip(kcontrol);
struct ak4113 *chip = snd_kcontrol_chip(kcontrol);
static void reg_write(struct ak4113 *ak4113, unsigned char reg,
struct ak4113 *chip = snd_kcontrol_chip(kcontrol);
ak4113->write(ak4113->private_data, reg, val);
if (reg < sizeof(ak4113->regmap))
ak4113->regmap[reg] = val;
struct ak4113 *chip = snd_kcontrol_chip(kcontrol);
static inline unsigned char reg_read(struct ak4113 *ak4113, unsigned char reg)
return ak4113->read(ak4113->private_data, reg);
static void snd_ak4113_free(struct ak4113 *chip)
struct ak4113 *ak4113 = entry->private_data;
val = reg_read(ak4113, reg);
static void snd_ak4113_proc_init(struct ak4113 *ak4113)
snd_card_ro_proc_new(ak4113->card, "ak4113", ak4113,
int snd_ak4113_build(struct ak4113 *ak4113,
ak4113->substream = cap_substream;
kctl = snd_ctl_new1(&snd_ak4113_iec958_controls[idx], ak4113);
err = snd_ctl_add(ak4113->card, kctl);
ak4113->kctls[idx] = kctl;
snd_ak4113_proc_init(ak4113);
schedule_delayed_work(&ak4113->work, HZ / 10);
struct ak4113 *chip = device->device_data;
int snd_ak4113_external_rate(struct ak4113 *ak4113)
rcs1 = reg_read(ak4113, AK4113_REG_RCS1);
int snd_ak4113_check_rate_and_errors(struct ak4113 *ak4113, unsigned int flags)
ak4113->substream ? ak4113->substream->runtime : NULL;
rcs1 = reg_read(ak4113, AK4113_REG_RCS1);
rcs0 = reg_read(ak4113, AK4113_REG_RCS0);
rcs2 = reg_read(ak4113, AK4113_REG_RCS2);
scoped_guard(spinlock_irqsave, &ak4113->lock) {
ak4113->errors[AK4113_PARITY_ERRORS]++;
ak4113->errors[AK4113_V_BIT_ERRORS]++;
ak4113->errors[AK4113_CCRC_ERRORS]++;
ak4113->errors[AK4113_QCRC_ERRORS]++;
c0 = (ak4113->rcs0 & (AK4113_QINT | AK4113_CINT | AK4113_STC |
c1 = (ak4113->rcs1 & (AK4113_DTSCD | AK4113_NPCM | AK4113_PEM |
ak4113->rcs0 = rcs0 & ~(AK4113_QINT | AK4113_CINT | AK4113_STC);
ak4113->rcs1 = rcs1;
ak4113->rcs2 = rcs2;
snd_ctl_notify(ak4113->card, SNDRV_CTL_EVENT_MASK_VALUE,
&ak4113->kctls[0]->id);
snd_ctl_notify(ak4113->card, SNDRV_CTL_EVENT_MASK_VALUE,
&ak4113->kctls[1]->id);
snd_ctl_notify(ak4113->card, SNDRV_CTL_EVENT_MASK_VALUE,
&ak4113->kctls[2]->id);
snd_ctl_notify(ak4113->card, SNDRV_CTL_EVENT_MASK_VALUE,
&ak4113->kctls[3]->id);
snd_ctl_notify(ak4113->card, SNDRV_CTL_EVENT_MASK_VALUE,
&ak4113->kctls[4]->id);
snd_ctl_notify(ak4113->card, SNDRV_CTL_EVENT_MASK_VALUE,
&ak4113->kctls[6]->id);
snd_ctl_notify(ak4113->card, SNDRV_CTL_EVENT_MASK_VALUE,
&ak4113->kctls[8]->id);
void *private_data, struct ak4113 **r_ak4113)
snd_ctl_notify(ak4113->card, SNDRV_CTL_EVENT_MASK_VALUE,
&ak4113->kctls[9]->id);
snd_ctl_notify(ak4113->card, SNDRV_CTL_EVENT_MASK_VALUE,
&ak4113->kctls[10]->id);
snd_ctl_notify(ak4113->card, SNDRV_CTL_EVENT_MASK_VALUE,
&ak4113->kctls[11]->id);
if (ak4113->change_callback && (c0 | c1) != 0)
ak4113->change_callback(ak4113, c0, c1);
snd_pcm_stream_lock_irqsave(ak4113->substream, _flags);
if (snd_pcm_running(ak4113->substream)) {
struct ak4113 *chip;
snd_pcm_stop(ak4113->substream,
snd_pcm_stream_unlock_irqrestore(ak4113->substream, _flags);
struct ak4113 *chip = container_of(work, struct ak4113, work.work);
void snd_ak4113_suspend(struct ak4113 *chip)
void snd_ak4113_resume(struct ak4113 *chip)
ice, &spec->ak4113);
spec->ak4113->change_callback = qtet_ak4113_change;
spec->ak4113->change_callback_private = ice;
spec->ak4113->check_flags = 0;
struct ak4113 *ak4113;
return snd_ak4113_build(spec->ak4113,
static void qtet_ak4113_change(struct ak4113 *ak4113, unsigned char c0,
struct snd_ice1712 *ice = ak4113->change_callback_private;
rate = snd_ak4113_external_rate(ak4113);
rate = snd_ak4113_external_rate(spec->ak4113);