diff options
author | Liam Girdwood <lrg@ti.com> | 2011-07-04 17:10:52 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-07-05 14:07:39 -0400 |
commit | b7950641374ddb41e9a03ff61b43f9ab3fcf763d (patch) | |
tree | afd469b165d71265caabb9070d24167419ad1f18 /sound/soc/soc-dapm.c | |
parent | a491a5c84f34febfebd4cb0b8c9add97977efa97 (diff) |
ASoC: core - Add platform widget IO
Allow platform driver widgets to perform any IO required for DAPM.
Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r-- | sound/soc/soc-dapm.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index ceb2ba44fd3f..54fa2e5e3078 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -128,14 +128,22 @@ static int soc_widget_read(struct snd_soc_dapm_widget *w, int reg) | |||
128 | { | 128 | { |
129 | if (w->codec) | 129 | if (w->codec) |
130 | return snd_soc_read(w->codec, reg); | 130 | return snd_soc_read(w->codec, reg); |
131 | return 0; | 131 | else if (w->platform) |
132 | return snd_soc_platform_read(w->platform, reg); | ||
133 | |||
134 | dev_err(w->dapm->dev, "no valid widget read method\n"); | ||
135 | return -1; | ||
132 | } | 136 | } |
133 | 137 | ||
134 | static int soc_widget_write(struct snd_soc_dapm_widget *w, int reg, int val) | 138 | static int soc_widget_write(struct snd_soc_dapm_widget *w, int reg, int val) |
135 | { | 139 | { |
136 | if (w->codec) | 140 | if (w->codec) |
137 | return snd_soc_write(w->codec, reg, val); | 141 | return snd_soc_write(w->codec, reg, val); |
138 | return 0; | 142 | else if (w->platform) |
143 | return snd_soc_platform_write(w->platform, reg, val); | ||
144 | |||
145 | dev_err(w->dapm->dev, "no valid widget write method\n"); | ||
146 | return -1; | ||
139 | } | 147 | } |
140 | 148 | ||
141 | static int soc_widget_update_bits(struct snd_soc_dapm_widget *w, | 149 | static int soc_widget_update_bits(struct snd_soc_dapm_widget *w, |
@@ -2495,6 +2503,7 @@ int snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm, | |||
2495 | dapm->n_widgets++; | 2503 | dapm->n_widgets++; |
2496 | w->dapm = dapm; | 2504 | w->dapm = dapm; |
2497 | w->codec = dapm->codec; | 2505 | w->codec = dapm->codec; |
2506 | w->platform = dapm->platform; | ||
2498 | INIT_LIST_HEAD(&w->sources); | 2507 | INIT_LIST_HEAD(&w->sources); |
2499 | INIT_LIST_HEAD(&w->sinks); | 2508 | INIT_LIST_HEAD(&w->sinks); |
2500 | INIT_LIST_HEAD(&w->list); | 2509 | INIT_LIST_HEAD(&w->list); |