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);
160 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
182 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
191 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
217 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
233 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
267 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
289 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
400 int snd_ak4117_build(struct ak4117 *ak4117, struct snd_pcm_substream *cap_substream)
408 ak4117->substream = cap_substream;
410 kctl = snd_ctl_new1(&snd_ak4117_iec958_controls[idx], ak4117);
415 err = snd_ctl_add(ak4117->card, kctl);
418 ak4117->kctls[idx] = kctl;
423 int snd_ak4117_external_rate(struct ak4117 *ak4117)
427 rcs1 = reg_read(ak4117, AK4117_REG_RCS1);
431 int snd_ak4117_check_rate_and_errors(struct ak4117 *ak4117, unsigned int flags)
433 struct snd_pcm_runtime *runtime = ak4117->substream ? ak4117->substream->runtime : NULL;
439 rcs1 = reg_read(ak4117, AK4117_REG_RCS1);
442 rcs0 = reg_read(ak4117, AK4117_REG_RCS0);
443 rcs2 = reg_read(ak4117, AK4117_REG_RCS2);
444 spin_lock_irqsave(&ak4117->lock, _flags);
446 ak4117->errors[AK4117_PARITY_ERRORS]++;
448 ak4117->errors[AK4117_V_BIT_ERRORS]++;
450 ak4117->errors[AK4117_CCRC_ERRORS]++;
452 ak4117->errors[AK4117_QCRC_ERRORS]++;
453 c0 = (ak4117->rcs0 & (AK4117_QINT | AK4117_CINT | AK4117_STC | AK4117_AUDION | AK4117_AUTO | AK4117_UNLCK)) ^
455 c1 = (ak4117->rcs1 & (AK4117_DTSCD | AK4117_NPCM | AK4117_PEM | 0x0f)) ^
457 ak4117->rcs0 = rcs0 & ~(AK4117_QINT | AK4117_CINT | AK4117_STC);
458 ak4117->rcs1 = rcs1;
459 ak4117->rcs2 = rcs2;
460 spin_unlock_irqrestore(&ak4117->lock, _flags);
463 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[0]->id);
465 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[1]->id);
467 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[2]->id);
469 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[3]->id);
473 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[4]->id);
476 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[6]->id);
478 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[8]->id);
481 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[9]->id);
483 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[10]->id);
485 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[11]->id);
487 if (ak4117->change_callback && (c0 | c1) != 0)
488 ak4117->change_callback(ak4117, c0, c1);
494 snd_pcm_stream_lock_irqsave(ak4117->substream, _flags);
495 if (snd_pcm_running(ak4117->substream)) {
496 snd_pcm_stop(ak4117->substream, SNDRV_PCM_STATE_DRAINING);
500 snd_pcm_stream_unlock_irqrestore(ak4117->substream, _flags);
507 struct ak4117 *chip = timer_container_of(chip, t, timer);