[PATCH 0/3] ASoC: ep93xx: Prepare for DT transition
This is a preparatory series for EP93xx transition to DT. This patchset is a pre-requisite and has been tested with the full DT patchset [1].
[1]. git://git.maquefel.me/linux.git branch ep93xx/6.2-rc4-v0
Alexander Sverdlin (3): ASoC: ep93xx: i2s: move enable call to startup callback ASoC: cs4271: flat regcache, trivial simplifications ASoC: ep93xx: i2s: Make it individually selectable
sound/soc/cirrus/Kconfig | 6 +++++- sound/soc/cirrus/ep93xx-i2s.c | 12 +++++++++++- sound/soc/codecs/cs4271-i2c.c | 1 - sound/soc/codecs/cs4271-spi.c | 1 - sound/soc/codecs/cs4271.c | 4 ++-- 5 files changed, 18 insertions(+), 6 deletions(-)
Make startup/shutdown callbacks symmetric to avoid clock subsystem warnings (reproduced with "aplay --dump-hw-params" + ctrl-c):
WARNING: CPU: 0 PID: 102 at drivers/clk/clk.c:1048 clk_core_disable lrclk already disabled CPU: 0 PID: 102 Comm: aplay Not tainted 6.2.0-rc4 #1 Hardware name: Generic DT based system ... clk_core_disable from clk_core_disable_lock clk_core_disable_lock from ep93xx_i2s_shutdown ep93xx_i2s_shutdown from snd_soc_dai_shutdown snd_soc_dai_shutdown from soc_pcm_clean soc_pcm_clean from soc_pcm_close soc_pcm_close from snd_pcm_release_substream.part.0 snd_pcm_release_substream.part.0 from snd_pcm_release snd_pcm_release from __fput __fput from task_work_run ...
WARNING: CPU: 0 PID: 102 at drivers/clk/clk.c:907 clk_core_unprepare lrclk already unprepared CPU: 0 PID: 102 Comm: aplay Tainted: G W 6.2.0-rc4 #1 Hardware name: Generic DT based system ... clk_core_unprepare from clk_unprepare clk_unprepare from ep93xx_i2s_shutdown ep93xx_i2s_shutdown from snd_soc_dai_shutdown snd_soc_dai_shutdown from soc_pcm_clean soc_pcm_clean from soc_pcm_close soc_pcm_close from snd_pcm_release_substream.part.0 snd_pcm_release_substream.part.0 from snd_pcm_release snd_pcm_release from __fput __fput from task_work_run ...
Signed-off-by: Alexander Sverdlin alexander.sverdlin@gmail.com --- sound/soc/cirrus/ep93xx-i2s.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/sound/soc/cirrus/ep93xx-i2s.c b/sound/soc/cirrus/ep93xx-i2s.c index 200d18060f7c..bbbb1065b2f1 100644 --- a/sound/soc/cirrus/ep93xx-i2s.c +++ b/sound/soc/cirrus/ep93xx-i2s.c @@ -209,6 +209,16 @@ static int ep93xx_i2s_dai_probe(struct snd_soc_dai *dai) return 0; }
+static int ep93xx_i2s_startup(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct ep93xx_i2s_info *info = snd_soc_dai_get_drvdata(dai); + + ep93xx_i2s_enable(info, substream->stream); + + return 0; +} + static void ep93xx_i2s_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { @@ -349,7 +359,6 @@ static int ep93xx_i2s_hw_params(struct snd_pcm_substream *substream, if (err) return err;
- ep93xx_i2s_enable(info, substream->stream); return 0; }
@@ -398,6 +407,7 @@ static int ep93xx_i2s_resume(struct snd_soc_component *component) #endif
static const struct snd_soc_dai_ops ep93xx_i2s_dai_ops = { + .startup = ep93xx_i2s_startup, .shutdown = ep93xx_i2s_shutdown, .hw_params = ep93xx_i2s_hw_params, .set_sysclk = ep93xx_i2s_set_sysclk,
On Tue, Apr 11, 2023 at 12:39:00AM +0200, Alexander Sverdlin wrote:
Make startup/shutdown callbacks symmetric to avoid clock subsystem warnings (reproduced with "aplay --dump-hw-params" + ctrl-c):
This doesn't apply against current code, please check and resend.
- Switch to REGCACHE_FLAT, the whole overhead of RBTREE is not worth it with non sparse register set in the address range 1..7. - Move register width to central location
Signed-off-by: Alexander Sverdlin alexander.sverdlin@gmail.com --- sound/soc/codecs/cs4271-i2c.c | 1 - sound/soc/codecs/cs4271-spi.c | 1 - sound/soc/codecs/cs4271.c | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/cs4271-i2c.c b/sound/soc/codecs/cs4271-i2c.c index 0e8a7cf0da50..4033be1c3bc1 100644 --- a/sound/soc/codecs/cs4271-i2c.c +++ b/sound/soc/codecs/cs4271-i2c.c @@ -17,7 +17,6 @@ static int cs4271_i2c_probe(struct i2c_client *client)
config = cs4271_regmap_config; config.reg_bits = 8; - config.val_bits = 8;
return cs4271_probe(&client->dev, devm_regmap_init_i2c(client, &config)); diff --git a/sound/soc/codecs/cs4271-spi.c b/sound/soc/codecs/cs4271-spi.c index 7ef0a66b7778..4feb80436bd9 100644 --- a/sound/soc/codecs/cs4271-spi.c +++ b/sound/soc/codecs/cs4271-spi.c @@ -17,7 +17,6 @@ static int cs4271_spi_probe(struct spi_device *spi)
config = cs4271_regmap_config; config.reg_bits = 16; - config.val_bits = 8; config.read_flag_mask = 0x21; config.write_flag_mask = 0x20;
diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c index 2021cf442606..188b8b43c524 100644 --- a/sound/soc/codecs/cs4271.c +++ b/sound/soc/codecs/cs4271.c @@ -689,8 +689,8 @@ const struct regmap_config cs4271_regmap_config = {
.reg_defaults = cs4271_reg_defaults, .num_reg_defaults = ARRAY_SIZE(cs4271_reg_defaults), - .cache_type = REGCACHE_RBTREE, - + .cache_type = REGCACHE_FLAT, + .val_bits = 8, .volatile_reg = cs4271_volatile_reg, }; EXPORT_SYMBOL_GPL(cs4271_regmap_config);
On Tue, Apr 11, 2023 at 12:39:01AM +0200, Alexander Sverdlin wrote:
- Switch to REGCACHE_FLAT, the whole overhead of RBTREE is not worth it with non sparse register set in the address range 1..7.
- Move register width to central location
Signed-off-by: Alexander Sverdlin alexander.sverdlin@gmail.com
Acked-by: Charles Keepax ckeepax@opensource.cirrus.com
Thanks, Charles
This is necessary to replace EDB93XX specific SoC audio driver with generic "simple-audio-card".
Signed-off-by: Alexander Sverdlin alexander.sverdlin@gmail.com --- sound/soc/cirrus/Kconfig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/sound/soc/cirrus/Kconfig b/sound/soc/cirrus/Kconfig index 34870c2d0cba..38a83c4dcc2d 100644 --- a/sound/soc/cirrus/Kconfig +++ b/sound/soc/cirrus/Kconfig @@ -8,7 +8,11 @@ config SND_EP93XX_SOC the EP93xx I2S or AC97 interfaces.
config SND_EP93XX_SOC_I2S - tristate + tristate "I2S controller support for the Cirrus Logic EP93xx series" + depends on SND_EP93XX_SOC + help + Say Y or M if you want to add support for codecs attached to + the EP93xx I2S interface.
if SND_EP93XX_SOC_I2S
On Tue, 11 Apr 2023 00:38:59 +0200, Alexander Sverdlin wrote:
This is a preparatory series for EP93xx transition to DT. This patchset is a pre-requisite and has been tested with the full DT patchset [1].
[1]. git://git.maquefel.me/linux.git branch ep93xx/6.2-rc4-v0
Alexander Sverdlin (3): ASoC: ep93xx: i2s: move enable call to startup callback ASoC: cs4271: flat regcache, trivial simplifications ASoC: ep93xx: i2s: Make it individually selectable
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/3] ASoC: ep93xx: i2s: move enable call to startup callback commit: 80f47122538d40b1a6a2c1a3c2d37b6e51b74224 [2/3] ASoC: cs4271: flat regcache, trivial simplifications commit: 2e9688c81cfc48b210af6f313cb04589b7943e86 [3/3] ASoC: ep93xx: i2s: Make it individually selectable commit: 24f934becf60598fdec9c9f2e06437c831ffa374
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
participants (3)
-
Alexander Sverdlin
-
Charles Keepax
-
Mark Brown