mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 17:24:17 +08:00
ASoC: cs42l42: Don't enable/disable regulator at Bias Level
dev_pm_ops already enable/disable the codec if not in use Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210305173442.195740-5-tanureal@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
72d904763a
commit
15013240fc
@ -511,43 +511,6 @@ static const struct snd_soc_dapm_route cs42l42_audio_map[] = {
|
|||||||
{"HP", NULL, "HPDRV"}
|
{"HP", NULL, "HPDRV"}
|
||||||
};
|
};
|
||||||
|
|
||||||
static int cs42l42_set_bias_level(struct snd_soc_component *component,
|
|
||||||
enum snd_soc_bias_level level)
|
|
||||||
{
|
|
||||||
struct cs42l42_private *cs42l42 = snd_soc_component_get_drvdata(component);
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
switch (level) {
|
|
||||||
case SND_SOC_BIAS_ON:
|
|
||||||
break;
|
|
||||||
case SND_SOC_BIAS_PREPARE:
|
|
||||||
break;
|
|
||||||
case SND_SOC_BIAS_STANDBY:
|
|
||||||
if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) {
|
|
||||||
regcache_cache_only(cs42l42->regmap, false);
|
|
||||||
regcache_sync(cs42l42->regmap);
|
|
||||||
ret = regulator_bulk_enable(
|
|
||||||
ARRAY_SIZE(cs42l42->supplies),
|
|
||||||
cs42l42->supplies);
|
|
||||||
if (ret != 0) {
|
|
||||||
dev_err(component->dev,
|
|
||||||
"Failed to enable regulators: %d\n",
|
|
||||||
ret);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SND_SOC_BIAS_OFF:
|
|
||||||
|
|
||||||
regcache_cache_only(cs42l42->regmap, true);
|
|
||||||
regulator_bulk_disable(ARRAY_SIZE(cs42l42->supplies),
|
|
||||||
cs42l42->supplies);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int cs42l42_component_probe(struct snd_soc_component *component)
|
static int cs42l42_component_probe(struct snd_soc_component *component)
|
||||||
{
|
{
|
||||||
struct cs42l42_private *cs42l42 =
|
struct cs42l42_private *cs42l42 =
|
||||||
@ -560,7 +523,6 @@ static int cs42l42_component_probe(struct snd_soc_component *component)
|
|||||||
|
|
||||||
static const struct snd_soc_component_driver soc_component_dev_cs42l42 = {
|
static const struct snd_soc_component_driver soc_component_dev_cs42l42 = {
|
||||||
.probe = cs42l42_component_probe,
|
.probe = cs42l42_component_probe,
|
||||||
.set_bias_level = cs42l42_set_bias_level,
|
|
||||||
.dapm_widgets = cs42l42_dapm_widgets,
|
.dapm_widgets = cs42l42_dapm_widgets,
|
||||||
.num_dapm_widgets = ARRAY_SIZE(cs42l42_dapm_widgets),
|
.num_dapm_widgets = ARRAY_SIZE(cs42l42_dapm_widgets),
|
||||||
.dapm_routes = cs42l42_audio_map,
|
.dapm_routes = cs42l42_audio_map,
|
||||||
|
Loading…
Reference in New Issue
Block a user