All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: Add card driver data
@ 2011-01-28 13:15 Mark Brown
  2011-01-28 13:19 ` Liam Girdwood
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2011-01-28 13:15 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: alsa-devel, patches, Stephen Warren, Mark Brown

Provide driver data for cards within the card structure. To simplify the
implementation of the PM operations we don't use the struct device driver
data as this is used by the core to retrieve the card in callbacks from
the device model and PM core.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 include/sound/soc.h |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 7ecdaef..4b6c0a8 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -705,6 +705,8 @@ struct snd_soc_card {
 	struct dentry *debugfs_pop_time;
 #endif
 	u32 pop_time;
+
+	void *drvdata;
 };
 
 /* SoC machine DAI configuration, glues a codec and cpu DAI together */
@@ -756,6 +758,17 @@ unsigned int snd_soc_write(struct snd_soc_codec *codec,
 
 /* device driver data */
 
+static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,
+		void *data)
+{
+	card->drvdata = data;
+}
+
+static inline void *snd_soc_card_get_drvdata(struct snd_soc_card *card)
+{
+	return card->drvdata;
+}
+
 static inline void snd_soc_codec_set_drvdata(struct snd_soc_codec *codec,
 		void *data)
 {
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-28 16:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-28 13:15 [PATCH] ASoC: Add card driver data Mark Brown
2011-01-28 13:19 ` Liam Girdwood
2011-01-28 16:11   ` Stephen Warren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.