All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: sunxi: sun4i-i2s: Enable 32-bit audio formats
@ 2024-03-26  3:50 ` John Watts
  0 siblings, 0 replies; 10+ messages in thread
From: John Watts @ 2024-03-26  3:50 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland
  Cc: linux-sound, linux-arm-kernel, linux-sunxi, linux-kernel, John Watts

The I2S driver already supports and checks for 32-bit sample sizes,
so indicate this size is available for use in the DAI driver.

This change has been tested on the T113-S3, but it should work just
fine on older hardware as get_sr checks for sample size support
correctly according to each core's datasheet.

Signed-off-by: John Watts <contact@jookia.org>
---
This patch enables support for 32-bit audio in the sunxi I2S driver.

I have only tested this on the Allwinner T113 but I'm fairly
certain it will work on older boards.
---
 sound/soc/sunxi/sun4i-i2s.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
index a736f632bf0b..aeea852141c1 100644
--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -1103,7 +1103,8 @@ static const struct snd_soc_dai_ops sun4i_i2s_dai_ops = {
 
 #define SUN4I_FORMATS	(SNDRV_PCM_FMTBIT_S16_LE | \
 			 SNDRV_PCM_FMTBIT_S20_LE | \
-			 SNDRV_PCM_FMTBIT_S24_LE)
+			 SNDRV_PCM_FMTBIT_S24_LE | \
+			 SNDRV_PCM_FMTBIT_S32_LE)
 
 static struct snd_soc_dai_driver sun4i_i2s_dai = {
 	.capture = {

---
base-commit: 72fb52fb0ac44b6a1edd9bc390e44bce3acccd26
change-id: 20240326-sunxi_s32-f2ab25b8e688

Best regards,
-- 
John Watts <contact@jookia.org>


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

* [PATCH] ASoC: sunxi: sun4i-i2s: Enable 32-bit audio formats
@ 2024-03-26  3:50 ` John Watts
  0 siblings, 0 replies; 10+ messages in thread
From: John Watts @ 2024-03-26  3:50 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland
  Cc: linux-sound, linux-arm-kernel, linux-sunxi, linux-kernel, John Watts

The I2S driver already supports and checks for 32-bit sample sizes,
so indicate this size is available for use in the DAI driver.

This change has been tested on the T113-S3, but it should work just
fine on older hardware as get_sr checks for sample size support
correctly according to each core's datasheet.

Signed-off-by: John Watts <contact@jookia.org>
---
This patch enables support for 32-bit audio in the sunxi I2S driver.

I have only tested this on the Allwinner T113 but I'm fairly
certain it will work on older boards.
---
 sound/soc/sunxi/sun4i-i2s.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
index a736f632bf0b..aeea852141c1 100644
--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -1103,7 +1103,8 @@ static const struct snd_soc_dai_ops sun4i_i2s_dai_ops = {
 
 #define SUN4I_FORMATS	(SNDRV_PCM_FMTBIT_S16_LE | \
 			 SNDRV_PCM_FMTBIT_S20_LE | \
-			 SNDRV_PCM_FMTBIT_S24_LE)
+			 SNDRV_PCM_FMTBIT_S24_LE | \
+			 SNDRV_PCM_FMTBIT_S32_LE)
 
 static struct snd_soc_dai_driver sun4i_i2s_dai = {
 	.capture = {

---
base-commit: 72fb52fb0ac44b6a1edd9bc390e44bce3acccd26
change-id: 20240326-sunxi_s32-f2ab25b8e688

Best regards,
-- 
John Watts <contact@jookia.org>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] ASoC: sunxi: sun4i-i2s: Enable 32-bit audio formats
  2024-03-26  3:50 ` John Watts
@ 2024-03-27 19:53   ` Jernej Škrabec
  -1 siblings, 0 replies; 10+ messages in thread
From: Jernej Škrabec @ 2024-03-27 19:53 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Chen-Yu Tsai, Samuel Holland, John Watts
  Cc: linux-sound, linux-arm-kernel, linux-sunxi, linux-kernel, John Watts

Dne torek, 26. marec 2024 ob 04:50:03 CET je John Watts napisal(a):
> The I2S driver already supports and checks for 32-bit sample sizes,
> so indicate this size is available for use in the DAI driver.
> 
> This change has been tested on the T113-S3, but it should work just
> fine on older hardware as get_sr checks for sample size support
> correctly according to each core's datasheet.
> 
> Signed-off-by: John Watts <contact@jookia.org>
> ---
> This patch enables support for 32-bit audio in the sunxi I2S driver.
> 
> I have only tested this on the Allwinner T113 but I'm fairly
> certain it will work on older boards.
> ---
>  sound/soc/sunxi/sun4i-i2s.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
> index a736f632bf0b..aeea852141c1 100644
> --- a/sound/soc/sunxi/sun4i-i2s.c
> +++ b/sound/soc/sunxi/sun4i-i2s.c
> @@ -1103,7 +1103,8 @@ static const struct snd_soc_dai_ops sun4i_i2s_dai_ops = {
>  
>  #define SUN4I_FORMATS	(SNDRV_PCM_FMTBIT_S16_LE | \
>  			 SNDRV_PCM_FMTBIT_S20_LE | \
> -			 SNDRV_PCM_FMTBIT_S24_LE)
> +			 SNDRV_PCM_FMTBIT_S24_LE | \
> +			 SNDRV_PCM_FMTBIT_S32_LE)

I wish it would be that simple. SUN4I_FORMATS is cross section of all I2S
variants that are supported by this driver. If you check A10, you'll see that
it doesn't support S32.

If you want to add support for S32, you'll have to add new quirk for each
variant.

Best regards,
Jernej

>  
>  static struct snd_soc_dai_driver sun4i_i2s_dai = {
>  	.capture = {
> 
> ---
> base-commit: 72fb52fb0ac44b6a1edd9bc390e44bce3acccd26
> change-id: 20240326-sunxi_s32-f2ab25b8e688
> 
> Best regards,
> 





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

* Re: [PATCH] ASoC: sunxi: sun4i-i2s: Enable 32-bit audio formats
@ 2024-03-27 19:53   ` Jernej Škrabec
  0 siblings, 0 replies; 10+ messages in thread
From: Jernej Škrabec @ 2024-03-27 19:53 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Chen-Yu Tsai, Samuel Holland, John Watts
  Cc: linux-sound, linux-arm-kernel, linux-sunxi, linux-kernel, John Watts

Dne torek, 26. marec 2024 ob 04:50:03 CET je John Watts napisal(a):
> The I2S driver already supports and checks for 32-bit sample sizes,
> so indicate this size is available for use in the DAI driver.
> 
> This change has been tested on the T113-S3, but it should work just
> fine on older hardware as get_sr checks for sample size support
> correctly according to each core's datasheet.
> 
> Signed-off-by: John Watts <contact@jookia.org>
> ---
> This patch enables support for 32-bit audio in the sunxi I2S driver.
> 
> I have only tested this on the Allwinner T113 but I'm fairly
> certain it will work on older boards.
> ---
>  sound/soc/sunxi/sun4i-i2s.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
> index a736f632bf0b..aeea852141c1 100644
> --- a/sound/soc/sunxi/sun4i-i2s.c
> +++ b/sound/soc/sunxi/sun4i-i2s.c
> @@ -1103,7 +1103,8 @@ static const struct snd_soc_dai_ops sun4i_i2s_dai_ops = {
>  
>  #define SUN4I_FORMATS	(SNDRV_PCM_FMTBIT_S16_LE | \
>  			 SNDRV_PCM_FMTBIT_S20_LE | \
> -			 SNDRV_PCM_FMTBIT_S24_LE)
> +			 SNDRV_PCM_FMTBIT_S24_LE | \
> +			 SNDRV_PCM_FMTBIT_S32_LE)

I wish it would be that simple. SUN4I_FORMATS is cross section of all I2S
variants that are supported by this driver. If you check A10, you'll see that
it doesn't support S32.

If you want to add support for S32, you'll have to add new quirk for each
variant.

Best regards,
Jernej

>  
>  static struct snd_soc_dai_driver sun4i_i2s_dai = {
>  	.capture = {
> 
> ---
> base-commit: 72fb52fb0ac44b6a1edd9bc390e44bce3acccd26
> change-id: 20240326-sunxi_s32-f2ab25b8e688
> 
> Best regards,
> 





_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] ASoC: sunxi: sun4i-i2s: Enable 32-bit audio formats
  2024-03-27 19:53   ` Jernej Škrabec
@ 2024-03-28  2:21     ` John Watts
  -1 siblings, 0 replies; 10+ messages in thread
From: John Watts @ 2024-03-28  2:21 UTC (permalink / raw)
  To: Jernej Škrabec
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Chen-Yu Tsai, Samuel Holland, linux-sound, linux-arm-kernel,
	linux-sunxi, linux-kernel

On Wed, Mar 27, 2024 at 08:53:32PM +0100, Jernej Škrabec wrote:
> I wish it would be that simple. SUN4I_FORMATS is cross section of all I2S
> variants that are supported by this driver. If you check A10, you'll see that
> it doesn't support S32.
> 
> If you want to add support for S32, you'll have to add new quirk for each
> variant.

Yes, A10 doesn't support it. But it should error out in hw_params due to
get_sr not supporting 32-bit, no?

> 
> Best regards,
> Jernej

John.

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

* Re: [PATCH] ASoC: sunxi: sun4i-i2s: Enable 32-bit audio formats
@ 2024-03-28  2:21     ` John Watts
  0 siblings, 0 replies; 10+ messages in thread
From: John Watts @ 2024-03-28  2:21 UTC (permalink / raw)
  To: Jernej Škrabec
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Chen-Yu Tsai, Samuel Holland, linux-sound, linux-arm-kernel,
	linux-sunxi, linux-kernel

On Wed, Mar 27, 2024 at 08:53:32PM +0100, Jernej Škrabec wrote:
> I wish it would be that simple. SUN4I_FORMATS is cross section of all I2S
> variants that are supported by this driver. If you check A10, you'll see that
> it doesn't support S32.
> 
> If you want to add support for S32, you'll have to add new quirk for each
> variant.

Yes, A10 doesn't support it. But it should error out in hw_params due to
get_sr not supporting 32-bit, no?

> 
> Best regards,
> Jernej

John.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] ASoC: sunxi: sun4i-i2s: Enable 32-bit audio formats
  2024-03-28  2:21     ` John Watts
@ 2024-03-28 13:56       ` Mark Brown
  -1 siblings, 0 replies; 10+ messages in thread
From: Mark Brown @ 2024-03-28 13:56 UTC (permalink / raw)
  To: John Watts
  Cc: Jernej Škrabec, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, Chen-Yu Tsai, Samuel Holland, linux-sound,
	linux-arm-kernel, linux-sunxi, linux-kernel

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

On Thu, Mar 28, 2024 at 01:21:21PM +1100, John Watts wrote:
> On Wed, Mar 27, 2024 at 08:53:32PM +0100, Jernej Škrabec wrote:

> > I wish it would be that simple. SUN4I_FORMATS is cross section of all I2S
> > variants that are supported by this driver. If you check A10, you'll see that
> > it doesn't support S32.

> > If you want to add support for S32, you'll have to add new quirk for each
> > variant.

> Yes, A10 doesn't support it. But it should error out in hw_params due to
> get_sr not supporting 32-bit, no?

The constraints shouldn't be advertising things that hw_params() will
error out on, sometimes there are contingent constraints that prevent
this but something that just doesn't work isn't one of those times.

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

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

* Re: [PATCH] ASoC: sunxi: sun4i-i2s: Enable 32-bit audio formats
@ 2024-03-28 13:56       ` Mark Brown
  0 siblings, 0 replies; 10+ messages in thread
From: Mark Brown @ 2024-03-28 13:56 UTC (permalink / raw)
  To: John Watts
  Cc: Jernej Škrabec, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, Chen-Yu Tsai, Samuel Holland, linux-sound,
	linux-arm-kernel, linux-sunxi, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 745 bytes --]

On Thu, Mar 28, 2024 at 01:21:21PM +1100, John Watts wrote:
> On Wed, Mar 27, 2024 at 08:53:32PM +0100, Jernej Škrabec wrote:

> > I wish it would be that simple. SUN4I_FORMATS is cross section of all I2S
> > variants that are supported by this driver. If you check A10, you'll see that
> > it doesn't support S32.

> > If you want to add support for S32, you'll have to add new quirk for each
> > variant.

> Yes, A10 doesn't support it. But it should error out in hw_params due to
> get_sr not supporting 32-bit, no?

The constraints shouldn't be advertising things that hw_params() will
error out on, sometimes there are contingent constraints that prevent
this but something that just doesn't work isn't one of those times.

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

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] ASoC: sunxi: sun4i-i2s: Enable 32-bit audio formats
  2024-03-28 13:56       ` Mark Brown
@ 2024-03-28 14:56         ` John Watts
  -1 siblings, 0 replies; 10+ messages in thread
From: John Watts @ 2024-03-28 14:56 UTC (permalink / raw)
  To: Mark Brown
  Cc: Jernej Škrabec, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, Chen-Yu Tsai, Samuel Holland, linux-sound,
	linux-arm-kernel, linux-sunxi, linux-kernel

On Thu, Mar 28, 2024 at 01:56:42PM +0000, Mark Brown wrote:
> On Thu, Mar 28, 2024 at 01:21:21PM +1100, John Watts wrote:
> > On Wed, Mar 27, 2024 at 08:53:32PM +0100, Jernej Škrabec wrote:
> 
> > > I wish it would be that simple. SUN4I_FORMATS is cross section of all I2S
> > > variants that are supported by this driver. If you check A10, you'll see that
> > > it doesn't support S32.
> 
> > > If you want to add support for S32, you'll have to add new quirk for each
> > > variant.
> 
> > Yes, A10 doesn't support it. But it should error out in hw_params due to
> > get_sr not supporting 32-bit, no?
> 
> The constraints shouldn't be advertising things that hw_params() will
> error out on, sometimes there are contingent constraints that prevent
> this but something that just doesn't work isn't one of those times.

Oh right! I'm not sure how I forgot about this, given I went through this
exact discussion for my wm8782 patch.

I'll try and get v2 patch for this soon. :)

John.

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

* Re: [PATCH] ASoC: sunxi: sun4i-i2s: Enable 32-bit audio formats
@ 2024-03-28 14:56         ` John Watts
  0 siblings, 0 replies; 10+ messages in thread
From: John Watts @ 2024-03-28 14:56 UTC (permalink / raw)
  To: Mark Brown
  Cc: Jernej Škrabec, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, Chen-Yu Tsai, Samuel Holland, linux-sound,
	linux-arm-kernel, linux-sunxi, linux-kernel

On Thu, Mar 28, 2024 at 01:56:42PM +0000, Mark Brown wrote:
> On Thu, Mar 28, 2024 at 01:21:21PM +1100, John Watts wrote:
> > On Wed, Mar 27, 2024 at 08:53:32PM +0100, Jernej Škrabec wrote:
> 
> > > I wish it would be that simple. SUN4I_FORMATS is cross section of all I2S
> > > variants that are supported by this driver. If you check A10, you'll see that
> > > it doesn't support S32.
> 
> > > If you want to add support for S32, you'll have to add new quirk for each
> > > variant.
> 
> > Yes, A10 doesn't support it. But it should error out in hw_params due to
> > get_sr not supporting 32-bit, no?
> 
> The constraints shouldn't be advertising things that hw_params() will
> error out on, sometimes there are contingent constraints that prevent
> this but something that just doesn't work isn't one of those times.

Oh right! I'm not sure how I forgot about this, given I went through this
exact discussion for my wm8782 patch.

I'll try and get v2 patch for this soon. :)

John.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2024-03-28 15:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-26  3:50 [PATCH] ASoC: sunxi: sun4i-i2s: Enable 32-bit audio formats John Watts
2024-03-26  3:50 ` John Watts
2024-03-27 19:53 ` Jernej Škrabec
2024-03-27 19:53   ` Jernej Škrabec
2024-03-28  2:21   ` John Watts
2024-03-28  2:21     ` John Watts
2024-03-28 13:56     ` Mark Brown
2024-03-28 13:56       ` Mark Brown
2024-03-28 14:56       ` John Watts
2024-03-28 14:56         ` John Watts

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.