Lines Matching defs:ak4117

14 #include <sound/ak4117.h>
25 static void reg_write(struct ak4117 *ak4117, unsigned char reg, unsigned char val)
27 ak4117->write(ak4117->private_data, reg, val);
28 if (reg < sizeof(ak4117->regmap))
29 ak4117->regmap[reg] = val;
32 static inline unsigned char reg_read(struct ak4117 *ak4117, unsigned char reg)
34 return ak4117->read(ak4117->private_data, reg);
37 static void snd_ak4117_free(struct ak4117 *chip)
45 struct ak4117 *chip = device->device_data;
51 const unsigned char pgm[5], void *private_data, struct ak4117 **r_ak4117)
53 struct ak4117 *chip;
91 void snd_ak4117_reg_write(struct ak4117 *chip, unsigned char reg, unsigned char mask, unsigned char val)
98 void snd_ak4117_reinit(struct ak4117 *chip)
145 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
159 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
181 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
190 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
215 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
231 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
265 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
287 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
398 int snd_ak4117_build(struct ak4117 *ak4117, struct snd_pcm_substream *cap_substream)
406 ak4117->substream = cap_substream;
408 kctl = snd_ctl_new1(&snd_ak4117_iec958_controls[idx], ak4117);
413 err = snd_ctl_add(ak4117->card, kctl);
416 ak4117->kctls[idx] = kctl;
421 int snd_ak4117_external_rate(struct ak4117 *ak4117)
425 rcs1 = reg_read(ak4117, AK4117_REG_RCS1);
429 int snd_ak4117_check_rate_and_errors(struct ak4117 *ak4117, unsigned int flags)
431 struct snd_pcm_runtime *runtime = ak4117->substream ? ak4117->substream->runtime : NULL;
437 rcs1 = reg_read(ak4117, AK4117_REG_RCS1);
440 rcs0 = reg_read(ak4117, AK4117_REG_RCS0);
441 rcs2 = reg_read(ak4117, AK4117_REG_RCS2);
442 scoped_guard(spinlock_irqsave, &ak4117->lock) {
444 ak4117->errors[AK4117_PARITY_ERRORS]++;
446 ak4117->errors[AK4117_V_BIT_ERRORS]++;
448 ak4117->errors[AK4117_CCRC_ERRORS]++;
450 ak4117->errors[AK4117_QCRC_ERRORS]++;
451 c0 = (ak4117->rcs0 & (AK4117_QINT | AK4117_CINT | AK4117_STC | AK4117_AUDION | AK4117_AUTO | AK4117_UNLCK)) ^
453 c1 = (ak4117->rcs1 & (AK4117_DTSCD | AK4117_NPCM | AK4117_PEM | 0x0f)) ^
455 ak4117->rcs0 = rcs0 & ~(AK4117_QINT | AK4117_CINT | AK4117_STC);
456 ak4117->rcs1 = rcs1;
457 ak4117->rcs2 = rcs2;
461 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[0]->id);
463 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[1]->id);
465 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[2]->id);
467 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[3]->id);
471 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[4]->id);
474 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[6]->id);
476 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[8]->id);
479 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[9]->id);
481 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[10]->id);
483 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[11]->id);
485 if (ak4117->change_callback && (c0 | c1) != 0)
486 ak4117->change_callback(ak4117, c0, c1);
492 snd_pcm_stream_lock_irqsave(ak4117->substream, _flags);
493 if (snd_pcm_running(ak4117->substream)) {
494 snd_pcm_stop(ak4117->substream, SNDRV_PCM_STATE_DRAINING);
498 snd_pcm_stream_unlock_irqrestore(ak4117->substream, _flags);
505 struct ak4117 *chip = timer_container_of(chip, t, timer);