summaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-03-24 09:24:39 +0100
committerTakashi Iwai <tiwai@suse.de>2014-03-24 09:24:39 +0100
commit89c8ae73459443eabfd7f24b4379ddb9248f1ee9 (patch)
treee13e7c3a780668da718161305f2d1741c0b7ae6f /include/sound
parent2df6742f613840a0b0a1590fb28f7af5b058a673 (diff)
parente090d5b6ad20056ec0ef58727e3ae95fd82be090 (diff)
Merge tag 'asoc-v3.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
ASoC: Updates for v3.15 A few more updates for the merge window: - Fixes for the simple-card DAI format DT mess. - A new driver for Cirrus cs42xx8 devices. - DT support for a couple more devices. - A revert of a previous buggy fix for soc-pcm, plus a few more fixes and cleanups.
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/soc.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index f7de629728b..0b83168d8ff 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1107,6 +1107,19 @@ struct soc_enum {
const unsigned int *values;
};
+/**
+ * snd_soc_component_to_codec() - Casts a component to the CODEC it is embedded in
+ * @component: The component to cast to a CODEC
+ *
+ * This function must only be used on components that are known to be CODECs.
+ * Otherwise the behavior is undefined.
+ */
+static inline struct snd_soc_codec *snd_soc_component_to_codec(
+ struct snd_soc_component *component)
+{
+ return container_of(component, struct snd_soc_codec, component);
+}
+
/* codec IO */
unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg);
unsigned int snd_soc_write(struct snd_soc_codec *codec,