aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorJon Smirl <jonsmirl@gmail.com>2008-07-29 06:42:27 -0400
committerJaroslav Kysela <perex@perex.cz>2008-07-29 15:32:18 -0400
commitf8ba0b7bfd06a2a5b3c49ff8d71cad31f57b0d51 (patch)
tree0e3d5fde54f21465665e54276325336be73fc718 /sound/soc/soc-dapm.c
parent4eaa9819dc08d7bfd1065ce530e31b18a119dcaf (diff)
ALSA: ASoC: Rename mask to max to reflect usage
Most of the ASoC controls refer to the maximum value that can be set for a control as mask but there is no actual requirement for all bits to be set at the highest possible value making the name mask misleading. Change the code to use max instead. Signed-off-by: Jon Smirl <jonsmirl@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index bbdca0dacba6..f08be8a329e9 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -125,13 +125,13 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w,
125 struct soc_enum *e = (struct soc_enum *)w->kcontrols[i].private_value; 125 struct soc_enum *e = (struct soc_enum *)w->kcontrols[i].private_value;
126 int val, item, bitmask; 126 int val, item, bitmask;
127 127
128 for (bitmask = 1; bitmask < e->mask; bitmask <<= 1) 128 for (bitmask = 1; bitmask < e->max; bitmask <<= 1)
129 ; 129 ;
130 val = snd_soc_read(w->codec, e->reg); 130 val = snd_soc_read(w->codec, e->reg);
131 item = (val >> e->shift_l) & (bitmask - 1); 131 item = (val >> e->shift_l) & (bitmask - 1);
132 132
133 p->connect = 0; 133 p->connect = 0;
134 for (i = 0; i < e->mask; i++) { 134 for (i = 0; i < e->max; i++) {
135 if (!(strcmp(p->name, e->texts[i])) && item == i) 135 if (!(strcmp(p->name, e->texts[i])) && item == i)
136 p->connect = 1; 136 p->connect = 1;
137 } 137 }
@@ -168,7 +168,7 @@ static int dapm_connect_mux(struct snd_soc_codec *codec,
168 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 168 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
169 int i; 169 int i;
170 170
171 for (i = 0; i < e->mask; i++) { 171 for (i = 0; i < e->max; i++) {
172 if (!(strcmp(control_name, e->texts[i]))) { 172 if (!(strcmp(control_name, e->texts[i]))) {
173 list_add(&path->list, &codec->dapm_paths); 173 list_add(&path->list, &codec->dapm_paths);
174 list_add(&path->list_sink, &dest->sources); 174 list_add(&path->list_sink, &dest->sources);
@@ -1258,7 +1258,7 @@ int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol,
1258 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 1258 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1259 unsigned short val, bitmask; 1259 unsigned short val, bitmask;
1260 1260
1261 for (bitmask = 1; bitmask < e->mask; bitmask <<= 1) 1261 for (bitmask = 1; bitmask < e->max; bitmask <<= 1)
1262 ; 1262 ;
1263 val = snd_soc_read(widget->codec, e->reg); 1263 val = snd_soc_read(widget->codec, e->reg);
1264 ucontrol->value.enumerated.item[0] = (val >> e->shift_l) & (bitmask - 1); 1264 ucontrol->value.enumerated.item[0] = (val >> e->shift_l) & (bitmask - 1);
@@ -1288,15 +1288,15 @@ int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
1288 unsigned short mask, bitmask; 1288 unsigned short mask, bitmask;
1289 int ret = 0; 1289 int ret = 0;
1290 1290
1291 for (bitmask = 1; bitmask < e->mask; bitmask <<= 1) 1291 for (bitmask = 1; bitmask < e->max; bitmask <<= 1)
1292 ; 1292 ;
1293 if (ucontrol->value.enumerated.item[0] > e->mask - 1) 1293 if (ucontrol->value.enumerated.item[0] > e->max - 1)
1294 return -EINVAL; 1294 return -EINVAL;
1295 mux = ucontrol->value.enumerated.item[0]; 1295 mux = ucontrol->value.enumerated.item[0];
1296 val = mux << e->shift_l; 1296 val = mux << e->shift_l;
1297 mask = (bitmask - 1) << e->shift_l; 1297 mask = (bitmask - 1) << e->shift_l;
1298 if (e->shift_l != e->shift_r) { 1298 if (e->shift_l != e->shift_r) {
1299 if (ucontrol->value.enumerated.item[1] > e->mask - 1) 1299 if (ucontrol->value.enumerated.item[1] > e->max - 1)
1300 return -EINVAL; 1300 return -EINVAL;
1301 val |= ucontrol->value.enumerated.item[1] << e->shift_r; 1301 val |= ucontrol->value.enumerated.item[1] << e->shift_r;
1302 mask |= (bitmask - 1) << e->shift_r; 1302 mask |= (bitmask - 1) << e->shift_r;