linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: rt5659: add S32_LE format
@ 2020-01-20  6:17 Sameer Pujar
  2020-01-20  6:24 ` Sameer Pujar
  0 siblings, 1 reply; 5+ messages in thread
From: Sameer Pujar @ 2020-01-20  6:17 UTC (permalink / raw)
  To: oder_chiou, bardliao, tiwai, perex; +Cc: alsa-devel, linux-kernel, Sameer Pujar

ALC5659 supports maximum data length of 24-bit. Currently driver supports
S24_LE which is a 32-bit container with valid data in [23:0] and 0s in MSB.
S24_3LE is not commonly used and is hard to find audio streams with this
format. Also many SoC HW do not support S24_LE and S32_LE is used in
general. The 24-bit data can be represented in S32_LE [31:8] and 0s are
padded in LSB.

This patch adds S32_LE to ALC5659 driver and data length for this is set
to 24 as per codec's maximum data length support. This helps to play
24-bit audio, packed in S32_LE, on HW which do not support S24_LE.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
---
 sound/soc/codecs/rt5659.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/rt5659.c b/sound/soc/codecs/rt5659.c
index fc74dd63..f910ddf 100644
--- a/sound/soc/codecs/rt5659.c
+++ b/sound/soc/codecs/rt5659.c
@@ -3339,6 +3339,7 @@ static int rt5659_hw_params(struct snd_pcm_substream *substream,
 		val_len |= RT5659_I2S_DL_20;
 		break;
 	case 24:
+	case 32:
 		val_len |= RT5659_I2S_DL_24;
 		break;
 	case 8:
@@ -3733,7 +3734,8 @@ static int rt5659_resume(struct snd_soc_component *component)
 
 #define RT5659_STEREO_RATES SNDRV_PCM_RATE_8000_192000
 #define RT5659_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
-		SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8)
+		SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE | \
+		SNDRV_PCM_FMTBIT_S8)
 
 static const struct snd_soc_dai_ops rt5659_aif_dai_ops = {
 	.hw_params = rt5659_hw_params,
-- 
2.7.4


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

* Re: [PATCH] ASoC: rt5659: add S32_LE format
  2020-01-20  6:17 [PATCH] ASoC: rt5659: add S32_LE format Sameer Pujar
@ 2020-01-20  6:24 ` Sameer Pujar
  2020-01-22 10:27   ` Sameer Pujar
  0 siblings, 1 reply; 5+ messages in thread
From: Sameer Pujar @ 2020-01-20  6:24 UTC (permalink / raw)
  To: oder_chiou, tiwai, perex; +Cc: alsa-devel, linux-kernel

Removing Bard(bardliao@realtek.com) from "to" list since I am getting 
undelivered message.

Oder,
Please add right folks as you feel necessary. Thanks.

On 1/20/2020 11:47 AM, Sameer Pujar wrote:
> ALC5659 supports maximum data length of 24-bit. Currently driver supports
> S24_LE which is a 32-bit container with valid data in [23:0] and 0s in MSB.
> S24_3LE is not commonly used and is hard to find audio streams with this
> format. Also many SoC HW do not support S24_LE and S32_LE is used in
> general. The 24-bit data can be represented in S32_LE [31:8] and 0s are
> padded in LSB.
>
> This patch adds S32_LE to ALC5659 driver and data length for this is set
> to 24 as per codec's maximum data length support. This helps to play
> 24-bit audio, packed in S32_LE, on HW which do not support S24_LE.
>
> Signed-off-by: Sameer Pujar <spujar@nvidia.com>
> ---
>   sound/soc/codecs/rt5659.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/codecs/rt5659.c b/sound/soc/codecs/rt5659.c
> index fc74dd63..f910ddf 100644
> --- a/sound/soc/codecs/rt5659.c
> +++ b/sound/soc/codecs/rt5659.c
> @@ -3339,6 +3339,7 @@ static int rt5659_hw_params(struct snd_pcm_substream *substream,
>   		val_len |= RT5659_I2S_DL_20;
>   		break;
>   	case 24:
> +	case 32:
>   		val_len |= RT5659_I2S_DL_24;
>   		break;
>   	case 8:
> @@ -3733,7 +3734,8 @@ static int rt5659_resume(struct snd_soc_component *component)
>   
>   #define RT5659_STEREO_RATES SNDRV_PCM_RATE_8000_192000
>   #define RT5659_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
> -		SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8)
> +		SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE | \
> +		SNDRV_PCM_FMTBIT_S8)
>   
>   static const struct snd_soc_dai_ops rt5659_aif_dai_ops = {
>   	.hw_params = rt5659_hw_params,

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

* Re: [PATCH] ASoC: rt5659: add S32_LE format
  2020-01-20  6:24 ` Sameer Pujar
@ 2020-01-22 10:27   ` Sameer Pujar
  2020-01-30  4:30     ` Oder Chiou
  0 siblings, 1 reply; 5+ messages in thread
From: Sameer Pujar @ 2020-01-22 10:27 UTC (permalink / raw)
  To: oder_chiou, tiwai, perex; +Cc: alsa-devel, linux-kernel

Hi Reviewers,

Kindly review. Thanks.

On 1/20/2020 11:54 AM, Sameer Pujar wrote:
> Removing Bard(bardliao@realtek.com) from "to" list since I am getting 
> undelivered message.
>
> Oder,
> Please add right folks as you feel necessary. Thanks.
>
> On 1/20/2020 11:47 AM, Sameer Pujar wrote:
>> ALC5659 supports maximum data length of 24-bit. Currently driver 
>> supports
>> S24_LE which is a 32-bit container with valid data in [23:0] and 0s 
>> in MSB.
>> S24_3LE is not commonly used and is hard to find audio streams with this
>> format. Also many SoC HW do not support S24_LE and S32_LE is used in
>> general. The 24-bit data can be represented in S32_LE [31:8] and 0s are
>> padded in LSB.
>>
>> This patch adds S32_LE to ALC5659 driver and data length for this is set
>> to 24 as per codec's maximum data length support. This helps to play
>> 24-bit audio, packed in S32_LE, on HW which do not support S24_LE.
>>
>> Signed-off-by: Sameer Pujar <spujar@nvidia.com>
>> ---
>>   sound/soc/codecs/rt5659.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/sound/soc/codecs/rt5659.c b/sound/soc/codecs/rt5659.c
>> index fc74dd63..f910ddf 100644
>> --- a/sound/soc/codecs/rt5659.c
>> +++ b/sound/soc/codecs/rt5659.c
>> @@ -3339,6 +3339,7 @@ static int rt5659_hw_params(struct 
>> snd_pcm_substream *substream,
>>           val_len |= RT5659_I2S_DL_20;
>>           break;
>>       case 24:
>> +    case 32:
>>           val_len |= RT5659_I2S_DL_24;
>>           break;
>>       case 8:
>> @@ -3733,7 +3734,8 @@ static int rt5659_resume(struct 
>> snd_soc_component *component)
>>     #define RT5659_STEREO_RATES SNDRV_PCM_RATE_8000_192000
>>   #define RT5659_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | 
>> SNDRV_PCM_FMTBIT_S20_3LE | \
>> -        SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8)
>> +        SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE | \
>> +        SNDRV_PCM_FMTBIT_S8)
>>     static const struct snd_soc_dai_ops rt5659_aif_dai_ops = {
>>       .hw_params = rt5659_hw_params,


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

* RE: [PATCH] ASoC: rt5659: add S32_LE format
  2020-01-22 10:27   ` Sameer Pujar
@ 2020-01-30  4:30     ` Oder Chiou
  2020-01-31  3:20       ` Sameer Pujar
  0 siblings, 1 reply; 5+ messages in thread
From: Oder Chiou @ 2020-01-30  4:30 UTC (permalink / raw)
  To: Sameer Pujar, tiwai, perex; +Cc: alsa-devel, linux-kernel

Acked-by: Oder Chiou <oder_chiou@realtek.com>

> -----Original Message-----
> From: Sameer Pujar [mailto:spujar@nvidia.com]
> Sent: Wednesday, January 22, 2020 6:27 PM
> To: Oder Chiou; tiwai@suse.com; perex@perex.cz
> Cc: alsa-devel@alsa-project.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] ASoC: rt5659: add S32_LE format
> 
> Hi Reviewers,
> 
> Kindly review. Thanks.
> 
> On 1/20/2020 11:54 AM, Sameer Pujar wrote:
> > Removing Bard(bardliao@realtek.com) from "to" list since I am getting
> > undelivered message.
> >
> > Oder,
> > Please add right folks as you feel necessary. Thanks.
> >
> > On 1/20/2020 11:47 AM, Sameer Pujar wrote:
> >> ALC5659 supports maximum data length of 24-bit. Currently driver
> >> supports
> >> S24_LE which is a 32-bit container with valid data in [23:0] and 0s
> >> in MSB.
> >> S24_3LE is not commonly used and is hard to find audio streams with this
> >> format. Also many SoC HW do not support S24_LE and S32_LE is used in
> >> general. The 24-bit data can be represented in S32_LE [31:8] and 0s are
> >> padded in LSB.
> >>
> >> This patch adds S32_LE to ALC5659 driver and data length for this is set
> >> to 24 as per codec's maximum data length support. This helps to play
> >> 24-bit audio, packed in S32_LE, on HW which do not support S24_LE.
> >>
> >> Signed-off-by: Sameer Pujar <spujar@nvidia.com>
> >> ---
> >>   sound/soc/codecs/rt5659.c | 4 +++-
> >>   1 file changed, 3 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/sound/soc/codecs/rt5659.c b/sound/soc/codecs/rt5659.c
> >> index fc74dd63..f910ddf 100644
> >> --- a/sound/soc/codecs/rt5659.c
> >> +++ b/sound/soc/codecs/rt5659.c
> >> @@ -3339,6 +3339,7 @@ static int rt5659_hw_params(struct
> >> snd_pcm_substream *substream,
> >>           val_len |= RT5659_I2S_DL_20;
> >>           break;
> >>       case 24:
> >> +    case 32:
> >>           val_len |= RT5659_I2S_DL_24;
> >>           break;
> >>       case 8:
> >> @@ -3733,7 +3734,8 @@ static int rt5659_resume(struct
> >> snd_soc_component *component)
> >>     #define RT5659_STEREO_RATES SNDRV_PCM_RATE_8000_192000
> >>   #define RT5659_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |
> >> SNDRV_PCM_FMTBIT_S20_3LE | \
> >> -        SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8)
> >> +        SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE | \
> >> +        SNDRV_PCM_FMTBIT_S8)
> >>     static const struct snd_soc_dai_ops rt5659_aif_dai_ops = {
> >>       .hw_params = rt5659_hw_params,
> 
> 
> ------Please consider the environment before printing this e-mail.

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

* Re: [PATCH] ASoC: rt5659: add S32_LE format
  2020-01-30  4:30     ` Oder Chiou
@ 2020-01-31  3:20       ` Sameer Pujar
  0 siblings, 0 replies; 5+ messages in thread
From: Sameer Pujar @ 2020-01-31  3:20 UTC (permalink / raw)
  To: Oder Chiou, tiwai, perex; +Cc: spujar, alsa-devel, linux-kernel



On 1/30/2020 10:00 AM, Oder Chiou wrote:
> External email: Use caution opening links or attachments
>
>
> Acked-by: Oder Chiou <oder_chiou@realtek.com>

Request maintainers to consider this patch for approval. Thanks in advance.

. . .
>>>> ALC5659 supports maximum data length of 24-bit. Currently driver
>>>> supports
>>>> S24_LE which is a 32-bit container with valid data in [23:0] and 0s
>>>> in MSB.
>>>> S24_3LE is not commonly used and is hard to find audio streams with this
>>>> format. Also many SoC HW do not support S24_LE and S32_LE is used in
>>>> general. The 24-bit data can be represented in S32_LE [31:8] and 0s are
>>>> padded in LSB.
>>>>
>>>> This patch adds S32_LE to ALC5659 driver and data length for this is set
>>>> to 24 as per codec's maximum data length support. This helps to play
>>>> 24-bit audio, packed in S32_LE, on HW which do not support S24_LE.
>>>>
>>>> Signed-off-by: Sameer Pujar <spujar@nvidia.com>
>>>> ---
>>>>    sound/soc/codecs/rt5659.c | 4 +++-
>>>>    1 file changed, 3 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/sound/soc/codecs/rt5659.c b/sound/soc/codecs/rt5659.c
>>>> index fc74dd63..f910ddf 100644
>>>> --- a/sound/soc/codecs/rt5659.c
>>>> +++ b/sound/soc/codecs/rt5659.c
>>>> @@ -3339,6 +3339,7 @@ static int rt5659_hw_params(struct
>>>> snd_pcm_substream *substream,
>>>>            val_len |= RT5659_I2S_DL_20;
>>>>            break;
>>>>        case 24:
>>>> +    case 32:
>>>>            val_len |= RT5659_I2S_DL_24;
>>>>            break;
>>>>        case 8:
>>>> @@ -3733,7 +3734,8 @@ static int rt5659_resume(struct
>>>> snd_soc_component *component)
>>>>      #define RT5659_STEREO_RATES SNDRV_PCM_RATE_8000_192000
>>>>    #define RT5659_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |
>>>> SNDRV_PCM_FMTBIT_S20_3LE | \
>>>> -        SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8)
>>>> +        SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE | \
>>>> +        SNDRV_PCM_FMTBIT_S8)
>>>>      static const struct snd_soc_dai_ops rt5659_aif_dai_ops = {
>>>>        .hw_params = rt5659_hw_params,
>>
>> ------Please consider the environment before printing this e-mail.


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

end of thread, other threads:[~2020-01-31  3:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-20  6:17 [PATCH] ASoC: rt5659: add S32_LE format Sameer Pujar
2020-01-20  6:24 ` Sameer Pujar
2020-01-22 10:27   ` Sameer Pujar
2020-01-30  4:30     ` Oder Chiou
2020-01-31  3:20       ` Sameer Pujar

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