diff options
author | Stephen Warren <swarren@nvidia.com> | 2011-04-28 19:37:58 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-05-03 14:28:47 -0400 |
commit | 82cfecdc03499be63262d60daf859b4cc1ea3fba (patch) | |
tree | 4af6e094485ecc5b9acd5525008446b6ff0cf680 /sound/soc/soc-dapm.c | |
parent | 65f7e32520fcc31c32d72e61198a4eb457656860 (diff) |
ASoC: s/w->kcontrols/w->kcontrol_news/g
A future change will modify struct snd_soc_dapm_widget to store the
actual kcontrol pointers for each kcontrol_new in a field named
kcontrols. Rename the existing kcontrols field to enable this.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.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.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 169e1767ebd0..35cc1ed00a44 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -187,7 +187,7 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w, | |||
187 | case snd_soc_dapm_mixer_named_ctl: { | 187 | case snd_soc_dapm_mixer_named_ctl: { |
188 | int val; | 188 | int val; |
189 | struct soc_mixer_control *mc = (struct soc_mixer_control *) | 189 | struct soc_mixer_control *mc = (struct soc_mixer_control *) |
190 | w->kcontrols[i].private_value; | 190 | w->kcontrol_news[i].private_value; |
191 | unsigned int reg = mc->reg; | 191 | unsigned int reg = mc->reg; |
192 | unsigned int shift = mc->shift; | 192 | unsigned int shift = mc->shift; |
193 | int max = mc->max; | 193 | int max = mc->max; |
@@ -204,7 +204,8 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w, | |||
204 | } | 204 | } |
205 | break; | 205 | break; |
206 | case snd_soc_dapm_mux: { | 206 | case snd_soc_dapm_mux: { |
207 | struct soc_enum *e = (struct soc_enum *)w->kcontrols[i].private_value; | 207 | struct soc_enum *e = (struct soc_enum *) |
208 | w->kcontrol_news[i].private_value; | ||
208 | int val, item, bitmask; | 209 | int val, item, bitmask; |
209 | 210 | ||
210 | for (bitmask = 1; bitmask < e->max; bitmask <<= 1) | 211 | for (bitmask = 1; bitmask < e->max; bitmask <<= 1) |
@@ -220,7 +221,8 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w, | |||
220 | } | 221 | } |
221 | break; | 222 | break; |
222 | case snd_soc_dapm_virt_mux: { | 223 | case snd_soc_dapm_virt_mux: { |
223 | struct soc_enum *e = (struct soc_enum *)w->kcontrols[i].private_value; | 224 | struct soc_enum *e = (struct soc_enum *) |
225 | w->kcontrol_news[i].private_value; | ||
224 | 226 | ||
225 | p->connect = 0; | 227 | p->connect = 0; |
226 | /* since a virtual mux has no backing registers to | 228 | /* since a virtual mux has no backing registers to |
@@ -235,7 +237,7 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w, | |||
235 | break; | 237 | break; |
236 | case snd_soc_dapm_value_mux: { | 238 | case snd_soc_dapm_value_mux: { |
237 | struct soc_enum *e = (struct soc_enum *) | 239 | struct soc_enum *e = (struct soc_enum *) |
238 | w->kcontrols[i].private_value; | 240 | w->kcontrol_news[i].private_value; |
239 | int val, item; | 241 | int val, item; |
240 | 242 | ||
241 | val = snd_soc_read(w->codec, e->reg); | 243 | val = snd_soc_read(w->codec, e->reg); |
@@ -310,11 +312,11 @@ static int dapm_connect_mixer(struct snd_soc_dapm_context *dapm, | |||
310 | 312 | ||
311 | /* search for mixer kcontrol */ | 313 | /* search for mixer kcontrol */ |
312 | for (i = 0; i < dest->num_kcontrols; i++) { | 314 | for (i = 0; i < dest->num_kcontrols; i++) { |
313 | if (!strcmp(control_name, dest->kcontrols[i].name)) { | 315 | if (!strcmp(control_name, dest->kcontrol_news[i].name)) { |
314 | list_add(&path->list, &dapm->card->paths); | 316 | list_add(&path->list, &dapm->card->paths); |
315 | list_add(&path->list_sink, &dest->sources); | 317 | list_add(&path->list_sink, &dest->sources); |
316 | list_add(&path->list_source, &src->sinks); | 318 | list_add(&path->list_source, &src->sinks); |
317 | path->name = dest->kcontrols[i].name; | 319 | path->name = dest->kcontrol_news[i].name; |
318 | dapm_set_path_status(dest, path, i); | 320 | dapm_set_path_status(dest, path, i); |
319 | return 0; | 321 | return 0; |
320 | } | 322 | } |
@@ -349,7 +351,7 @@ static int dapm_new_mixer(struct snd_soc_dapm_context *dapm, | |||
349 | list_for_each_entry(path, &w->sources, list_sink) { | 351 | list_for_each_entry(path, &w->sources, list_sink) { |
350 | 352 | ||
351 | /* mixer/mux paths name must match control name */ | 353 | /* mixer/mux paths name must match control name */ |
352 | if (path->name != (char*)w->kcontrols[i].name) | 354 | if (path->name != (char *)w->kcontrol_news[i].name) |
353 | continue; | 355 | continue; |
354 | 356 | ||
355 | /* add dapm control with long name. | 357 | /* add dapm control with long name. |
@@ -358,7 +360,7 @@ static int dapm_new_mixer(struct snd_soc_dapm_context *dapm, | |||
358 | * for dapm_mixer_named_ctl this is simply the | 360 | * for dapm_mixer_named_ctl this is simply the |
359 | * kcontrol name. | 361 | * kcontrol name. |
360 | */ | 362 | */ |
361 | name_len = strlen(w->kcontrols[i].name) + 1; | 363 | name_len = strlen(w->kcontrol_news[i].name) + 1; |
362 | if (w->id != snd_soc_dapm_mixer_named_ctl) | 364 | if (w->id != snd_soc_dapm_mixer_named_ctl) |
363 | name_len += 1 + strlen(w->name); | 365 | name_len += 1 + strlen(w->name); |
364 | 366 | ||
@@ -377,17 +379,17 @@ static int dapm_new_mixer(struct snd_soc_dapm_context *dapm, | |||
377 | */ | 379 | */ |
378 | snprintf(path->long_name, name_len, "%s %s", | 380 | snprintf(path->long_name, name_len, "%s %s", |
379 | w->name + prefix_len, | 381 | w->name + prefix_len, |
380 | w->kcontrols[i].name); | 382 | w->kcontrol_news[i].name); |
381 | break; | 383 | break; |
382 | case snd_soc_dapm_mixer_named_ctl: | 384 | case snd_soc_dapm_mixer_named_ctl: |
383 | snprintf(path->long_name, name_len, "%s", | 385 | snprintf(path->long_name, name_len, "%s", |
384 | w->kcontrols[i].name); | 386 | w->kcontrol_news[i].name); |
385 | break; | 387 | break; |
386 | } | 388 | } |
387 | 389 | ||
388 | path->long_name[name_len - 1] = '\0'; | 390 | path->long_name[name_len - 1] = '\0'; |
389 | 391 | ||
390 | path->kcontrol = snd_soc_cnew(&w->kcontrols[i], w, | 392 | path->kcontrol = snd_soc_cnew(&w->kcontrol_news[i], w, |
391 | path->long_name, prefix); | 393 | path->long_name, prefix); |
392 | ret = snd_ctl_add(card, path->kcontrol); | 394 | ret = snd_ctl_add(card, path->kcontrol); |
393 | if (ret < 0) { | 395 | if (ret < 0) { |
@@ -433,7 +435,7 @@ static int dapm_new_mux(struct snd_soc_dapm_context *dapm, | |||
433 | * process but we're also using the same prefix for widgets so | 435 | * process but we're also using the same prefix for widgets so |
434 | * cut the prefix off the front of the widget name. | 436 | * cut the prefix off the front of the widget name. |
435 | */ | 437 | */ |
436 | kcontrol = snd_soc_cnew(&w->kcontrols[0], w, w->name + prefix_len, | 438 | kcontrol = snd_soc_cnew(&w->kcontrol_news[0], w, w->name + prefix_len, |
437 | prefix); | 439 | prefix); |
438 | ret = snd_ctl_add(card, kcontrol); | 440 | ret = snd_ctl_add(card, kcontrol); |
439 | 441 | ||
@@ -1648,7 +1650,7 @@ static int snd_soc_dapm_add_route(struct snd_soc_dapm_context *dapm, | |||
1648 | case snd_soc_dapm_virt_mux: | 1650 | case snd_soc_dapm_virt_mux: |
1649 | case snd_soc_dapm_value_mux: | 1651 | case snd_soc_dapm_value_mux: |
1650 | ret = dapm_connect_mux(dapm, wsource, wsink, path, control, | 1652 | ret = dapm_connect_mux(dapm, wsource, wsink, path, control, |
1651 | &wsink->kcontrols[0]); | 1653 | &wsink->kcontrol_news[0]); |
1652 | if (ret != 0) | 1654 | if (ret != 0) |
1653 | goto err; | 1655 | goto err; |
1654 | break; | 1656 | break; |