diff options
-rw-r--r-- | include/sound/soc.h | 9 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 5 | ||||
-rw-r--r-- | sound/soc/soc-dapm.c | 14 |
3 files changed, 19 insertions, 9 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index 1f661a760ae..6e223ff8bf1 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -202,6 +202,14 @@ | |||
202 | #define SOC_VALUE_ENUM_SINGLE_DECL(name, xreg, xshift, xmask, xtexts, xvalues) \ | 202 | #define SOC_VALUE_ENUM_SINGLE_DECL(name, xreg, xshift, xmask, xtexts, xvalues) \ |
203 | SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues) | 203 | SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues) |
204 | 204 | ||
205 | |||
206 | /* DAI Link Host Mode Support */ | ||
207 | #define SND_SOC_DAI_LINK_NO_HOST 0x1 | ||
208 | #define SND_SOC_DAI_LINK_OPT_HOST 0x2 | ||
209 | |||
210 | #define snd_soc_get_enum_text(soc_enum, idx) \ | ||
211 | (soc_enum->texts ? soc_enum->texts[idx] : soc_enum->dtexts[idx]) | ||
212 | |||
205 | /* | 213 | /* |
206 | * Component probe and remove ordering levels for components with runtime | 214 | * Component probe and remove ordering levels for components with runtime |
207 | * dependencies. | 215 | * dependencies. |
@@ -905,6 +913,7 @@ struct soc_enum { | |||
905 | unsigned int max; | 913 | unsigned int max; |
906 | unsigned int mask; | 914 | unsigned int mask; |
907 | const char * const *texts; | 915 | const char * const *texts; |
916 | char **dtexts; | ||
908 | const unsigned int *values; | 917 | const unsigned int *values; |
909 | void *dapm; | 918 | void *dapm; |
910 | }; | 919 | }; |
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 */ |