Skip to contentSkip to conversation

Introduce Lenovo Legion Y700 Gen4

PATCH Superseded Pengyu Luo 3 participants 6 messages Jul 19 – Jul 21

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Pengyu Luo

author
#0 lore raw

cover Introduce Lenovo Legion Y700 Gen4

Add an initial devicetree for the Lenovo Legion Y700 Gen4, which is based on sm8750-qrd.

---

Pengyu Luo (2):
dt-bindings: arm: qcom: Document Lenovo Legion Y700 Gen4
arm64: dts: qcom: sm8750: Add Lenovo Legion Y700 Gen4

 .../devicetree/bindings/arm/qcom.yaml         |    1 +
 arch/arm64/boot/dts/qcom/Makefile             |    1 +
 .../boot/dts/qcom/sm8750-lenovo-elden.dts     | 1097 +++++++++++++++++
 3 files changed, 1099 insertions(+)
 create mode 100644 arch/arm64/boot/dts/qcom/sm8750-lenovo-elden.dts
Signature · 1 line
2.54.0
author
#1 lore raw

PATCH 1/2 dt-bindings: arm: qcom: Document Lenovo Legion Y700 Gen4

Add compatible for the SM8750-based Lenovo Legion Y700 Gen4, using its codename, elden.

---
 Documentation/devicetree/bindings/arm/qcom.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/arm/qcom.yaml +1 -0
index c7c9a9279684..e1ade271e712 100644
@@ -1160,6 +1160,7 @@ properties:
 
       - items:
           - enum:
+              - lenovo,elden
               - qcom,sm8750-mtp
               - qcom,sm8750-qrd
           - const: qcom,sm8750
Signature · 1 line
2.54.0
author
#3 lore raw

PATCH 2/2 arm64: dts: qcom: sm8750: Add Lenovo Legion Y700 Gen4

In reply to Pengyu Luo

Add an initial devicetree for the Lenovo Legion Y700 Gen4, which is based on sm8750-qrd.

Supported features:
- Altmode
- Backlight
- Battery & Charge (Full speed)
- Buttons
- Framebuffer (Require mdss and dispcc to be disabled)
- USB (Two ports)

Downstream supported features:
- Display (8/10 bits) (Pending [1])
- GPU
- Touchscreen

Unsupported features:
- BT & WIFI
- Cameras & Flash
- Microphones & Speakers (Downstream available, pending test [2])
- Sensors (Downstream available, pending test [3])
- Vibrators (Downstream available, pending test [2])

[1]: https://lore.kernel.org/dri-devel/[email protected]
[2]: https://github.com/GUF296/linux/commits/codex/tb321fu-full-remediation-20260715
[3]: https://github.com/linux-msm/hexagonrpc

---
 arch/arm64/boot/dts/qcom/Makefile             |    1 +
 .../boot/dts/qcom/sm8750-lenovo-elden.dts     | 1097 +++++++++++++++++
 2 files changed, 1098 insertions(+)
 create mode 100644 arch/arm64/boot/dts/qcom/sm8750-lenovo-elden.dts
arch/arm64/boot/dts/qcom/Makefile +1 -0
index e05414290d8e..cb93708e0415 100644
@@ -405,6 +405,7 @@ dtb-$(CONFIG_ARCH_QCOM)	+= sm8650-hdk-rear-camera-card.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8650-hdk.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8650-mtp.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8650-qrd.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= sm8750-lenovo-elden.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8750-mtp.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8750-qrd.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= talos-evk.dtb
arch/arm64/boot/dts/qcom/sm8750-lenovo-elden.dts new file +1096 -0

1,096 lines not on this page · raw message

Signature · 1 line
2.54.0
#4 lore raw

Re: [PATCH 2/2] arm64: dts: qcom: sm8750: Add Lenovo Legion Y700 Gen4

Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider: - [Medium] SD card detection GPIO polarity is inverted. - [Medium] Unresolved `splash-region` node name…

Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [Medium] SD card detection GPIO polarity is inverted.
- [Medium] Unresolved splash-region node name breaks bootloader framebuffer setup.
- [Medium] The SBU mux (fsa4480_hs_sbu_mux) for the short edge Type-C connector is improperly mapped to port@1 instead of port@2.
- [Low] Invalid scalar property enable-gpio used for the Awinic backlight driver instead of enable-gpios.
--

--- Patch [2]: [PATCH 2/2] arm64: dts: qcom: sm8750: Add Lenovo Legion Y700 Gen4 --- commit fd69339b25380307f4c2239ad2b73d115e6d80d8
Author: Pengyu Luo <[email protected]>

arm64: dts: qcom: sm8750: Add Lenovo Legion Y700 Gen4

Add an initial devicetree for the Lenovo Legion Y700 Gen4, which is based on sm8750-qrd.

Quoted 5 lines
arch/arm64/boot/dts/qcom/sm8750-lenovo-elden.dts new file +0 -0
new file mode 100644
index 0000000000000..602e7322b921b

[ ... ]

Quoted 11 lines
arch/arm64/boot/dts/qcom/sm8750-lenovo-elden.dts new file +11 -0
+		/* Short edge */
+		connector@1 {
+			compatible = "usb-c-connector";
+			reg = <1>;
+
+			power-role = "dual";
+			data-role = "dual";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;

[ ... ]

arch/arm64/boot/dts/qcom/sm8750-lenovo-elden.dts line 172

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8750-lenovo-elden.dts new file +10 -0
+				port@1 {
+					reg = <1>;
+
+					pmic_glink_hs_sbu: endpoint {
+						remote-endpoint = <&fsa4480_hs_sbu_mux>;
+					};
+				};
+			};
+		};
+	};

[Severity: Medium]
Is this SBU mux mapped to the correct port? According to the usb-connector schema, port 1 is reserved for SuperSpeed, while port 2 is reserved for SBU. Will mapping this to port 1 cause the Type-C subsystem and pmic_glink_altmode driver to misidentify the SBU mux as a SuperSpeed switch and break routing?

arch/arm64/boot/dts/qcom/sm8750-lenovo-elden.dts line 183

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8750-lenovo-elden.dts new file +10 -0
+	reserved-memory {
+		/*
+		 * Use this to tell the BL to initialize the display related
+		 * resources, so we can use efifb. Please 's/-/_/'
+		 */
+		splash-region {
+			reg = <0 0xfc800000 0 0x2b00000>;
+			no-map;
+		};
+	};

[Severity: Medium]
Will this node name break out-of-the-box framebuffer initialization? Since the comment indicates the bootloader expects an underscore, could we provide the correctly formatted splash_region here directly rather than relying on a manual string replacement during compilation or deployment?

[ ... ]

arch/arm64/boot/dts/qcom/sm8750-lenovo-elden.dts line 787

Quoted 5 lines
arch/arm64/boot/dts/qcom/sm8750-lenovo-elden.dts new file +5 -0
+	backlight: backlight@76 {
+		compatible = "awinic,aw99706";
+		reg = <0x76>;
+
+		enable-gpio = <&tlmm 88 GPIO_ACTIVE_HIGH>;

[Severity: Low]
Should this be enable-gpios instead of enable-gpio? While gpiolib transparently handles the singular fallback at runtime, using the singular form will likely cause dtbs_check to fail since the awinic,aw99706 binding requires the plural property name.

[ ... ]

arch/arm64/boot/dts/qcom/sm8750-lenovo-elden.dts line 953

Quoted 2 lines

+&sdhc_2 {

arch/arm64/boot/dts/qcom/sm8750-lenovo-elden.dts new file +1 -0
+	cd-gpios = <&tlmm 55 GPIO_ACTIVE_HIGH>;

[Severity: Medium]
Is the polarity for cd-gpios correct here? The sdc2_card_det_n pinctrl node further down defines a bias-pull-up, meaning a floating (empty) slot will pull high.

With GPIO_ACTIVE_HIGH logic, will this cause the driver to incorrectly interpret an empty slot as occupied?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#5 lore raw

Re: [PATCH 2/2] arm64: dts: qcom: sm8750: Add Lenovo Legion Y700 Gen4

In reply to Pengyu Luo

arch/arm64/boot/dts/qcom/sm8750-lenovo-elden.dts line 179

Quoted 7 lines · Pengyu Luo
arch/arm64/boot/dts/qcom/sm8750-lenovo-elden.dts new file +7 -0
+
+	reserved-memory {
+		/*
+		 * Use this to tell the BL to initialize the display related
+		 * resources, so we can use efifb. Please 's/-/_/'
+		 */
+		splash-region {

Missing unit address.

arch/arm64/boot/dts/qcom/sm8750-lenovo-elden.dts line 185

Quoted 6 lines
arch/arm64/boot/dts/qcom/sm8750-lenovo-elden.dts new file +6 -0
+			reg = <0 0xfc800000 0 0x2b00000>;
+			no-map;
+		};
+	};
+
+	vph_pwr: vph-pwr-regulator {

foo-regulator but...

arch/arm64/boot/dts/qcom/sm8750-lenovo-elden.dts line 196

Quoted 11 lines
arch/arm64/boot/dts/qcom/sm8750-lenovo-elden.dts new file +11 -0
+		compatible = "regulator-fixed";
+
+		regulator-name = "vph_pwr";
+		regulator-min-microvolt = <3700000>;
+		regulator-max-microvolt = <3700000>;
+
+		regulator-always-on;
+		regulator-boot-on;
+	};
+
+	vreg_iovdd_1p8: regulator-dsi-1p8 {

... here regulator-foo.

Please write consistent code.

Please use name for all fixed regulators which matches current format
recommendation: 'regulator-[0-9]v[0-9]'
https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/regulator/fixed-regulator.yaml

Best regards,
Krzysztof