diff mbox series

[v4,1/2] arm64: dts: qcom: sc7180-trogdor: Add lpass dai link for I2S driver

Message ID 20210311164815.14113-2-srivasam@codeaurora.org (mailing list archive)
State Superseded
Headers show
Series Qualcomm's lpass device tree changes for I2s dai | expand

Commit Message

Srinivasa Rao Mandadapu March 11, 2021, 4:48 p.m. UTC
From: Ajit Pandey <ajitp@codeaurora.org>

Add dai link for supporting lpass I2S driver, which is used
for audio capture and playback.
Add lpass-cpu node with  pin controls and i2s primary
and secondary dai-links

Signed-off-by: Ajit Pandey <ajitp@codeaurora.org>
Signed-off-by: V Sujith Kumar Reddy <vsujithk@codeaurora.org>
Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
---
 arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 58 ++++++++++++++++++++
 1 file changed, 58 insertions(+)

Comments

Douglas Anderson March 11, 2021, 7:56 p.m. UTC | #1
Hi,

On Thu, Mar 11, 2021 at 8:49 AM Srinivasa Rao Mandadapu
<srivasam@codeaurora.org> wrote:
>
> From: Ajit Pandey <ajitp@codeaurora.org>
>
> Add dai link for supporting lpass I2S driver, which is used
> for audio capture and playback.
> Add lpass-cpu node with  pin controls and i2s primary
> and secondary dai-links
>
> Signed-off-by: Ajit Pandey <ajitp@codeaurora.org>
> Signed-off-by: V Sujith Kumar Reddy <vsujithk@codeaurora.org>
> Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
> ---
>  arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 58 ++++++++++++++++++++
>  1 file changed, 58 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
> index 436582279dad..501e3d4c9097 100644
> --- a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
> @@ -9,6 +9,7 @@
>  #include <dt-bindings/input/gpio-keys.h>
>  #include <dt-bindings/input/input.h>
>  #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
> +#include <dt-bindings/sound/qcom,lpass.h>

It seems marginally better to include "sc7180-lpass.h" to get this? I
don't really know the difference between the two but since unless
we're planning to delete the sc7180 version it seems like you might as
well include that one?


>  /* PMICs depend on spmi_bus label and so must come after SoC */
>  #include "pm6150.dtsi"
> @@ -283,6 +284,42 @@ keyboard_backlight: keyboard-backlight {
>                         max-brightness = <1023>;
>                 };
>         };
> +
> +       sound: sound {
> +               compatible = "google,sc7180-trogdor";
> +               model = "sc7180-rt5682-max98357a-1mic";
> +
> +               audio-routing =
> +                       "Headphone Jack", "HPOL",
> +                       "Headphone Jack", "HPOR";
> +
> +               #address-cells = <1>;
> +               #size-cells = <0>;
> +
> +               dai-link@0 {
> +                       link-name = "MultiMedia0";
> +                       reg = <MI2S_PRIMARY>;
> +                       cpu {
> +                               sound-dai = <&lpass_cpu MI2S_PRIMARY>;
> +                       };
> +
> +                       codec {
> +                               sound-dai = <&alc5682 MI2S_PRIMARY>;

I'm an audio noob but isn't "MI2S_PRIMARY" something to be used with
"lpass_cpu", not with "alc5682" ?

I have no idea what the IDs correspond to on "alc5682". Are you sure
we even need an extra ID there? The "alc5682" bindings upstream don't
talk anything about dai-cells, but maybe they're just wrong...

-Doug
Srinivasa Rao Mandadapu March 12, 2021, 1:02 p.m. UTC | #2
Hi Doug,

Thanks for your time!!!

On 3/12/2021 1:26 AM, Doug Anderson wrote:
> Hi,
>
> On Thu, Mar 11, 2021 at 8:49 AM Srinivasa Rao Mandadapu
> <srivasam@codeaurora.org> wrote:
>> From: Ajit Pandey <ajitp@codeaurora.org>
>>
>> Add dai link for supporting lpass I2S driver, which is used
>> for audio capture and playback.
>> Add lpass-cpu node with  pin controls and i2s primary
>> and secondary dai-links
>>
>> Signed-off-by: Ajit Pandey <ajitp@codeaurora.org>
>> Signed-off-by: V Sujith Kumar Reddy <vsujithk@codeaurora.org>
>> Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
>> ---
>>   arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 58 ++++++++++++++++++++
>>   1 file changed, 58 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
>> index 436582279dad..501e3d4c9097 100644
>> --- a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
>> @@ -9,6 +9,7 @@
>>   #include <dt-bindings/input/gpio-keys.h>
>>   #include <dt-bindings/input/input.h>
>>   #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
>> +#include <dt-bindings/sound/qcom,lpass.h>
> It seems marginally better to include "sc7180-lpass.h" to get this? I
> don't really know the difference between the two but since unless
> we're planning to delete the sc7180 version it seems like you might as
> well include that one?

Yes, I agree.

Recently, all Quallcomm variant headers are combined and created 
"qcom,lpass.h".

"sc7180-lpass.h" still includes "qcom,lpass.h". So I will change and 
repost the patch.


Here is the reference commit:

>
>
>>   /* PMICs depend on spmi_bus label and so must come after SoC */
>>   #include "pm6150.dtsi"
>> @@ -283,6 +284,42 @@ keyboard_backlight: keyboard-backlight {
>>                          max-brightness = <1023>;
>>                  };
>>          };
>> +
>> +       sound: sound {
>> +               compatible = "google,sc7180-trogdor";
>> +               model = "sc7180-rt5682-max98357a-1mic";
>> +
>> +               audio-routing =
>> +                       "Headphone Jack", "HPOL",
>> +                       "Headphone Jack", "HPOR";
>> +
>> +               #address-cells = <1>;
>> +               #size-cells = <0>;
>> +
>> +               dai-link@0 {
>> +                       link-name = "MultiMedia0";
>> +                       reg = <MI2S_PRIMARY>;
>> +                       cpu {
>> +                               sound-dai = <&lpass_cpu MI2S_PRIMARY>;
>> +                       };
>> +
>> +                       codec {
>> +                               sound-dai = <&alc5682 MI2S_PRIMARY>;
> I'm an audio noob but isn't "MI2S_PRIMARY" something to be used with
> "lpass_cpu", not with "alc5682" ?
>
> I have no idea what the IDs correspond to on "alc5682". Are you sure
> we even need an extra ID there? The "alc5682" bindings upstream don't
> talk anything about dai-cells, but maybe they're just wrong...
Yes. I will change and re-post.
>
> -Doug
Srinivasa Rao Mandadapu March 12, 2021, 3:55 p.m. UTC | #3
Hi Doug,

On 3/12/2021 6:32 PM, Srinivasa Rao Mandadapu wrote:
> Hi Doug,
>
> Thanks for your time!!!
>
> On 3/12/2021 1:26 AM, Doug Anderson wrote:
>> Hi,
>>
>> On Thu, Mar 11, 2021 at 8:49 AM Srinivasa Rao Mandadapu
>> <srivasam@codeaurora.org> wrote:
>>> From: Ajit Pandey <ajitp@codeaurora.org>
>>>
>>> Add dai link for supporting lpass I2S driver, which is used
>>> for audio capture and playback.
>>> Add lpass-cpu node with  pin controls and i2s primary
>>> and secondary dai-links
>>>
>>> Signed-off-by: Ajit Pandey <ajitp@codeaurora.org>
>>> Signed-off-by: V Sujith Kumar Reddy <vsujithk@codeaurora.org>
>>> Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
>>> ---
>>>   arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 58 
>>> ++++++++++++++++++++
>>>   1 file changed, 58 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi 
>>> b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
>>> index 436582279dad..501e3d4c9097 100644
>>> --- a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
>>> +++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
>>> @@ -9,6 +9,7 @@
>>>   #include <dt-bindings/input/gpio-keys.h>
>>>   #include <dt-bindings/input/input.h>
>>>   #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
>>> +#include <dt-bindings/sound/qcom,lpass.h>
>> It seems marginally better to include "sc7180-lpass.h" to get this? I
>> don't really know the difference between the two but since unless
>> we're planning to delete the sc7180 version it seems like you might as
>> well include that one?
>
> Yes, I agree.
>
> Recently, all Quallcomm variant headers are combined and created 
> "qcom,lpass.h".
>
> "sc7180-lpass.h" still includes "qcom,lpass.h". So I will change and 
> repost the patch.
>
>
> Here is the reference commit:
>
>>
>>
>>>   /* PMICs depend on spmi_bus label and so must come after SoC */
>>>   #include "pm6150.dtsi"
>>> @@ -283,6 +284,42 @@ keyboard_backlight: keyboard-backlight {
>>>                          max-brightness = <1023>;
>>>                  };
>>>          };
>>> +
>>> +       sound: sound {
>>> +               compatible = "google,sc7180-trogdor";
>>> +               model = "sc7180-rt5682-max98357a-1mic";
>>> +
>>> +               audio-routing =
>>> +                       "Headphone Jack", "HPOL",
>>> +                       "Headphone Jack", "HPOR";
>>> +
>>> +               #address-cells = <1>;
>>> +               #size-cells = <0>;
>>> +
>>> +               dai-link@0 {
>>> +                       link-name = "MultiMedia0";
>>> +                       reg = <MI2S_PRIMARY>;
>>> +                       cpu {
>>> +                               sound-dai = <&lpass_cpu MI2S_PRIMARY>;
>>> +                       };
>>> +
>>> +                       codec {
>>> +                               sound-dai = <&alc5682 MI2S_PRIMARY>;
>> I'm an audio noob but isn't "MI2S_PRIMARY" something to be used with
>> "lpass_cpu", not with "alc5682" ?
>>
>> I have no idea what the IDs correspond to on "alc5682". Are you sure
>> we even need an extra ID there? The "alc5682" bindings upstream don't
>> talk anything about dai-cells, but maybe they're just wrong...
> Yes. I will change and re-post.
Actually, without dai-cells getting compilation issues. So I think it's 
necessary here.
>>
>> -Doug
>
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
index 436582279dad..501e3d4c9097 100644
--- a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
@@ -9,6 +9,7 @@ 
 #include <dt-bindings/input/gpio-keys.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+#include <dt-bindings/sound/qcom,lpass.h>
 
 /* PMICs depend on spmi_bus label and so must come after SoC */
 #include "pm6150.dtsi"
@@ -283,6 +284,42 @@  keyboard_backlight: keyboard-backlight {
 			max-brightness = <1023>;
 		};
 	};
+
+	sound: sound {
+		compatible = "google,sc7180-trogdor";
+		model = "sc7180-rt5682-max98357a-1mic";
+
+		audio-routing =
+			"Headphone Jack", "HPOL",
+			"Headphone Jack", "HPOR";
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		dai-link@0 {
+			link-name = "MultiMedia0";
+			reg = <MI2S_PRIMARY>;
+			cpu {
+				sound-dai = <&lpass_cpu MI2S_PRIMARY>;
+			};
+
+			codec {
+				sound-dai = <&alc5682 MI2S_PRIMARY>;
+			};
+		};
+
+		dai-link@1 {
+			link-name = "MultiMedia1";
+			reg = <MI2S_SECONDARY>;
+			cpu {
+				sound-dai = <&lpass_cpu MI2S_SECONDARY>;
+			};
+
+			codec {
+				sound-dai = <&max98357a>;
+			};
+		};
+	};
 };
 
 &qfprom {
@@ -720,6 +757,27 @@  &ipa {
 	modem-init;
 };
 
+&lpass_cpu {
+	status = "okay";
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&sec_mi2s_active &pri_mi2s_active &pri_mi2s_mclk_active>;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	mi2s-primary@0 {
+		reg = <MI2S_PRIMARY>;
+		qcom,playback-sd-lines = <1>;
+		qcom,capture-sd-lines = <0>;
+	};
+
+	mi2s-secondary@1 {
+		reg = <MI2S_SECONDARY>;
+		qcom,playback-sd-lines = <0>;
+	};
+};
+
 &mdp {
 	status = "okay";
 };