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>
This commit is contained in:
parent
695594f1b7
commit
ec02995ada
|
@ -1011,12 +1011,14 @@ int dapm_clock_event(struct snd_soc_dapm_widget *w,
|
||||||
if (!w->clk)
|
if (!w->clk)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
|
#ifdef CONFIG_HAVE_CLK
|
||||||
if (SND_SOC_DAPM_EVENT_ON(event)) {
|
if (SND_SOC_DAPM_EVENT_ON(event)) {
|
||||||
return clk_enable(w->clk);
|
return clk_enable(w->clk);
|
||||||
} else {
|
} else {
|
||||||
clk_disable(w->clk);
|
clk_disable(w->clk);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(dapm_clock_event);
|
EXPORT_SYMBOL_GPL(dapm_clock_event);
|
||||||
|
|
||||||
|
@ -2902,6 +2904,7 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case snd_soc_dapm_clock_supply:
|
case snd_soc_dapm_clock_supply:
|
||||||
|
#ifdef CONFIG_HAVE_CLK
|
||||||
w->clk = devm_clk_get(dapm->dev, w->name);
|
w->clk = devm_clk_get(dapm->dev, w->name);
|
||||||
if (IS_ERR(w->clk)) {
|
if (IS_ERR(w->clk)) {
|
||||||
ret = PTR_ERR(w->clk);
|
ret = PTR_ERR(w->clk);
|
||||||
|
@ -2909,6 +2912,9 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
|
||||||
w->name, ret);
|
w->name, ret);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
return NULL;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue