diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-07-09 11:43:04 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-07-09 11:43:04 +0200 |
commit | e320bc42be746b8f006d163b6e340e5fb79ce7b2 (patch) | |
tree | 70cbde5344d0a478c6a514f3f3e45fb9edb1eb0f /sound/soc/soc-dapm.c | |
parent | f187700c2d769bd3160b52f99cc4e747d5c5014b (diff) | |
parent | b5d5f59be2ac586db2db0ac324215a714961f364 (diff) | |
download | linux-e320bc42be746b8f006d163b6e340e5fb79ce7b2.tar.bz2 |
Merge branch 'for-3.1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6 into topic/asoc
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) { if (w->codec) return snd_soc_read(w->codec, reg); - return 0; + else if (w->platform) + return snd_soc_platform_read(w->platform, reg); + + dev_err(w->dapm->dev, "no valid widget read method\n"); + return -1; } static int soc_widget_write(struct snd_soc_dapm_widget *w, int reg, int val) { if (w->codec) return snd_soc_write(w->codec, reg, val); - return 0; + else if (w->platform) + return snd_soc_platform_write(w->platform, reg, val); + + dev_err(w->dapm->dev, "no valid widget write method\n"); + return -1; } 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, dapm->n_widgets++; w->dapm = dapm; w->codec = dapm->codec; + w->platform = dapm->platform; INIT_LIST_HEAD(&w->sources); INIT_LIST_HEAD(&w->sinks); INIT_LIST_HEAD(&w->list); |