summaryrefslogtreecommitdiffstats
path: root/sound/pci/asihpi/hpicmn.c
diff options
context:
space:
mode:
authorEliot Blennerhassett <eblennerhassett@audioscience.com>2010-07-05 22:37:10 +0200
committerTakashi Iwai <tiwai@suse.de>2010-07-06 08:20:21 +0200
commit36ed8bdd867314660b8dca2d1b6d9e92352b319b (patch)
tree35c9c26d395a553bd75d992b02545838a8fd7427 /sound/pci/asihpi/hpicmn.c
parentALSA: asihpi - Change compander API and tidy (diff)
downloadlinux-36ed8bdd867314660b8dca2d1b6d9e92352b319b.tar.xz
linux-36ed8bdd867314660b8dca2d1b6d9e92352b319b.zip
ALSA: asihpi - Minor HPI error handling fixes
Handle errors in tuner level caching, Ccorrect error code for aesebu rx status. Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/asihpi/hpicmn.c')
-rw-r--r--sound/pci/asihpi/hpicmn.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sound/pci/asihpi/hpicmn.c b/sound/pci/asihpi/hpicmn.c
index fcd64539d9ef..dda4f1c6f658 100644
--- a/sound/pci/asihpi/hpicmn.c
+++ b/sound/pci/asihpi/hpicmn.c
@@ -353,7 +353,12 @@ short hpi_check_control_cache(struct hpi_control_cache *p_cache,
phr->u.c.param1 = pC->u.t.band;
else if ((phm->u.c.attribute == HPI_TUNER_LEVEL)
&& (phm->u.c.param1 == HPI_TUNER_LEVEL_AVERAGE))
- phr->u.c.param1 = pC->u.t.level;
+ if (pC->u.t.level == HPI_ERROR_ILLEGAL_CACHE_VALUE) {
+ phr->u.c.param1 = 0;
+ phr->error =
+ HPI_ERROR_INVALID_CONTROL_ATTRIBUTE;
+ } else
+ phr->u.c.param1 = pC->u.t.level;
else
found = 0;
break;
@@ -397,7 +402,8 @@ short hpi_check_control_cache(struct hpi_control_cache *p_cache,
if (pC->u.clk.source_index ==
HPI_ERROR_ILLEGAL_CACHE_VALUE) {
phr->u.c.param1 = 0;
- phr->error = HPI_ERROR_INVALID_OPERATION;
+ phr->error =
+ HPI_ERROR_INVALID_CONTROL_ATTRIBUTE;
} else
phr->u.c.param1 = pC->u.clk.source_index;
} else if (phm->u.c.attribute == HPI_SAMPLECLOCK_SAMPLERATE)