All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] arch: arm64: qcom: sdm845-shift-axolotl: fix Bluetooth firmware loading
@ 2022-06-09  9:54 Alexander Martinz
  2022-06-09  9:54 ` [PATCH 2/2] arm64: dts: qcom/sdm845-shift-axolotl: Add audio support Alexander Martinz
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Alexander Martinz @ 2022-06-09  9:54 UTC (permalink / raw)
  To: ~postmarketos/upstreaming
  Cc: phone-devel, Andy Gross, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, devicetree, linux-kernel,
	Dylan Van Assche, Alexander Martinz

From: Dylan Van Assche <me@dylanvanassche.be>

Add hsuart0 alias, firmware name and prevent garbage data on Bluetooth UART lines
on the SHIFT 6mq based on the Qualcomm SDM845 chip.
I discovered that these were missing by comparing the DTS with similar
devices such as the Oneplus 6/6T and Dragonboard 845c.

Signed-of-by: Dylan Van Assche <me@dylanvanassche.be>
Tested-by: Alexander Martinz <amartinz@shiftphones.com>
---
 .../boot/dts/qcom/sdm845-shift-axolotl.dts    | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
index 103cc40816fd..fa72f23ef0c2 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
@@ -20,6 +20,7 @@ / {
 
 	aliases {
 		display0 = &framebuffer0;
+		hsuart0 = &uart6;
 		serial0 = &uart9;
 	};
 
@@ -529,6 +530,32 @@ volume_down_resin: resin {
 	};
 };
 
+/*
+ * Prevent garbage data on bluetooth UART lines
+ */
+&qup_uart6_default {
+        pinmux {
+                pins = "gpio45", "gpio46", "gpio47", "gpio48";
+                function = "qup6";
+        };
+
+        cts {
+                pins = "gpio45";
+                bias-pull-down;
+        };
+
+        rts-tx {
+                pins = "gpio46", "gpio47";
+                drive-strength = <2>;
+                bias-disable;
+        };
+
+        rx {
+                pins = "gpio48";
+                bias-pull-up;
+        };
+};
+
 &qup_uart9_default {
 	pinconf-rx {
 		pins = "gpio5";
@@ -667,6 +694,12 @@ &uart6 {
 	bluetooth {
 		compatible = "qcom,wcn3990-bt";
 
+		/*
+		 * This path is relative to the qca/
+		 * subdir under lib/firmware.
+		 */
+		firmware-name = "axolotl/crnv21.bin";
+
 		vddio-supply = <&vreg_s4a_1p8>;
 		vddxo-supply = <&vreg_l7a_1p8>;
 		vddrf-supply = <&vreg_l17a_1p3>;
-- 
2.36.1


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

* [PATCH 2/2] arm64: dts: qcom/sdm845-shift-axolotl: Add audio support
  2022-06-09  9:54 [PATCH 1/2] arch: arm64: qcom: sdm845-shift-axolotl: fix Bluetooth firmware loading Alexander Martinz
@ 2022-06-09  9:54 ` Alexander Martinz
  2022-06-09 12:14   ` Krzysztof Kozlowski
                     ` (2 more replies)
  2022-06-09 12:11 ` [PATCH 1/2] arch: arm64: qcom: sdm845-shift-axolotl: fix Bluetooth firmware loading Krzysztof Kozlowski
  2022-06-09 12:47 ` Dmitry Baryshkov
  2 siblings, 3 replies; 8+ messages in thread
From: Alexander Martinz @ 2022-06-09  9:54 UTC (permalink / raw)
  To: ~postmarketos/upstreaming
  Cc: phone-devel, Andy Gross, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, devicetree, linux-kernel,
	Alexander Martinz, Dylan Van Assche

This patch adds audio support for the SHIFT6mq phone.

The primary microphone and headphone jack are handled by the
SDM845 sound card and WCD9340 codec.

The primary speaker needs to go through the TFA9890 speaker
amplifier.

Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
Tested-by: Dylan Van Assche <me@dylanvanassche.be>
---
 .../boot/dts/qcom/sdm845-shift-axolotl.dts    | 141 ++++++++++++++++++
 1 file changed, 141 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
index fa72f23ef0c2..8c4967d6d0e3 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
@@ -8,6 +8,8 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+#include <dt-bindings/sound/qcom,q6afe.h>
+#include <dt-bindings/sound/qcom,q6asm.h>
 #include "sdm845.dtsi"
 #include "pm8998.dtsi"
 #include "pmi8998.dtsi"
@@ -492,6 +494,19 @@ touchscreen@38 {
 	};
 };
 
+&i2c11 {
+	status = "okay";
+	clock-frequency = <400000>;
+
+	tfa9890_codec: tfa9890@34 {
+		compatible = "nxp,tfa9890";
+		reg = <0x34>;
+		vddd-supply = <&vreg_s4a_1p8>;
+		reset-gpio = <&tlmm 7 0>;
+		#sound-dai-cells = <1>;
+	};
+};
+
 &ipa {
 	status = "okay";
 
@@ -530,6 +545,27 @@ volume_down_resin: resin {
 	};
 };
 
+&q6afedai {
+	qi2s@22 {
+		reg = <22>;
+		qcom,sd-lines = <0>;
+	};
+};
+
+&q6asmdai {
+	dai@0 {
+		reg = <0>;
+	};
+
+	dai@1 {
+		reg = <1>;
+	};
+
+	dai@2 {
+		reg = <2>;
+	};
+};
+
 /*
  * Prevent garbage data on bluetooth UART lines
  */
@@ -578,6 +614,84 @@ &qupv3_id_1 {
 	status = "okay";
 };
 
+&sound {
+	model = "SHIFT6mq";
+	compatible = "qcom,sdm845-sndcard";
+	pinctrl-0 = <&quat_mi2s_active &quat_mi2s_sd0_active>;
+	pinctrl-names = "default";
+
+	audio-routing = "RX_BIAS", "MCLK",
+			"AMIC1", "MIC BIAS1",
+			"AMIC2", "MIC BIAS2",
+			"AMIC3", "MIC BIAS3";
+
+	mm1-dai-link {
+		link-name = "MultiMedia1";
+		cpu {
+			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>;
+		};
+	};
+
+	mm2-dai-link {
+		link-name = "MultiMedia2";
+		cpu {
+			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA2>;
+		};
+	};
+
+	mm3-dai-link {
+		link-name = "MultiMedia3";
+		cpu {
+			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA3>;
+		};
+	};
+
+	speaker-dai-link {
+		link-name = "Speaker Playback";
+		codec {
+			sound-dai = <&tfa9890_codec 0>;
+		};
+
+		cpu {
+			sound-dai = <&q6afedai QUATERNARY_MI2S_RX>;
+		};
+
+		platform {
+			sound-dai = <&q6routing>;
+		};
+	};
+
+	slim-dai-link {
+		link-name = "SLIM Playback";
+		codec {
+			sound-dai = <&wcd9340 0>;
+		};
+
+		cpu {
+			sound-dai = <&q6afedai SLIMBUS_0_RX>;
+		};
+
+		platform {
+			sound-dai = <&q6routing>;
+		};
+	};
+
+	slimcap-dai-link {
+		link-name = "SLIM Capture";
+		codec {
+			sound-dai = <&wcd9340 1>;
+		};
+
+		cpu {
+			sound-dai = <&q6afedai SLIMBUS_0_TX>;
+		};
+
+		platform {
+			sound-dai = <&q6routing>;
+		};
+	};
+};
+
 &tlmm {
 	gpio-reserved-ranges = <0 4>, <81 4>;
 
@@ -686,6 +800,15 @@ config {
 			bias-pull-down;
 		};
 	};
+
+	wcd_intr_default: wcd_intr_default {
+		pins = <54>;
+		function = "gpio";
+
+		input-enable;
+		bias-pull-down;
+		drive-strength = <2>;
+	};
 };
 
 &uart6 {
@@ -756,6 +879,24 @@ &venus {
 	firmware-name = "qcom/sdm845/axolotl/venus.mbn";
 };
 
+&wcd9340 {
+	pinctrl-0 = <&wcd_intr_default>;
+	pinctrl-names = "default";
+	clock-names = "extclk";
+	clocks = <&rpmhcc RPMH_LN_BB_CLK2>;
+	reset-gpios = <&tlmm 64 0>;
+	vdd-buck-supply = <&vreg_s4a_1p8>;
+	vdd-buck-sido-supply = <&vreg_s4a_1p8>;
+	vdd-tx-supply = <&vreg_s4a_1p8>;
+	vdd-rx-supply = <&vreg_s4a_1p8>;
+	vdd-io-supply = <&vreg_s4a_1p8>;
+
+	qcom,micbias1-microvolt = <2700000>;
+	qcom,micbias2-microvolt = <2700000>;
+	qcom,micbias3-microvolt = <2700000>;
+	qcom,micbias4-microvolt = <2700000>;
+};
+
 &wifi {
 	status = "okay";
 
-- 
2.36.1


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

* Re: [PATCH 1/2] arch: arm64: qcom: sdm845-shift-axolotl: fix Bluetooth firmware loading
  2022-06-09  9:54 [PATCH 1/2] arch: arm64: qcom: sdm845-shift-axolotl: fix Bluetooth firmware loading Alexander Martinz
  2022-06-09  9:54 ` [PATCH 2/2] arm64: dts: qcom/sdm845-shift-axolotl: Add audio support Alexander Martinz
@ 2022-06-09 12:11 ` Krzysztof Kozlowski
  2022-06-09 12:47 ` Dmitry Baryshkov
  2 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-09 12:11 UTC (permalink / raw)
  To: Alexander Martinz, ~postmarketos/upstreaming
  Cc: phone-devel, Andy Gross, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, devicetree, linux-kernel,
	Dylan Van Assche

On 09/06/2022 11:54, Alexander Martinz wrote:
> From: Dylan Van Assche <me@dylanvanassche.be>
> 
> Add hsuart0 alias, firmware name and prevent garbage data on Bluetooth UART lines
> on the SHIFT 6mq based on the Qualcomm SDM845 chip.
> I discovered that these were missing by comparing the DTS with similar
> devices such as the Oneplus 6/6T and Dragonboard 845c.
> 
> Signed-of-by: Dylan Van Assche <me@dylanvanassche.be>
> Tested-by: Alexander Martinz <amartinz@shiftphones.co>

Thanks for the patch. Instead of your Tested-by (or beside) your SoB is
needed, following Dylan's.

Best regards,
Krzysztof

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

* Re: [PATCH 2/2] arm64: dts: qcom/sdm845-shift-axolotl: Add audio support
  2022-06-09  9:54 ` [PATCH 2/2] arm64: dts: qcom/sdm845-shift-axolotl: Add audio support Alexander Martinz
@ 2022-06-09 12:14   ` Krzysztof Kozlowski
  2022-06-09 17:07   ` Stephan Gerhold
  2022-06-09 17:19   ` Luca Weiss
  2 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-09 12:14 UTC (permalink / raw)
  To: Alexander Martinz, ~postmarketos/upstreaming
  Cc: phone-devel, Andy Gross, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, devicetree, linux-kernel,
	Dylan Van Assche

On 09/06/2022 11:54, Alexander Martinz wrote:
> This patch adds audio support for the SHIFT6mq phone.
> 
> The primary microphone and headphone jack are handled by the
> SDM845 sound card and WCD9340 codec.
> 
> The primary speaker needs to go through the TFA9890 speaker
> amplifier.

Thank you for your patch. There is something to discuss/improve.

> 
> Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
> Tested-by: Dylan Van Assche <me@dylanvanassche.be>

Same problem.

> ---
>  .../boot/dts/qcom/sdm845-shift-axolotl.dts    | 141 ++++++++++++++++++
>  1 file changed, 141 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
> index fa72f23ef0c2..8c4967d6d0e3 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
> @@ -8,6 +8,8 @@
>  
>  #include <dt-bindings/gpio/gpio.h>
>  #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
> +#include <dt-bindings/sound/qcom,q6afe.h>
> +#include <dt-bindings/sound/qcom,q6asm.h>
>  #include "sdm845.dtsi"
>  #include "pm8998.dtsi"
>  #include "pmi8998.dtsi"
> @@ -492,6 +494,19 @@ touchscreen@38 {
>  	};
>  };
>  
> +&i2c11 {
> +	status = "okay";
> +	clock-frequency = <400000>;
> +
> +	tfa9890_codec: tfa9890@34 {

Generic node names please, so I guess it is: codec or audio-codec

> +		compatible = "nxp,tfa9890";
> +		reg = <0x34>;
> +		vddd-supply = <&vreg_s4a_1p8>;
> +		reset-gpio = <&tlmm 7 0>;
> +		#sound-dai-cells = <1>;
> +	};
> +};
> +
>  &ipa {
>  	status = "okay";
>  
> @@ -530,6 +545,27 @@ volume_down_resin: resin {
>  	};
>  };
>  
> +&q6afedai {
> +	qi2s@22 {
> +		reg = <22>;
> +		qcom,sd-lines = <0>;
> +	};
> +};
> +
> +&q6asmdai {
> +	dai@0 {
> +		reg = <0>;
> +	};
> +
> +	dai@1 {
> +		reg = <1>;
> +	};
> +
> +	dai@2 {
> +		reg = <2>;
> +	};
> +};
> +
>  /*
>   * Prevent garbage data on bluetooth UART lines
>   */
> @@ -578,6 +614,84 @@ &qupv3_id_1 {
>  	status = "okay";
>  };
>  
> +&sound {
> +	model = "SHIFT6mq";
> +	compatible = "qcom,sdm845-sndcard";
> +	pinctrl-0 = <&quat_mi2s_active &quat_mi2s_sd0_active>;
> +	pinctrl-names = "default";
> +
> +	audio-routing = "RX_BIAS", "MCLK",
> +			"AMIC1", "MIC BIAS1",
> +			"AMIC2", "MIC BIAS2",
> +			"AMIC3", "MIC BIAS3";
> +
> +	mm1-dai-link {
> +		link-name = "MultiMedia1";
> +		cpu {
> +			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>;
> +		};
> +	};
> +
> +	mm2-dai-link {
> +		link-name = "MultiMedia2";
> +		cpu {
> +			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA2>;
> +		};
> +	};
> +
> +	mm3-dai-link {
> +		link-name = "MultiMedia3";
> +		cpu {
> +			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA3>;
> +		};
> +	};
> +
> +	speaker-dai-link {
> +		link-name = "Speaker Playback";
> +		codec {
> +			sound-dai = <&tfa9890_codec 0>;
> +		};
> +
> +		cpu {
> +			sound-dai = <&q6afedai QUATERNARY_MI2S_RX>;
> +		};
> +
> +		platform {
> +			sound-dai = <&q6routing>;
> +		};
> +	};
> +
> +	slim-dai-link {
> +		link-name = "SLIM Playback";
> +		codec {
> +			sound-dai = <&wcd9340 0>;
> +		};
> +
> +		cpu {
> +			sound-dai = <&q6afedai SLIMBUS_0_RX>;
> +		};
> +
> +		platform {
> +			sound-dai = <&q6routing>;
> +		};
> +	};
> +
> +	slimcap-dai-link {
> +		link-name = "SLIM Capture";
> +		codec {
> +			sound-dai = <&wcd9340 1>;
> +		};
> +
> +		cpu {
> +			sound-dai = <&q6afedai SLIMBUS_0_TX>;
> +		};
> +
> +		platform {
> +			sound-dai = <&q6routing>;
> +		};
> +	};
> +};
> +
>  &tlmm {
>  	gpio-reserved-ranges = <0 4>, <81 4>;
>  
> @@ -686,6 +800,15 @@ config {
>  			bias-pull-down;
>  		};
>  	};
> +
> +	wcd_intr_default: wcd_intr_default {

No underscores in node names. Instead hyphens.

> +		pins = <54>;
> +		function = "gpio";
> +
> +		input-enable;
> +		bias-pull-down;
> +		drive-strength = <2>;
> +	};
>  };


Best regards,
Krzysztof

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

* Re: [PATCH 1/2] arch: arm64: qcom: sdm845-shift-axolotl: fix Bluetooth firmware loading
  2022-06-09  9:54 [PATCH 1/2] arch: arm64: qcom: sdm845-shift-axolotl: fix Bluetooth firmware loading Alexander Martinz
  2022-06-09  9:54 ` [PATCH 2/2] arm64: dts: qcom/sdm845-shift-axolotl: Add audio support Alexander Martinz
  2022-06-09 12:11 ` [PATCH 1/2] arch: arm64: qcom: sdm845-shift-axolotl: fix Bluetooth firmware loading Krzysztof Kozlowski
@ 2022-06-09 12:47 ` Dmitry Baryshkov
  2022-07-06 18:49   ` Caleb Connolly
  2 siblings, 1 reply; 8+ messages in thread
From: Dmitry Baryshkov @ 2022-06-09 12:47 UTC (permalink / raw)
  To: Alexander Martinz
  Cc: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	devicetree, linux-kernel, Dylan Van Assche

On Thu, 9 Jun 2022 at 12:54, Alexander Martinz <amartinz@shiftphones.com> wrote:
>
> From: Dylan Van Assche <me@dylanvanassche.be>
>
> Add hsuart0 alias, firmware name and prevent garbage data on Bluetooth UART lines

hsuart aliases are not standard. Please use serialN alias instead.

> on the SHIFT 6mq based on the Qualcomm SDM845 chip.
> I discovered that these were missing by comparing the DTS with similar
> devices such as the Oneplus 6/6T and Dragonboard 845c.
>
> Signed-of-by: Dylan Van Assche <me@dylanvanassche.be>
> Tested-by: Alexander Martinz <amartinz@shiftphones.com>
> ---
>  .../boot/dts/qcom/sdm845-shift-axolotl.dts    | 33 +++++++++++++++++++
>  1 file changed, 33 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
> index 103cc40816fd..fa72f23ef0c2 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
> @@ -20,6 +20,7 @@ / {
>
>         aliases {
>                 display0 = &framebuffer0;
> +               hsuart0 = &uart6;
>                 serial0 = &uart9;
>         };
>
> @@ -529,6 +530,32 @@ volume_down_resin: resin {
>         };
>  };
>
> +/*
> + * Prevent garbage data on bluetooth UART lines
> + */
> +&qup_uart6_default {
> +        pinmux {
> +                pins = "gpio45", "gpio46", "gpio47", "gpio48";
> +                function = "qup6";
> +        };

This chunk should probably go into sdm845.dtsi. I'd suggest either
adding a separate qup_uart6_4pin or just making qup_uart6_default the
4-pin UART.

> +
> +        cts {
> +                pins = "gpio45";

Then the label and 'pins' can go into the dtsi, while keeping just the
bias and drive-strength in the platform dtsi.

> +                bias-pull-down;
> +        };
> +
> +        rts-tx {
> +                pins = "gpio46", "gpio47";
> +                drive-strength = <2>;
> +                bias-disable;
> +        };
> +
> +        rx {
> +                pins = "gpio48";
> +                bias-pull-up;
> +        };
> +};
> +
>  &qup_uart9_default {
>         pinconf-rx {
>                 pins = "gpio5";
> @@ -667,6 +694,12 @@ &uart6 {
>         bluetooth {
>                 compatible = "qcom,wcn3990-bt";
>
> +               /*
> +                * This path is relative to the qca/
> +                * subdir under lib/firmware.
> +                */
> +               firmware-name = "axolotl/crnv21.bin";

Do you know what is the difference between axolotl's bin and the regular one?

> +
>                 vddio-supply = <&vreg_s4a_1p8>;
>                 vddxo-supply = <&vreg_l7a_1p8>;
>                 vddrf-supply = <&vreg_l17a_1p3>;

-- 
With best wishes
Dmitry

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

* Re: [PATCH 2/2] arm64: dts: qcom/sdm845-shift-axolotl: Add audio support
  2022-06-09  9:54 ` [PATCH 2/2] arm64: dts: qcom/sdm845-shift-axolotl: Add audio support Alexander Martinz
  2022-06-09 12:14   ` Krzysztof Kozlowski
@ 2022-06-09 17:07   ` Stephan Gerhold
  2022-06-09 17:19   ` Luca Weiss
  2 siblings, 0 replies; 8+ messages in thread
From: Stephan Gerhold @ 2022-06-09 17:07 UTC (permalink / raw)
  To: Alexander Martinz
  Cc: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	devicetree, linux-kernel, Dylan Van Assche

On Thu, Jun 09, 2022 at 11:54:12AM +0200, Alexander Martinz wrote:
> This patch adds audio support for the SHIFT6mq phone.
> 
> The primary microphone and headphone jack are handled by the
> SDM845 sound card and WCD9340 codec.
> 
> The primary speaker needs to go through the TFA9890 speaker
> amplifier.
> 
> Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
> Tested-by: Dylan Van Assche <me@dylanvanassche.be>
> ---
>  .../boot/dts/qcom/sdm845-shift-axolotl.dts    | 141 ++++++++++++++++++
>  1 file changed, 141 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
> index fa72f23ef0c2..8c4967d6d0e3 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
[...]
> @@ -492,6 +494,19 @@ touchscreen@38 {
>  	};
>  };
>  
> +&i2c11 {
> +	status = "okay";
> +	clock-frequency = <400000>;
> +
> +	tfa9890_codec: tfa9890@34 {

Please use "audio-codec@" as suggested in the bindings. Also, I think a
label such as "speaker_codec: " would make it more obvious that this is
the speaker. But that's personal preference. :)

> +		compatible = "nxp,tfa9890";
> +		reg = <0x34>;
> +		vddd-supply = <&vreg_s4a_1p8>;
> +		reset-gpio = <&tlmm 7 0>;

The mainline driver does not support the reset-gpio (it resets via the
I2C registers instead). Can just drop this.

Alternatively we could document it to the DT schema and describe it here
for completeness. That way it's already there if someone ever considers
it necessary for the driver.

> +		#sound-dai-cells = <1>;

Should be <0>. You might want to check your addition with
"make dtbs_check" to make sure it matches the DT schema. :)

Also, I would recommend adding a "sound-name-prefix". The prefix is used
for the ALSA mixers which makes it more obvious that they belong to the
speaker. (See example in DT schema.)

> +	};
> +};
> +
>  &ipa {
>  	status = "okay";
>  
[...]
> @@ -756,6 +879,24 @@ &venus {
>  	firmware-name = "qcom/sdm845/axolotl/venus.mbn";
>  };
>  
> +&wcd9340 {
> +	pinctrl-0 = <&wcd_intr_default>;
> +	pinctrl-names = "default";
> +	clock-names = "extclk";
> +	clocks = <&rpmhcc RPMH_LN_BB_CLK2>;
> +	reset-gpios = <&tlmm 64 0>;

0 => GPIO_ACTIVE_HIGH

Thanks,
Stephan

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

* Re: [PATCH 2/2] arm64: dts: qcom/sdm845-shift-axolotl: Add audio support
  2022-06-09  9:54 ` [PATCH 2/2] arm64: dts: qcom/sdm845-shift-axolotl: Add audio support Alexander Martinz
  2022-06-09 12:14   ` Krzysztof Kozlowski
  2022-06-09 17:07   ` Stephan Gerhold
@ 2022-06-09 17:19   ` Luca Weiss
  2 siblings, 0 replies; 8+ messages in thread
From: Luca Weiss @ 2022-06-09 17:19 UTC (permalink / raw)
  To: ~postmarketos/upstreaming
  Cc: phone-devel, Andy Gross, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, devicetree, linux-kernel,
	Alexander Martinz, Dylan Van Assche, Alexander Martinz

Hi Alexander,

On Donnerstag, 9. Juni 2022 11:54:12 CEST Alexander Martinz wrote:
> This patch adds audio support for the SHIFT6mq phone.
> 
> The primary microphone and headphone jack are handled by the
> SDM845 sound card and WCD9340 codec.
> 
> The primary speaker needs to go through the TFA9890 speaker
> amplifier.
> 
> Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
> Tested-by: Dylan Van Assche <me@dylanvanassche.be>
> ---
>  .../boot/dts/qcom/sdm845-shift-axolotl.dts    | 141 ++++++++++++++++++
>  1 file changed, 141 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
> b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts index
> fa72f23ef0c2..8c4967d6d0e3 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
> @@ -8,6 +8,8 @@
> 
>  #include <dt-bindings/gpio/gpio.h>
>  #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
> +#include <dt-bindings/sound/qcom,q6afe.h>
> +#include <dt-bindings/sound/qcom,q6asm.h>
>  #include "sdm845.dtsi"
>  #include "pm8998.dtsi"
>  #include "pmi8998.dtsi"
> @@ -492,6 +494,19 @@ touchscreen@38 {
>  	};
>  };
> 
> +&i2c11 {
> +	status = "okay";
> +	clock-frequency = <400000>;
> +
> +	tfa9890_codec: tfa9890@34 {
> +		compatible = "nxp,tfa9890";
> +		reg = <0x34>;
> +		vddd-supply = <&vreg_s4a_1p8>;
> +		reset-gpio = <&tlmm 7 0>;
> +		#sound-dai-cells = <1>;
> +	};
> +};
> +
>  &ipa {
>  	status = "okay";
> 
> @@ -530,6 +545,27 @@ volume_down_resin: resin {
>  	};
>  };
> 
> +&q6afedai {
> +	qi2s@22 {
> +		reg = <22>;
> +		qcom,sd-lines = <0>;
> +	};
> +};

While my patch hasn't been reviewed yet, I have proposed to change the magic 
number <22> to the constant QUATERNARY_MI2S_RX here in existing dts files which 
better describes what the reg here is.

https://lore.kernel.org/linux-arm-msm/20220603094710.64591-1-luca.weiss@fairphone.com/

Maybe worth doing the same here for v2?

Regards
Luca




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

* Re: [PATCH 1/2] arch: arm64: qcom: sdm845-shift-axolotl: fix Bluetooth firmware loading
  2022-06-09 12:47 ` Dmitry Baryshkov
@ 2022-07-06 18:49   ` Caleb Connolly
  0 siblings, 0 replies; 8+ messages in thread
From: Caleb Connolly @ 2022-07-06 18:49 UTC (permalink / raw)
  To: Dmitry Baryshkov, Alexander Martinz
  Cc: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	devicetree, linux-kernel, Dylan Van Assche



On 09/06/2022 13:47, Dmitry Baryshkov wrote:
> On Thu, 9 Jun 2022 at 12:54, Alexander Martinz <amartinz@shiftphones.com> wrote:
>>
>> From: Dylan Van Assche <me@dylanvanassche.be>
>>
>> Add hsuart0 alias, firmware name and prevent garbage data on Bluetooth UART lines
>
> hsuart aliases are not standard. Please use serialN alias instead.
>
>> on the SHIFT 6mq based on the Qualcomm SDM845 chip.
>> I discovered that these were missing by comparing the DTS with similar
>> devices such as the Oneplus 6/6T and Dragonboard 845c.
>>
>> Signed-of-by: Dylan Van Assche <me@dylanvanassche.be>
>> Tested-by: Alexander Martinz <amartinz@shiftphones.com>
>> ---
>>   .../boot/dts/qcom/sdm845-shift-axolotl.dts    | 33 +++++++++++++++++++
>>   1 file changed, 33 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
>> index 103cc40816fd..fa72f23ef0c2 100644
>> --- a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
>> +++ b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
>> @@ -20,6 +20,7 @@ / {
>>
>>          aliases {
>>                  display0 = &framebuffer0;
>> +               hsuart0 = &uart6;
>>                  serial0 = &uart9;
>>          };
>>
>> @@ -529,6 +530,32 @@ volume_down_resin: resin {
>>          };
>>   };
>>
>> +/*
>> + * Prevent garbage data on bluetooth UART lines
>> + */
>> +&qup_uart6_default {
>> +        pinmux {
>> +                pins = "gpio45", "gpio46", "gpio47", "gpio48";
>> +                function = "qup6";
>> +        };
>
> This chunk should probably go into sdm845.dtsi. I'd suggest either
> adding a separate qup_uart6_4pin or just making qup_uart6_default the
> 4-pin UART.
This sounds good
>
>> +
>> +        cts {
>> +                pins = "gpio45";
>
> Then the label and 'pins' can go into the dtsi, while keeping just the
> bias and drive-strength in the platform dtsi.
>
>> +                bias-pull-down;
>> +        };
>> +
>> +        rts-tx {
>> +                pins = "gpio46", "gpio47";
>> +                drive-strength = <2>;
>> +                bias-disable;
>> +        };
>> +
>> +        rx {
>> +                pins = "gpio48";
>> +                bias-pull-up;
>> +        };
>> +};
>> +
>>   &qup_uart9_default {
>>          pinconf-rx {
>>                  pins = "gpio5";
>> @@ -667,6 +694,12 @@ &uart6 {
>>          bluetooth {
>>                  compatible = "qcom,wcn3990-bt";
>>
>> +               /*
>> +                * This path is relative to the qca/
>> +                * subdir under lib/firmware.
>> +                */
>> +               firmware-name = "axolotl/crnv21.bin";
>
> Do you know what is the difference between axolotl's bin and the regular one?
Just checked in a hex editor and there are some differences. This firmware is
signed on most devices but given the SHIFT6mq is secureboot off we could in
theory use upstream firmware here - if it works. This particular device has some
very broken wifi firmware - we have to use the firmware from the OnePlus 6 to
get wifi to work at all...
>
>> +
>>                  vddio-supply = <&vreg_s4a_1p8>;
>>                  vddxo-supply = <&vreg_l7a_1p8>;
>>                  vddrf-supply = <&vreg_l17a_1p3>;
>
> --
> With best wishes
> Dmitry

--
Kind Regards,
Caleb


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

end of thread, other threads:[~2022-07-06 18:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09  9:54 [PATCH 1/2] arch: arm64: qcom: sdm845-shift-axolotl: fix Bluetooth firmware loading Alexander Martinz
2022-06-09  9:54 ` [PATCH 2/2] arm64: dts: qcom/sdm845-shift-axolotl: Add audio support Alexander Martinz
2022-06-09 12:14   ` Krzysztof Kozlowski
2022-06-09 17:07   ` Stephan Gerhold
2022-06-09 17:19   ` Luca Weiss
2022-06-09 12:11 ` [PATCH 1/2] arch: arm64: qcom: sdm845-shift-axolotl: fix Bluetooth firmware loading Krzysztof Kozlowski
2022-06-09 12:47 ` Dmitry Baryshkov
2022-07-06 18:49   ` Caleb Connolly

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.