arm64: dts: qcom: add LG V60 ThinQ 5G (timelm) support
Subsystems (8)
v2 cover arm64: dts: qcom: add LG V60 ThinQ 5G (timelm) support
This series adds initial mainline device tree and driver support for the Qualcomm SM8250-based LG V60 ThinQ 5G (timelm / LM-V600) smartphone.
Hardware features supported in this stage:
- Base board devicetree (sm8250-lg-timelm.dts)
- PM8150, PM8150B, PM8150L, and PM8009 PMICs and regulators
- UFS 3.0 storage and MicroSD card slot
- GPIO keys (Volume Down, Google Assistant) and PON keys (Power, Volume Up)
- Simple framebuffer (continuous splash handed off from bootloader)
- Adreno 650 GPU with GMU and zap shader
- LG SW43103 1080x2460 DSI command mode AMOLED panel with DSC
- Silicon Works SW42902 I2C touchscreen controller
- PM8150B USB Type-C controller in sink mode with USB-PD and orientation switch
- QCA6390 Bluetooth HCI controller on UART6
Changes in v2:
- General / DCO & Identity:
- Replaced account handle "rofikkerneldev" with real name "Abdur Rofik <[email protected]>" across all commit authors, Signed-off-by trailers, MAINTAINERS entries, and copyright headers per Documentation/process/submitting-patches.rst.
- Replaced un-documented "lge" vendor prefix with documented "lg" prefix across devicetree bindings, compatible strings, and dts files.
- Devicetree bindings:
- Added lg,timelm compatible in arm/qcom.yaml.
- Added lg,sw43103 panel binding with enable-gpios and vddi/vpnl supplies.
- Added lg,sw42902 touchscreen binding with vcl-supply and vdd-supply.
- Device Tree (arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts):
- Renamed file to sm8250-lg-timelm.dts matching vendor prefix.
- Reserved memory: folded cont_splash_mem and log regions into base dts; sorted all nodes by ascending unit-address.
- Ramoops: adjusted size allocations (record-size 0x40000, pmsg-size
0x1c0000) ensuring 256KB is available for dmesg panic dumps.
- Regulators: dropped unused LDO4 from PM8009 regulators-2 node,
resolving the invalid 1.05V constraint failure.
- USB QMP PHY: corrected swapped supplies (vdda-phy to 0.9V l18a_0p9,
vdda-pll to 1.2V l9a_1p2).
- GPU: enabled &gmu alongside &gpu to ensure MSM DRM component
binding succeeds without -ENODEV in a6xx_gmu_init().
- SDHC: added complete pinctrl states (sdc2_default_state,
sdc2_sleep_state, sdc2_card_det_n) to &sdhc_2.
- UFS: added regulator-allow-set-load and regulator-allowed-modes for
dynamic load scaling.
- Panel: added enable-gpios to panel@0 node; sorted display nodes
alphabetically.
- Touchscreen: used fixed regulators reg_ts_vcl and reg_ts_vdd for
power supplies instead of raw GPIO toggles.
- USB Type-C: replaced PDO_BATT with PDO_VAR(5000, 9000, 3000) to
ensure valid 9V/3A PD sink requests without clamping to 600mA;
added OF graph ports connecting DWC3 HS and SuperSpeed QMP PHY
orientation switch.
- Bluetooth: corrected QCA6390 PMU voltages by setting smps6 (0.95V)
and smps8 (1.35V) constraints. - Cleaned up unused dt-bindings headers and enforced strict alphabetical ordering of all referenced label nodes.
- Panel driver (drivers/gpu/drm/panel/panel-lg-sw43103.c):
- Removed redundant manual unprepare call in sw43103_remove().
- Guarded sw43103_backlight_update_status() against execution when unprepared, avoiding unsynchronized DSI DCS writes.
- Removed hardcoded full brightness writes in sw43103_enable().
- Expanded Kconfig help paragraph to 4 lines.
- Touchscreen driver (drivers/input/touchscreen/sw42902.c):
- Converted GPIO power controls to standard regulator bulk supplies (vcl and vdd).
- Added suspended flag guarding resume and I2C operations to prevent IRQ disable imbalance on resume error.
- Pre-scanned for palm touch reports before queueing MT slots.
- Used named initializer in struct i2c_device_id table.
- Followed input subsystem error naming conventions.
- MAINTAINERS:
- Added entries for LG V60 ThinQ 5G, LG SW43103 panel driver, and Silicon Works SW42902 touchscreen driver in strict alphabetical order.
Abdur Rofik (10):
dt-bindings: arm: qcom: add LG V60 ThinQ 5G (timelm)
arm64: dts: qcom: add LG V60 ThinQ 5G (timelm) support
dt-bindings: display: panel: add LG SW43103 drm/panel: add LG SW43103 panel driver
dt-bindings: input: touchscreen: add Silicon Works SW42902
Input: touchscreen: add Silicon Works SW42902 support
arm64: dts: qcom: sm8250-lg-timelm: enable SW43103 panel
arm64: dts: qcom: sm8250-lg-timelm: add SW42902 touchscreen
arm64: dts: qcom: sm8250-lg-timelm: enable USB Type-C
arm64: dts: qcom: sm8250-lg-timelm: add QCA6390 Bluetooth
.../devicetree/bindings/arm/qcom.yaml | 1 + .../bindings/display/panel/lg,sw43103.yaml | 69 ++ .../input/touchscreen/lg,sw42902.yaml | 73 ++ MAINTAINERS | 19 + arch/arm64/boot/dts/qcom/Makefile | 1 + arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts | 840 ++++++++++++++++++ drivers/gpu/drm/panel/Kconfig | 13 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-lg-sw43103.c | 587 ++++++++++++ drivers/input/touchscreen/Kconfig | 13 + drivers/input/touchscreen/Makefile | 1 + drivers/input/touchscreen/sw42902.c | 355 ++++++++ 12 files changed, 1973 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/lg,sw43103.yaml create mode 100644 Documentation/devicetree/bindings/input/touchscreen/lg,sw42902.yaml create mode 100644 arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts create mode 100644 drivers/gpu/drm/panel/panel-lg-sw43103.c create mode 100644 drivers/input/touchscreen/sw42902.c
Signature · 1 line
2.39.5
PATCH v2 1/10 dt-bindings: arm: qcom: add LG V60 ThinQ 5G (timelm)
Document the compatible for the LG V60 ThinQ 5G (timelm), based on the Qualcomm SM8250 platform.
--- Documentation/devicetree/bindings/arm/qcom.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/arm/qcom.yaml +1 -0
@@ -1139,6 +1139,7 @@ properties: - items: - enum: + - lg,timelm - qcom,qrb5165-rb5 - qcom,sm8250-hdk - qcom,sm8250-mtp
Signature · 1 line
2.39.5
PATCH v2 2/10 arm64: dts: qcom: add LG V60 ThinQ 5G (timelm) support
In reply to Abdur RofikAdd initial device tree and MAINTAINERS entry for the LG V60 ThinQ 5G (timelm), an SM8250-based smartphone released in 2020.
The initial description enables:
- Memory reservations for bootloader and firmware log regions
- Simple framebuffer continuous splash reservation
- Volume Down and Google Assistant keys via PM8150 GPIOs
- Volume Up key via PM8150 RESIN
- RPMh power supplies across PM8150, PM8150L, and PM8009
- Storage via UFS 3.0 and SD card via SDHC2 with pinctrl states
- Graphics via Adreno 650 GPU with GMU and ZAP shader firmware
- High-Speed USB on PM8150B and SuperSpeed QMP PHY
- Console output on GENI UART12
--- MAINTAINERS | 6 + arch/arm64/boot/dts/qcom/Makefile | 1 + arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts | 615 ++++++++++++++++++ 3 files changed, 622 insertions(+) create mode 100644 arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts
MAINTAINERS +6 -0
@@ -15211,6 +15211,12 @@ F: Documentation/ABI/testing/sysfs-platform-lg-laptop F: Documentation/admin-guide/laptops/lg-laptop.rst F: drivers/platform/x86/lg-laptop.c +LG V60 THINQ 5G (TIMELM) SUPPORT +M: Abdur Rofik <[email protected]> +L: [email protected] +S: Maintained +F: arch/arm64/boot/dts/qcom/sm8250-lg-timelm* + LG2160 MEDIA DRIVER M: Michael Krufky <[email protected]> L: [email protected]
arch/arm64/boot/dts/qcom/Makefile +1 -0
@@ -409,6 +409,7 @@ dtb-$(CONFIG_ARCH_QCOM) += sm8150-mtp.dtb dtb-$(CONFIG_ARCH_QCOM) += sm8150-sony-xperia-kumano-bahamut.dtb dtb-$(CONFIG_ARCH_QCOM) += sm8150-sony-xperia-kumano-griffin.dtb dtb-$(CONFIG_ARCH_QCOM) += sm8250-hdk.dtb +dtb-$(CONFIG_ARCH_QCOM) += sm8250-lg-timelm.dtb dtb-$(CONFIG_ARCH_QCOM) += sm8250-mtp.dtb dtb-$(CONFIG_ARCH_QCOM) += sm8250-samsung-r8q.dtb dtb-$(CONFIG_ARCH_QCOM) += sm8250-samsung-x1q.dtb
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts new file +615 -0
615 lines not on this page · raw message
Signature · 1 line
2.39.5
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 5 potential issues to consider: - [High] arm64: dts: qcom: invalid smps6 in regulators-1 aborts rpmh_regulator_probe() - [Medium] arm64: dts…
Thank you for your contribution! Sashiko AI review found 5 potential issues to consider:
- [High] arm64: dts: qcom: invalid smps6 in regulators-1 aborts rpmh_regulator_probe()
- [Medium] arm64: dts: qcom: conflicting reg and memory-region on simple-framebuffer
- [Medium] arm64: dts: qcom: missing board-specific firmware-name on cdsp and gpu_zap_shader
- [Low] arm64: dts: qcom: duplicate sdc2_sleep_state node and redundant pon status
- [Low] arm64: dts: qcom: non-power-of-two pmsg-size in ramoops is rounded down
--
commit 3fe02ddb83035271fb02be5f0c325bb78269f75e
Author: Abdur Rofik <[email protected]>
arm64: dts: qcom: add LG V60 ThinQ 5G (timelm) support
This commit adds the initial device tree and MAINTAINERS entry for the SM8250-based LG V60 ThinQ 5G (timelm) smartphone.
Quoted 6 lines
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts new file +0
-0@@ -0,0 +1,615 @@
[ ... ]
Quoted 6 lines
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts new file +6
-0+ chosen { + stdout-path = "serial0:115200n8"; + #address-cells = <2>; + #size-cells = <2>; + ranges; +
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts line 41
Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts new file +10
-0+ framebuffer@9c000000 { + compatible = "simple-framebuffer"; + reg = <0x0 0x9c000000 0x0 (1080 * 2460 * 4)>; + width = <1080>; + height = <2460>; + stride = <(1080 * 4)>; + format = "a8r8g8b8"; + memory-region = <&cont_splash_mem>; + }; + };
[Severity: Medium]
Should framebuffer@9c000000 drop memory-region (or drop reg and the unit address) instead of specifying both?
When both properties are present, simplefb_get_memory_of() in simpledrm and simplefb_parse_dt() in simplefb emit a boot warning ("preferring "memory-region" over "reg" property") and ignore the exact framebuffer size in reg in favor of the full 0x1200000-byte cont_splash_mem region, allowing fb_mmap() on /dev/fb0 to map the trailing reserved memory beyond the framebuffer.
[ ... ]
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts line 92
Quoted 9 lines
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts new file +9
-0+ ramoops: ramoops@b0000000 { + compatible = "ramoops"; + reg = <0x0 0xb0000000 0x0 0x280000>; + record-size = <0x40000>; + console-size = <0x40000>; + ftrace-size = <0x40000>; + pmsg-size = <0x1c0000>; + no-map; + };
[Severity: Low]
Is pmsg-size = <0x1c0000> intended here? ramoops_probe() requires pmsg_size to be a power of two and rounds 0x1c0000 down to 0x100000 via rounddown_pow_of_two(), shifting the buffer offsets and leaving the remaining 0xc0000 bytes to dump_mem_sz.
[ ... ]
Quoted 3 lines
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts new file +3
-0+ regulators-1 { + compatible = "qcom,pm8150l-rpmh-regulators"; + qcom,pmic-id = "c";
[ ... ]
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts line 294
Quoted 13 lines
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts new file +13
-0+ vreg_bob: bob { + regulator-name = "vreg_bob"; + regulator-min-microvolt = <3008000>; + regulator-max-microvolt = <4000000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>; + }; + + vreg_s6c_0p88: smps6 { + regulator-name = "vreg_s6c_0p88"; + regulator-min-microvolt = <348000>; + regulator-max-microvolt = <1000000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + };
[Severity: High]
Does defining smps6 under regulators-1 cause rpmh_regulator_probe() to fail with -ENODEV?
On SM8250 with PM8150L (qcom,pmic-id = "c"), SMPS6C is an ARC level resource (ebi.lvl) rather than a VRM resource, so cmd_db_read_addr() in rpmh_regulator_init_vreg() returns 0 for "smpc6" and aborts probing regulators-1 before smps8 (vreg_s8c_1p35) and ldo1..ldo11 are registered. That leaves the parent supplies for PM8150 and PM8009 LDOs as well as the UFS, SDHC2, and USB PHY rails unregistered.
As on other SM8250 boards, vreg_s6c_0p88 should be a top-level regulator-fixed node at 880000 uV, and the 348000..1000000 uV rail under regulators-1 should be smps7 (vreg_s7c_0p35).
[ ... ]
Quoted 3 lines
+&cdsp {
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts new file +2
-0+ status = "okay"; +};
[ ... ]
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts line 461
Quoted 7 lines
+&gpu {
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts new file +6
-0+ status = "okay"; + + zap-shader { + firmware-name = "qcom/sm8250/a650_zap.mbn"; + }; +};
[Severity: Medium]
Should &cdsp and the GPU zap-shader specify board-specific firmware-name paths?
Enabling &cdsp without firmware-name causes qcom_pas_probe() to fall back to bare "cdsp.mdt", and using the generic reference-board path "qcom/sm8250/a650_zap.mbn" fails PAS authentication on fused retail devices that require OEM-signed firmware (and zap-shader can be referenced directly via &gpu_zap_shader).
[ ... ]
Quoted 3 lines
+&pon {
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts new file +2
-0+ status = "okay"; +};
[ ... ]
Quoted 9 lines
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts new file +9
-0+ sdc2_sleep_state: sdc2-sleep-state { + clk-pins { + pins = "sdc2_clk"; + drive-strength = <2>; + bias-disable; + }; + + cmd-pins { + pins = "sdc2_cmd";
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts line 562
Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts new file +10
-0+ drive-strength = <2>; + bias-pull-up; + }; + + data-pins { + pins = "sdc2_data"; + drive-strength = <2>; + bias-pull-up; + }; + };
[Severity: Low]
This isn't a bug, but sdc2_sleep_state duplicates the identical node already defined in sm8250.dtsi, and &pon is already enabled in pm8150.dtsi. Also, the commit message mentions "High-Speed USB on PM8150B", whereas &usb_1_hsphy is the SoC-internal HS PHY supplied by PM8150.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
PATCH v2 3/10 dt-bindings: display: panel: add LG SW43103
In reply to Abdur RofikDocument the SW43103 FHD+ AMOLED panel used by the LG V60. The panel uses DSI command mode with DSC and DCS backlight control.
--- .../bindings/display/panel/lg,sw43103.yaml | 69 +++++++++++++++++++ MAINTAINERS | 5 ++ 2 files changed, 74 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/lg,sw43103.yaml
Documentation/devicetree/bindings/display/panel/lg,sw43103.yaml new file +69 -0
@@ -0,0 +1,69 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/lg,sw43103.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: LG / BOE SW43103 1080x2460 DSI cmd mode panel + +maintainers: + - Abdur Rofik <[email protected]> + +description: | + The SW43103 is a 1080x2460 command-mode AMOLED panel used by LG V60 (timelm). + It uses Display Stream Compression (DSC) over a 4-lane MIPI DSI interface. + +allOf: + - $ref: panel-common.yaml# + +properties: + compatible: + enum: + - lg,sw43103 + - boe,sw43103 + + reg: + maxItems: 1 + + port: true + vddi-supply: true + vpnl-supply: true + reset-gpios: true + enable-gpios: true + +required: + - compatible + - reg + - vddi-supply + - vpnl-supply + - reset-gpios + - port + +additionalProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + + dsi { + #address-cells = <1>; + #size-cells = <0>; + + panel@0 { + compatible = "lg,sw43103"; + reg = <0>; + + vddi-supply = <&vreg_l14a_1p8>; + vpnl-supply = <&vreg_l11c_3p0>; + + reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>; + enable-gpios = <&pm8150l_gpios 4 GPIO_ACTIVE_HIGH>; + + port { + endpoint { + remote-endpoint = <&mdss_dsi0_out>; + }; + }; + }; + }; +...
MAINTAINERS +5 -0
@@ -15211,6 +15211,11 @@ F: Documentation/ABI/testing/sysfs-platform-lg-laptop F: Documentation/admin-guide/laptops/lg-laptop.rst F: drivers/platform/x86/lg-laptop.c +LG SW43103 PANEL DRIVER +M: Abdur Rofik <[email protected]> +S: Maintained +F: Documentation/devicetree/bindings/display/panel/lg,sw43103.yaml + LG V60 THINQ 5G (TIMELM) SUPPORT M: Abdur Rofik <[email protected]> L: [email protected]
Signature · 1 line
2.39.5
PATCH v2 4/10 drm/panel: add LG SW43103 panel driver
In reply to Abdur RofikAdd support for the 1080x2460 SW43103 AMOLED panel. Handle power and reset sequencing, DCS backlight control, and the DSC configuration required by the panel.
--- MAINTAINERS | 1 + drivers/gpu/drm/panel/Kconfig | 13 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-lg-sw43103.c | 587 +++++++++++++++++++++++ 4 files changed, 602 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-lg-sw43103.c
MAINTAINERS +1 -0
@@ -15215,6 +15215,7 @@ LG SW43103 PANEL DRIVER M: Abdur Rofik <[email protected]> S: Maintained F: Documentation/devicetree/bindings/display/panel/lg,sw43103.yaml +F: drivers/gpu/drm/panel/panel-lg-sw43103.c LG V60 THINQ 5G (TIMELM) SUPPORT M: Abdur Rofik <[email protected]>
drivers/gpu/drm/panel/Kconfig +13 -0
@@ -540,6 +540,19 @@ config DRM_PANEL_LG_LG4573 Say Y here if you want to enable support for LG4573 RGB panel. To compile this driver as a module, choose M here. +config DRM_PANEL_LG_SW43103 + tristate "LG / BOE SW43103 panel" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + select DRM_DISPLAY_DSC_HELPER + select DRM_DISPLAY_HELPER + help + Say Y here if you want to enable support for the LG / BOE SW43103 + 1080x2460 AMOLED panel used in the LG V60 ThinQ 5G smartphone. + The panel operates in DSI command mode with Display Stream + Compression (DSC). + config DRM_PANEL_LG_SW43408 tristate "LG SW43408 panel" depends on GPIOLIB
drivers/gpu/drm/panel/Makefile +1 -0
@@ -53,6 +53,7 @@ obj-$(CONFIG_DRM_PANEL_LINCOLNTECH_LCD197) += panel-lincolntech-lcd197.o obj-$(CONFIG_DRM_PANEL_LG_LB035Q02) += panel-lg-lb035q02.o obj-$(CONFIG_DRM_PANEL_LG_LD070WX3) += panel-lg-ld070wx3.o obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o +obj-$(CONFIG_DRM_PANEL_LG_SW43103) += panel-lg-sw43103.o obj-$(CONFIG_DRM_PANEL_LG_SW43408) += panel-lg-sw43408.o obj-$(CONFIG_DRM_PANEL_LXD_M9189A) += panel-lxd-m9189a.o obj-$(CONFIG_DRM_PANEL_MAGNACHIP_D53E6EA8966) += panel-magnachip-d53e6ea8966.o
drivers/gpu/drm/panel/panel-lg-sw43103.c new file +587 -0
587 lines not on this page · raw message
Signature · 1 line
2.39.5
PATCH v2 5/10 dt-bindings: input: touchscreen: add Silicon Works SW42902
In reply to Abdur RofikDocument the Silicon Works SW42902 I2C touchscreen controller, including its interrupt, reset GPIO, power supplies, and panel touch properties.
--- .../input/touchscreen/lg,sw42902.yaml | 73 +++++++++++++++++++ MAINTAINERS | 6 ++ 2 files changed, 79 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/touchscreen/lg,sw42902.yaml
Documentation/devicetree/bindings/input/touchscreen/lg,sw42902.yaml new file +73 -0
@@ -0,0 +1,73 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/touchscreen/lg,sw42902.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Silicon Works SW42902 Touchscreen Controller + +maintainers: + - Abdur Rofik <[email protected]> + +description: | + The SW42902 is an I2C capacitive touchscreen controller used on the + LG V60 (timelm). + +allOf: + - $ref: touchscreen.yaml# + +properties: + compatible: + const: lg,sw42902 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + reset-gpios: + maxItems: 1 + description: Active-low hardware reset + + vcl-supply: + description: 3.3 V power supply + + vdd-supply: + description: 1.8 V power supply + +required: + - compatible + - reg + - interrupts + - reset-gpios + - vcl-supply + - vdd-supply + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + #include <dt-bindings/interrupt-controller/irq.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + touchscreen@48 { + compatible = "lg,sw42902"; + reg = <0x48>; + + interrupt-parent = <&tlmm>; + interrupts = <39 IRQ_TYPE_LEVEL_LOW>; + + reset-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; + vcl-supply = <®_ts_vcl>; + vdd-supply = <®_ts_vdd>; + + touchscreen-size-x = <1080>; + touchscreen-size-y = <2460>; + }; + }; +...
MAINTAINERS +6 -0
@@ -25835,6 +25835,12 @@ S: Maintained F: Documentation/fb/sm712fb.rst F: drivers/video/fbdev/sm712* +SILICON WORKS SW42902 TOUCHSCREEN DRIVER +M: Abdur Rofik <[email protected]> +L: [email protected] +S: Maintained +F: Documentation/devicetree/bindings/input/touchscreen/lg,sw42902.yaml + SILVACO I3C DUAL-ROLE MASTER M: Miquel Raynal <[email protected]> M: Frank Li <[email protected]>
Signature · 1 line
2.39.5
PATCH v2 6/10 Input: touchscreen: add Silicon Works SW42902 support
In reply to Abdur RofikAdd basic multitouch support for the SW42902 controller. Implement the power and reset sequence using regulator supplies and use the firmware already present in controller flash; no firmware update is performed.
--- MAINTAINERS | 1 + drivers/input/touchscreen/Kconfig | 13 + drivers/input/touchscreen/Makefile | 1 + drivers/input/touchscreen/sw42902.c | 355 ++++++++++++++++++++++++++++ 4 files changed, 370 insertions(+) create mode 100644 drivers/input/touchscreen/sw42902.c
MAINTAINERS +1 -0
@@ -25840,6 +25840,7 @@ M: Abdur Rofik <[email protected]> L: [email protected] S: Maintained F: Documentation/devicetree/bindings/input/touchscreen/lg,sw42902.yaml +F: drivers/input/touchscreen/sw42902.c SILVACO I3C DUAL-ROLE MASTER M: Miquel Raynal <[email protected]>
drivers/input/touchscreen/Kconfig +13 -0
@@ -1299,6 +1299,19 @@ config TOUCHSCREEN_SURFACE3_SPI To compile this driver as a module, choose M here: the module will be called surface3_spi. +config TOUCHSCREEN_SW42902 + tristate "Silicon Works SW42902 touchscreen" + depends on I2C + depends on GPIOLIB + help + Say Y here if you have a Silicon Works SW42902 touchscreen + connected to your system (e.g. LG V60). + + If unsure, say N. + + To compile this driver as a module, choose M here: the + module will be called sw42902. + config TOUCHSCREEN_SX8654 tristate "Semtech SX8654 touchscreen" depends on I2C
drivers/input/touchscreen/Makefile +1 -0
@@ -86,6 +86,7 @@ obj-$(CONFIG_TOUCHSCREEN_STMPE) += stmpe-ts.o obj-$(CONFIG_TOUCHSCREEN_SUN4I) += sun4i-ts.o obj-$(CONFIG_TOUCHSCREEN_SUR40) += sur40.o obj-$(CONFIG_TOUCHSCREEN_SURFACE3_SPI) += surface3_spi.o +obj-$(CONFIG_TOUCHSCREEN_SW42902) += sw42902.o obj-$(CONFIG_TOUCHSCREEN_TI_AM335X_TSC) += ti_am335x_tsc.o obj-$(CONFIG_TOUCHSCREEN_TOUCHIT213) += touchit213.o obj-$(CONFIG_TOUCHSCREEN_TOUCHRIGHT) += touchright.o
drivers/input/touchscreen/sw42902.c new file +355 -0
355 lines not on this page · raw message
Signature · 1 line
2.39.5
[email protected]
AI reviewRe: [PATCH v2 06/10] Input: touchscreen: add Silicon Works SW42902 support
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] Input: sw42902: unbalanced regulator disable in sw42902_power_off() --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Medium] Input: sw42902: unbalanced regulator disable in sw42902_power_off()
--
commit 11bdb001b9ee56acee9761786c40a8731d5ef9cb
Author: Abdur Rofik <[email protected]>
Input: touchscreen: add Silicon Works SW42902 support
This commit adds an I2C touchscreen driver for the Silicon Works SW42902 controller, handling regulator power sequencing, reset GPIO control, and multitouch input reporting.
Quoted 5 lines
drivers/input/touchscreen/sw42902.c new file +0
-0
[ ... ]
Quoted 16 lines
drivers/input/touchscreen/sw42902.c new file +16
-0+static void sw42902_power_off (void *data) +{ +struct sw42902 *ts = data; + +gpiod_set_value_cansleep (ts->reset,1 ); +usleep_range (1000 ,2000 ); +regulator_bulk_disable (ARRAY_SIZE (ts->supplies), ts->supplies); +} + +static int sw42902_power_on (struct sw42902 *ts) +{ +int error; + + error =regulator_bulk_enable (ARRAY_SIZE (ts->supplies), ts->supplies); +if (error) +return error;
[ ... ]
Quoted 2 lines
drivers/input/touchscreen/sw42902.c new file +2
-0+static int sw42902_probe (struct i2c_client *client) +{
[ ... ]
Quoted 11 lines
drivers/input/touchscreen/sw42902.c new file +11
-0+ error =devm_regulator_bulk_get (dev,ARRAY_SIZE (ts->supplies), ts->supplies); +if (error) +return dev_err_probe (dev, error,"failed to get regulators\n" ); + + error =devm_add_action_or_reset (dev, sw42902_power_off, ts); +if (error) +return error; + + input =devm_input_allocate_device (dev); +if (!input) +return -ENOMEM ;
[ ... ]
drivers/input/touchscreen/sw42902.c line 276
Quoted 9 lines
drivers/input/touchscreen/sw42902.c new file +9
-0+ error =devm_request_threaded_irq (dev, client->irq,NULL , sw42902_irq, +IRQF_ONESHOT |IRQF_NO_AUTOEN , +dev_name (dev), ts); +if (error) +return error; + + error =sw42902_power_on (ts); +if (error) +return error;
[Severity: Medium]
Can sw42902_power_off() call regulator_bulk_disable() when ts->supplies are not enabled?
devm_add_action_or_reset() registers sw42902_power_off() before sw42902_power_on() enables the regulators, so a failure in devm_input_allocate_device(), input_mt_init_slots(), devm_request_threaded_irq(), or regulator_bulk_enable() itself runs sw42902_power_off() on disabled regulators and triggers an unbalanced regulator disable warning. The same happens on driver unbind while suspended or after a failed sw42902_resume(), because sw42902_suspend() already called sw42902_power_off() and set ts->suspended = true.
Registering the devres action right after sw42902_power_on() succeeds (and before devm_request_threaded_irq(), so the IRQ is freed before power is cut on unbind) and skipping sw42902_power_off() when ts->suspended is set would avoid the unbalanced disables.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
PATCH v2 7/10 arm64: dts: qcom: sm8250-lg-timelm: enable SW43103 panel
In reply to Abdur RofikEnable MDSS, DSI0, and its PHY. Attach the SW43103 panel with its power rails, enable and reset GPIOs, and four-lane DSI link.
--- arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+)
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts +37 -0
@@ -8,6 +8,7 @@ #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/input/input.h> +#include <dt-bindings/phy/phy.h> #include <dt-bindings/regulator/qcom,rpmh-regulator.h> #include "sm8250.dtsi" #include "pm8150.dtsi"
@@ -460,6 +461,42 @@ zap-shader { }; }; +&mdss { + status = "okay"; +}; + +&mdss_dsi0 { + vdda-supply = <&vreg_l9a_1p2>; + status = "okay"; + + panel@0 { + compatible = "lg,sw43103"; + reg = <0>; + + vddi-supply = <&vreg_l14a_1p8>; + vpnl-supply = <&vreg_l11c_3p0>; + + reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>; + enable-gpios = <&pm8150l_gpios 4 GPIO_ACTIVE_HIGH>; + + port { + panel_in: endpoint { + remote-endpoint = <&mdss_dsi0_out>; + }; + }; + }; +}; + +&mdss_dsi0_out { + remote-endpoint = <&panel_in>; + data-lanes = <0 1 2 3>; +}; + +&mdss_dsi0_phy { + vdds-supply = <&vreg_l5a_0p88>; + status = "okay"; +}; + &pm8150_gpios { google_assist_state: google-assist-state { pins = "gpio1";
Signature · 1 line
2.39.5
[email protected]
AI reviewRe: [PATCH v2 07/10] arm64: dts: qcom: sm8250-lg-timelm: enable SW43103 panel
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] arm64: dts: qcom: unused dt-bindings/phy/phy.h include in sm8250-lg-timelm.dts --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] arm64: dts: qcom: unused dt-bindings/phy/phy.h include in sm8250-lg-timelm.dts
--
commit 374b6a1bedb56450ce91de89b10571b27d001468
Author: Abdur Rofik <[email protected]>
arm64: dts: qcom: sm8250-lg-timelm: enable SW43103 panel
This commit enables MDSS, DSI0, and its PHY, and attaches the LG SW43103 panel in the sm8250-lg-timelm device tree.
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts line 14
Quoted 12 lines
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts +1
-0@@ -8,6 +8,7 @@ #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/input/input.h> +#include <dt-bindings/phy/phy.h> #include <dt-bindings/regulator/qcom,rpmh-regulator.h> #include "sm8250.dtsi" #include "pm8150.dtsi"
[Severity: Low]
Is <dt-bindings/phy/phy.h> needed here? None of its macros are used in sm8250-lg-timelm.dts.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=7
PATCH v2 8/10 arm64: dts: qcom: sm8250-lg-timelm: add SW42902 touchscreen
In reply to Abdur RofikDescribe the SW42902 touchscreen on GENI I2C13 with its interrupt, reset, regulator supplies, pinctrl, and native 1080x2460 touch area.
--- arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+)
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts +48 -0
@@ -101,6 +101,24 @@ vph_pwr: vph-pwr-regulator { regulator-always-on; regulator-boot-on; }; + + reg_ts_vcl: regulator-ts-vcl { + compatible = "regulator-fixed"; + regulator-name = "reg_ts_vcl"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&pm8150_gpios 8 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + + reg_ts_vdd: regulator-ts-vdd { + compatible = "regulator-fixed"; + regulator-name = "reg_ts_vdd"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + gpio = <&pm8150_gpios 9 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; }; &apps_rsc {
@@ -461,6 +479,29 @@ zap-shader { }; }; +&i2c13 { + status = "okay"; + clock-frequency = <400000>; + + touchscreen@48 { + compatible = "lg,sw42902"; + reg = <0x48>; + + interrupt-parent = <&tlmm>; + interrupts = <39 IRQ_TYPE_LEVEL_LOW>; + + pinctrl-names = "default"; + pinctrl-0 = <&ts_int_default>; + + reset-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; + vcl-supply = <®_ts_vcl>; + vdd-supply = <®_ts_vdd>; + + touchscreen-size-x = <1080>; + touchscreen-size-y = <2460>; + }; +}; + &mdss { status = "okay"; };
@@ -604,6 +645,13 @@ sdc2_card_det_n: sd-card-det-n-state { drive-strength = <2>; bias-pull-up; }; + + ts_int_default: ts-int-default-state { + pins = "gpio39"; + function = "gpio"; + drive-strength = <8>; + bias-pull-up; + }; }; &uart12 {
Signature · 1 line
2.39.5
[email protected]
AI reviewRe: [PATCH v2 08/10] arm64: dts: qcom: sm8250-lg-timelm: add SW42902 touchscreen
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] Input: sw42902: unbalanced regulator_bulk_disable() in sw42902_power_off() --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Medium] Input: sw42902: unbalanced regulator_bulk_disable() in sw42902_power_off()
--
commit 675fc0153d8629f5c836725c06a791bb2e0ad680
Author: Abdur Rofik <[email protected]>
arm64: dts: qcom: sm8250-lg-timelm: add SW42902 touchscreen
This commit adds the SW42902 touchscreen node on I2C13 along with its fixed regulator supplies and interrupt pinctrl state for the LG V60 ThinQ 5G (timelm).
Quoted 4 lines
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts +0
-0
[ ... ]
Quoted 11 lines
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts +7
-0@@ -461,6 +479,29 @@ zap-shader { }; }; +&i2c13 { + status = "okay"; + clock-frequency = <400000>; + + touchscreen@48 { + compatible = "lg,sw42902"; + reg = <0x48>;
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts zap-shader { · line 498
Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts +10
-0+ + interrupt-parent = <&tlmm>; + interrupts = <39 IRQ_TYPE_LEVEL_LOW>; + + pinctrl-names = "default"; + pinctrl-0 = <&ts_int_default>; + + reset-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; + vcl-supply = <®_ts_vcl>; + vdd-supply = <®_ts_vdd>;
[Severity: Medium]
Can binding this node trigger an unbalanced regulator_bulk_disable() on ts->supplies in the driver added by commit "Input: touchscreen: add Silicon Works SW42902 support"?
sw42902_probe() registers the sw42902_power_off() devres action right after devm_regulator_bulk_get(), before sw42902_power_on() enables the vcl and vdd regulators:
drivers/input/touchscreen/sw42902.c:sw42902_probe() {
...
error = devm_regulator_bulk_get(dev, ARRAY_SIZE(ts->supplies), ts->supplies);
if (error)
return dev_err_probe(dev, error, "failed to get regulators\n");
error = devm_add_action_or_reset(dev, sw42902_power_off, ts);
if (error)
return error;
...
error = sw42902_power_on(ts);
if (error)
return error;
...
}If an intermediate call such as devm_request_threaded_irq() or regulator_bulk_enable() inside sw42902_power_on() fails, devres runs sw42902_power_off() and calls regulator_bulk_disable() on supplies that were never enabled, underflowing the regulator enable count and triggering a WARN_ON() in _regulator_disable(). Unbinding the device while suspended has the same effect because sw42902_suspend() already called sw42902_power_off() without tracking power state in sw42902_power_off().
Registering the devres action after sw42902_power_on() succeeds and skipping sw42902_power_off() when ts->suspended is set would avoid disabling already-disabled regulators.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=8
PATCH v2 9/10 arm64: dts: qcom: sm8250-lg-timelm: enable USB Type-C
In reply to Abdur RofikEnable the PM8150B Type-C controller in sink mode with PDO_VAR up to 9V/3A, and connect the OF graph endpoints for USB DWC3 and SuperSpeed QMP PHY orientation switching.
--- arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+)
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts +48 -0
@@ -10,6 +10,7 @@ #include <dt-bindings/input/input.h> #include <dt-bindings/phy/phy.h> #include <dt-bindings/regulator/qcom,rpmh-regulator.h> +#include <dt-bindings/usb/pd.h> #include "sm8250.dtsi" #include "pm8150.dtsi" #include "pm8150b.dtsi"
@@ -556,6 +557,45 @@ volume_down_state: volume-down-state { }; }; +&pm8150b_typec { + status = "okay"; + + vdd-pdphy-supply = <&vreg_l2a_3p1>; + + connector { + compatible = "usb-c-connector"; + + power-role = "sink"; + data-role = "device"; + self-powered; + + op-sink-microwatt = <15000000>; + sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM) + PDO_VAR(5000, 9000, 3000)>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + pm8150b_hs_in: endpoint { + remote-endpoint = <&usb_1_dwc3_hs_out>; + }; + }; + + port@1 { + reg = <1>; + + pm8150b_typec_mux: endpoint { + remote-endpoint = <&usb_1_qmpphy_out>; + }; + }; + }; + }; +}; + &pon { status = "okay"; };
@@ -684,6 +724,10 @@ &usb_1_dwc3 { dr_mode = "peripheral"; }; +&usb_1_dwc3_hs_out { + remote-endpoint = <&pm8150b_hs_in>; +}; + &usb_1_hsphy { status = "okay";
@@ -698,3 +742,7 @@ &usb_1_qmpphy { vdda-phy-supply = <&vreg_l18a_0p9>; vdda-pll-supply = <&vreg_l9a_1p2>; }; + +&usb_1_qmpphy_out { + remote-endpoint = <&pm8150b_typec_mux>; +};
Signature · 1 line
2.39.5
PATCH v2 10/10 arm64: dts: qcom: sm8250-lg-timelm: add QCA6390 Bluetooth
In reply to Abdur RofikDescribe the QCA6390 power sequencer with properly voltaged supplies and enable Bluetooth HCI on GENI UART6.
--- arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+)
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts +92 -0
@@ -67,6 +67,67 @@ key-assistant { }; }; + qca6390-pmu { + compatible = "qcom,qca6390-pmu"; + + pinctrl-names = "default"; + pinctrl-0 = <&bt_en_state>, <&wlan_en_state>; + + vddaon-supply = <&vreg_s6a_0p95>; + vddpmu-supply = <&vreg_s6a_0p95>; + vddrfa0p95-supply = <&vreg_s6a_0p95>; + vddrfa1p3-supply = <&vreg_s8c_1p35>; + vddrfa1p9-supply = <&vreg_s5a_1p9>; + vddpcie1p3-supply = <&vreg_s8c_1p35>; + vddpcie1p9-supply = <&vreg_s5a_1p9>; + vddio-supply = <&vreg_s4a_1p8>; + + wlan-enable-gpios = <&tlmm 20 GPIO_ACTIVE_HIGH>; + bt-enable-gpios = <&tlmm 21 GPIO_ACTIVE_HIGH>; + + regulators { + vreg_pmu_rfa_cmn: ldo0 { + regulator-name = "vreg_pmu_rfa_cmn"; + }; + + vreg_pmu_aon_0p59: ldo1 { + regulator-name = "vreg_pmu_aon_0p59"; + }; + + vreg_pmu_wlcx_0p8: ldo2 { + regulator-name = "vreg_pmu_wlcx_0p8"; + }; + + vreg_pmu_wlmx_0p85: ldo3 { + regulator-name = "vreg_pmu_wlmx_0p85"; + }; + + vreg_pmu_btcmx_0p85: ldo4 { + regulator-name = "vreg_pmu_btcmx_0p85"; + }; + + vreg_pmu_rfa_0p8: ldo5 { + regulator-name = "vreg_pmu_rfa_0p8"; + }; + + vreg_pmu_rfa_1p2: ldo6 { + regulator-name = "vreg_pmu_rfa_1p2"; + }; + + vreg_pmu_rfa_1p7: ldo7 { + regulator-name = "vreg_pmu_rfa_1p7"; + }; + + vreg_pmu_pcie_0p9: ldo8 { + regulator-name = "vreg_pmu_pcie_0p9"; + }; + + vreg_pmu_pcie_1p8: ldo9 { + regulator-name = "vreg_pmu_pcie_1p8"; + }; + }; + }; + reserved-memory { res_xbl_uefi_log_region: memory@80880000 { reg = <0x0 0x80880000 0x0 0x14000>;
@@ -639,6 +700,14 @@ &sdhc_2 { &tlmm { gpio-reserved-ranges = <40 4>, <52 4>; + bt_en_state: bt-enable-state { + pins = "gpio21"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + output-low; + }; + sdc2_default_state: sdc2-default-state { clk-pins { pins = "sdc2_clk";
@@ -692,6 +761,29 @@ ts_int_default: ts-int-default-state { drive-strength = <8>; bias-pull-up; }; + + wlan_en_state: wlan-enable-state { + pins = "gpio20"; + function = "gpio"; + drive-strength = <16>; + bias-pull-up; + output-low; + }; +}; + +&uart6 { + status = "okay"; + + bluetooth { + compatible = "qcom,qca6390-bt"; + + vddrfacmn-supply = <&vreg_pmu_rfa_cmn>; + vddaon-supply = <&vreg_pmu_aon_0p59>; + vddbtcmx-supply = <&vreg_pmu_btcmx_0p85>; + vddrfa0p8-supply = <&vreg_pmu_rfa_0p8>; + vddrfa1p2-supply = <&vreg_pmu_rfa_1p2>; + vddrfa1p7-supply = <&vreg_pmu_rfa_1p7>; + }; }; &uart12 {
Signature · 1 line
2.39.5