Skip to content

Commit eb71072

Browse files
crojewsk-intelbroonie
authored andcommitted
ASoC: codecs: pcm3168a: Drop CONFIG_PM-conditional preproc directive
Revert changes done in commit 489db5d ("ASoC: pcm3168a: Don't disable pcm3168a when CONFIG_PM defined") and add pm_runtime_status_suspended() check. The suspended-check addresses regulator's "unbalanced disables" warning during driver removal even when CONFIG_PM is enabled. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://patch.msgid.link/20260525201801.1336936-4-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 2c73443 commit eb71072

1 file changed

Lines changed: 7 additions & 13 deletions

File tree

sound/soc/codecs/pcm3168a.c

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -821,15 +821,6 @@ int pcm3168a_probe(struct device *dev, struct regmap *regmap)
821821
}
822822
EXPORT_SYMBOL_GPL(pcm3168a_probe);
823823

824-
static void pcm3168a_disable(struct device *dev)
825-
{
826-
struct pcm3168a_priv *pcm3168a = dev_get_drvdata(dev);
827-
828-
regulator_bulk_disable(ARRAY_SIZE(pcm3168a->supplies),
829-
pcm3168a->supplies);
830-
clk_disable_unprepare(pcm3168a->scki);
831-
}
832-
833824
void pcm3168a_remove(struct device *dev)
834825
{
835826
struct pcm3168a_priv *pcm3168a = dev_get_drvdata(dev);
@@ -841,10 +832,12 @@ void pcm3168a_remove(struct device *dev)
841832
* The asserted level of GPIO_ACTIVE_LOW is LOW.
842833
*/
843834
gpiod_set_value_cansleep(pcm3168a->gpio_rst, 1);
835+
844836
pm_runtime_disable(dev);
845-
#ifndef CONFIG_PM
846-
pcm3168a_disable(dev);
847-
#endif
837+
if (!pm_runtime_status_suspended(dev)) {
838+
regulator_bulk_disable(ARRAY_SIZE(pcm3168a->supplies), pcm3168a->supplies);
839+
clk_disable_unprepare(pcm3168a->scki);
840+
}
848841
}
849842
EXPORT_SYMBOL_GPL(pcm3168a_remove);
850843

@@ -899,7 +892,8 @@ static int pcm3168a_rt_suspend(struct device *dev)
899892

900893
regcache_cache_only(pcm3168a->regmap, true);
901894

902-
pcm3168a_disable(dev);
895+
regulator_bulk_disable(ARRAY_SIZE(pcm3168a->supplies), pcm3168a->supplies);
896+
clk_disable_unprepare(pcm3168a->scki);
903897

904898
return 0;
905899
}

0 commit comments

Comments
 (0)