diff options
author | Florian Fainelli <florian@openwrt.org> | 2014-09-27 19:10:51 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2014-09-27 19:10:51 +0000 |
commit | c65ec1aa8fbcbafdc568c4206286ca77f3234caf (patch) | |
tree | 563323b952b96b10d5cca5b124de2cd9266259b0 /target/linux/brcm2708/patches-3.10/0186-Fix-volsw_range-functions-so-SOC_DOUBLE_R_RANGE_TLV-.patch | |
parent | 7771ecddf3b18914aa513ef818042516f61e79a9 (diff) | |
download | upstream-c65ec1aa8fbcbafdc568c4206286ca77f3234caf.tar.gz upstream-c65ec1aa8fbcbafdc568c4206286ca77f3234caf.tar.bz2 upstream-c65ec1aa8fbcbafdc568c4206286ca77f3234caf.zip |
brcm2708: update 3.10 patches with raspberrypi/rpi-3.10.y of 27 Apr. 2014
Update the 3.10 rasperry patches by rebasing raspberry/rpi-3.10-y
against linux-stable/v3.10.49.
Signed-off-by: Florian Fainelli <florian@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42678 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm2708/patches-3.10/0186-Fix-volsw_range-functions-so-SOC_DOUBLE_R_RANGE_TLV-.patch')
-rw-r--r-- | target/linux/brcm2708/patches-3.10/0186-Fix-volsw_range-functions-so-SOC_DOUBLE_R_RANGE_TLV-.patch | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/target/linux/brcm2708/patches-3.10/0186-Fix-volsw_range-functions-so-SOC_DOUBLE_R_RANGE_TLV-.patch b/target/linux/brcm2708/patches-3.10/0186-Fix-volsw_range-functions-so-SOC_DOUBLE_R_RANGE_TLV-.patch new file mode 100644 index 0000000000..2b49c73658 --- /dev/null +++ b/target/linux/brcm2708/patches-3.10/0186-Fix-volsw_range-functions-so-SOC_DOUBLE_R_RANGE_TLV-.patch @@ -0,0 +1,78 @@ +From 4c91cfe1cfa38f4e17e96cd7d78ac2a4fa86d5c9 Mon Sep 17 00:00:00 2001 +From: Howard Mitchell <hm@hmbedded.co.uk> +Date: Fri, 28 Mar 2014 16:27:57 +0000 +Subject: [PATCH 186/196] Fix volsw_range functions so SOC_DOUBLE_R_RANGE_TLV + works. + +This is so that the correct rabge of values as specified +with the SOC_DOUBLE_R_RANGE_TLV macro are sent to the +hardware for both the normal and invert cases. +--- + sound/soc/soc-core.c | 22 ++++++++++------------ + 1 file changed, 10 insertions(+), 12 deletions(-) + +diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c +index d18272c..be302e1 100644 +--- a/sound/soc/soc-core.c ++++ b/sound/soc/soc-core.c +@@ -2925,8 +2925,8 @@ int snd_soc_info_volsw_range(struct snd_kcontrol *kcontrol, + + uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; + uinfo->count = snd_soc_volsw_is_stereo(mc) ? 2 : 1; +- uinfo->value.integer.min = 0; +- uinfo->value.integer.max = platform_max - min; ++ uinfo->value.integer.min = min; ++ uinfo->value.integer.max = platform_max; + + return 0; + } +@@ -2957,9 +2957,10 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, + unsigned int val, val_mask; + int ret; + +- val = ((ucontrol->value.integer.value[0] + min) & mask); + if (invert) +- val = max - val; ++ val = ((max - ucontrol->value.integer.value[0] + min) & mask); ++ else ++ val = (ucontrol->value.integer.value[0] & mask); + val_mask = mask << shift; + val = val << shift; + +@@ -2968,9 +2969,10 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, + return ret; + + if (snd_soc_volsw_is_stereo(mc)) { +- val = ((ucontrol->value.integer.value[1] + min) & mask); + if (invert) +- val = max - val; ++ val = ((max - ucontrol->value.integer.value[1] + min) & mask); ++ else ++ val = (ucontrol->value.integer.value[1] & mask); + val_mask = mask << shift; + val = val << shift; + +@@ -3008,18 +3010,14 @@ int snd_soc_get_volsw_range(struct snd_kcontrol *kcontrol, + (snd_soc_read(codec, reg) >> shift) & mask; + if (invert) + ucontrol->value.integer.value[0] = +- max - ucontrol->value.integer.value[0]; +- ucontrol->value.integer.value[0] = +- ucontrol->value.integer.value[0] - min; ++ max - ucontrol->value.integer.value[0] + min; + + if (snd_soc_volsw_is_stereo(mc)) { + ucontrol->value.integer.value[1] = + (snd_soc_read(codec, rreg) >> shift) & mask; + if (invert) + ucontrol->value.integer.value[1] = +- max - ucontrol->value.integer.value[1]; +- ucontrol->value.integer.value[1] = +- ucontrol->value.integer.value[1] - min; ++ max - ucontrol->value.integer.value[1] + min; + } + + return 0; +-- +1.9.1 + |