Skip to contentSkip to conversation

ASoC: Add card driver data

PATCH In review Mark Brown 3 participants 3 messages Jan 28, 2011

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ASoC: Add card driver data

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.

---
 include/sound/soc.h |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
include/sound/soc.h +13 -0
index 7ecdaef..4b6c0a8 100644
@@ -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)
 {
Signature · 1 line
1.7.2.3
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · 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.

Signature · 3 lines
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
#2 lore raw

Liam Girdwood wrote on Friday, January 28, 2011 6:20 AM:

Quoted 11 lines · Mark Brown
Quoted 2 lines

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

Quoted 4 lines

data as this is used by the core to retrieve the card in callbacks from the device model and PM core.

Thanks. This is obviously exactly what I need too.

Signature · 1 line
nvpublic