2020-02-12 01:53:53

by Adam Serbinski

[permalink] [raw]
Subject: [PATCH v3 6/6] ASoC: qdsp6: dt-bindings: Add q6afe pcm dt binding documentation

This patch adds documentation of bindings required for PCM ports on AFE.

Signed-off-by: Adam Serbinski <[email protected]>
CC: Andy Gross <[email protected]>
CC: Mark Rutland <[email protected]>
CC: Liam Girdwood <[email protected]>
CC: Patrick Lai <[email protected]>
CC: Banajit Goswami <[email protected]>
CC: Jaroslav Kysela <[email protected]>
CC: Takashi Iwai <[email protected]>
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
---
.../devicetree/bindings/sound/qcom,q6afe.txt | 42 +++++++++++++++++++
1 file changed, 42 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/qcom,q6afe.txt b/Documentation/devicetree/bindings/sound/qcom,q6afe.txt
index d74888b9f1bb..6b1b17d31a2a 100644
--- a/Documentation/devicetree/bindings/sound/qcom,q6afe.txt
+++ b/Documentation/devicetree/bindings/sound/qcom,q6afe.txt
@@ -51,6 +51,24 @@ configuration of each dai. Must contain the following properties.
Definition: Must be list of serial data lines used by this dai.
should be one or more of the 0-3 sd lines.

+ - qcom,pcm-quantype
+ Usage: required for pcm interface
+ Value type: <u32>
+ Definition: PCM quantization type
+ 0 - ALAW, no padding
+ 1 - MULAW, no padding
+ 2 - Linear, no padding
+ 3 - ALAW, padding
+ 4 - MULAW, padding
+ 5 - Linear, padding
+
+ - qcom,pcm-slot-mapping
+ Usage: required for pcm interface
+ Value type: <prop-encoded-array>
+ Definition: Slot mapping for audio channels. Array size is the number
+ of slots, minimum 1, maximum 4. The value is 0 for no mapping
+ to the slot, or the channel number from 1 to 32.
+
- qcom,tdm-sync-mode:
Usage: required for tdm interface
Value type: <prop-encoded-array>
@@ -174,5 +192,29 @@ q6afe@4 {
reg = <23>;
qcom,sd-lines = <1>;
};
+
+ pri-pcm-rx@105 {
+ reg = <105>;
+ qcom,pcm-quantype = <2>;
+ qcom,pcm-slot-mapping = <1>;
+ };
+
+ pri-pcm-tx@106 {
+ reg = <106>;
+ qcom,pcm-quantype = <2>;
+ qcom,pcm-slot-mapping = <1>;
+ };
+
+ quat-pcm-rx@111 {
+ reg = <111>;
+ qcom,pcm-quantype = <5>;
+ qcom,pcm-slot-mapping = <0 0 1>;
+ };
+
+ quat-pcm-tx@112 {
+ reg = <112>;
+ qcom,pcm-quantype = <5>;
+ qcom,pcm-slot-mapping = <0 0 1>;
+ };
};
};
--
2.21.1


2020-02-12 10:00:22

by Srinivas Kandagatla

[permalink] [raw]
Subject: Re: [PATCH v3 6/6] ASoC: qdsp6: dt-bindings: Add q6afe pcm dt binding documentation



On 12/02/2020 01:52, Adam Serbinski wrote:
> This patch adds documentation of bindings required for PCM ports on AFE.
>
> Signed-off-by: Adam Serbinski <[email protected]>
> CC: Andy Gross <[email protected]>
> CC: Mark Rutland <[email protected]>
> CC: Liam Girdwood <[email protected]>
> CC: Patrick Lai <[email protected]>
> CC: Banajit Goswami <[email protected]>
> CC: Jaroslav Kysela <[email protected]>
> CC: Takashi Iwai <[email protected]>
> CC: [email protected]
> CC: [email protected]
> CC: [email protected]
> CC: [email protected]
> ---
> .../devicetree/bindings/sound/qcom,q6afe.txt | 42 +++++++++++++++++++
> 1 file changed, 42 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/sound/qcom,q6afe.txt b/Documentation/devicetree/bindings/sound/qcom,q6afe.txt
> index d74888b9f1bb..6b1b17d31a2a 100644
> --- a/Documentation/devicetree/bindings/sound/qcom,q6afe.txt
> +++ b/Documentation/devicetree/bindings/sound/qcom,q6afe.txt
> @@ -51,6 +51,24 @@ configuration of each dai. Must contain the following properties.
> Definition: Must be list of serial data lines used by this dai.
> should be one or more of the 0-3 sd lines.
>
> + - qcom,pcm-quantype
> + Usage: required for pcm interface
> + Value type: <u32>
> + Definition: PCM quantization type
> + 0 - ALAW, no padding
> + 1 - MULAW, no padding
> + 2 - Linear, no padding
> + 3 - ALAW, padding
> + 4 - MULAW, padding
> + 5 - Linear, padding
> +
> + - qcom,pcm-slot-mapping
> + Usage: required for pcm interface

Are these not specific to 8k and 16k mode ?
We should probably list values for both modes here.

--srini

> + Value type: <prop-encoded-array>
> + Definition: Slot mapping for audio channels. Array size is the number
> + of slots, minimum 1, maximum 4. The value is 0 for no mapping
> + to the slot, or the channel number from 1 to 32.
> +
> - qcom,tdm-sync-mode:
> Usage: required for tdm interface
> Value type: <prop-encoded-array>
> @@ -174,5 +192,29 @@ q6afe@4 {
> reg = <23>;
> qcom,sd-lines = <1>;
> };
> +
> + pri-pcm-rx@105 {
> + reg = <105>;
> + qcom,pcm-quantype = <2>;
> + qcom,pcm-slot-mapping = <1>;
> + };
> +
> + pri-pcm-tx@106 {
> + reg = <106>;
> + qcom,pcm-quantype = <2>;
> + qcom,pcm-slot-mapping = <1>;
> + };
> +
> + quat-pcm-rx@111 {
> + reg = <111>;
> + qcom,pcm-quantype = <5>;
> + qcom,pcm-slot-mapping = <0 0 1>;
> + };
> +
> + quat-pcm-tx@112 {
> + reg = <112>;
> + qcom,pcm-quantype = <5>;
> + qcom,pcm-slot-mapping = <0 0 1>;
> + };
> };
> };
>

2020-02-12 11:02:35

by Adam Serbinski

[permalink] [raw]
Subject: Re: [PATCH v3 6/6] ASoC: qdsp6: dt-bindings: Add q6afe pcm dt binding documentation

On 2020-02-12 04:59, Srinivas Kandagatla wrote:
> On 12/02/2020 01:52, Adam Serbinski wrote:
>> This patch adds documentation of bindings required for PCM ports on
>> AFE.
>>
>> Signed-off-by: Adam Serbinski <[email protected]>
>> CC: Andy Gross <[email protected]>
>> CC: Mark Rutland <[email protected]>
>> CC: Liam Girdwood <[email protected]>
>> CC: Patrick Lai <[email protected]>
>> CC: Banajit Goswami <[email protected]>
>> CC: Jaroslav Kysela <[email protected]>
>> CC: Takashi Iwai <[email protected]>
>> CC: [email protected]
>> CC: [email protected]
>> CC: [email protected]
>> CC: [email protected]
>> ---
>> .../devicetree/bindings/sound/qcom,q6afe.txt | 42
>> +++++++++++++++++++
>> 1 file changed, 42 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/sound/qcom,q6afe.txt
>> b/Documentation/devicetree/bindings/sound/qcom,q6afe.txt
>> index d74888b9f1bb..6b1b17d31a2a 100644
>> --- a/Documentation/devicetree/bindings/sound/qcom,q6afe.txt
>> +++ b/Documentation/devicetree/bindings/sound/qcom,q6afe.txt
>> @@ -51,6 +51,24 @@ configuration of each dai. Must contain the
>> following properties.
>> Definition: Must be list of serial data lines used by this dai.
>> should be one or more of the 0-3 sd lines.
>> + - qcom,pcm-quantype
>> + Usage: required for pcm interface
>> + Value type: <u32>
>> + Definition: PCM quantization type
>> + 0 - ALAW, no padding
>> + 1 - MULAW, no padding
>> + 2 - Linear, no padding
>> + 3 - ALAW, padding
>> + 4 - MULAW, padding
>> + 5 - Linear, padding
>> +
>> + - qcom,pcm-slot-mapping
>> + Usage: required for pcm interface
>
> Are these not specific to 8k and 16k mode ?
> We should probably list values for both modes here.

No, this is just the offset that the audio sample is placed in with
respect to a maximum of 4 slots, 16 bits wide, beginning with the sync
pulse.

When switching between 8 and 16k sample rate, it is just the sync pulse
rate that is changed. The audio sample will be delivered in the same
slot, just at a different frequency.


>> + Value type: <prop-encoded-array>
>> + Definition: Slot mapping for audio channels. Array size is the
>> number
>> + of slots, minimum 1, maximum 4. The value is 0 for no mapping
>> + to the slot, or the channel number from 1 to 32.
>> +
>> - qcom,tdm-sync-mode:
>> Usage: required for tdm interface
>> Value type: <prop-encoded-array>
>> @@ -174,5 +192,29 @@ q6afe@4 {
>> reg = <23>;
>> qcom,sd-lines = <1>;
>> };
>> +
>> + pri-pcm-rx@105 {
>> + reg = <105>;
>> + qcom,pcm-quantype = <2>;
>> + qcom,pcm-slot-mapping = <1>;
>> + };
>> +
>> + pri-pcm-tx@106 {
>> + reg = <106>;
>> + qcom,pcm-quantype = <2>;
>> + qcom,pcm-slot-mapping = <1>;
>> + };
>> +
>> + quat-pcm-rx@111 {
>> + reg = <111>;
>> + qcom,pcm-quantype = <5>;
>> + qcom,pcm-slot-mapping = <0 0 1>;
>> + };
>> +
>> + quat-pcm-tx@112 {
>> + reg = <112>;
>> + qcom,pcm-quantype = <5>;
>> + qcom,pcm-slot-mapping = <0 0 1>;
>> + };
>> };
>> };
>>

2020-02-12 11:44:26

by Srinivas Kandagatla

[permalink] [raw]
Subject: Re: [PATCH v3 6/6] ASoC: qdsp6: dt-bindings: Add q6afe pcm dt binding documentation



On 12/02/2020 11:01, Adam Serbinski wrote:
>>>
>>> +
>>> + - qcom,pcm-slot-mapping
>>> +    Usage: required for pcm interface
>>
>> Are these not specific to 8k and 16k mode ?
>> We should probably list values for both modes here.
>
> No, this is just the offset that the audio sample is placed in with
> respect to a maximum of 4 slots, 16 bits wide, beginning with the sync
> pulse.


That's not true atleast by the QDSP documentation,
according to it we will use more slots to transfer at higher sample
rate. ex:
16 kHz data can be transferred using 8 kHz samples in two
slots.

Also there are 32 slots for each of 4 supported channels for PCM AFE port.


>
> When switching between 8 and 16k sample rate, it is just the sync pulse
> rate that is changed. The audio sample will be delivered in the same
> slot, just at a different frequency.

2020-02-12 12:09:30

by Adam Serbinski

[permalink] [raw]
Subject: Re: [PATCH v3 6/6] ASoC: qdsp6: dt-bindings: Add q6afe pcm dt binding documentation

On 2020-02-12 06:43, Srinivas Kandagatla wrote:
> On 12/02/2020 11:01, Adam Serbinski wrote:
>>>>
>>>> +
>>>> + - qcom,pcm-slot-mapping
>>>> +    Usage: required for pcm interface
>>>
>>> Are these not specific to 8k and 16k mode ?
>>> We should probably list values for both modes here.
>>
>> No, this is just the offset that the audio sample is placed in with
>> respect to a maximum of 4 slots, 16 bits wide, beginning with the sync
>> pulse.
>
>
> That's not true atleast by the QDSP documentation,
> according to it we will use more slots to transfer at higher sample
> rate. ex:
> 16 kHz data can be transferred using 8 kHz samples in two
> slots.
>
> Also there are 32 slots for each of 4 supported channels for PCM AFE
> port.

Ok, if that's the case, then it sounds like someone else is going to
have to implement it. I have no way to test that kind of a
configuration, so attempting to implement it would be futile.

>
>
>>
>> When switching between 8 and 16k sample rate, it is just the sync
>> pulse rate that is changed. The audio sample will be delivered in the
>> same slot, just at a different frequency.