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);
38 static void reg_dump(struct ak4117 *ak4117)
44 printk(KERN_DEBUG "reg[%02x] = %02x (%02x)\n", i, reg_read(ak4117, i), i < sizeof(ak4117->regmap) ? ak4117->regmap[i] : 0);
48 static void snd_ak4117_free(struct ak4117 *chip)
56 struct ak4117 *chip = device->device_data;
62 const unsigned char pgm[5], void *private_data, struct ak4117 **r_ak4117)
64 struct ak4117 *chip;
102 void snd_ak4117_reg_write(struct ak4117 *chip, unsigned char reg, unsigned char mask, unsigned char val)
109 void snd_ak4117_reinit(struct ak4117 *chip)
156 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
171 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
193 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
202 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
228 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
244 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
278 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
300 struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
411 int snd_ak4117_build(struct ak4117 *ak4117, struct snd_pcm_substream *cap_substream)
419 ak4117->substream = cap_substream;
421 kctl = snd_ctl_new1(&snd_ak4117_iec958_controls[idx], ak4117);
426 err = snd_ctl_add(ak4117->card, kctl);
429 ak4117->kctls[idx] = kctl;
434 int snd_ak4117_external_rate(struct ak4117 *ak4117)
438 rcs1 = reg_read(ak4117, AK4117_REG_RCS1);
442 int snd_ak4117_check_rate_and_errors(struct ak4117 *ak4117, unsigned int flags)
444 struct snd_pcm_runtime *runtime = ak4117->substream ? ak4117->substream->runtime : NULL;
450 rcs1 = reg_read(ak4117, AK4117_REG_RCS1);
453 rcs0 = reg_read(ak4117, AK4117_REG_RCS0);
454 rcs2 = reg_read(ak4117, AK4117_REG_RCS2);
456 spin_lock_irqsave(&ak4117->lock, _flags);
458 ak4117->errors[AK4117_PARITY_ERRORS]++;
460 ak4117->errors[AK4117_V_BIT_ERRORS]++;
462 ak4117->errors[AK4117_CCRC_ERRORS]++;
464 ak4117->errors[AK4117_QCRC_ERRORS]++;
465 c0 = (ak4117->rcs0 & (AK4117_QINT | AK4117_CINT | AK4117_STC | AK4117_AUDION | AK4117_AUTO | AK4117_UNLCK)) ^
467 c1 = (ak4117->rcs1 & (AK4117_DTSCD | AK4117_NPCM | AK4117_PEM | 0x0f)) ^
469 ak4117->rcs0 = rcs0 & ~(AK4117_QINT | AK4117_CINT | AK4117_STC);
470 ak4117->rcs1 = rcs1;
471 ak4117->rcs2 = rcs2;
472 spin_unlock_irqrestore(&ak4117->lock, _flags);
475 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[0]->id);
477 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[1]->id);
479 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[2]->id);
481 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[3]->id);
485 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[4]->id);
488 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[6]->id);
490 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[8]->id);
493 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[9]->id);
495 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[10]->id);
497 snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[11]->id);
499 if (ak4117->change_callback && (c0 | c1) != 0)
500 ak4117->change_callback(ak4117, c0, c1);
506 snd_pcm_stream_lock_irqsave(ak4117->substream, _flags);
507 if (snd_pcm_running(ak4117->substream)) {
509 snd_pcm_stop(ak4117->substream, SNDRV_PCM_STATE_DRAINING);
513 snd_pcm_stream_unlock_irqrestore(ak4117->substream, _flags);
520 struct ak4117 *chip = from_timer(chip, t, timer);