aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sound/soc-dapm.h1
-rw-r--r--include/sound/soc.h13
-rw-r--r--sound/soc/soc-dapm.c10
3 files changed, 13 insertions, 11 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 8d7416e46861..78633efd40ee 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -440,7 +440,6 @@ void dapm_mark_endpoints_dirty(struct snd_soc_card *card);
440int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, 440int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream,
441 struct snd_soc_dapm_widget_list **list); 441 struct snd_soc_dapm_widget_list **list);
442 442
443struct snd_soc_codec *snd_soc_dapm_kcontrol_codec(struct snd_kcontrol *kcontrol);
444struct snd_soc_dapm_context *snd_soc_dapm_kcontrol_dapm( 443struct snd_soc_dapm_context *snd_soc_dapm_kcontrol_dapm(
445 struct snd_kcontrol *kcontrol); 444 struct snd_kcontrol *kcontrol);
446 445
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 0d1ade195628..85a6853a40bb 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1258,6 +1258,19 @@ static inline struct snd_soc_dapm_context *snd_soc_component_get_dapm(
1258 return component->dapm_ptr; 1258 return component->dapm_ptr;
1259} 1259}
1260 1260
1261/**
1262 * snd_soc_dapm_kcontrol_codec() - Returns the codec associated to a kcontrol
1263 * @kcontrol: The kcontrol
1264 *
1265 * This function must only be used on DAPM contexts that are known to be part of
1266 * a CODEC (e.g. in a CODEC driver). Otherwise the behavior is undefined.
1267 */
1268static inline struct snd_soc_codec *snd_soc_dapm_kcontrol_codec(
1269 struct snd_kcontrol *kcontrol)
1270{
1271 return snd_soc_dapm_to_codec(snd_soc_dapm_kcontrol_dapm(kcontrol));
1272}
1273
1261/* codec IO */ 1274/* codec IO */
1262unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg); 1275unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg);
1263int snd_soc_write(struct snd_soc_codec *codec, unsigned int reg, 1276int snd_soc_write(struct snd_soc_codec *codec, unsigned int reg,
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index b6f88202b8c9..95337c832258 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -473,16 +473,6 @@ struct snd_soc_dapm_context *snd_soc_dapm_kcontrol_dapm(
473} 473}
474EXPORT_SYMBOL_GPL(snd_soc_dapm_kcontrol_dapm); 474EXPORT_SYMBOL_GPL(snd_soc_dapm_kcontrol_dapm);
475 475
476/**
477 * snd_soc_dapm_kcontrol_codec() - Returns the codec associated to a kcontrol
478 * @kcontrol: The kcontrol
479 */
480struct snd_soc_codec *snd_soc_dapm_kcontrol_codec(struct snd_kcontrol *kcontrol)
481{
482 return snd_soc_dapm_to_codec(snd_soc_dapm_kcontrol_dapm(kcontrol));
483}
484EXPORT_SYMBOL_GPL(snd_soc_dapm_kcontrol_codec);
485
486static void dapm_reset(struct snd_soc_card *card) 476static void dapm_reset(struct snd_soc_card *card)
487{ 477{
488 struct snd_soc_dapm_widget *w; 478 struct snd_soc_dapm_widget *w;