aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 3f44150d8e30..e1a920cd8953 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1264,10 +1264,10 @@ EXPORT_SYMBOL_GPL(snd_soc_free_ac97_codec);
1264 * Returns 1 for change else 0. 1264 * Returns 1 for change else 0.
1265 */ 1265 */
1266int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg, 1266int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg,
1267 unsigned short mask, unsigned short value) 1267 unsigned int mask, unsigned int value)
1268{ 1268{
1269 int change; 1269 int change;
1270 unsigned short old, new; 1270 unsigned int old, new;
1271 1271
1272 mutex_lock(&io_mutex); 1272 mutex_lock(&io_mutex);
1273 old = snd_soc_read(codec, reg); 1273 old = snd_soc_read(codec, reg);
@@ -1294,10 +1294,10 @@ EXPORT_SYMBOL_GPL(snd_soc_update_bits);
1294 * Returns 1 for change else 0. 1294 * Returns 1 for change else 0.
1295 */ 1295 */
1296int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg, 1296int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg,
1297 unsigned short mask, unsigned short value) 1297 unsigned int mask, unsigned int value)
1298{ 1298{
1299 int change; 1299 int change;
1300 unsigned short old, new; 1300 unsigned int old, new;
1301 1301
1302 mutex_lock(&io_mutex); 1302 mutex_lock(&io_mutex);
1303 old = snd_soc_read(codec, reg); 1303 old = snd_soc_read(codec, reg);
@@ -1583,7 +1583,7 @@ int snd_soc_get_enum_double(struct snd_kcontrol *kcontrol,
1583{ 1583{
1584 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 1584 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
1585 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 1585 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1586 unsigned short val, bitmask; 1586 unsigned int val, bitmask;
1587 1587
1588 for (bitmask = 1; bitmask < e->max; bitmask <<= 1) 1588 for (bitmask = 1; bitmask < e->max; bitmask <<= 1)
1589 ; 1589 ;
@@ -1612,8 +1612,8 @@ int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol,
1612{ 1612{
1613 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 1613 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
1614 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 1614 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1615 unsigned short val; 1615 unsigned int val;
1616 unsigned short mask, bitmask; 1616 unsigned int mask, bitmask;
1617 1617
1618 for (bitmask = 1; bitmask < e->max; bitmask <<= 1) 1618 for (bitmask = 1; bitmask < e->max; bitmask <<= 1)
1619 ; 1619 ;
@@ -1649,7 +1649,7 @@ int snd_soc_get_value_enum_double(struct snd_kcontrol *kcontrol,
1649{ 1649{
1650 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 1650 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
1651 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 1651 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1652 unsigned short reg_val, val, mux; 1652 unsigned int reg_val, val, mux;
1653 1653
1654 reg_val = snd_soc_read(codec, e->reg); 1654 reg_val = snd_soc_read(codec, e->reg);
1655 val = (reg_val >> e->shift_l) & e->mask; 1655 val = (reg_val >> e->shift_l) & e->mask;
@@ -1688,8 +1688,8 @@ int snd_soc_put_value_enum_double(struct snd_kcontrol *kcontrol,
1688{ 1688{
1689 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 1689 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
1690 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 1690 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1691 unsigned short val; 1691 unsigned int val;
1692 unsigned short mask; 1692 unsigned int mask;
1693 1693
1694 if (ucontrol->value.enumerated.item[0] > e->max - 1) 1694 if (ucontrol->value.enumerated.item[0] > e->max - 1)
1695 return -EINVAL; 1695 return -EINVAL;
@@ -1849,7 +1849,7 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
1849 int max = mc->max; 1849 int max = mc->max;
1850 unsigned int mask = (1 << fls(max)) - 1; 1850 unsigned int mask = (1 << fls(max)) - 1;
1851 unsigned int invert = mc->invert; 1851 unsigned int invert = mc->invert;
1852 unsigned short val, val2, val_mask; 1852 unsigned int val, val2, val_mask;
1853 1853
1854 val = (ucontrol->value.integer.value[0] & mask); 1854 val = (ucontrol->value.integer.value[0] & mask);
1855 if (invert) 1855 if (invert)
@@ -1915,7 +1915,7 @@ int snd_soc_get_volsw_2r(struct snd_kcontrol *kcontrol,
1915 unsigned int reg2 = mc->rreg; 1915 unsigned int reg2 = mc->rreg;
1916 unsigned int shift = mc->shift; 1916 unsigned int shift = mc->shift;
1917 int max = mc->max; 1917 int max = mc->max;
1918 unsigned int mask = (1<<fls(max))-1; 1918 unsigned int mask = (1 << fls(max)) - 1;
1919 unsigned int invert = mc->invert; 1919 unsigned int invert = mc->invert;
1920 1920
1921 ucontrol->value.integer.value[0] = 1921 ucontrol->value.integer.value[0] =
@@ -1955,7 +1955,7 @@ int snd_soc_put_volsw_2r(struct snd_kcontrol *kcontrol,
1955 unsigned int mask = (1 << fls(max)) - 1; 1955 unsigned int mask = (1 << fls(max)) - 1;
1956 unsigned int invert = mc->invert; 1956 unsigned int invert = mc->invert;
1957 int err; 1957 int err;
1958 unsigned short val, val2, val_mask; 1958 unsigned int val, val2, val_mask;
1959 1959
1960 val_mask = mask << shift; 1960 val_mask = mask << shift;
1961 val = (ucontrol->value.integer.value[0] & mask); 1961 val = (ucontrol->value.integer.value[0] & mask);
@@ -2047,7 +2047,7 @@ int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol,
2047 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 2047 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
2048 unsigned int reg = mc->reg; 2048 unsigned int reg = mc->reg;
2049 int min = mc->min; 2049 int min = mc->min;
2050 unsigned short val; 2050 unsigned int val;
2051 2051
2052 val = (ucontrol->value.integer.value[0]+min) & 0xff; 2052 val = (ucontrol->value.integer.value[0]+min) & 0xff;
2053 val |= ((ucontrol->value.integer.value[1]+min) & 0xff) << 8; 2053 val |= ((ucontrol->value.integer.value[1]+min) & 0xff) << 8;