diff options
author | Liam Girdwood <lrg@ti.com> | 2011-07-24 15:59:44 -0400 |
---|---|---|
committer | Paolo Pisati <paolo.pisati@canonical.com> | 2012-08-17 04:18:25 -0400 |
commit | ad578b9dd93624c073edc24bf5185cd8a90c748d (patch) | |
tree | 17e2a481107f9dbdc70c7f0997561ef0a8bd554a /sound | |
parent | 66ec52141b9cf37192397b5936bdfb4f061f0dc8 (diff) |
Subject: [PATCH 074/104] ASoC: core - add dynamic kcontrols
TODO: First phase of dynamic kcontrols. More todo.
Signed-off-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/soc-core.c | 5 | ||||
-rw-r--r-- | sound/soc/soc-dapm.c | 14 |
2 files changed, 10 insertions, 9 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 4e5d87b10e3..5cae2124705 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -2124,7 +2124,8 @@ int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, | |||
2124 | if (uinfo->value.enumerated.item > e->max - 1) | 2124 | if (uinfo->value.enumerated.item > e->max - 1) |
2125 | uinfo->value.enumerated.item = e->max - 1; | 2125 | uinfo->value.enumerated.item = e->max - 1; |
2126 | strcpy(uinfo->value.enumerated.name, | 2126 | strcpy(uinfo->value.enumerated.name, |
2127 | e->texts[uinfo->value.enumerated.item]); | 2127 | snd_soc_get_enum_text(e, uinfo->value.enumerated.item)); |
2128 | |||
2128 | return 0; | 2129 | return 0; |
2129 | } | 2130 | } |
2130 | EXPORT_SYMBOL_GPL(snd_soc_info_enum_double); | 2131 | EXPORT_SYMBOL_GPL(snd_soc_info_enum_double); |
@@ -2288,7 +2289,7 @@ int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol, | |||
2288 | if (uinfo->value.enumerated.item > e->max - 1) | 2289 | if (uinfo->value.enumerated.item > e->max - 1) |
2289 | uinfo->value.enumerated.item = e->max - 1; | 2290 | uinfo->value.enumerated.item = e->max - 1; |
2290 | strcpy(uinfo->value.enumerated.name, | 2291 | strcpy(uinfo->value.enumerated.name, |
2291 | e->texts[uinfo->value.enumerated.item]); | 2292 | snd_soc_get_enum_text(e, uinfo->value.enumerated.item)); |
2292 | return 0; | 2293 | return 0; |
2293 | } | 2294 | } |
2294 | EXPORT_SYMBOL_GPL(snd_soc_info_enum_ext); | 2295 | EXPORT_SYMBOL_GPL(snd_soc_info_enum_ext); |
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 29d0800e134..12f294961af 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -594,7 +594,7 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w, | |||
594 | 594 | ||
595 | p->connect = 0; | 595 | p->connect = 0; |
596 | for (i = 0; i < e->max; i++) { | 596 | for (i = 0; i < e->max; i++) { |
597 | if (!(strcmp(p->name, e->texts[i])) && item == i) | 597 | if (!(strcmp(p->name, snd_soc_get_enum_text(e, i))) && item == i) |
598 | p->connect = 1; | 598 | p->connect = 1; |
599 | } | 599 | } |
600 | } | 600 | } |
@@ -610,7 +610,7 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w, | |||
610 | * that the default mux choice (the first) will be | 610 | * that the default mux choice (the first) will be |
611 | * correctly powered up during initialization. | 611 | * correctly powered up during initialization. |
612 | */ | 612 | */ |
613 | if (!strcmp(p->name, e->texts[0])) | 613 | if (!strcmp(p->name, snd_soc_get_enum_text(e, 0))) |
614 | p->connect = 1; | 614 | p->connect = 1; |
615 | } | 615 | } |
616 | break; | 616 | break; |
@@ -628,7 +628,7 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w, | |||
628 | 628 | ||
629 | p->connect = 0; | 629 | p->connect = 0; |
630 | for (i = 0; i < e->max; i++) { | 630 | for (i = 0; i < e->max; i++) { |
631 | if (!(strcmp(p->name, e->texts[i])) && item == i) | 631 | if (!(strcmp(p->name, snd_soc_get_enum_text(e, i))) && item == i) |
632 | p->connect = 1; | 632 | p->connect = 1; |
633 | } | 633 | } |
634 | } | 634 | } |
@@ -669,11 +669,11 @@ static int dapm_connect_mux(struct snd_soc_dapm_context *dapm, | |||
669 | int i; | 669 | int i; |
670 | 670 | ||
671 | for (i = 0; i < e->max; i++) { | 671 | for (i = 0; i < e->max; i++) { |
672 | if (!(strcmp(control_name, e->texts[i]))) { | 672 | if (!(strcmp(control_name, snd_soc_get_enum_text(e, i)))) { |
673 | list_add(&path->list, &dapm->card->paths); | 673 | list_add(&path->list, &dapm->card->paths); |
674 | list_add(&path->list_sink, &dest->sources); | 674 | list_add(&path->list_sink, &dest->sources); |
675 | list_add(&path->list_source, &src->sinks); | 675 | list_add(&path->list_source, &src->sinks); |
676 | path->name = (char*)e->texts[i]; | 676 | path->name = (char*)snd_soc_get_enum_text(e, i); |
677 | dapm_set_path_status(dest, path, 0); | 677 | dapm_set_path_status(dest, path, 0); |
678 | return 0; | 678 | return 0; |
679 | } | 679 | } |
@@ -1830,12 +1830,12 @@ int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget, | |||
1830 | if (path->kcontrol != kcontrol) | 1830 | if (path->kcontrol != kcontrol) |
1831 | continue; | 1831 | continue; |
1832 | 1832 | ||
1833 | if (!path->name || !e->texts[mux]) | 1833 | if (!path->name || !snd_soc_get_enum_text(e, mux)) |
1834 | continue; | 1834 | continue; |
1835 | 1835 | ||
1836 | found = 1; | 1836 | found = 1; |
1837 | /* we now need to match the string in the enum to the path */ | 1837 | /* we now need to match the string in the enum to the path */ |
1838 | if (!(strcmp(path->name, e->texts[mux]))) | 1838 | if (!(strcmp(path->name, snd_soc_get_enum_text(e, mux)))) |
1839 | path->connect = 1; /* new connection */ | 1839 | path->connect = 1; /* new connection */ |
1840 | else | 1840 | else |
1841 | path->connect = 0; /* old connection must be powered down */ | 1841 | path->connect = 0; /* old connection must be powered down */ |