aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-04 03:16:20 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-04 06:23:50 -0400
commitec02995adad5a7b428f46c1a87fae1bc93d6dfe3 (patch)
treeec1f6ec14f61ecc1beac237710c3f8209004c04a /sound/soc/soc-dapm.c
parent695594f1b79d3b88e99e28f06afaab32c4d65853 (diff)
ASoC: dapm: Bodge for lack of a widely available clk API
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index a66379accec9..39e8c2fdf50e 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1011,12 +1011,14 @@ int dapm_clock_event(struct snd_soc_dapm_widget *w,
1011 if (!w->clk) 1011 if (!w->clk)
1012 return -EIO; 1012 return -EIO;
1013 1013
1014#ifdef CONFIG_HAVE_CLK
1014 if (SND_SOC_DAPM_EVENT_ON(event)) { 1015 if (SND_SOC_DAPM_EVENT_ON(event)) {
1015 return clk_enable(w->clk); 1016 return clk_enable(w->clk);
1016 } else { 1017 } else {
1017 clk_disable(w->clk); 1018 clk_disable(w->clk);
1018 return 0; 1019 return 0;
1019 } 1020 }
1021#endif
1020} 1022}
1021EXPORT_SYMBOL_GPL(dapm_clock_event); 1023EXPORT_SYMBOL_GPL(dapm_clock_event);
1022 1024
@@ -2902,6 +2904,7 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
2902 } 2904 }
2903 break; 2905 break;
2904 case snd_soc_dapm_clock_supply: 2906 case snd_soc_dapm_clock_supply:
2907#ifdef CONFIG_HAVE_CLK
2905 w->clk = devm_clk_get(dapm->dev, w->name); 2908 w->clk = devm_clk_get(dapm->dev, w->name);
2906 if (IS_ERR(w->clk)) { 2909 if (IS_ERR(w->clk)) {
2907 ret = PTR_ERR(w->clk); 2910 ret = PTR_ERR(w->clk);
@@ -2909,6 +2912,9 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
2909 w->name, ret); 2912 w->name, ret);
2910 return NULL; 2913 return NULL;
2911 } 2914 }
2915#else
2916 return NULL;
2917#endif
2912 break; 2918 break;
2913 default: 2919 default:
2914 break; 2920 break;