diff mbox series

[v8,4/4] arm64: dts: qcom: sc8280xp-x13s: Add bluetooth

Message ID 20230326233812.28058-5-steev@kali.org (mailing list archive)
State Accepted
Headers show
Series Add WCN6855 Bluetooth support | expand

Commit Message

Steev Klimaszewski March 26, 2023, 11:38 p.m. UTC
The Lenovo Thinkpad X13s has a WCN6855 Bluetooth controller on uart2,
add this.

Signed-off-by: Steev Klimaszewski <steev@kali.org>
---
Changes since v7:
 * Drop regulator now in a different patchset from Johan
 * Fix alphabetization

Changes since v6:
 * Remove allowed-modes as they aren't needed
 * Remove regulator-allow-set-load
 * Set regulator-always-on because the wifi chip also uses the regulator
 * cts pin uses bias-bus-hold
 * Alphabetize uart2 pins

Changes since v5:
 * Update patch subject
 * Specify initial mode (via guess) for vreg_s1c
 * Drop uart17 definition
 * Rename bt_en to bt_default because configuring more than one pin
 * Correct (maybe) bias configurations
 * Correct cts gpio
 * Split rts-tx into two nodes
 * Drop incorrect link in the commit message

Changes since v4:
 * Address Konrad's review comments.

Changes since v3:
 * Add vreg_s1c
 * Add regulators and not dead code
 * Fix commit message changelog

Changes since v2:
 * Remove dead code and add TODO comment
 * Make dtbs_check happy with the pin definitions

 .../qcom/sc8280xp-lenovo-thinkpad-x13s.dts    | 70 +++++++++++++++++++
 1 file changed, 70 insertions(+)

Comments

Luiz Augusto von Dentz March 28, 2023, 10:24 p.m. UTC | #1
Hi Steev,

On Sun, Mar 26, 2023 at 4:38 PM Steev Klimaszewski <steev@kali.org> wrote:
>
> The Lenovo Thinkpad X13s has a WCN6855 Bluetooth controller on uart2,
> add this.
>
> Signed-off-by: Steev Klimaszewski <steev@kali.org>

I would like to merge this set but this one still doesn't have any
Signed-off-by other than yours.

> ---
> Changes since v7:
>  * Drop regulator now in a different patchset from Johan
>  * Fix alphabetization
>
> Changes since v6:
>  * Remove allowed-modes as they aren't needed
>  * Remove regulator-allow-set-load
>  * Set regulator-always-on because the wifi chip also uses the regulator
>  * cts pin uses bias-bus-hold
>  * Alphabetize uart2 pins
>
> Changes since v5:
>  * Update patch subject
>  * Specify initial mode (via guess) for vreg_s1c
>  * Drop uart17 definition
>  * Rename bt_en to bt_default because configuring more than one pin
>  * Correct (maybe) bias configurations
>  * Correct cts gpio
>  * Split rts-tx into two nodes
>  * Drop incorrect link in the commit message
>
> Changes since v4:
>  * Address Konrad's review comments.
>
> Changes since v3:
>  * Add vreg_s1c
>  * Add regulators and not dead code
>  * Fix commit message changelog
>
> Changes since v2:
>  * Remove dead code and add TODO comment
>  * Make dtbs_check happy with the pin definitions
>
>  .../qcom/sc8280xp-lenovo-thinkpad-x13s.dts    | 70 +++++++++++++++++++
>  1 file changed, 70 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
> index da79b5465a1b..129c5f9a2a61 100644
> --- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
> +++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
> @@ -24,6 +24,7 @@ / {
>         aliases {
>                 i2c4 = &i2c4;
>                 i2c21 = &i2c21;
> +               serial1 = &uart2;
>         };
>
>         wcd938x: audio-codec {
> @@ -1102,6 +1103,32 @@ &txmacro {
>         status = "okay";
>  };
>
> +&uart2 {
> +       pinctrl-0 = <&uart2_default>;
> +       pinctrl-names = "default";
> +
> +       status = "okay";
> +
> +       bluetooth {
> +               compatible = "qcom,wcn6855-bt";
> +
> +               vddio-supply = <&vreg_s10b>;
> +               vddbtcxmx-supply = <&vreg_s12b>;
> +               vddrfacmn-supply = <&vreg_s12b>;
> +               vddrfa0p8-supply = <&vreg_s12b>;
> +               vddrfa1p2-supply = <&vreg_s11b>;
> +               vddrfa1p7-supply = <&vreg_s1c>;
> +
> +               max-speed = <3200000>;
> +
> +               enable-gpios = <&tlmm 133 GPIO_ACTIVE_HIGH>;
> +               swctrl-gpios = <&tlmm 132 GPIO_ACTIVE_HIGH>;
> +
> +               pinctrl-0 = <&bt_default>;
> +               pinctrl-names = "default";
> +       };
> +};
> +
>  &usb_0 {
>         status = "okay";
>  };
> @@ -1222,6 +1249,21 @@ hastings_reg_en: hastings-reg-en-state {
>  &tlmm {
>         gpio-reserved-ranges = <70 2>, <74 6>, <83 4>, <125 2>, <128 2>, <154 7>;
>
> +       bt_default: bt-default-state {
> +               hstp-bt-en-pins {
> +                       pins = "gpio133";
> +                       function = "gpio";
> +                       drive-strength = <16>;
> +                       bias-disable;
> +               };
> +
> +               hstp-sw-ctrl-pins {
> +                       pins = "gpio132";
> +                       function = "gpio";
> +                       bias-pull-down;
> +               };
> +       };
> +
>         edp_reg_en: edp-reg-en-state {
>                 pins = "gpio25";
>                 function = "gpio";
> @@ -1389,6 +1431,34 @@ reset-n-pins {
>                 };
>         };
>
> +       uart2_default: uart2-default-state {
> +               cts-pins {
> +                       pins = "gpio121";
> +                       function = "qup2";
> +                       bias-bus-hold;
> +               };
> +
> +               rts-pins {
> +                       pins = "gpio122";
> +                       function = "qup2";
> +                       drive-strength = <2>;
> +                       bias-disable;
> +               };
> +
> +               rx-pins {
> +                       pins = "gpio124";
> +                       function = "qup2";
> +                       bias-pull-up;
> +               };
> +
> +               tx-pins {
> +                       pins = "gpio123";
> +                       function = "qup2";
> +                       drive-strength = <2>;
> +                       bias-disable;
> +               };
> +       };
> +
>         usb0_sbu_default: usb0-sbu-state {
>                 oe-n-pins {
>                         pins = "gpio101";
> --
> 2.39.2
>
Steev Klimaszewski March 29, 2023, 12:26 a.m. UTC | #2
Hi Luiz,

On Tue, Mar 28, 2023 at 5:24 PM Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> Hi Steev,
>
> On Sun, Mar 26, 2023 at 4:38 PM Steev Klimaszewski <steev@kali.org> wrote:
> >
> > The Lenovo Thinkpad X13s has a WCN6855 Bluetooth controller on uart2,
> > add this.
> >
> > Signed-off-by: Steev Klimaszewski <steev@kali.org>
>
> I would like to merge this set but this one still doesn't have any
> Signed-off-by other than yours.
>
> --
> Luiz Augusto von Dentz
I don't quite follow - should I be adding others S-o-b?  I know that
Bjorn had previously sent an R-b, and Johan as well, but since the
code changed, I didn't bring them forward.  If I'm doing something
wrong, please let me know!
--steev
Konrad Dybcio March 29, 2023, 12:38 a.m. UTC | #3
On 29.03.2023 00:24, Luiz Augusto von Dentz wrote:
> Hi Steev,
> 
> On Sun, Mar 26, 2023 at 4:38 PM Steev Klimaszewski <steev@kali.org> wrote:
>>
>> The Lenovo Thinkpad X13s has a WCN6855 Bluetooth controller on uart2,
>> add this.
>>
>> Signed-off-by: Steev Klimaszewski <steev@kali.org>
> 
> I would like to merge this set but this one still doesn't have any
> Signed-off-by other than yours.
> 
>> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>> Changes since v7:
>>  * Drop regulator now in a different patchset from Johan
>>  * Fix alphabetization
>>
>> Changes since v6:
>>  * Remove allowed-modes as they aren't needed
>>  * Remove regulator-allow-set-load
>>  * Set regulator-always-on because the wifi chip also uses the regulator
>>  * cts pin uses bias-bus-hold
>>  * Alphabetize uart2 pins
>>
>> Changes since v5:
>>  * Update patch subject
>>  * Specify initial mode (via guess) for vreg_s1c
>>  * Drop uart17 definition
>>  * Rename bt_en to bt_default because configuring more than one pin
>>  * Correct (maybe) bias configurations
>>  * Correct cts gpio
>>  * Split rts-tx into two nodes
>>  * Drop incorrect link in the commit message
>>
>> Changes since v4:
>>  * Address Konrad's review comments.
>>
>> Changes since v3:
>>  * Add vreg_s1c
>>  * Add regulators and not dead code
>>  * Fix commit message changelog
>>
>> Changes since v2:
>>  * Remove dead code and add TODO comment
>>  * Make dtbs_check happy with the pin definitions
>>
>>  .../qcom/sc8280xp-lenovo-thinkpad-x13s.dts    | 70 +++++++++++++++++++
>>  1 file changed, 70 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
>> index da79b5465a1b..129c5f9a2a61 100644
>> --- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
>> +++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
>> @@ -24,6 +24,7 @@ / {
>>         aliases {
>>                 i2c4 = &i2c4;
>>                 i2c21 = &i2c21;
>> +               serial1 = &uart2;
>>         };
>>
>>         wcd938x: audio-codec {
>> @@ -1102,6 +1103,32 @@ &txmacro {
>>         status = "okay";
>>  };
>>
>> +&uart2 {
>> +       pinctrl-0 = <&uart2_default>;
>> +       pinctrl-names = "default";
>> +
>> +       status = "okay";
>> +
>> +       bluetooth {
>> +               compatible = "qcom,wcn6855-bt";
>> +
>> +               vddio-supply = <&vreg_s10b>;
>> +               vddbtcxmx-supply = <&vreg_s12b>;
>> +               vddrfacmn-supply = <&vreg_s12b>;
>> +               vddrfa0p8-supply = <&vreg_s12b>;
>> +               vddrfa1p2-supply = <&vreg_s11b>;
>> +               vddrfa1p7-supply = <&vreg_s1c>;
>> +
>> +               max-speed = <3200000>;
>> +
>> +               enable-gpios = <&tlmm 133 GPIO_ACTIVE_HIGH>;
>> +               swctrl-gpios = <&tlmm 132 GPIO_ACTIVE_HIGH>;
>> +
>> +               pinctrl-0 = <&bt_default>;
>> +               pinctrl-names = "default";
>> +       };
>> +};
>> +
>>  &usb_0 {
>>         status = "okay";
>>  };
>> @@ -1222,6 +1249,21 @@ hastings_reg_en: hastings-reg-en-state {
>>  &tlmm {
>>         gpio-reserved-ranges = <70 2>, <74 6>, <83 4>, <125 2>, <128 2>, <154 7>;
>>
>> +       bt_default: bt-default-state {
>> +               hstp-bt-en-pins {
>> +                       pins = "gpio133";
>> +                       function = "gpio";
>> +                       drive-strength = <16>;
>> +                       bias-disable;
>> +               };
>> +
>> +               hstp-sw-ctrl-pins {
>> +                       pins = "gpio132";
>> +                       function = "gpio";
>> +                       bias-pull-down;
>> +               };
>> +       };
>> +
>>         edp_reg_en: edp-reg-en-state {
>>                 pins = "gpio25";
>>                 function = "gpio";
>> @@ -1389,6 +1431,34 @@ reset-n-pins {
>>                 };
>>         };
>>
>> +       uart2_default: uart2-default-state {
>> +               cts-pins {
>> +                       pins = "gpio121";
>> +                       function = "qup2";
>> +                       bias-bus-hold;
>> +               };
>> +
>> +               rts-pins {
>> +                       pins = "gpio122";
>> +                       function = "qup2";
>> +                       drive-strength = <2>;
>> +                       bias-disable;
>> +               };
>> +
>> +               rx-pins {
>> +                       pins = "gpio124";
>> +                       function = "qup2";
>> +                       bias-pull-up;
>> +               };
>> +
>> +               tx-pins {
>> +                       pins = "gpio123";
>> +                       function = "qup2";
>> +                       drive-strength = <2>;
>> +                       bias-disable;
>> +               };
>> +       };
>> +
>>         usb0_sbu_default: usb0-sbu-state {
>>                 oe-n-pins {
>>                         pins = "gpio101";
>> --
>> 2.39.2
>>
> 
>
Johan Hovold March 29, 2023, 6:40 a.m. UTC | #4
On Tue, Mar 28, 2023 at 03:24:02PM -0700, Luiz Augusto von Dentz wrote:
> On Sun, Mar 26, 2023 at 4:38 PM Steev Klimaszewski <steev@kali.org> wrote:
> >
> > The Lenovo Thinkpad X13s has a WCN6855 Bluetooth controller on uart2,
> > add this.
> >
> > Signed-off-by: Steev Klimaszewski <steev@kali.org>
> 
> I would like to merge this set but this one still doesn't have any
> Signed-off-by other than yours.

While unfortunately not mentioned in the cover letter, this one should
go through the qcom tree once the binding and driver patches have been
merged (i.e. Bjorn will pick it up).

Johan
Johan Hovold March 29, 2023, 6:44 a.m. UTC | #5
On Sun, Mar 26, 2023 at 06:38:12PM -0500, Steev Klimaszewski wrote:
> The Lenovo Thinkpad X13s has a WCN6855 Bluetooth controller on uart2,
> add this.
> 
> Signed-off-by: Steev Klimaszewski <steev@kali.org>
> ---
> Changes since v7:
>  * Drop regulator now in a different patchset from Johan
>  * Fix alphabetization
> 
> Changes since v6:
>  * Remove allowed-modes as they aren't needed
>  * Remove regulator-allow-set-load
>  * Set regulator-always-on because the wifi chip also uses the regulator
>  * cts pin uses bias-bus-hold
>  * Alphabetize uart2 pins
> 
> Changes since v5:
>  * Update patch subject
>  * Specify initial mode (via guess) for vreg_s1c
>  * Drop uart17 definition
>  * Rename bt_en to bt_default because configuring more than one pin
>  * Correct (maybe) bias configurations
>  * Correct cts gpio
>  * Split rts-tx into two nodes
>  * Drop incorrect link in the commit message
> 
> Changes since v4:
>  * Address Konrad's review comments.
> 
> Changes since v3:
>  * Add vreg_s1c
>  * Add regulators and not dead code
>  * Fix commit message changelog
> 
> Changes since v2:
>  * Remove dead code and add TODO comment
>  * Make dtbs_check happy with the pin definitions

Looks like we're good to go now. Thanks for sticking with it.

Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
Tested-by: Johan Hovold <johan+linaro@kernel.org>

Johan
Krzysztof Kozlowski March 29, 2023, 7:26 a.m. UTC | #6
On 29/03/2023 00:24, Luiz Augusto von Dentz wrote:
> Hi Steev,
> 
> On Sun, Mar 26, 2023 at 4:38 PM Steev Klimaszewski <steev@kali.org> wrote:
>>
>> The Lenovo Thinkpad X13s has a WCN6855 Bluetooth controller on uart2,
>> add this.
>>
>> Signed-off-by: Steev Klimaszewski <steev@kali.org>
> 
> I would like to merge this set but this one still doesn't have any
> Signed-off-by other than yours.

Please take only driver and bindings. The DTS should always go via
Qualcomm SoC tree (as we want to be sure 100% that it is independent of
driver).

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
index da79b5465a1b..129c5f9a2a61 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
+++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
@@ -24,6 +24,7 @@  / {
 	aliases {
 		i2c4 = &i2c4;
 		i2c21 = &i2c21;
+		serial1 = &uart2;
 	};
 
 	wcd938x: audio-codec {
@@ -1102,6 +1103,32 @@  &txmacro {
 	status = "okay";
 };
 
+&uart2 {
+	pinctrl-0 = <&uart2_default>;
+	pinctrl-names = "default";
+
+	status = "okay";
+
+	bluetooth {
+		compatible = "qcom,wcn6855-bt";
+
+		vddio-supply = <&vreg_s10b>;
+		vddbtcxmx-supply = <&vreg_s12b>;
+		vddrfacmn-supply = <&vreg_s12b>;
+		vddrfa0p8-supply = <&vreg_s12b>;
+		vddrfa1p2-supply = <&vreg_s11b>;
+		vddrfa1p7-supply = <&vreg_s1c>;
+
+		max-speed = <3200000>;
+
+		enable-gpios = <&tlmm 133 GPIO_ACTIVE_HIGH>;
+		swctrl-gpios = <&tlmm 132 GPIO_ACTIVE_HIGH>;
+
+		pinctrl-0 = <&bt_default>;
+		pinctrl-names = "default";
+	};
+};
+
 &usb_0 {
 	status = "okay";
 };
@@ -1222,6 +1249,21 @@  hastings_reg_en: hastings-reg-en-state {
 &tlmm {
 	gpio-reserved-ranges = <70 2>, <74 6>, <83 4>, <125 2>, <128 2>, <154 7>;
 
+	bt_default: bt-default-state {
+		hstp-bt-en-pins {
+			pins = "gpio133";
+			function = "gpio";
+			drive-strength = <16>;
+			bias-disable;
+		};
+
+		hstp-sw-ctrl-pins {
+			pins = "gpio132";
+			function = "gpio";
+			bias-pull-down;
+		};
+	};
+
 	edp_reg_en: edp-reg-en-state {
 		pins = "gpio25";
 		function = "gpio";
@@ -1389,6 +1431,34 @@  reset-n-pins {
 		};
 	};
 
+	uart2_default: uart2-default-state {
+		cts-pins {
+			pins = "gpio121";
+			function = "qup2";
+			bias-bus-hold;
+		};
+
+		rts-pins {
+			pins = "gpio122";
+			function = "qup2";
+			drive-strength = <2>;
+			bias-disable;
+		};
+
+		rx-pins {
+			pins = "gpio124";
+			function = "qup2";
+			bias-pull-up;
+		};
+
+		tx-pins {
+			pins = "gpio123";
+			function = "qup2";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
 	usb0_sbu_default: usb0-sbu-state {
 		oe-n-pins {
 			pins = "gpio101";