linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ASoC: ep93xx: Prepare for DT transition
@ 2023-04-10 22:38 Alexander Sverdlin
  2023-04-10 22:39 ` [PATCH 1/3] ASoC: ep93xx: i2s: move enable call to startup callback Alexander Sverdlin
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Alexander Sverdlin @ 2023-04-10 22:38 UTC (permalink / raw)
  To: alsa-devel
  Cc: Alexander Sverdlin, Nikita Shubin, David Rhodes, James Schulman,
	Jaroslav Kysela, Liam Girdwood, linux-kernel, Lucas Tanure,
	Mark Brown, patches, Richard Fitzgerald, Takashi Iwai

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(-)

-- 
2.40.0


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

* [PATCH 1/3] ASoC: ep93xx: i2s: move enable call to startup callback
  2023-04-10 22:38 [PATCH 0/3] ASoC: ep93xx: Prepare for DT transition Alexander Sverdlin
@ 2023-04-10 22:39 ` Alexander Sverdlin
  2023-04-11 11:39   ` Mark Brown
  2023-04-10 22:39 ` [PATCH 2/3] ASoC: cs4271: flat regcache, trivial simplifications Alexander Sverdlin
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Alexander Sverdlin @ 2023-04-10 22:39 UTC (permalink / raw)
  To: alsa-devel
  Cc: Alexander Sverdlin, Nikita Shubin, David Rhodes, James Schulman,
	Jaroslav Kysela, Liam Girdwood, linux-kernel, Lucas Tanure,
	Mark Brown, patches, Richard Fitzgerald, Takashi Iwai

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,
-- 
2.40.0


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

* [PATCH 2/3] ASoC: cs4271: flat regcache, trivial simplifications
  2023-04-10 22:38 [PATCH 0/3] ASoC: ep93xx: Prepare for DT transition Alexander Sverdlin
  2023-04-10 22:39 ` [PATCH 1/3] ASoC: ep93xx: i2s: move enable call to startup callback Alexander Sverdlin
@ 2023-04-10 22:39 ` Alexander Sverdlin
  2023-04-12  9:09   ` Charles Keepax
  2023-04-10 22:39 ` [PATCH 3/3] ASoC: ep93xx: i2s: Make it individually selectable Alexander Sverdlin
  2023-04-11 14:19 ` [PATCH 0/3] ASoC: ep93xx: Prepare for DT transition Mark Brown
  3 siblings, 1 reply; 7+ messages in thread
From: Alexander Sverdlin @ 2023-04-10 22:39 UTC (permalink / raw)
  To: alsa-devel
  Cc: Alexander Sverdlin, Nikita Shubin, David Rhodes, James Schulman,
	Jaroslav Kysela, Liam Girdwood, linux-kernel, Lucas Tanure,
	Mark Brown, patches, Richard Fitzgerald, Takashi Iwai

- 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);
-- 
2.40.0


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

* [PATCH 3/3] ASoC: ep93xx: i2s: Make it individually selectable
  2023-04-10 22:38 [PATCH 0/3] ASoC: ep93xx: Prepare for DT transition Alexander Sverdlin
  2023-04-10 22:39 ` [PATCH 1/3] ASoC: ep93xx: i2s: move enable call to startup callback Alexander Sverdlin
  2023-04-10 22:39 ` [PATCH 2/3] ASoC: cs4271: flat regcache, trivial simplifications Alexander Sverdlin
@ 2023-04-10 22:39 ` Alexander Sverdlin
  2023-04-11 14:19 ` [PATCH 0/3] ASoC: ep93xx: Prepare for DT transition Mark Brown
  3 siblings, 0 replies; 7+ messages in thread
From: Alexander Sverdlin @ 2023-04-10 22:39 UTC (permalink / raw)
  To: alsa-devel
  Cc: Alexander Sverdlin, Nikita Shubin, David Rhodes, James Schulman,
	Jaroslav Kysela, Liam Girdwood, linux-kernel, Lucas Tanure,
	Mark Brown, patches, Richard Fitzgerald, Takashi Iwai

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
 
-- 
2.40.0


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

* Re: [PATCH 1/3] ASoC: ep93xx: i2s: move enable call to startup callback
  2023-04-10 22:39 ` [PATCH 1/3] ASoC: ep93xx: i2s: move enable call to startup callback Alexander Sverdlin
@ 2023-04-11 11:39   ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2023-04-11 11:39 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: alsa-devel, Nikita Shubin, David Rhodes, James Schulman,
	Jaroslav Kysela, Liam Girdwood, linux-kernel, Lucas Tanure,
	patches, Richard Fitzgerald, Takashi Iwai

[-- Attachment #1: Type: text/plain, Size: 268 bytes --]

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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 0/3] ASoC: ep93xx: Prepare for DT transition
  2023-04-10 22:38 [PATCH 0/3] ASoC: ep93xx: Prepare for DT transition Alexander Sverdlin
                   ` (2 preceding siblings ...)
  2023-04-10 22:39 ` [PATCH 3/3] ASoC: ep93xx: i2s: Make it individually selectable Alexander Sverdlin
@ 2023-04-11 14:19 ` Mark Brown
  3 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2023-04-11 14:19 UTC (permalink / raw)
  To: alsa-devel, Alexander Sverdlin
  Cc: Nikita Shubin, David Rhodes, James Schulman, Jaroslav Kysela,
	Liam Girdwood, linux-kernel, Lucas Tanure, patches,
	Richard Fitzgerald, Takashi Iwai

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


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

* Re: [PATCH 2/3] ASoC: cs4271: flat regcache, trivial simplifications
  2023-04-10 22:39 ` [PATCH 2/3] ASoC: cs4271: flat regcache, trivial simplifications Alexander Sverdlin
@ 2023-04-12  9:09   ` Charles Keepax
  0 siblings, 0 replies; 7+ messages in thread
From: Charles Keepax @ 2023-04-12  9:09 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: alsa-devel, Nikita Shubin, David Rhodes, James Schulman,
	Jaroslav Kysela, Liam Girdwood, linux-kernel, Lucas Tanure,
	Mark Brown, patches, Richard Fitzgerald, Takashi Iwai

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

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

end of thread, other threads:[~2023-04-12  9:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-10 22:38 [PATCH 0/3] ASoC: ep93xx: Prepare for DT transition Alexander Sverdlin
2023-04-10 22:39 ` [PATCH 1/3] ASoC: ep93xx: i2s: move enable call to startup callback Alexander Sverdlin
2023-04-11 11:39   ` Mark Brown
2023-04-10 22:39 ` [PATCH 2/3] ASoC: cs4271: flat regcache, trivial simplifications Alexander Sverdlin
2023-04-12  9:09   ` Charles Keepax
2023-04-10 22:39 ` [PATCH 3/3] ASoC: ep93xx: i2s: Make it individually selectable Alexander Sverdlin
2023-04-11 14:19 ` [PATCH 0/3] ASoC: ep93xx: Prepare for DT transition Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).