Skip to contentSkip to conversation

Add support for Xiaomi Poco F1 EBBG variant

PATCH Superseded Joel Selvaraj 2 participants 10 messages Aug 28, 2022 – Sep 5, 2022

Subsystems (3)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v4 cover Add support for Xiaomi Poco F1 EBBG variant

Changes in v4:
--------------
- Update board's compatible and model property to distinguish between the two variants. (Suggested by Krzysztof Kozlowski and Marijn Suijten)
- Update the dt-bindings as per the new compatible values. (Fix checkpatch.pl script warnings)

Changes in v3:
--------------
- Approach suggested by Marijn Suijten and Krzysztof Kozlowski to make git handle renames more appropriately and to avoid moving large chunks of code. Helps with reviewing the patch.

Changes in v2:
--------------
- Fix issue with builds breaking across multiple commits making git bisect harder to find where the rename has happened.

There are two variants of Xiaomi Poco F1.
- Tianma variant with NOVATEK NT36672A panel + touchscreen manufactured by Tianma
- EBBG variant with Focaltech FT8719 panel + touchscreen manufactured by EBBG

The current sdm845-xiaomi-beryllium.dts represents Tianma panel variant.

To add support for the EBBG variant:
------------------------------------
- Rename sdm845-xiaomi-beryllium.dts to sdm845-xiaomi-beryllium-common.dtsi
- Generalize the display panel node by assigning label, removing compatible property and renaming the panel endpoints to be generic.
- Create a dts for the Tianma variant called sdm845-xiaomi-beryllium-tianma.dts which will inherit the common dtsi and set the compatible property for the respective display panel.
- Adjust the Makefile since the sdm845-xiaomi-beryllium.dts is now called sdm845-xiaomi-beryllium-tianma.dts for the tianma variant.
- Create sdm845-xiaomi-beryllium-ebbg.dts for the EBBG variant which will inherit the common dtsi and set the compatible property for the respective display panel.

Note:
-----
Both the panels are already upstreamed and the split is based on them. There were patches earlier for both the touchscreens, but they are not accepted in upstream yet. Once they are accepted, we will add them to respective variants.

Joel Selvaraj (4):
dt-bindings: arm: qcom: update beryllium compatible property
arm64: dts: qcom: split beryllium dts into common dtsi and tianma dts
dt-bindings: arm: qcom: Add Xiaomi Poco F1 EBBG variant bindings
arm64: dts: qcom: sdm845-xiaomi-beryllium-ebbg: introduce Xiaomi Poco
F1 EBBG variant

 Documentation/devicetree/bindings/arm/qcom.yaml   |  3 ++-
 arch/arm64/boot/dts/qcom/Makefile                 |  3 ++-
 ...um.dts => sdm845-xiaomi-beryllium-common.dtsi} | 11 +++++------
 .../dts/qcom/sdm845-xiaomi-beryllium-ebbg.dts     | 15 +++++++++++++++
 .../dts/qcom/sdm845-xiaomi-beryllium-tianma.dts   | 15 +++++++++++++++
 5 files changed, 39 insertions(+), 8 deletions(-)
 rename arch/arm64/boot/dts/qcom/{sdm845-xiaomi-beryllium.dts => sdm845-xiaomi-beryllium-common.dtsi} (98%)
 create mode 100644 arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-ebbg.dts
 create mode 100644 arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-tianma.dts
Signature · 1 line
2.37.2
#1 lore raw

PATCH v4 1/4 dt-bindings: arm: qcom: update beryllium compatible property

There are two panel variants of Xiaomi Poco F1. Tianma and EBBG panel. The previous beryllium dts supported the Tianma variant. In order to add support for EBBG variant, the common nodes from beryllium dts are moved to a new common dtsi and to make the variants distinguishable, sdm845-xiaomi-beryllium.dts is now named as sdm845-xiaomi-beryllium-tianma.dts. The board's model and compatible properties are also renamed to distinguish between the variants. So update the dt-bindings to reflect the new compatible value.

---
 Documentation/devicetree/bindings/arm/qcom.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/arm/qcom.yaml +1 -1
index fb1d00bcc847..e465ca45c07f 100644
@@ -666,7 +666,7 @@ properties:
               - sony,akatsuki-row
               - sony,apollo-row
               - thundercomm,db845c
-              - xiaomi,beryllium
+              - xiaomi,beryllium-tianma
               - xiaomi,polaris
           - const: qcom,sdm845
 
Signature · 1 line
2.37.2
#2 lore raw

Re: [PATCH v4 1/4] dt-bindings: arm: qcom: update beryllium compatible property

Quoted 19 lines · Joel Selvaraj

There are two panel variants of Xiaomi Poco F1. Tianma and EBBG panel. The previous beryllium dts supported the Tianma variant. In order to add support for EBBG variant, the common nodes from beryllium dts are moved to a new common dtsi and to make the variants distinguishable, sdm845-xiaomi-beryllium.dts is now named as sdm845-xiaomi-beryllium-tianma.dts. The board's model and compatible properties are also renamed to distinguish between the variants. So update the dt-bindings to reflect the new compatible value.

---
 Documentation/devicetree/bindings/arm/qcom.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/arm/qcom.yaml +0 -0
index fb1d00bcc847..e465ca45c07f 100644

Documentation/devicetree/bindings/arm/qcom.yaml properties: · line 669

Quoted 5 lines
Documentation/devicetree/bindings/arm/qcom.yaml +1 -1
@@ -666,7 +666,7 @@ properties:
               - sony,akatsuki-row
               - sony,apollo-row
               - thundercomm,db845c
-              - xiaomi,beryllium
+              - xiaomi,beryllium-tianma

The board compatibles are not that important for ABI yet this creates precedence, so I am against it. Simple renaming should not be a reason to change compatibles.

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH v4 1/4] dt-bindings: arm: qcom: update beryllium compatible property

Hi Krzysztof Kozlowski,

Quoted 3 lines

The board compatibles are not that important for ABI yet this creates precedence, so I am against it. Simple renaming should not be a reason to change compatibles.

So what should I do now?
1. Retain "xiaomi,beryllium" for tianma and "xiaomi,beryllium-ebbg" for ebbg?
2. If adding new compatible is not an issue, can I do "xiaomi,beryllium-tianma", "xiaomi,beryllium", "qcom,sdm845" - for tianma "xiaomi,beryllium-ebbg", "xiaomi,beryllium", "qcom,sdm845" - for ebbg

Kindly let me know if any other possible solution is present.

Thank you,
Joel Selvaraj

#4 lore raw

Re: [PATCH v4 1/4] dt-bindings: arm: qcom: update beryllium compatible property

Quoted 6 lines · Joel Selvaraj

Hi Krzysztof Kozlowski,

Quoted 3 lines

The board compatibles are not that important for ABI yet this creates precedence, so I am against it. Simple renaming should not be a reason to change compatibles.

Quoted 6 lines

So what should I do now?
1. Retain "xiaomi,beryllium" for tianma and "xiaomi,beryllium-ebbg" for ebbg?
2. If adding new compatible is not an issue, can I do "xiaomi,beryllium-tianma", "xiaomi,beryllium", "qcom,sdm845" - for tianma "xiaomi,beryllium-ebbg", "xiaomi,beryllium", "qcom,sdm845" - for ebbg

Both options work for me. I understand that boards are quite compatible and only the panel is different but the safest option (from any 3rd party users) is (1) above. If anyone has other preference, I am also ok. If not, then go with (1) above.

Best regards,
Krzysztof

#5 lore raw

PATCH v4 2/4 arm64: dts: qcom: split beryllium dts into common dtsi and tianma dts

In reply to Joel Selvaraj

There are two panel variants of Xiaomi Poco F1. Tianma and EBBG panel. The previous beryllium dts supported the Tianma variant. In order to add support for EBBG variant, the common nodes from beryllium dts are moved to a new common dtsi and to make the variants distinguishable, sdm845-xiaomi-beryllium.dts is now named as sdm845-xiaomi-beryllium-tianma.dts. The model and compatible property are also updated to distinguish between the variants.

---
 arch/arm64/boot/dts/qcom/Makefile                 |  2 +-
 ...um.dts => sdm845-xiaomi-beryllium-common.dtsi} | 11 +++++------
 .../dts/qcom/sdm845-xiaomi-beryllium-tianma.dts   | 15 +++++++++++++++
 3 files changed, 21 insertions(+), 7 deletions(-)
 rename arch/arm64/boot/dts/qcom/{sdm845-xiaomi-beryllium.dts => sdm845-xiaomi-beryllium-common.dtsi} (98%)
 create mode 100644 arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-tianma.dts
arch/arm64/boot/dts/qcom/Makefile +1 -1
index 1d86a33de528..d0bba59d2a8c 100644
@@ -128,7 +128,7 @@ dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-oneplus-fajita.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-sony-xperia-tama-akari.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-sony-xperia-tama-akatsuki.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-sony-xperia-tama-apollo.dtb
-dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-xiaomi-beryllium.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-xiaomi-beryllium-tianma.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-xiaomi-polaris.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-shift-axolotl.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sdm850-lenovo-yoga-c630.dtb
arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi renamed from arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium.dts +5 -6
similarity index 98%
rename from arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium.dts
rename to arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi
index 82c27f90d300..940ac9cd0aba 100644
@@ -26,8 +26,6 @@
 /delete-node/ &rmtfs_mem;
 
 / {
-	model = "Xiaomi Pocophone F1";
-	compatible = "xiaomi,beryllium", "qcom,sdm845";
 	chassis-type = "handset";
 
 	/* required for bootloader to select correct board */
@@ -221,8 +219,7 @@ &dsi0 {
 	status = "okay";
 	vdda-supply = <&vreg_l26a_1p2>;
 
-	panel@0 {
-		compatible = "tianma,fhd-video";
+	display_panel: panel@0 {
 		reg = <0>;
 		vddio-supply = <&vreg_l14a_1p8>;
 		vddpos-supply = <&lab>;
@@ -234,8 +231,10 @@ panel@0 {
 		backlight = <&pmi8998_wled>;
 		reset-gpios = <&tlmm 6 GPIO_ACTIVE_LOW>;
 
+		status = "disabled";
+
 		port {
-			tianma_nt36672a_in_0: endpoint {
+			panel_in_0: endpoint {
 				remote-endpoint = <&dsi0_out>;
 			};
 		};
@@ -243,7 +242,7 @@ tianma_nt36672a_in_0: endpoint {
 };
 
 &dsi0_out {
-	remote-endpoint = <&tianma_nt36672a_in_0>;
+	remote-endpoint = <&panel_in_0>;
 	data-lanes = <0 1 2 3>;
 };
 
arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-tianma.dts new file +15 -0
new file mode 100644
index 000000000000..5411ca29a89b
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0
+
+/dts-v1/;
+
+#include "sdm845-xiaomi-beryllium-common.dtsi"
+
+/ {
+	model = "Xiaomi Pocophone F1 (Tianma)";
+	compatible = "xiaomi,beryllium-tianma", "qcom,sdm845";
+};
+
+&display_panel {
+	compatible = "tianma,fhd-video";
+	status = "okay";
+};
Signature · 1 line
2.37.2
#6 lore raw

PATCH v4 3/4 dt-bindings: arm: qcom: Add Xiaomi Poco F1 EBBG variant bindings

In reply to Joel Selvaraj

Add documentation for "xiaomi,beryllium-ebbg" device.

---
 Documentation/devicetree/bindings/arm/qcom.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/arm/qcom.yaml +1 -0
index e465ca45c07f..4515151e3104 100644
@@ -666,6 +666,7 @@ properties:
               - sony,akatsuki-row
               - sony,apollo-row
               - thundercomm,db845c
+              - xiaomi,beryllium-ebbg
               - xiaomi,beryllium-tianma
               - xiaomi,polaris
           - const: qcom,sdm845
Signature · 1 line
2.37.2
#8 lore raw

PATCH v4 4/4 arm64: dts: qcom: sdm845-xiaomi-beryllium-ebbg: introduce Xiaomi Poco F1 EBBG variant

In reply to Joel Selvaraj

Introduce support for the Xiaomi Poco F1 EBBG variant. The EBBG variant uses EBBG FT8719 panel manufactured by EBBG.

---
 arch/arm64/boot/dts/qcom/Makefile                 |  1 +
 .../dts/qcom/sdm845-xiaomi-beryllium-ebbg.dts     | 15 +++++++++++++++
 2 files changed, 16 insertions(+)
 create mode 100644 arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-ebbg.dts
arch/arm64/boot/dts/qcom/Makefile +1 -0
index d0bba59d2a8c..a5045bd120c1 100644
@@ -128,6 +128,7 @@ dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-oneplus-fajita.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-sony-xperia-tama-akari.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-sony-xperia-tama-akatsuki.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-sony-xperia-tama-apollo.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-xiaomi-beryllium-ebbg.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-xiaomi-beryllium-tianma.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-xiaomi-polaris.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-shift-axolotl.dtb
arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-ebbg.dts new file +15 -0
new file mode 100644
index 000000000000..76931ebad065
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0
+
+/dts-v1/;
+
+#include "sdm845-xiaomi-beryllium-common.dtsi"
+
+/ {
+	model = "Xiaomi Pocophone F1 (EBBG)";
+	compatible = "xiaomi,beryllium-ebbg", "qcom,sdm845";
+};
+
+&display_panel {
+	compatible = "ebbg,ft8719";
+	status = "okay";
+};
Signature · 1 line
2.37.2
Reviewed-by on v4 4/4
#9 lore raw

Re: [PATCH v4 4/4] arm64: dts: qcom: sdm845-xiaomi-beryllium-ebbg: introduce Xiaomi Poco F1 EBBG variant

Quoted 7 lines · Joel Selvaraj

Introduce support for the Xiaomi Poco F1 EBBG variant. The EBBG variant uses EBBG FT8719 panel manufactured by EBBG.

---
 arch/arm64/boot/dts/qcom/Makefile                 |  1 +

Best regards,
Krzysztof