|
@@ -168,12 +168,11 @@ static int snd_ak4117_in_error_get(struct snd_kcontrol *kcontrol,
|
|
struct snd_ctl_elem_value *ucontrol)
|
|
struct snd_ctl_elem_value *ucontrol)
|
|
{
|
|
{
|
|
struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
|
|
struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
|
|
- long *ptr;
|
|
|
|
|
|
|
|
spin_lock_irq(&chip->lock);
|
|
spin_lock_irq(&chip->lock);
|
|
- ptr = (long *)(((char *)chip) + kcontrol->private_value);
|
|
|
|
- ucontrol->value.integer.value[0] = *ptr;
|
|
|
|
- *ptr = 0;
|
|
|
|
|
|
+ ucontrol->value.integer.value[0] =
|
|
|
|
+ chip->errors[kcontrol->private_value];
|
|
|
|
+ chip->errors[kcontrol->private_value] = 0;
|
|
spin_unlock_irq(&chip->lock);
|
|
spin_unlock_irq(&chip->lock);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
@@ -328,7 +327,7 @@ static struct snd_kcontrol_new snd_ak4117_iec958_controls[] = {
|
|
.access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
|
|
.access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
|
|
.info = snd_ak4117_in_error_info,
|
|
.info = snd_ak4117_in_error_info,
|
|
.get = snd_ak4117_in_error_get,
|
|
.get = snd_ak4117_in_error_get,
|
|
- .private_value = offsetof(struct ak4117, parity_errors),
|
|
|
|
|
|
+ .private_value = AK4117_PARITY_ERRORS,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
|
|
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
|
|
@@ -336,7 +335,7 @@ static struct snd_kcontrol_new snd_ak4117_iec958_controls[] = {
|
|
.access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
|
|
.access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
|
|
.info = snd_ak4117_in_error_info,
|
|
.info = snd_ak4117_in_error_info,
|
|
.get = snd_ak4117_in_error_get,
|
|
.get = snd_ak4117_in_error_get,
|
|
- .private_value = offsetof(struct ak4117, v_bit_errors),
|
|
|
|
|
|
+ .private_value = AK4117_V_BIT_ERRORS,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
|
|
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
|
|
@@ -344,7 +343,7 @@ static struct snd_kcontrol_new snd_ak4117_iec958_controls[] = {
|
|
.access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
|
|
.access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
|
|
.info = snd_ak4117_in_error_info,
|
|
.info = snd_ak4117_in_error_info,
|
|
.get = snd_ak4117_in_error_get,
|
|
.get = snd_ak4117_in_error_get,
|
|
- .private_value = offsetof(struct ak4117, ccrc_errors),
|
|
|
|
|
|
+ .private_value = AK4117_CCRC_ERRORS,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
|
|
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
|
|
@@ -352,7 +351,7 @@ static struct snd_kcontrol_new snd_ak4117_iec958_controls[] = {
|
|
.access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
|
|
.access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
|
|
.info = snd_ak4117_in_error_info,
|
|
.info = snd_ak4117_in_error_info,
|
|
.get = snd_ak4117_in_error_get,
|
|
.get = snd_ak4117_in_error_get,
|
|
- .private_value = offsetof(struct ak4117, qcrc_errors),
|
|
|
|
|
|
+ .private_value = AK4117_QCRC_ERRORS,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
|
|
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
|
|
@@ -470,13 +469,13 @@ int snd_ak4117_check_rate_and_errors(struct ak4117 *ak4117, unsigned int flags)
|
|
// printk(KERN_DEBUG "AK IRQ: rcs0 = 0x%x, rcs1 = 0x%x, rcs2 = 0x%x\n", rcs0, rcs1, rcs2);
|
|
// printk(KERN_DEBUG "AK IRQ: rcs0 = 0x%x, rcs1 = 0x%x, rcs2 = 0x%x\n", rcs0, rcs1, rcs2);
|
|
spin_lock_irqsave(&ak4117->lock, _flags);
|
|
spin_lock_irqsave(&ak4117->lock, _flags);
|
|
if (rcs0 & AK4117_PAR)
|
|
if (rcs0 & AK4117_PAR)
|
|
- ak4117->parity_errors++;
|
|
|
|
|
|
+ ak4117->errors[AK4117_PARITY_ERRORS]++;
|
|
if (rcs0 & AK4117_V)
|
|
if (rcs0 & AK4117_V)
|
|
- ak4117->v_bit_errors++;
|
|
|
|
|
|
+ ak4117->errors[AK4117_V_BIT_ERRORS]++;
|
|
if (rcs2 & AK4117_CCRC)
|
|
if (rcs2 & AK4117_CCRC)
|
|
- ak4117->ccrc_errors++;
|
|
|
|
|
|
+ ak4117->errors[AK4117_CCRC_ERRORS]++;
|
|
if (rcs2 & AK4117_QCRC)
|
|
if (rcs2 & AK4117_QCRC)
|
|
- ak4117->qcrc_errors++;
|
|
|
|
|
|
+ ak4117->errors[AK4117_QCRC_ERRORS]++;
|
|
c0 = (ak4117->rcs0 & (AK4117_QINT | AK4117_CINT | AK4117_STC | AK4117_AUDION | AK4117_AUTO | AK4117_UNLCK)) ^
|
|
c0 = (ak4117->rcs0 & (AK4117_QINT | AK4117_CINT | AK4117_STC | AK4117_AUDION | AK4117_AUTO | AK4117_UNLCK)) ^
|
|
(rcs0 & (AK4117_QINT | AK4117_CINT | AK4117_STC | AK4117_AUDION | AK4117_AUTO | AK4117_UNLCK));
|
|
(rcs0 & (AK4117_QINT | AK4117_CINT | AK4117_STC | AK4117_AUDION | AK4117_AUTO | AK4117_UNLCK));
|
|
c1 = (ak4117->rcs1 & (AK4117_DTSCD | AK4117_NPCM | AK4117_PEM | 0x0f)) ^
|
|
c1 = (ak4117->rcs1 & (AK4117_DTSCD | AK4117_NPCM | AK4117_PEM | 0x0f)) ^
|