Skip to contentSkip to conversation

Some devicetree cleanup for MSM8974 Sony Xperia Z2 Tablet

PATCH Applied Luca Weiss 4 participants 12 messages Mar 5, 2024 – Mar 19, 2024

Subsystems (3)
lore
Share & tools
lore

Luca Weiss

author
#0 lore raw

cover Some devicetree cleanup for MSM8974 Sony Xperia Z2 Tablet

The sony-castor dts has been around for a while, clean up some things to prepare for further changes including the introduction of the shinano-based Sony Xperia Z3.

---
Luca Weiss (5):
ARM: dts: qcom: msm8974pro-castor: Clean up formatting
ARM: dts: qcom: msm8974pro-castor: Add mmc aliases
ARM: dts: qcom: msm8974pro-castor: Remove camera button definitions
ARM: dts: qcom: msm8974pro-castor: Add debounce-interval for keys
ARM: dts: qcom: msm8974pro-castor: Rename wifi node name

 .../qcom-msm8974pro-sony-xperia-shinano-castor.dts | 83 +++++++++-------------
 1 file changed, 32 insertions(+), 51 deletions(-)

---
base-commit: 2e397253aae928c6d318beb18c05bc2236f69a8a
change-id: 20240305-castor-changes-bc6785ba8458

Best regards,

Signature · 1 line
Luca Weiss <[email protected]>
author
#1 lore raw

PATCH 1/5 ARM: dts: qcom: msm8974pro-castor: Clean up formatting

Clean up some easy things do prepare the dts for further changes.

* Move pinctrl-names below pinctrl-*
* Move status as last property
* Remove default linux,input-type value

---
 .../qcom-msm8974pro-sony-xperia-shinano-castor.dts | 65 +++++++++-------------
 1 file changed, 27 insertions(+), 38 deletions(-)
arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts +27 -38
index ee94741a26ed..2db2ddf00580 100644
@@ -23,34 +23,30 @@ chosen {
 	gpio-keys {
 		compatible = "gpio-keys";
 
-		pinctrl-names = "default";
 		pinctrl-0 = <&gpio_keys_pin_a>;
+		pinctrl-names = "default";
 
 		key-volume-down {
 			label = "volume_down";
 			gpios = <&pm8941_gpios 2 GPIO_ACTIVE_LOW>;
-			linux,input-type = <1>;
 			linux,code = <KEY_VOLUMEDOWN>;
 		};
 
 		key-camera-snapshot {
 			label = "camera_snapshot";
 			gpios = <&pm8941_gpios 3 GPIO_ACTIVE_LOW>;
-			linux,input-type = <1>;
 			linux,code = <KEY_CAMERA>;
 		};
 
 		key-camera-focus {
 			label = "camera_focus";
 			gpios = <&pm8941_gpios 4 GPIO_ACTIVE_LOW>;
-			linux,input-type = <1>;
 			linux,code = <KEY_CAMERA_FOCUS>;
 		};
 
 		key-volume-up {
 			label = "volume_up";
 			gpios = <&pm8941_gpios 5 GPIO_ACTIVE_LOW>;
-			linux,input-type = <1>;
 			linux,code = <KEY_VOLUMEUP>;
 		};
 	};
@@ -67,8 +63,8 @@ vreg_bl_vddio: lcd-backlight-vddio {
 		vin-supply = <&pm8941_s3>;
 		startup-delay-us = <70000>;
 
-		pinctrl-names = "default";
 		pinctrl-0 = <&lcd_backlight_en_pin_a>;
+		pinctrl-names = "default";
 	};
 
 	vreg_vsp: lcd-dcdc-regulator {
@@ -80,8 +76,8 @@ vreg_vsp: lcd-dcdc-regulator {
 		gpio = <&pm8941_gpios 20 GPIO_ACTIVE_HIGH>;
 		enable-active-high;
 
-		pinctrl-names = "default";
 		pinctrl-0 = <&lcd_dcdc_en_pin_a>;
+		pinctrl-names = "default";
 	};
 
 	vreg_boost: vreg-boost {
@@ -121,8 +117,8 @@ vreg_wlan: wlan-regulator {
 		gpio = <&pm8941_gpios 18 GPIO_ACTIVE_HIGH>;
 		enable-active-high;
 
-		pinctrl-names = "default";
 		pinctrl-0 = <&wlan_regulator_pin>;
+		pinctrl-names = "default";
 	};
 };
 
@@ -131,9 +127,10 @@ &blsp1_uart2 {
 };
 
 &blsp2_i2c2 {
-	status = "okay";
 	clock-frequency = <355000>;
 
+	status = "okay";
+
 	synaptics@2c {
 		compatible = "syna,rmi4-i2c";
 		reg = <0x2c>;
@@ -147,8 +144,8 @@ synaptics@2c {
 		vdd-supply = <&pm8941_l22>;
 		vio-supply = <&pm8941_lvs3>;
 
-		pinctrl-names = "default";
 		pinctrl-0 = <&ts_int_pin>;
+		pinctrl-names = "default";
 
 		syna,startup-delay-ms = <100>;
 
@@ -166,9 +163,10 @@ rmi4-f11@11 {
 };
 
 &blsp2_i2c5 {
-	status = "okay";
 	clock-frequency = <355000>;
 
+	status = "okay";
+
 	lp8566_wled: backlight@2c {
 		compatible = "ti,lp8556";
 		reg = <0x2c>;
@@ -232,8 +230,8 @@ bluetooth {
 		compatible = "brcm,bcm43438-bt";
 		max-speed = <3000000>;
 
-		pinctrl-names = "default";
 		pinctrl-0 = <&bt_host_wake_pin>, <&bt_dev_wake_pin>, <&bt_reg_on_pin>;
+		pinctrl-names = "default";
 
 		host-wakeup-gpios = <&tlmm 95 GPIO_ACTIVE_HIGH>;
 		device-wakeup-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
@@ -242,17 +240,16 @@ bluetooth {
 };
 
 &pm8941_coincell {
-	status = "okay";
-
 	qcom,rset-ohms = <2100>;
 	qcom,vset-millivolts = <3000>;
+
+	status = "okay";
 };
 
 &pm8941_gpios {
 	gpio_keys_pin_a: gpio-keys-active-state {
 		pins = "gpio2", "gpio5";
 		function = "normal";
-
 		bias-pull-up;
 		power-source = <PM8941_GPIO_S3>;
 	};
@@ -260,7 +257,6 @@ gpio_keys_pin_a: gpio-keys-active-state {
 	bt_reg_on_pin: bt-reg-on-state {
 		pins = "gpio16";
 		function = "normal";
-
 		output-low;
 		power-source = <PM8941_GPIO_S3>;
 	};
@@ -268,7 +264,6 @@ bt_reg_on_pin: bt-reg-on-state {
 	wlan_sleep_clk_pin: wl-sleep-clk-state {
 		pins = "gpio17";
 		function = "func2";
-
 		output-high;
 		power-source = <PM8941_GPIO_S3>;
 	};
@@ -276,7 +271,6 @@ wlan_sleep_clk_pin: wl-sleep-clk-state {
 	wlan_regulator_pin: wl-reg-active-state {
 		pins = "gpio18";
 		function = "normal";
-
 		bias-disable;
 		power-source = <PM8941_GPIO_S3>;
 	};
@@ -284,20 +278,18 @@ wlan_regulator_pin: wl-reg-active-state {
 	lcd_dcdc_en_pin_a: lcd-dcdc-en-active-state {
 		pins = "gpio20";
 		function = "normal";
-
 		bias-disable;
 		power-source = <PM8941_GPIO_S3>;
 		input-disable;
 		output-low;
 	};
-
 };
 
 &pm8941_lpg {
-	status = "okay";
-
 	qcom,power-source = <1>;
 
+	status = "okay";
+
 	multi-led {
 		color = <LED_COLOR_ID_RGB>;
 		function = LED_FUNCTION_STATUS;
@@ -530,41 +522,38 @@ pm8941_l24: l24 {
 };
 
 &sdhc_1 {
-	status = "okay";
-
 	vmmc-supply = <&pm8941_l20>;
 	vqmmc-supply = <&pm8941_s3>;
 
-	pinctrl-names = "default", "sleep";
 	pinctrl-0 = <&sdc1_on>;
 	pinctrl-1 = <&sdc1_off>;
+	pinctrl-names = "default", "sleep";
+
+	status = "okay";
 };
 
 &sdhc_2 {
-	status = "okay";
-
 	vmmc-supply = <&pm8941_l21>;
 	vqmmc-supply = <&pm8941_l13>;
 
 	cd-gpios = <&tlmm 62 GPIO_ACTIVE_LOW>;
 
-	pinctrl-names = "default", "sleep";
 	pinctrl-0 = <&sdc2_on>;
 	pinctrl-1 = <&sdc2_off>;
+	pinctrl-names = "default", "sleep";
+
+	status = "okay";
 };
 
 &sdhc_3 {
-	status = "okay";
-
 	max-frequency = <100000000>;
 	vmmc-supply = <&vreg_wlan>;
 	non-removable;
 
-	pinctrl-names = "default";
 	pinctrl-0 = <&sdc3_on>;
+	pinctrl-names = "default";
 
-	#address-cells = <1>;
-	#size-cells = <0>;
+	status = "okay";
 
 	bcrmf@1 {
 		compatible = "brcm,bcm4339-fmac", "brcm,bcm4329-fmac";
@@ -572,8 +561,8 @@ bcrmf@1 {
 
 		brcm,drive-strength = <10>;
 
-		pinctrl-names = "default";
 		pinctrl-0 = <&wlan_sleep_clk_pin>;
+		pinctrl-names = "default";
 	};
 };
 
@@ -682,8 +671,6 @@ bt_dev_wake_pin: bt-dev-wake-state {
 };
 
 &usb {
-	status = "okay";
-
 	phys = <&usb_hs1_phy>;
 	phy-select = <&tcsr 0xb000 0>;
 	extcon = <&smbb>, <&usb_id>;
@@ -692,14 +679,16 @@ &usb {
 	hnp-disable;
 	srp-disable;
 	adp-disable;
+
+	status = "okay";
 };
 
 &usb_hs1_phy {
-	status = "okay";
-
 	v1p8-supply = <&pm8941_l6>;
 	v3p3-supply = <&pm8941_l24>;
 
 	extcon = <&smbb>;
 	qcom,init-seq = /bits/ 8 <0x1 0x64>;
+
+	status = "okay";
 };
Signature · 1 line
2.44.0
Reviewed-by on v1 1/5
#2 lore raw

Re: [PATCH 1/5] ARM: dts: qcom: msm8974pro-castor: Clean up formatting

Quoted 8 lines · Luca Weiss

Clean up some easy things do prepare the dts for further changes.

* Move pinctrl-names below pinctrl-*
* Move status as last property
* Remove default linux,input-type value

---

Konrad

author
#3 lore raw

PATCH 2/5 ARM: dts: qcom: msm8974pro-castor: Add mmc aliases

In reply to Luca Weiss

Add the mmc0 & mmc1 aliases to make sure internal storage always becomes /dev/mmcblk0 and SD card becomes /dev/mmcblk1

---
 arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts +2 -0
index 2db2ddf00580..da554f72528a 100644
@@ -12,6 +12,8 @@ / {
 	chassis-type = "tablet";
 
 	aliases {
+		mmc0 = &sdhc_1;
+		mmc1 = &sdhc_2;
 		serial0 = &blsp1_uart2;
 		serial1 = &blsp2_uart1;
 	};
Signature · 1 line
2.44.0
Reviewed-by on v1 2/5
#4 lore raw

Re: [PATCH 2/5] ARM: dts: qcom: msm8974pro-castor: Add mmc aliases

Quoted 8 lines · Luca Weiss

Add the mmc0 & mmc1 aliases to make sure internal storage always becomes /dev/mmcblk0 and SD card becomes /dev/mmcblk1

---
 arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts | 2 ++
 1 file changed, 2 insertions(+)
Signature · 2 lines
With best wishes
Dmitry
author
#5 lore raw

PATCH 3/5 ARM: dts: qcom: msm8974pro-castor: Remove camera button definitions

In reply to Luca Weiss

From what I can tell, the camera buttons are not part of Z2 Tablet hardware even though other devices based on 'shinano' do have them.

Fixes ab80661883de ("ARM: dts: qcom: msm8974: Add Sony Xperia Z2 Tablet")
---
 .../dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts  | 12 ------------
 1 file changed, 12 deletions(-)
arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts +0 -12
index da554f72528a..97b55bda9189 100644
@@ -34,18 +34,6 @@ key-volume-down {
 			linux,code = <KEY_VOLUMEDOWN>;
 		};
 
-		key-camera-snapshot {
-			label = "camera_snapshot";
-			gpios = <&pm8941_gpios 3 GPIO_ACTIVE_LOW>;
-			linux,code = <KEY_CAMERA>;
-		};
-
-		key-camera-focus {
-			label = "camera_focus";
-			gpios = <&pm8941_gpios 4 GPIO_ACTIVE_LOW>;
-			linux,code = <KEY_CAMERA_FOCUS>;
-		};
-
 		key-volume-up {
 			label = "volume_up";
 			gpios = <&pm8941_gpios 5 GPIO_ACTIVE_LOW>;
Signature · 1 line
2.44.0
Reviewed-by on v1 3/5
#6 lore raw

Re: [PATCH 3/5] ARM: dts: qcom: msm8974pro-castor: Remove camera button definitions

Quoted 6 lines · Luca Weiss

From what I can tell, the camera buttons are not part of Z2 Tablet
hardware even though other devices based on 'shinano' do have them.

Fixes ab80661883de ("ARM: dts: qcom: msm8974: Add Sony Xperia Z2 Tablet")

---

https://3dmodels.org/360-view/?id=82800

Doesn't look like!

Konrad

author
#7 lore raw

PATCH 4/5 ARM: dts: qcom: msm8974pro-castor: Add debounce-interval for keys

In reply to Luca Weiss

Set the debounce-interval for the GPIO keys.

---
 arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts +2 -0
index 97b55bda9189..c9f74bf2f8bd 100644
@@ -32,12 +32,14 @@ key-volume-down {
 			label = "volume_down";
 			gpios = <&pm8941_gpios 2 GPIO_ACTIVE_LOW>;
 			linux,code = <KEY_VOLUMEDOWN>;
+			debounce-interval = <15>;
 		};
 
 		key-volume-up {
 			label = "volume_up";
 			gpios = <&pm8941_gpios 5 GPIO_ACTIVE_LOW>;
 			linux,code = <KEY_VOLUMEUP>;
+			debounce-interval = <15>;
 		};
 	};
 
Signature · 1 line
2.44.0
Reviewed-by on v1 4/5
#8 lore raw

Re: [PATCH 4/5] ARM: dts: qcom: msm8974pro-castor: Add debounce-interval for keys

Quoted 7 lines · Luca Weiss

Set the debounce-interval for the GPIO keys.

---
 arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts | 2 ++
 1 file changed, 2 insertions(+)
Signature · 2 lines
With best wishes
Dmitry
author
#9 lore raw

PATCH 5/5 ARM: dts: qcom: msm8974pro-castor: Rename wifi node name

In reply to Luca Weiss

Give the wifi node a generic node name 'wifi'.

---
 arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts +1 -1
index c9f74bf2f8bd..20f98a9e49ea 100644
@@ -547,7 +547,7 @@ &sdhc_3 {
 
 	status = "okay";
 
-	bcrmf@1 {
+	wifi@1 {
 		compatible = "brcm,bcm4339-fmac", "brcm,bcm4329-fmac";
 		reg = <1>;
 
Signature · 1 line
2.44.0
Reviewed-by on v1 5/5
#10 lore raw

Re: [PATCH 5/5] ARM: dts: qcom: msm8974pro-castor: Rename wifi node name

Quoted 7 lines · Luca Weiss

Give the wifi node a generic node name 'wifi'.

---
 arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 2 lines
With best wishes
Dmitry
maintainer Applied
#11 lore raw
In reply to Luca Weiss
Quoted 5 lines · Luca Weiss

The sony-castor dts has been around for a while, clean up some things to prepare for further changes including the introduction of the shinano-based Sony Xperia Z3.

Applied, thanks!

[1/5] ARM: dts: qcom: msm8974pro-castor: Clean up formatting

      commit: c0b9c616e881a1ea6b158dcad73e2198c483a56a
[2/5] ARM: dts: qcom: msm8974pro-castor: Add mmc aliases
      commit: 0268bfec8ae06bc1091c2b9058287391872f8853
[3/5] ARM: dts: qcom: msm8974pro-castor: Remove camera button definitions
      commit: 26b950f2af40bd6cc36c3ac8ee6643ff3e905753
[4/5] ARM: dts: qcom: msm8974pro-castor: Add debounce-interval for keys
      commit: ead56f2e68b874c3549a67c6ae0c6186f780bf2f
[5/5] ARM: dts: qcom: msm8974pro-castor: Rename wifi node name
      commit: b756001175b1145a4855c8cfa77ceec78350c36a

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>