[alsa-devel] [PATCH v3 1/3] ASoC: DAPM: Add private data pointer for DAPM widget
Peter Ujfalusi
peter.ujfalusi at ti.com
Fri Aug 26 15:33:21 CEST 2011
Support for using custom private data assigned
per DAPM widget.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi at ti.com>
---
include/sound/soc-dapm.h | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index e0583b7..c10d4cc 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -474,6 +474,7 @@ struct snd_soc_dapm_widget {
unsigned char force:1; /* force state */
unsigned char ignore_suspend:1; /* kept enabled over suspend */
int subseq; /* sort within widget type */
+ void *private_data; /* for widget specific data */
int (*power_check)(struct snd_soc_dapm_widget *w);
@@ -535,4 +536,16 @@ struct snd_soc_dapm_widget_list {
struct snd_soc_dapm_widget *widgets[0];
};
+/* Accessors for snd_soc_dapm_widget->private_data */
+static inline void *snd_soc_dapm_widget_get_pdata(struct snd_soc_dapm_widget *w)
+{
+ return w->private_data;
+}
+
+static inline void snd_soc_dapm_widget_set_pdata(struct snd_soc_dapm_widget *w,
+ void *data)
+{
+ w->private_data = data;
+}
+
#endif
--
1.7.6.1
More information about the Alsa-devel
mailing list