summaryrefslogtreecommitdiff
path: root/sound/aoa/codecs/snd-aoa-codec-tas.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-31 23:16:28 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-31 23:16:28 (GMT)
commite1a9c9872dd004617555dff079b357a6ffd945e9 (patch)
treec34779e59712ff345f8e4ee97e74086a85b34974 /sound/aoa/codecs/snd-aoa-codec-tas.c
parentfcc3ff4f9d695a80dc6e6058e0d631a3026ed4c3 (diff)
parent2ecba4ffbbc6c85fce8c3878514be415edace413 (diff)
downloadlinux-fsl-qoriq-e1a9c9872dd004617555dff079b357a6ffd945e9.tar.xz
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/perex/alsa
* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/perex/alsa: (299 commits) [ALSA] version 1.0.16rc2 [ALSA] hda: fix Mic in as output [ALSA] emu10k1 - Another EMU0404 Board ID [ALSA] emu10k1 - Fix kthread handling at resume [ALSA] emu10k1: General cleanup, add new locks, fix alsa bug#3501, kernel bug#9304. [ALSA] emu10k1 - Use enum for emu_model types [ALSA] emu10k1 - Don't create emu1010 controls for non-emu boards [ALSA] emu10k1 - 1616(M) cardbus improvements [ALSA] snd:emu10k1: E-Mu updates. Fixes to firmware loading and support for 0404. [ALSA] emu10k1: Add comments regarding E-Mu ins and outs. [ALSA] oxygen: revert SPI clock frequency change for AK4396/WM8785 [ALSA] es1938 - improve capture hw pointer reads [ALSA] HDA-Intel - Add support for Intel SCH [ALSA] hda: Add GPIO mute support to STAC9205 [ALSA] hda-codec - Add Dell T3400 support [ALSA] hda-codec - Add model for HP DV9553EG laptop [ALSA] hda-codec - Control SPDIF as slave [ALSA] hda_intel: ALSA HD Audio patch for Intel ICH10 DeviceID's [ALSA] Fix Oops with PCM OSS sync [ALSA] hda-codec - Add speaker automute to ALC262 HP models ...
Diffstat (limited to 'sound/aoa/codecs/snd-aoa-codec-tas.c')
-rw-r--r--sound/aoa/codecs/snd-aoa-codec-tas.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/sound/aoa/codecs/snd-aoa-codec-tas.c b/sound/aoa/codecs/snd-aoa-codec-tas.c
index 70c3416..7a16a33 100644
--- a/sound/aoa/codecs/snd-aoa-codec-tas.c
+++ b/sound/aoa/codecs/snd-aoa-codec-tas.c
@@ -248,6 +248,13 @@ static int tas_snd_vol_put(struct snd_kcontrol *kcontrol,
{
struct tas *tas = snd_kcontrol_chip(kcontrol);
+ if (ucontrol->value.integer.value[0] < 0 ||
+ ucontrol->value.integer.value[0] > 177)
+ return -EINVAL;
+ if (ucontrol->value.integer.value[1] < 0 ||
+ ucontrol->value.integer.value[1] > 177)
+ return -EINVAL;
+
mutex_lock(&tas->mtx);
if (tas->cached_volume_l == ucontrol->value.integer.value[0]
&& tas->cached_volume_r == ucontrol->value.integer.value[1]) {
@@ -401,6 +408,10 @@ static int tas_snd_drc_range_put(struct snd_kcontrol *kcontrol,
{
struct tas *tas = snd_kcontrol_chip(kcontrol);
+ if (ucontrol->value.integer.value[0] < 0 ||
+ ucontrol->value.integer.value[0] > TAS3004_DRC_MAX)
+ return -EINVAL;
+
mutex_lock(&tas->mtx);
if (tas->drc_range == ucontrol->value.integer.value[0]) {
mutex_unlock(&tas->mtx);
@@ -447,7 +458,7 @@ static int tas_snd_drc_switch_put(struct snd_kcontrol *kcontrol,
return 0;
}
- tas->drc_enabled = ucontrol->value.integer.value[0];
+ tas->drc_enabled = !!ucontrol->value.integer.value[0];
if (tas->hw_enabled)
tas3004_set_drc(tas);
mutex_unlock(&tas->mtx);
@@ -494,6 +505,8 @@ static int tas_snd_capture_source_put(struct snd_kcontrol *kcontrol,
struct tas *tas = snd_kcontrol_chip(kcontrol);
int oldacr;
+ if (ucontrol->value.enumerated.item[0] > 1)
+ return -EINVAL;
mutex_lock(&tas->mtx);
oldacr = tas->acr;
@@ -562,6 +575,9 @@ static int tas_snd_treble_put(struct snd_kcontrol *kcontrol,
{
struct tas *tas = snd_kcontrol_chip(kcontrol);
+ if (ucontrol->value.integer.value[0] < TAS3004_TREBLE_MIN ||
+ ucontrol->value.integer.value[0] > TAS3004_TREBLE_MAX)
+ return -EINVAL;
mutex_lock(&tas->mtx);
if (tas->treble == ucontrol->value.integer.value[0]) {
mutex_unlock(&tas->mtx);
@@ -610,6 +626,9 @@ static int tas_snd_bass_put(struct snd_kcontrol *kcontrol,
{
struct tas *tas = snd_kcontrol_chip(kcontrol);
+ if (ucontrol->value.integer.value[0] < TAS3004_BASS_MIN ||
+ ucontrol->value.integer.value[0] > TAS3004_BASS_MAX)
+ return -EINVAL;
mutex_lock(&tas->mtx);
if (tas->bass == ucontrol->value.integer.value[0]) {
mutex_unlock(&tas->mtx);