diff options
Diffstat (limited to 'sound/i2c/other/ak4114.c')
-rw-r--r-- | sound/i2c/other/ak4114.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/sound/i2c/other/ak4114.c b/sound/i2c/other/ak4114.c index d53c9bb36281..7fb1aeb46915 100644 --- a/sound/i2c/other/ak4114.c +++ b/sound/i2c/other/ak4114.c | |||
@@ -194,12 +194,11 @@ static int snd_ak4114_in_error_get(struct snd_kcontrol *kcontrol, | |||
194 | struct snd_ctl_elem_value *ucontrol) | 194 | struct snd_ctl_elem_value *ucontrol) |
195 | { | 195 | { |
196 | struct ak4114 *chip = snd_kcontrol_chip(kcontrol); | 196 | struct ak4114 *chip = snd_kcontrol_chip(kcontrol); |
197 | long *ptr; | ||
198 | 197 | ||
199 | spin_lock_irq(&chip->lock); | 198 | spin_lock_irq(&chip->lock); |
200 | ptr = (long *)(((char *)chip) + kcontrol->private_value); | 199 | ucontrol->value.integer.value[0] = |
201 | ucontrol->value.integer.value[0] = *ptr; | 200 | chip->errors[kcontrol->private_value]; |
202 | *ptr = 0; | 201 | chip->errors[kcontrol->private_value] = 0; |
203 | spin_unlock_irq(&chip->lock); | 202 | spin_unlock_irq(&chip->lock); |
204 | return 0; | 203 | return 0; |
205 | } | 204 | } |
@@ -341,7 +340,7 @@ static struct snd_kcontrol_new snd_ak4114_iec958_controls[] = { | |||
341 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, | 340 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, |
342 | .info = snd_ak4114_in_error_info, | 341 | .info = snd_ak4114_in_error_info, |
343 | .get = snd_ak4114_in_error_get, | 342 | .get = snd_ak4114_in_error_get, |
344 | .private_value = offsetof(struct ak4114, parity_errors), | 343 | .private_value = AK4114_PARITY_ERRORS, |
345 | }, | 344 | }, |
346 | { | 345 | { |
347 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 346 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
@@ -349,7 +348,7 @@ static struct snd_kcontrol_new snd_ak4114_iec958_controls[] = { | |||
349 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, | 348 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, |
350 | .info = snd_ak4114_in_error_info, | 349 | .info = snd_ak4114_in_error_info, |
351 | .get = snd_ak4114_in_error_get, | 350 | .get = snd_ak4114_in_error_get, |
352 | .private_value = offsetof(struct ak4114, v_bit_errors), | 351 | .private_value = AK4114_V_BIT_ERRORS, |
353 | }, | 352 | }, |
354 | { | 353 | { |
355 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 354 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
@@ -357,7 +356,7 @@ static struct snd_kcontrol_new snd_ak4114_iec958_controls[] = { | |||
357 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, | 356 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, |
358 | .info = snd_ak4114_in_error_info, | 357 | .info = snd_ak4114_in_error_info, |
359 | .get = snd_ak4114_in_error_get, | 358 | .get = snd_ak4114_in_error_get, |
360 | .private_value = offsetof(struct ak4114, ccrc_errors), | 359 | .private_value = AK4114_CCRC_ERRORS, |
361 | }, | 360 | }, |
362 | { | 361 | { |
363 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 362 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
@@ -365,7 +364,7 @@ static struct snd_kcontrol_new snd_ak4114_iec958_controls[] = { | |||
365 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, | 364 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, |
366 | .info = snd_ak4114_in_error_info, | 365 | .info = snd_ak4114_in_error_info, |
367 | .get = snd_ak4114_in_error_get, | 366 | .get = snd_ak4114_in_error_get, |
368 | .private_value = offsetof(struct ak4114, qcrc_errors), | 367 | .private_value = AK4114_QCRC_ERRORS, |
369 | }, | 368 | }, |
370 | { | 369 | { |
371 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 370 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
@@ -581,13 +580,13 @@ int snd_ak4114_check_rate_and_errors(struct ak4114 *ak4114, unsigned int flags) | |||
581 | rcs0 = reg_read(ak4114, AK4114_REG_RCS0); | 580 | rcs0 = reg_read(ak4114, AK4114_REG_RCS0); |
582 | spin_lock_irqsave(&ak4114->lock, _flags); | 581 | spin_lock_irqsave(&ak4114->lock, _flags); |
583 | if (rcs0 & AK4114_PAR) | 582 | if (rcs0 & AK4114_PAR) |
584 | ak4114->parity_errors++; | 583 | ak4114->errors[AK4114_PARITY_ERRORS]++; |
585 | if (rcs1 & AK4114_V) | 584 | if (rcs1 & AK4114_V) |
586 | ak4114->v_bit_errors++; | 585 | ak4114->errors[AK4114_V_BIT_ERRORS]++; |
587 | if (rcs1 & AK4114_CCRC) | 586 | if (rcs1 & AK4114_CCRC) |
588 | ak4114->ccrc_errors++; | 587 | ak4114->errors[AK4114_CCRC_ERRORS]++; |
589 | if (rcs1 & AK4114_QCRC) | 588 | if (rcs1 & AK4114_QCRC) |
590 | ak4114->qcrc_errors++; | 589 | ak4114->errors[AK4114_QCRC_ERRORS]++; |
591 | c0 = (ak4114->rcs0 & (AK4114_QINT | AK4114_CINT | AK4114_PEM | AK4114_AUDION | AK4114_AUTO | AK4114_UNLCK)) ^ | 590 | c0 = (ak4114->rcs0 & (AK4114_QINT | AK4114_CINT | AK4114_PEM | AK4114_AUDION | AK4114_AUTO | AK4114_UNLCK)) ^ |
592 | (rcs0 & (AK4114_QINT | AK4114_CINT | AK4114_PEM | AK4114_AUDION | AK4114_AUTO | AK4114_UNLCK)); | 591 | (rcs0 & (AK4114_QINT | AK4114_CINT | AK4114_PEM | AK4114_AUDION | AK4114_AUTO | AK4114_UNLCK)); |
593 | c1 = (ak4114->rcs1 & 0xf0) ^ (rcs1 & 0xf0); | 592 | c1 = (ak4114->rcs1 & 0xf0) ^ (rcs1 & 0xf0); |