Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: codecs: ak4xxx: Use devm_pm_runtime_enable()
@ 2026-12-04 11:26 phucduc.bui
  2026-12-04 11:26 ` [PATCH 1/2] ASoC: codecs: ak4458: " phucduc.bui
  2026-12-04 11:26 ` [PATCH 2/2] ASoC: codecs: ak5558: " phucduc.bui
  0 siblings, 2 replies; 3+ messages in thread
From: phucduc.bui @ 2026-12-04 11:26 UTC (permalink / raw)
  To: Mark Brown, Shengjiu Wang
  Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Kees Cook,
	Kuninori Morimoto, linux-sound, linux-kernel, bui duc phuc

From: bui duc phuc <phucduc.bui@gmail.com>

Hi all,

This series converts the AK4458 and AK5558 drivers to use
devm_pm_runtime_enable() and removes their redundant remove
callbacks.

Compile-tested only.

Best regards,
Phuc

bui duc phuc (2):
  ASoC: codecs: ak4458: Use devm_pm_runtime_enable()
  ASoC: codecs: ak5558: Use devm_pm_runtime_enable()

 sound/soc/codecs/ak4458.c | 14 +++++---------
 sound/soc/codecs/ak5558.c | 14 +++++---------
 2 files changed, 10 insertions(+), 18 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] ASoC: codecs: ak4458: Use devm_pm_runtime_enable()
  2026-12-04 11:26 [PATCH 0/2] ASoC: codecs: ak4xxx: Use devm_pm_runtime_enable() phucduc.bui
@ 2026-12-04 11:26 ` phucduc.bui
  2026-12-04 11:26 ` [PATCH 2/2] ASoC: codecs: ak5558: " phucduc.bui
  1 sibling, 0 replies; 3+ messages in thread
From: phucduc.bui @ 2026-12-04 11:26 UTC (permalink / raw)
  To: Mark Brown, Shengjiu Wang
  Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Kees Cook,
	Kuninori Morimoto, linux-sound, linux-kernel, bui duc phuc

From: bui duc phuc <phucduc.bui@gmail.com>

Replace pm_runtime_enable() with devm_pm_runtime_enable()
and remove the redundant remove callback.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
 sound/soc/codecs/ak4458.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/sound/soc/codecs/ak4458.c b/sound/soc/codecs/ak4458.c
index 11b5e4cc11f8..9683e775a564 100644
--- a/sound/soc/codecs/ak4458.c
+++ b/sound/soc/codecs/ak4458.c
@@ -782,6 +782,11 @@ static int ak4458_i2c_probe(struct i2c_client *i2c)
 		return ret;
 	}
 
+	ret = devm_pm_runtime_enable(&i2c->dev);
+	if (ret)
+		return ret;
+	regcache_cache_only(ak4458->regmap, true);
+
 	ret = devm_snd_soc_register_component(ak4458->dev,
 					      ak4458->drvdata->comp_drv,
 					      ak4458->drvdata->dai_drv, 1);
@@ -790,17 +795,9 @@ static int ak4458_i2c_probe(struct i2c_client *i2c)
 		return ret;
 	}
 
-	pm_runtime_enable(&i2c->dev);
-	regcache_cache_only(ak4458->regmap, true);
-
 	return 0;
 }
 
-static void ak4458_i2c_remove(struct i2c_client *i2c)
-{
-	pm_runtime_disable(&i2c->dev);
-}
-
 static const struct of_device_id ak4458_of_match[] = {
 	{ .compatible = "asahi-kasei,ak4458", .data = &ak4458_drvdata},
 	{ .compatible = "asahi-kasei,ak4497", .data = &ak4497_drvdata},
@@ -815,7 +812,6 @@ static struct i2c_driver ak4458_i2c_driver = {
 		.of_match_table = ak4458_of_match,
 		},
 	.probe = ak4458_i2c_probe,
-	.remove = ak4458_i2c_remove,
 };
 
 module_i2c_driver(ak4458_i2c_driver);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] ASoC: codecs: ak5558: Use devm_pm_runtime_enable()
  2026-12-04 11:26 [PATCH 0/2] ASoC: codecs: ak4xxx: Use devm_pm_runtime_enable() phucduc.bui
  2026-12-04 11:26 ` [PATCH 1/2] ASoC: codecs: ak4458: " phucduc.bui
@ 2026-12-04 11:26 ` phucduc.bui
  1 sibling, 0 replies; 3+ messages in thread
From: phucduc.bui @ 2026-12-04 11:26 UTC (permalink / raw)
  To: Mark Brown, Shengjiu Wang
  Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Kees Cook,
	Kuninori Morimoto, linux-sound, linux-kernel, bui duc phuc

From: bui duc phuc <phucduc.bui@gmail.com>

Replace pm_runtime_enable() with devm_pm_runtime_enable()
and remove the redundant remove callback.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
 sound/soc/codecs/ak5558.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/sound/soc/codecs/ak5558.c b/sound/soc/codecs/ak5558.c
index f4b3cb6f3c00..9cebcaf8b74c 100644
--- a/sound/soc/codecs/ak5558.c
+++ b/sound/soc/codecs/ak5558.c
@@ -465,6 +465,11 @@ static int ak5558_i2c_probe(struct i2c_client *i2c)
 		return ret;
 	}
 
+	ret = devm_pm_runtime_enable(&i2c->dev);
+	if (ret)
+		return ret;
+	regcache_cache_only(ak5558->regmap, true);
+
 	dev_id = (uintptr_t)of_device_get_match_data(&i2c->dev);
 	switch (dev_id) {
 	case AK5552:
@@ -486,17 +491,9 @@ static int ak5558_i2c_probe(struct i2c_client *i2c)
 		return ret;
 	}
 
-	pm_runtime_enable(&i2c->dev);
-	regcache_cache_only(ak5558->regmap, true);
-
 	return 0;
 }
 
-static void ak5558_i2c_remove(struct i2c_client *i2c)
-{
-	pm_runtime_disable(&i2c->dev);
-}
-
 static const struct of_device_id ak5558_i2c_dt_ids[] __maybe_unused = {
 	{ .compatible = "asahi-kasei,ak5558", .data = (void *) AK5558 },
 	{ .compatible = "asahi-kasei,ak5552", .data = (void *) AK5552 },
@@ -511,7 +508,6 @@ static struct i2c_driver ak5558_i2c_driver = {
 		.pm = pm_ptr(&ak5558_pm),
 	},
 	.probe = ak5558_i2c_probe,
-	.remove = ak5558_i2c_remove,
 };
 
 module_i2c_driver(ak5558_i2c_driver);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-04 11:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 11:26 [PATCH 0/2] ASoC: codecs: ak4xxx: Use devm_pm_runtime_enable() phucduc.bui
2026-12-04 11:26 ` [PATCH 1/2] ASoC: codecs: ak4458: " phucduc.bui
2026-12-04 11:26 ` [PATCH 2/2] ASoC: codecs: ak5558: " phucduc.bui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox