aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorDaniel Ribeiro <drwyrm@gmail.com>2009-06-07 01:49:11 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-06-08 05:53:12 -0400
commit46f5822f7841697d4aedaf4672661d7a765172cd (patch)
tree3812a50996393f069ea22329562d3ae53b78d590 /sound/soc/soc-dapm.c
parent74b8f955a73d20b1e22403fd1ef85834fbf38d98 (diff)
ASoC: Allow 32 bit registers for DAPM
Replace the remaining unsigned shorts with unsigned ints. Tested with pcap2 codec (25 bits registers). Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 21c69074aa17..7ad8afa8553d 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -268,7 +268,7 @@ static int dapm_connect_mixer(struct snd_soc_codec *codec,
268static int dapm_update_bits(struct snd_soc_dapm_widget *widget) 268static int dapm_update_bits(struct snd_soc_dapm_widget *widget)
269{ 269{
270 int change, power; 270 int change, power;
271 unsigned short old, new; 271 unsigned int old, new;
272 struct snd_soc_codec *codec = widget->codec; 272 struct snd_soc_codec *codec = widget->codec;
273 273
274 /* check for valid widgets */ 274 /* check for valid widgets */
@@ -1372,7 +1372,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
1372 int max = mc->max; 1372 int max = mc->max;
1373 unsigned int mask = (1 << fls(max)) - 1; 1373 unsigned int mask = (1 << fls(max)) - 1;
1374 unsigned int invert = mc->invert; 1374 unsigned int invert = mc->invert;
1375 unsigned short val, val2, val_mask; 1375 unsigned int val, val2, val_mask;
1376 int ret; 1376 int ret;
1377 1377
1378 val = (ucontrol->value.integer.value[0] & mask); 1378 val = (ucontrol->value.integer.value[0] & mask);
@@ -1436,7 +1436,7 @@ int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol,
1436{ 1436{
1437 struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol); 1437 struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
1438 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 1438 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1439 unsigned short val, bitmask; 1439 unsigned int val, bitmask;
1440 1440
1441 for (bitmask = 1; bitmask < e->max; bitmask <<= 1) 1441 for (bitmask = 1; bitmask < e->max; bitmask <<= 1)
1442 ; 1442 ;
@@ -1464,8 +1464,8 @@ int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
1464{ 1464{
1465 struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol); 1465 struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
1466 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 1466 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1467 unsigned short val, mux; 1467 unsigned int val, mux;
1468 unsigned short mask, bitmask; 1468 unsigned int mask, bitmask;
1469 int ret = 0; 1469 int ret = 0;
1470 1470
1471 for (bitmask = 1; bitmask < e->max; bitmask <<= 1) 1471 for (bitmask = 1; bitmask < e->max; bitmask <<= 1)
@@ -1523,7 +1523,7 @@ int snd_soc_dapm_get_value_enum_double(struct snd_kcontrol *kcontrol,
1523{ 1523{
1524 struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol); 1524 struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
1525 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 1525 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1526 unsigned short reg_val, val, mux; 1526 unsigned int reg_val, val, mux;
1527 1527
1528 reg_val = snd_soc_read(widget->codec, e->reg); 1528 reg_val = snd_soc_read(widget->codec, e->reg);
1529 val = (reg_val >> e->shift_l) & e->mask; 1529 val = (reg_val >> e->shift_l) & e->mask;
@@ -1563,8 +1563,8 @@ int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol,
1563{ 1563{
1564 struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol); 1564 struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
1565 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 1565 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1566 unsigned short val, mux; 1566 unsigned int val, mux;
1567 unsigned short mask; 1567 unsigned int mask;
1568 int ret = 0; 1568 int ret = 0;
1569 1569
1570 if (ucontrol->value.enumerated.item[0] > e->max - 1) 1570 if (ucontrol->value.enumerated.item[0] > e->max - 1)