* [PATCH v2 00/10] arm64: dts: qcom: add LG V60 ThinQ 5G (timelm) support
@ 2026-11-18 12:07 Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 01/10] dt-bindings: arm: qcom: add LG V60 ThinQ 5G (timelm) Abdur Rofik
` (9 more replies)
0 siblings, 10 replies; 12+ messages in thread
From: Abdur Rofik @ 2026-11-18 12:07 UTC (permalink / raw)
To: linux-arm-msm
Cc: devicetree, phone-devel, dri-devel, linux-input, linux-kernel,
Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Dmitry Torokhov, Ivon Argel,
Abdur Rofik
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 <rofikcoga@gmail.com>" 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
--
2.39.5
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 01/10] dt-bindings: arm: qcom: add LG V60 ThinQ 5G (timelm)
2026-11-18 12:07 [PATCH v2 00/10] arm64: dts: qcom: add LG V60 ThinQ 5G (timelm) support Abdur Rofik
@ 2026-11-18 12:07 ` Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 02/10] arm64: dts: qcom: add LG V60 ThinQ 5G (timelm) support Abdur Rofik
` (8 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Abdur Rofik @ 2026-11-18 12:07 UTC (permalink / raw)
To: linux-arm-msm
Cc: devicetree, phone-devel, dri-devel, linux-input, linux-kernel,
Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Dmitry Torokhov, Ivon Argel,
Abdur Rofik
Document the compatible for the LG V60 ThinQ 5G (timelm), based on
the Qualcomm SM8250 platform.
Signed-off-by: Abdur Rofik <rofikcoga@gmail.com>
---
Documentation/devicetree/bindings/arm/qcom.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/arm/qcom.yaml b/Documentation/devicetree/bindings/arm/qcom.yaml
index 121ca557ce1ef..85635a871e7f3 100644
--- a/Documentation/devicetree/bindings/arm/qcom.yaml
+++ b/Documentation/devicetree/bindings/arm/qcom.yaml
@@ -1139,6 +1139,7 @@ properties:
- items:
- enum:
+ - lg,timelm
- qcom,qrb5165-rb5
- qcom,sm8250-hdk
- qcom,sm8250-mtp
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 02/10] arm64: dts: qcom: add LG V60 ThinQ 5G (timelm) support
2026-11-18 12:07 [PATCH v2 00/10] arm64: dts: qcom: add LG V60 ThinQ 5G (timelm) support Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 01/10] dt-bindings: arm: qcom: add LG V60 ThinQ 5G (timelm) Abdur Rofik
@ 2026-11-18 12:07 ` Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 03/10] dt-bindings: display: panel: add LG SW43103 Abdur Rofik
` (7 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Abdur Rofik @ 2026-11-18 12:07 UTC (permalink / raw)
To: linux-arm-msm
Cc: devicetree, phone-devel, dri-devel, linux-input, linux-kernel,
Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Dmitry Torokhov, Ivon Argel,
Abdur Rofik
Add 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
Signed-off-by: Abdur Rofik <rofikcoga@gmail.com>
---
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
diff --git a/MAINTAINERS b/MAINTAINERS
index ccbcdc0799b9f..80c1bfb66f8cc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -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 <rofikcoga@gmail.com>
+L: linux-arm-msm@vger.kernel.org
+S: Maintained
+F: arch/arm64/boot/dts/qcom/sm8250-lg-timelm*
+
LG2160 MEDIA DRIVER
M: Michael Krufky <mkrufky@linuxtv.org>
L: linux-media@vger.kernel.org
diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
index 88230c4e00ea9..84ed4bf513960 100644
--- a/arch/arm64/boot/dts/qcom/Makefile
+++ b/arch/arm64/boot/dts/qcom/Makefile
@@ -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
diff --git a/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts b/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts
new file mode 100644
index 0000000000000..1b2b67486fee7
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts
@@ -0,0 +1,615 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2026 Abdur Rofik <rofikcoga@gmail.com>
+ * Device Tree for LG V60 ThinQ 5G (timelm / LM-V600)
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+#include "sm8250.dtsi"
+#include "pm8150.dtsi"
+#include "pm8150b.dtsi"
+#include "pm8150l.dtsi"
+
+/ {
+ model = "LG V60 ThinQ 5G";
+ compatible = "lg,timelm", "qcom,sm8250";
+ chassis-type = "handset";
+
+ aliases {
+ serial0 = &uart12;
+ };
+
+ chosen {
+ stdout-path = "serial0:115200n8";
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges;
+
+ 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>;
+ };
+ };
+
+ gpio-keys {
+ compatible = "gpio-keys";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&volume_down_state>, <&google_assist_state>;
+
+ key-vol-down {
+ label = "Volume Down";
+ gpios = <&pm8150_gpios 6 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_VOLUMEDOWN>;
+ debounce-interval = <15>;
+ linux,can-disable;
+ wakeup-source;
+ };
+
+ key-assistant {
+ label = "Google Assistant";
+ gpios = <&pm8150_gpios 1 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_ASSISTANT>;
+ debounce-interval = <15>;
+ linux,can-disable;
+ wakeup-source;
+ };
+ };
+
+ reserved-memory {
+ res_xbl_uefi_log_region: memory@80880000 {
+ reg = <0x0 0x80880000 0x0 0x14000>;
+ no-map;
+ };
+
+ cont_splash_mem: memory@9c000000 {
+ reg = <0x0 0x9c000000 0x0 0x1200000>;
+ no-map;
+ };
+
+ dfps_data_mem: memory@9e300000 {
+ reg = <0x0 0x9e300000 0x0 0x100000>;
+ no-map;
+ };
+
+ ramoops: ramoops@b0000000 {
+ compatible = "ramoops";
+ reg = <0x0 0xb0000000 0x0 0x280000>;
+ record-size = <0x40000>;
+ console-size = <0x40000>;
+ ftrace-size = <0x40000>;
+ pmsg-size = <0x1c0000>;
+ no-map;
+ };
+ };
+
+ vph_pwr: vph-pwr-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "vph_pwr";
+ regulator-min-microvolt = <3700000>;
+ regulator-max-microvolt = <3700000>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+};
+
+&apps_rsc {
+ regulators-0 {
+ compatible = "qcom,pm8150-rpmh-regulators";
+ qcom,pmic-id = "a";
+
+ vdd-s1-supply = <&vph_pwr>;
+ vdd-s2-supply = <&vph_pwr>;
+ vdd-s3-supply = <&vph_pwr>;
+ vdd-s4-supply = <&vph_pwr>;
+ vdd-s5-supply = <&vph_pwr>;
+ vdd-s6-supply = <&vph_pwr>;
+ vdd-s7-supply = <&vph_pwr>;
+ vdd-s8-supply = <&vph_pwr>;
+ vdd-s9-supply = <&vph_pwr>;
+ vdd-s10-supply = <&vph_pwr>;
+ vdd-l1-l8-l11-supply = <&vreg_s6c_0p88>;
+ vdd-l2-l10-supply = <&vreg_bob>;
+ vdd-l3-l4-l5-l18-supply = <&vreg_s6a_0p95>;
+ vdd-l6-l9-supply = <&vreg_s8c_1p35>;
+ vdd-l7-l12-l14-l15-supply = <&vreg_s5a_1p9>;
+ vdd-l13-l16-l17-supply = <&vreg_bob>;
+
+ vreg_s4a_1p8: smps4 {
+ regulator-name = "vreg_s4a_1p8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ regulator-allow-set-load;
+ regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
+ RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_s5a_1p9: smps5 {
+ regulator-name = "vreg_s5a_1p9";
+ regulator-min-microvolt = <1900000>;
+ regulator-max-microvolt = <2040000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_s6a_0p95: smps6 {
+ regulator-name = "vreg_s6a_0p95";
+ regulator-min-microvolt = <950000>;
+ regulator-max-microvolt = <1128000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l1a_0p88: ldo1 {
+ regulator-name = "vreg_l1a_0p88";
+ regulator-min-microvolt = <880000>;
+ regulator-max-microvolt = <880000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l2a_3p1: ldo2 {
+ regulator-name = "vreg_l2a_3p1";
+ regulator-min-microvolt = <3072000>;
+ regulator-max-microvolt = <3072000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l3a_0p8: ldo3 {
+ regulator-name = "vreg_l3a_0p8";
+ regulator-min-microvolt = <800000>;
+ regulator-max-microvolt = <800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l5a_0p88: ldo5 {
+ regulator-name = "vreg_l5a_0p88";
+ regulator-min-microvolt = <880000>;
+ regulator-max-microvolt = <880000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l6a_1p2: ldo6 {
+ regulator-name = "vreg_l6a_1p2";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ regulator-allow-set-load;
+ regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
+ RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l7a_1p7: ldo7 {
+ regulator-name = "vreg_l7a_1p7";
+ regulator-min-microvolt = <1704000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l9a_1p2: ldo9 {
+ regulator-name = "vreg_l9a_1p2";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l10a_1p8: ldo10 {
+ regulator-name = "vreg_l10a_1p8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l12a_1p8: ldo12 {
+ regulator-name = "vreg_l12a_1p8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l13a_ts: ldo13 {
+ regulator-name = "vreg_l13a_ts";
+ regulator-min-microvolt = <3000000>;
+ regulator-max-microvolt = <3000000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l14a_1p8: ldo14 {
+ regulator-name = "vreg_l14a_1p8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l15a_1p8: ldo15 {
+ regulator-name = "vreg_l15a_1p8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l16a_2p7: ldo16 {
+ regulator-name = "vreg_l16a_2p7";
+ regulator-min-microvolt = <2704000>;
+ regulator-max-microvolt = <2960000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l17a_3p0: ldo17 {
+ regulator-name = "vreg_l17a_3p0";
+ regulator-min-microvolt = <2950000>;
+ regulator-max-microvolt = <3008000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ regulator-allow-set-load;
+ regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
+ RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l18a_0p9: ldo18 {
+ regulator-name = "vreg_l18a_0p9";
+ regulator-min-microvolt = <880000>;
+ regulator-max-microvolt = <912000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+ };
+
+ regulators-1 {
+ compatible = "qcom,pm8150l-rpmh-regulators";
+ qcom,pmic-id = "c";
+
+ vdd-s1-supply = <&vph_pwr>;
+ vdd-s2-supply = <&vph_pwr>;
+ vdd-s3-supply = <&vph_pwr>;
+ vdd-s4-supply = <&vph_pwr>;
+ vdd-s5-supply = <&vph_pwr>;
+ vdd-s6-supply = <&vph_pwr>;
+ vdd-s7-supply = <&vph_pwr>;
+ vdd-s8-supply = <&vph_pwr>;
+ vdd-l1-l8-supply = <&vreg_s4a_1p8>;
+ vdd-l2-l3-supply = <&vreg_s8c_1p35>;
+ vdd-l4-l5-l6-supply = <&vreg_bob>;
+ vdd-l7-l11-supply = <&vreg_bob>;
+ vdd-l9-l10-supply = <&vreg_bob>;
+ vdd-bob-supply = <&vph_pwr>;
+
+ 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>;
+ };
+
+ vreg_s8c_1p35: smps8 {
+ regulator-name = "vreg_s8c_1p35";
+ regulator-min-microvolt = <1350000>;
+ regulator-max-microvolt = <1400000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l1c_1p8: ldo1 {
+ regulator-name = "vreg_l1c_1p8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l2c_1p2: ldo2 {
+ regulator-name = "vreg_l2c_1p2";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l3c_1p2: ldo3 {
+ regulator-name = "vreg_l3c_1p2";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l4c_1p7: ldo4 {
+ regulator-name = "vreg_l4c_1p7";
+ regulator-min-microvolt = <1704000>;
+ regulator-max-microvolt = <3000000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l5c_1p8: ldo5 {
+ regulator-name = "vreg_l5c_1p8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l6c_2p9: ldo6 {
+ regulator-name = "vreg_l6c_2p9";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <2960000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l7c_2p85: ldo7 {
+ regulator-name = "vreg_l7c_2p85";
+ regulator-min-microvolt = <2856000>;
+ regulator-max-microvolt = <3104000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l8c_1p8: ldo8 {
+ regulator-name = "vreg_l8c_1p8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l9c_2p9: ldo9 {
+ regulator-name = "vreg_l9c_2p9";
+ regulator-min-microvolt = <2704000>;
+ regulator-max-microvolt = <2960000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l10c_3p3: ldo10 {
+ regulator-name = "vreg_l10c_3p3";
+ regulator-min-microvolt = <3000000>;
+ regulator-max-microvolt = <3304000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l11c_3p0: ldo11 {
+ regulator-name = "vreg_l11c_3p0";
+ regulator-min-microvolt = <3000000>;
+ regulator-max-microvolt = <3312000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+ };
+
+ regulators-2 {
+ compatible = "qcom,pm8009-rpmh-regulators";
+ qcom,pmic-id = "f";
+
+ vdd-s1-supply = <&vph_pwr>;
+ vdd-s2-supply = <&vreg_bob>;
+ vdd-l2-supply = <&vreg_s8c_1p35>;
+ vdd-l5-l6-supply = <&vreg_bob>;
+ vdd-l7-supply = <&vreg_s4a_1p8>;
+
+ vreg_s1f_1p2: smps1 {
+ regulator-name = "vreg_s1f_1p2";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_s2f_0p5: smps2 {
+ regulator-name = "vreg_s2f_0p5";
+ regulator-min-microvolt = <512000>;
+ regulator-max-microvolt = <1100000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l2f_1p3: ldo2 {
+ regulator-name = "vreg_l2f_1p3";
+ regulator-min-microvolt = <1304000>;
+ regulator-max-microvolt = <1304000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l5f_2p8: ldo5 {
+ regulator-name = "vreg_l5f_2p8";
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l6f_2p8: ldo6 {
+ regulator-name = "vreg_l6f_2p8";
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l7f_1p8: ldo7 {
+ regulator-name = "vreg_l7f_1p8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+ };
+};
+
+&cdsp {
+ status = "okay";
+};
+
+&gpi_dma0 {
+ status = "okay";
+};
+
+&gpi_dma1 {
+ status = "okay";
+};
+
+&gpi_dma2 {
+ status = "okay";
+};
+
+&gmu {
+ status = "okay";
+};
+
+&gpu {
+ status = "okay";
+
+ zap-shader {
+ firmware-name = "qcom/sm8250/a650_zap.mbn";
+ };
+};
+
+&pm8150_gpios {
+ google_assist_state: google-assist-state {
+ pins = "gpio1";
+ function = "normal";
+ input-enable;
+ bias-pull-up;
+ power-source = <0>;
+ };
+
+ volume_down_state: volume-down-state {
+ pins = "gpio6";
+ function = "normal";
+ input-enable;
+ bias-pull-up;
+ power-source = <0>;
+ };
+};
+
+&pon {
+ status = "okay";
+};
+
+&pon_pwrkey {
+ status = "okay";
+};
+
+&pon_resin {
+ status = "okay";
+ linux,code = <KEY_VOLUMEUP>;
+};
+
+&qupv3_id_0 {
+ status = "okay";
+};
+
+&qupv3_id_1 {
+ status = "okay";
+};
+
+&qupv3_id_2 {
+ status = "okay";
+};
+
+&sdhc_2 {
+ status = "okay";
+
+ pinctrl-names = "default", "sleep";
+ pinctrl-0 = <&sdc2_default_state>, <&sdc2_card_det_n>;
+ pinctrl-1 = <&sdc2_sleep_state>, <&sdc2_card_det_n>;
+
+ cd-gpios = <&tlmm 77 GPIO_ACTIVE_LOW>;
+ vmmc-supply = <&vreg_l9c_2p9>;
+ vqmmc-supply = <&vreg_l6c_2p9>;
+ bus-width = <4>;
+ no-sdio;
+ no-mmc;
+};
+
+&tlmm {
+ gpio-reserved-ranges = <40 4>, <52 4>;
+
+ sdc2_default_state: sdc2-default-state {
+ clk-pins {
+ pins = "sdc2_clk";
+ drive-strength = <16>;
+ bias-disable;
+ };
+
+ cmd-pins {
+ pins = "sdc2_cmd";
+ drive-strength = <16>;
+ bias-pull-up;
+ };
+
+ data-pins {
+ pins = "sdc2_data";
+ drive-strength = <16>;
+ bias-pull-up;
+ };
+ };
+
+ sdc2_sleep_state: sdc2-sleep-state {
+ clk-pins {
+ pins = "sdc2_clk";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ cmd-pins {
+ pins = "sdc2_cmd";
+ drive-strength = <2>;
+ bias-pull-up;
+ };
+
+ data-pins {
+ pins = "sdc2_data";
+ drive-strength = <2>;
+ bias-pull-up;
+ };
+ };
+
+ sdc2_card_det_n: sd-card-det-n-state {
+ pins = "gpio77";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-pull-up;
+ };
+};
+
+&uart12 {
+ status = "okay";
+};
+
+&ufs_mem_hc {
+ status = "okay";
+
+ vcc-supply = <&vreg_l17a_3p0>;
+ vcc-max-microamp = <800000>;
+ vccq-supply = <&vreg_l6a_1p2>;
+ vccq-max-microamp = <800000>;
+ vccq2-supply = <&vreg_s4a_1p8>;
+ vccq2-max-microamp = <800000>;
+};
+
+&ufs_mem_phy {
+ status = "okay";
+
+ vdda-phy-supply = <&vreg_l5a_0p88>;
+ vdda-pll-supply = <&vreg_l9a_1p2>;
+};
+
+&usb_1 {
+ status = "okay";
+};
+
+&usb_1_dwc3 {
+ dr_mode = "peripheral";
+};
+
+&usb_1_hsphy {
+ status = "okay";
+
+ vdda-pll-supply = <&vreg_l5a_0p88>;
+ vdda18-supply = <&vreg_l12a_1p8>;
+ vdda33-supply = <&vreg_l2a_3p1>;
+};
+
+&usb_1_qmpphy {
+ status = "okay";
+
+ vdda-phy-supply = <&vreg_l18a_0p9>;
+ vdda-pll-supply = <&vreg_l9a_1p2>;
+};
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 03/10] dt-bindings: display: panel: add LG SW43103
2026-11-18 12:07 [PATCH v2 00/10] arm64: dts: qcom: add LG V60 ThinQ 5G (timelm) support Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 01/10] dt-bindings: arm: qcom: add LG V60 ThinQ 5G (timelm) Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 02/10] arm64: dts: qcom: add LG V60 ThinQ 5G (timelm) support Abdur Rofik
@ 2026-11-18 12:07 ` Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 04/10] drm/panel: add LG SW43103 panel driver Abdur Rofik
` (6 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Abdur Rofik @ 2026-11-18 12:07 UTC (permalink / raw)
To: linux-arm-msm
Cc: devicetree, phone-devel, dri-devel, linux-input, linux-kernel,
Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Dmitry Torokhov, Ivon Argel,
Abdur Rofik
Document the SW43103 FHD+ AMOLED panel used by the LG V60. The panel
uses DSI command mode with DSC and DCS backlight control.
Signed-off-by: Abdur Rofik <rofikcoga@gmail.com>
---
.../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
diff --git a/Documentation/devicetree/bindings/display/panel/lg,sw43103.yaml b/Documentation/devicetree/bindings/display/panel/lg,sw43103.yaml
new file mode 100644
index 0000000000000..7f44ac6672bda
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/lg,sw43103.yaml
@@ -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 <rofikcoga@gmail.com>
+
+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>;
+ };
+ };
+ };
+ };
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index 80c1bfb66f8cc..594863936fb5c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -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 <rofikcoga@gmail.com>
+S: Maintained
+F: Documentation/devicetree/bindings/display/panel/lg,sw43103.yaml
+
LG V60 THINQ 5G (TIMELM) SUPPORT
M: Abdur Rofik <rofikcoga@gmail.com>
L: linux-arm-msm@vger.kernel.org
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 04/10] drm/panel: add LG SW43103 panel driver
2026-11-18 12:07 [PATCH v2 00/10] arm64: dts: qcom: add LG V60 ThinQ 5G (timelm) support Abdur Rofik
` (2 preceding siblings ...)
2026-11-18 12:07 ` [PATCH v2 03/10] dt-bindings: display: panel: add LG SW43103 Abdur Rofik
@ 2026-11-18 12:07 ` Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 05/10] dt-bindings: input: touchscreen: add Silicon Works SW42902 Abdur Rofik
` (5 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Abdur Rofik @ 2026-11-18 12:07 UTC (permalink / raw)
To: linux-arm-msm
Cc: devicetree, phone-devel, dri-devel, linux-input, linux-kernel,
Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Dmitry Torokhov, Ivon Argel,
Abdur Rofik
Add support for the 1080x2460 SW43103 AMOLED panel. Handle power and
reset sequencing, DCS backlight control, and the DSC configuration
required by the panel.
Signed-off-by: Abdur Rofik <rofikcoga@gmail.com>
---
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
diff --git a/MAINTAINERS b/MAINTAINERS
index 594863936fb5c..28e4aac18d44a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -15215,6 +15215,7 @@ LG SW43103 PANEL DRIVER
M: Abdur Rofik <rofikcoga@gmail.com>
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 <rofikcoga@gmail.com>
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 7a520b4d60fef..a3b86364d6825 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index da5175909d540..c6f3280cd5828 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -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
diff --git a/drivers/gpu/drm/panel/panel-lg-sw43103.c b/drivers/gpu/drm/panel/panel-lg-sw43103.c
new file mode 100644
index 0000000000000..94a6bd905b713
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-lg-sw43103.c
@@ -0,0 +1,587 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2026 Abdur Rofik <rofikcoga@gmail.com>
+ * Panel driver for LG / BOE SW43103 FHD+ DSC Command Mode AMOLED panel
+ * (LG V60 ThinQ 5G - timelm)
+ */
+
+#include <linux/backlight.h>
+#include <linux/delay.h>
+#include <linux/gpio/consumer.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/regulator/consumer.h>
+
+#include <video/mipi_display.h>
+
+#include <drm/drm_mipi_dsi.h>
+#include <drm/drm_panel.h>
+#include <drm/drm_probe_helper.h>
+#include <drm/display/drm_dsc.h>
+#include <drm/display/drm_dsc_helper.h>
+
+#define NUM_SUPPLIES 2
+
+struct sw43103_panel {
+ struct drm_panel base;
+ struct mipi_dsi_device *link;
+
+ struct regulator_bulk_data supplies[NUM_SUPPLIES];
+
+ struct gpio_desc *reset_gpio;
+ struct gpio_desc *enable_gpio;
+
+ struct drm_dsc_config dsc;
+ bool prepared;
+};
+
+static inline struct sw43103_panel *to_panel_info(struct drm_panel *panel)
+{
+ return container_of(panel, struct sw43103_panel, base);
+}
+
+static void sw43103_init_sequence(struct mipi_dsi_multi_context *ctx)
+{
+ /* Manufacturer Command Protect Unlock */
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb0, 0xa1);
+
+ /* Column Address Set: 0 to 1079 (0x0437) */
+ mipi_dsi_dcs_write_seq_multi(ctx, MIPI_DCS_SET_COLUMN_ADDRESS,
+ 0x00, 0x00, 0x04, 0x37);
+
+ /* Page Address Set: 0 to 2459 (0x099b) */
+ mipi_dsi_dcs_write_seq_multi(ctx, MIPI_DCS_SET_PAGE_ADDRESS,
+ 0x00, 0x00, 0x09, 0x9b);
+
+ /* HBM Mode2 */
+ mipi_dsi_dcs_write_seq_multi(ctx, 0x55, 0x08);
+
+ /* Partial Address Row Set: 0 to 2459 */
+ mipi_dsi_dcs_write_seq_multi(ctx, MIPI_DCS_SET_PARTIAL_ROWS,
+ 0x00, 0x00, 0x09, 0x9b);
+
+ /* Partial Address Column Set: 0 to 1079 */
+ mipi_dsi_dcs_write_seq_multi(ctx, MIPI_DCS_SET_PARTIAL_COLUMNS,
+ 0x00, 0x00, 0x04, 0x37);
+
+ /* Tear Effect On */
+ mipi_dsi_dcs_set_tear_on_multi(ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
+
+ /* Manufacturer Command Protect */
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb0, 0xca);
+
+ /* Sleep Out */
+ mipi_dsi_dcs_exit_sleep_mode_multi(ctx);
+ mipi_dsi_msleep(ctx, 120);
+
+ /* MCS Lv1 */
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb0, 0xa1);
+
+ /* Workaround for AOD VBP Issue */
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb3,
+ 0x91, 0x49, 0x00, 0x0f, 0x0c, 0x00,
+ 0x0f, 0x0c, 0x28, 0x00, 0x02, 0x14);
+
+ /* Global IRC */
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb0, 0xa5);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb1,
+ 0x61, 0xc0, 0x00, 0x00, 0x00, 0x10, 0xff);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb2,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xea, 0x6b, 0x60, 0x58, 0x50, 0x49, 0x41,
+ 0x3a, 0x33, 0x2c, 0x25, 0x1e, 0x17, 0x11, 0x0b,
+ 0x05, 0x6c, 0x61, 0x58, 0x50, 0x48, 0x40, 0x38,
+ 0x31, 0x29, 0x22, 0x1b, 0x14, 0x0d, 0x06, 0x00,
+ 0x62, 0x57, 0x4d, 0x44, 0x3c);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb3,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x34, 0x2d, 0x25, 0x1e, 0x16, 0x0f, 0x08,
+ 0x01, 0x00, 0x57, 0x4c, 0x42, 0x3a, 0x31, 0x29,
+ 0x22, 0x1a, 0x12, 0x0b, 0x03, 0x00, 0x00, 0x4c,
+ 0x42, 0x38, 0x2e, 0x26, 0x1e, 0x16, 0x0e, 0x07,
+ 0x00, 0x00, 0x00, 0x45, 0x39);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb4,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x2f, 0x25, 0x1c, 0x14, 0x0c, 0x04, 0x00,
+ 0x00, 0x00, 0x34, 0x2a, 0x21, 0x19, 0x10, 0x09,
+ 0x01, 0x00, 0x00, 0x00, 0x2e, 0x23, 0x19, 0x10,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x25, 0x1b, 0x11,
+ 0x08, 0x00, 0x00, 0x00, 0x00);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb5,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f,
+ 0x13, 0x09, 0x00, 0x00, 0x00, 0x00, 0x16, 0x0c,
+ 0x03, 0x00, 0x00, 0x00, 0x0e, 0x06, 0x00, 0x00,
+ 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb6,
+ 0x44, 0x31, 0x10, 0x00, 0x00, 0x64, 0x00, 0x59,
+ 0xf3, 0x10, 0x80, 0x30, 0x20, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00);
+
+ /* Global IRC DCC Control */
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xd1,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x10, 0x02,
+ 0x00, 0x00, 0x00);
+
+ /* V256 Enable */
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb0, 0xa3);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xee, 0x02, 0x00, 0x00);
+
+ /* Gamma Band 1 */
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb8,
+ 0x00, 0x00, 0x83, 0xff, 0x5c, 0x96, 0xf2, 0x29,
+ 0x84, 0xb4, 0xd2, 0x77, 0x70, 0xa3, 0xcb, 0xe4);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb9,
+ 0x00, 0x00, 0x02, 0xff, 0x4d, 0xd7, 0xb4, 0xfe,
+ 0x66, 0xa0, 0xca, 0x6f, 0x6f, 0xa8, 0xce, 0xe6);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xba,
+ 0x00, 0x00, 0x84, 0xff, 0x89, 0x3d, 0xec, 0x28,
+ 0x83, 0xae, 0xd2, 0x7e, 0x77, 0xa8, 0xcb, 0xe0);
+
+ /* Gamma Band 2 */
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xbb,
+ 0x00, 0x13, 0x83, 0xff, 0x61, 0x66, 0xed, 0x24,
+ 0x81, 0xaf, 0xd4, 0x7b, 0x6b, 0xa8, 0xce, 0xe4);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xbc,
+ 0x00, 0x13, 0x02, 0xff, 0x53, 0xb4, 0xad, 0xf4,
+ 0x5e, 0x9d, 0xc7, 0x71, 0x68, 0xaa, 0xcf, 0xe6);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xbd,
+ 0x00, 0x13, 0x84, 0xff, 0x8a, 0x05, 0xea, 0x23,
+ 0x80, 0xaf, 0xd3, 0x82, 0x74, 0xab, 0xce, 0xe3);
+
+ /* Gamma Band 3 */
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xbe,
+ 0x00, 0x37, 0x83, 0xff, 0x77, 0x5c, 0xdd, 0x15,
+ 0x79, 0xaf, 0xcf, 0x72, 0x6f, 0xa7, 0xce, 0xe5);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xbf,
+ 0x00, 0x37, 0x02, 0xff, 0x65, 0xaa, 0xa0, 0xe5,
+ 0x52, 0x96, 0xc4, 0x64, 0x6b, 0xa9, 0xcf, 0xe7);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xc0,
+ 0x00, 0x37, 0x83, 0xff, 0x9d, 0xfd, 0xd8, 0x1c,
+ 0x7c, 0xac, 0xd0, 0x7b, 0x78, 0xac, 0xce, 0xe4);
+
+ /* Gamma Band 4 */
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xc1,
+ 0x02, 0x24, 0x82, 0xff, 0x7e, 0xf1, 0xcc, 0x05,
+ 0x6e, 0xa4, 0xca, 0x6f, 0x6e, 0xab, 0xd2, 0xe8);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xc2,
+ 0x02, 0x24, 0x02, 0xff, 0x6e, 0x58, 0xa3, 0xd5,
+ 0x3d, 0x8c, 0xbc, 0x59, 0x66, 0xaa, 0xd2, 0xe8);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xc3,
+ 0x02, 0x24, 0x83, 0xff, 0x9e, 0x7e, 0xc5, 0x10,
+ 0x72, 0xab, 0xcd, 0x78, 0x79, 0xb0, 0xd5, 0xe9);
+
+ /* Gamma Band 5 */
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xc4,
+ 0x04, 0x0f, 0x02, 0xff, 0x88, 0xa4, 0xc4, 0xe9,
+ 0x60, 0xa0, 0xc8, 0x64, 0x6b, 0xac, 0xd3, 0xe9);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xc5,
+ 0x04, 0x0f, 0x02, 0xff, 0x7a, 0x20, 0xac, 0xca,
+ 0x30, 0x7d, 0xb6, 0x4a, 0x5c, 0xa8, 0xd2, 0xe9);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xc6,
+ 0x04, 0x0f, 0x03, 0xff, 0xa8, 0x2e, 0xbd, 0xfa,
+ 0x65, 0xa3, 0xcc, 0x6e, 0x76, 0xb3, 0xd6, 0xea);
+
+ /* Gamma Band 6 */
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xc7,
+ 0x06, 0x12, 0x02, 0xff, 0x99, 0x7d, 0xbc, 0xde,
+ 0x51, 0x8e, 0xc6, 0x58, 0x63, 0xaa, 0xd2, 0xe9);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xc8,
+ 0x06, 0x12, 0x02, 0xff, 0x8d, 0x02, 0x9a, 0xcf,
+ 0x1e, 0x6b, 0xb0, 0x37, 0x50, 0xa3, 0xd0, 0xe7);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xc9,
+ 0x06, 0x12, 0x03, 0xff, 0xbc, 0x04, 0xb3, 0xdb,
+ 0x63, 0x8f, 0xc6, 0x67, 0x6f, 0xb1, 0xd5, 0xea);
+
+ /* Gamma Band 7 */
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xca,
+ 0x08, 0x0a, 0x02, 0xff, 0xa3, 0x44, 0xca, 0xda,
+ 0x2d, 0x8d, 0xbc, 0x4c, 0x5a, 0xa7, 0xd0, 0xea);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xcb,
+ 0x08, 0x0a, 0x01, 0xff, 0x97, 0xd5, 0xb4, 0xdb,
+ 0x21, 0x6f, 0xa1, 0x24, 0x42, 0x9d, 0xcd, 0xe7);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xcc,
+ 0x08, 0x0a, 0x02, 0xff, 0xc6, 0xc5, 0xb8, 0xc7,
+ 0x46, 0x98, 0xbd, 0x5a, 0x68, 0xaf, 0xd4, 0xea);
+
+ /* Gamma Band 8 */
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xcd,
+ 0x0c, 0x02, 0x01, 0xff, 0xb2, 0xfd, 0xac, 0xd5,
+ 0x25, 0x6d, 0xb7, 0x3b, 0x45, 0x9e, 0xd0, 0xe6);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xce,
+ 0x0c, 0x02, 0x01, 0xff, 0xa5, 0x9a, 0xac, 0xe2,
+ 0x31, 0x68, 0xab, 0x0e, 0x2a, 0x90, 0xc9, 0xe3);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xcf,
+ 0x0c, 0x02, 0x02, 0xff, 0xd5, 0x74, 0xad, 0xe6,
+ 0x2f, 0x7c, 0xbf, 0x43, 0x58, 0xa6, 0xd3, 0xe9);
+
+ /* Gamma Band 9 */
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xd0,
+ 0x12, 0x00, 0x01, 0xff, 0xc8, 0x97, 0x01, 0xb6,
+ 0x0b, 0x82, 0xab, 0x0a, 0x26, 0x8d, 0xc7, 0xe4);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xd1,
+ 0x12, 0x00, 0x01, 0xff, 0xbe, 0x4a, 0x01, 0xc0,
+ 0x44, 0x80, 0xb3, 0x03, 0x06, 0x76, 0xba, 0xde);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xd2,
+ 0x12, 0x00, 0x02, 0xff, 0xf2, 0x00, 0x01, 0xb1,
+ 0x11, 0x5f, 0xa8, 0x16, 0x30, 0x94, 0xc8, 0xe7);
+
+ /* Gamma Band 10 */
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xd3,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xd4,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xd5,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb0, 0xa5);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xcd,
+ 0x10, 0x12, 0x01, 0x5a, 0x90, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x5d);
+
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb0, 0xa1);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0x55,
+ 0x08, 0x00, 0x82, 0xa8, 0x1c, 0x61, 0x0a, 0x90,
+ 0x04, 0x00);
+
+ /* Dimming Frame Setting */
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb0, 0xa3);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb3,
+ 0x1f, 0x63, 0x00, 0x00, 0x06);
+
+ /* Default Color Mode (Natural) */
+ mipi_dsi_dcs_write_seq_multi(ctx, 0x53, 0x84);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb0, 0xa4);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb4,
+ 0x00, 0x03, 0x05, 0xaf, 0x03, 0x05, 0xaf, 0x03,
+ 0x05, 0xaf);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb5,
+ 0x00, 0xff, 0x94, 0x1f, 0xae, 0x37, 0xae, 0x1f,
+ 0x94, 0x00, 0xfb, 0x94, 0x1e, 0xad, 0x35, 0xab,
+ 0x1c, 0x90, 0x00, 0xdd, 0x8f, 0x16, 0x9f, 0x24,
+ 0x97, 0x04, 0x75);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb7,
+ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+ 0x80, 0x80, 0x80, 0x80);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb8,
+ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+ 0x80, 0x80, 0x80, 0x80);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb9,
+ 0x35, 0x2d, 0x2d, 0x37, 0x34, 0x35, 0x36, 0x36,
+ 0x36, 0x2d, 0x35, 0x33);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xba,
+ 0x80, 0x80, 0x80, 0x80, 0x88, 0x80, 0x80, 0x80,
+ 0x80, 0x80, 0x80, 0x7d);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xbb,
+ 0x80, 0x5a, 0x7b, 0x95, 0x65, 0x70, 0x96, 0x90,
+ 0x90, 0x90, 0x83, 0x72);
+
+ /* DCC(GCC) Off */
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb0, 0xa1);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xc2,
+ 0xf3, 0x20, 0x00, 0x00, 0x1d);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xb0, 0xa5);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xd1,
+ 0x0a, 0x00, 0x01);
+ mipi_dsi_msleep(ctx, 20);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xd1,
+ 0x02, 0x00, 0x01);
+ mipi_dsi_dcs_write_seq_multi(ctx, 0xd1,
+ 0x00, 0x00, 0x01);
+}
+
+static int sw43103_program(struct drm_panel *panel)
+{
+ struct sw43103_panel *sw43103 = to_panel_info(panel);
+ struct mipi_dsi_multi_context ctx = { .dsi = sw43103->link };
+ struct drm_dsc_picture_parameter_set pps;
+
+ sw43103_init_sequence(&ctx);
+
+ /* Transmit PPS in high speed mode */
+ sw43103->link->mode_flags &= ~MIPI_DSI_MODE_LPM;
+
+ drm_dsc_pps_payload_pack(&pps, sw43103->link->dsc);
+
+ mipi_dsi_picture_parameter_set_multi(&ctx, &pps);
+
+ /* Switch back to low power mode for DSC compression enable */
+ sw43103->link->mode_flags |= MIPI_DSI_MODE_LPM;
+
+ /* Enable DSC compression mode with PPS 0 */
+ mipi_dsi_compression_mode_ext_multi(&ctx, true,
+ MIPI_DSI_COMPRESSION_DSC, 0);
+
+ return ctx.accum_err;
+}
+
+static int sw43103_prepare(struct drm_panel *panel)
+{
+ struct sw43103_panel *ctx = to_panel_info(panel);
+ int ret;
+
+ ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+ if (ret < 0)
+ return ret;
+
+ if (ctx->enable_gpio)
+ gpiod_set_value_cansleep(ctx->enable_gpio, 1);
+
+ usleep_range(5000, 6000);
+
+ /* Hardware reset sequence: deassert, assert 2ms, deassert */
+ gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+ usleep_range(10000, 11000);
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+ usleep_range(2000, 3000);
+ gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+ usleep_range(10000, 11000);
+
+ ret = sw43103_program(panel);
+ if (ret)
+ goto poweroff;
+
+ ctx->prepared = true;
+ return 0;
+
+poweroff:
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+ if (ctx->enable_gpio)
+ gpiod_set_value_cansleep(ctx->enable_gpio, 0);
+ regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+ return ret;
+}
+
+static int sw43103_enable(struct drm_panel *panel)
+{
+ struct sw43103_panel *sw43103 = to_panel_info(panel);
+ struct mipi_dsi_multi_context ctx = { .dsi = sw43103->link };
+
+ /* Display On */
+ mipi_dsi_dcs_set_display_on_multi(&ctx);
+ mipi_dsi_msleep(&ctx, 20);
+
+ return ctx.accum_err;
+}
+
+static int sw43103_disable(struct drm_panel *panel)
+{
+ struct sw43103_panel *sw43103 = to_panel_info(panel);
+ struct mipi_dsi_multi_context ctx = { .dsi = sw43103->link };
+
+ /* Display Off (0x28) */
+ mipi_dsi_dcs_set_display_off_multi(&ctx);
+ mipi_dsi_msleep(&ctx, 20);
+
+ /* Sleep In (0x10) */
+ mipi_dsi_dcs_enter_sleep_mode_multi(&ctx);
+ mipi_dsi_msleep(&ctx, 80);
+
+ return ctx.accum_err;
+}
+
+static int sw43103_unprepare(struct drm_panel *panel)
+{
+ struct sw43103_panel *sw43103 = to_panel_info(panel);
+
+ sw43103->prepared = false;
+
+ gpiod_set_value_cansleep(sw43103->reset_gpio, 1);
+ if (sw43103->enable_gpio)
+ gpiod_set_value_cansleep(sw43103->enable_gpio, 0);
+
+ return regulator_bulk_disable(ARRAY_SIZE(sw43103->supplies), sw43103->supplies);
+}
+
+static const struct drm_display_mode sw43103_mode = {
+ .clock = 179177,
+ .hdisplay = 1080,
+ .hsync_start = 1080 + 50,
+ .hsync_end = 1080 + 50 + 30,
+ .htotal = 1080 + 50 + 30 + 50,
+ .vdisplay = 2460,
+ .vsync_start = 2460 + 4,
+ .vsync_end = 2460 + 4 + 2,
+ .vtotal = 2460 + 4 + 2 + 2,
+ .width_mm = 69,
+ .height_mm = 158,
+ .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
+};
+
+static int sw43103_get_modes(struct drm_panel *panel,
+ struct drm_connector *connector)
+{
+ return drm_connector_helper_get_modes_fixed(connector, &sw43103_mode);
+}
+
+static int sw43103_backlight_update_status(struct backlight_device *bl)
+{
+ struct sw43103_panel *ctx = bl_get_data(bl);
+ struct mipi_dsi_device *dsi = ctx->link;
+ u16 brightness = backlight_get_brightness(bl);
+ u8 ctrl = 0x2c;
+ int ret;
+
+ if (!ctx->prepared)
+ return 0;
+
+ ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_WRITE_CONTROL_DISPLAY, &ctrl, sizeof(ctrl));
+ if (ret < 0)
+ return ret;
+
+ return mipi_dsi_dcs_set_display_brightness_large(dsi, brightness);
+}
+
+static const struct backlight_ops sw43103_backlight_ops = {
+ .update_status = sw43103_backlight_update_status,
+};
+
+static int sw43103_backlight_init(struct sw43103_panel *ctx)
+{
+ struct device *dev = &ctx->link->dev;
+ const struct backlight_properties props = {
+ .type = BACKLIGHT_PLATFORM,
+ .brightness = 1024,
+ .max_brightness = 2047,
+ };
+
+ ctx->base.backlight = devm_backlight_device_register(dev, dev_name(dev), dev,
+ ctx,
+ &sw43103_backlight_ops,
+ &props);
+
+ if (IS_ERR(ctx->base.backlight))
+ return dev_err_probe(dev, PTR_ERR(ctx->base.backlight),
+ "Failed to create backlight\n");
+
+ return 0;
+}
+
+static const struct drm_panel_funcs sw43103_funcs = {
+ .prepare = sw43103_prepare,
+ .unprepare = sw43103_unprepare,
+ .enable = sw43103_enable,
+ .disable = sw43103_disable,
+ .get_modes = sw43103_get_modes,
+};
+
+static const struct of_device_id sw43103_of_match[] = {
+ { .compatible = "lg,sw43103" },
+ { .compatible = "boe,sw43103" },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, sw43103_of_match);
+
+static int sw43103_add(struct sw43103_panel *ctx)
+{
+ struct device *dev = &ctx->link->dev;
+ int ret;
+
+ ctx->supplies[0].supply = "vddi"; /* 1.8 V */
+ ctx->supplies[0].init_load_uA = 62000;
+ ctx->supplies[1].supply = "vpnl"; /* 3.0 V */
+ ctx->supplies[1].init_load_uA = 857000;
+
+ ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies),
+ ctx->supplies);
+ if (ret < 0)
+ return ret;
+
+ ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
+ if (IS_ERR(ctx->reset_gpio)) {
+ ret = PTR_ERR(ctx->reset_gpio);
+ return dev_err_probe(dev, ret, "cannot get reset gpio\n");
+ }
+
+ ctx->enable_gpio = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_LOW);
+ if (IS_ERR(ctx->enable_gpio)) {
+ ret = PTR_ERR(ctx->enable_gpio);
+ return dev_err_probe(dev, ret, "cannot get enable gpio\n");
+ }
+
+ ret = sw43103_backlight_init(ctx);
+ if (ret < 0)
+ return ret;
+
+ ctx->base.prepare_prev_first = true;
+
+ drm_panel_add(&ctx->base);
+ return 0;
+}
+
+static int sw43103_probe(struct mipi_dsi_device *dsi)
+{
+ struct sw43103_panel *ctx;
+ int ret;
+
+ ctx = devm_drm_panel_alloc(&dsi->dev, __typeof(*ctx), base,
+ &sw43103_funcs, DRM_MODE_CONNECTOR_DSI);
+ if (IS_ERR(ctx))
+ return PTR_ERR(ctx);
+
+ dsi->mode_flags = MIPI_DSI_MODE_LPM;
+ dsi->format = MIPI_DSI_FMT_RGB888;
+ dsi->lanes = 4;
+
+ ctx->link = dsi;
+ mipi_dsi_set_drvdata(dsi, ctx);
+
+ ret = sw43103_add(ctx);
+ if (ret < 0)
+ return ret;
+
+ /* The panel works only in DSC mode. Set DSC params. */
+ ctx->dsc.dsc_version_major = 1;
+ ctx->dsc.dsc_version_minor = 1;
+
+ /* slice_count * slice_width == 2 * 540 = 1080 */
+ ctx->dsc.pic_width = 1080;
+ ctx->dsc.pic_height = 2460;
+ ctx->dsc.slice_height = 60;
+ ctx->dsc.slice_width = 540;
+ ctx->dsc.slice_count = 2;
+ ctx->dsc.slice_chunk_size = 540;
+ ctx->dsc.bits_per_component = 8;
+ ctx->dsc.bits_per_pixel = 8 << 4;
+ ctx->dsc.block_pred_enable = true;
+
+ dsi->dsc = &ctx->dsc;
+
+ ret = mipi_dsi_attach(dsi);
+ if (ret)
+ drm_panel_remove(&ctx->base);
+
+ return ret;
+}
+
+static void sw43103_remove(struct mipi_dsi_device *dsi)
+{
+ struct sw43103_panel *ctx = mipi_dsi_get_drvdata(dsi);
+ int ret;
+
+ ret = mipi_dsi_detach(dsi);
+ if (ret < 0)
+ dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret);
+
+ drm_panel_remove(&ctx->base);
+}
+
+static struct mipi_dsi_driver sw43103_driver = {
+ .driver = {
+ .name = "panel-lg-sw43103",
+ .of_match_table = sw43103_of_match,
+ },
+ .probe = sw43103_probe,
+ .remove = sw43103_remove,
+};
+module_mipi_dsi_driver(sw43103_driver);
+
+MODULE_AUTHOR("Abdur Rofik <rofikcoga@gmail.com>");
+MODULE_DESCRIPTION("LG / BOE SW43103 FHD+ DSC Command Mode AMOLED panel");
+MODULE_LICENSE("GPL");
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 05/10] dt-bindings: input: touchscreen: add Silicon Works SW42902
2026-11-18 12:07 [PATCH v2 00/10] arm64: dts: qcom: add LG V60 ThinQ 5G (timelm) support Abdur Rofik
` (3 preceding siblings ...)
2026-11-18 12:07 ` [PATCH v2 04/10] drm/panel: add LG SW43103 panel driver Abdur Rofik
@ 2026-11-18 12:07 ` Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 06/10] Input: touchscreen: add Silicon Works SW42902 support Abdur Rofik
` (4 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Abdur Rofik @ 2026-11-18 12:07 UTC (permalink / raw)
To: linux-arm-msm
Cc: devicetree, phone-devel, dri-devel, linux-input, linux-kernel,
Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Dmitry Torokhov, Ivon Argel,
Abdur Rofik
Document the Silicon Works SW42902 I2C touchscreen controller, including
its interrupt, reset GPIO, power supplies, and panel touch properties.
Signed-off-by: Abdur Rofik <rofikcoga@gmail.com>
---
.../input/touchscreen/lg,sw42902.yaml | 73 +++++++++++++++++++
MAINTAINERS | 6 ++
2 files changed, 79 insertions(+)
create mode 100644 Documentation/devicetree/bindings/input/touchscreen/lg,sw42902.yaml
diff --git a/Documentation/devicetree/bindings/input/touchscreen/lg,sw42902.yaml b/Documentation/devicetree/bindings/input/touchscreen/lg,sw42902.yaml
new file mode 100644
index 0000000000000..c5ec3bf4e545b
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/lg,sw42902.yaml
@@ -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 <rofikcoga@gmail.com>
+
+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>;
+ };
+ };
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index 28e4aac18d44a..a29019d984393 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -25835,6 +25835,12 @@ S: Maintained
F: Documentation/fb/sm712fb.rst
F: drivers/video/fbdev/sm712*
+SILICON WORKS SW42902 TOUCHSCREEN DRIVER
+M: Abdur Rofik <rofikcoga@gmail.com>
+L: linux-input@vger.kernel.org
+S: Maintained
+F: Documentation/devicetree/bindings/input/touchscreen/lg,sw42902.yaml
+
SILVACO I3C DUAL-ROLE MASTER
M: Miquel Raynal <miquel.raynal@bootlin.com>
M: Frank Li <Frank.Li@nxp.com>
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 06/10] Input: touchscreen: add Silicon Works SW42902 support
2026-11-18 12:07 [PATCH v2 00/10] arm64: dts: qcom: add LG V60 ThinQ 5G (timelm) support Abdur Rofik
` (4 preceding siblings ...)
2026-11-18 12:07 ` [PATCH v2 05/10] dt-bindings: input: touchscreen: add Silicon Works SW42902 Abdur Rofik
@ 2026-11-18 12:07 ` Abdur Rofik
2026-11-18 12:17 ` sashiko-bot
2026-11-18 12:07 ` [PATCH v2 07/10] arm64: dts: qcom: sm8250-lg-timelm: enable SW43103 panel Abdur Rofik
` (3 subsequent siblings)
9 siblings, 1 reply; 12+ messages in thread
From: Abdur Rofik @ 2026-11-18 12:07 UTC (permalink / raw)
To: linux-arm-msm
Cc: devicetree, phone-devel, dri-devel, linux-input, linux-kernel,
Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Dmitry Torokhov, Ivon Argel,
Abdur Rofik
Add 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.
Signed-off-by: Abdur Rofik <rofikcoga@gmail.com>
---
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
diff --git a/MAINTAINERS b/MAINTAINERS
index a29019d984393..7a1904f6d0fad 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -25840,6 +25840,7 @@ M: Abdur Rofik <rofikcoga@gmail.com>
L: linux-input@vger.kernel.org
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 <miquel.raynal@bootlin.com>
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index 9b9ae8ac3f7fd..14c6cd999ec92 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -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
diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile
index bfd9de83389d8..1ee2590014535 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -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
diff --git a/drivers/input/touchscreen/sw42902.c b/drivers/input/touchscreen/sw42902.c
new file mode 100644
index 0000000000000..a68bd850bf2e2
--- /dev/null
+++ b/drivers/input/touchscreen/sw42902.c
@@ -0,0 +1,355 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2026 Abdur Rofik <rofikcoga@gmail.com>
+ * Silicon Works SW42902 touchscreen, as used by LG V60 (timelm).
+ * Register protocol and report layout derived from the LGE vendor driver
+ * (Copyright (C) 2015 LGE, author hoyeon.jang@lge.com).
+ * This driver uses the controller's existing flash firmware.
+ */
+
+#include <linux/delay.h>
+#include <linux/gpio/consumer.h>
+#include <linux/i2c.h>
+#include <linux/input/mt.h>
+#include <linux/input/touchscreen.h>
+#include <linux/interrupt.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/pm.h>
+#include <linux/regulator/consumer.h>
+#include <linux/slab.h>
+#include <linux/unaligned.h>
+
+#define SW42902_MAX_CONTACTS 10
+#define SW42902_REPORT_SIZE (12 + 24 + 12 * SW42902_MAX_CONTACTS)
+#define SW42902_IC_STATUS 0x600
+#define SW42902_VERSION 0x642
+#define SW42902_DEVICE_CTL 0xc00
+#define SW42902_INTERRUPT_CTL 0xc01
+#define SW42902_DRIVING_CTL 0xc03
+#define SW42902_SERIAL_SPI_EN 0xfe4
+#define SW42902_DRIVING_STOP 0x04
+#define SW42902_DRIVING_U3 0x8303
+
+static const char * const sw42902_supplies[] = {
+ "vcl",
+ "vdd",
+};
+
+struct sw42902 {
+ struct i2c_client *client;
+ struct input_dev *input;
+ struct touchscreen_properties prop;
+ struct gpio_desc *reset;
+ struct regulator_bulk_data supplies[ARRAY_SIZE(sw42902_supplies)];
+ bool suspended;
+ u8 report[SW42902_REPORT_SIZE];
+};
+
+static int sw42902_read(struct sw42902 *ts, u16 reg, void *data, u16 len)
+{
+ u8 command[] = { (reg >> 8) | (len > 4 ? 0x20 : 0), reg & 0xff };
+ struct i2c_msg msgs[] = {
+ { .addr = ts->client->addr, .len = sizeof(command),
+ .buf = command },
+ { .addr = ts->client->addr, .flags = I2C_M_RD,
+ .len = len, .buf = data },
+ };
+ int error;
+
+ error = i2c_transfer(ts->client->adapter, msgs, ARRAY_SIZE(msgs));
+ if (error < 0)
+ return error;
+ return error == ARRAY_SIZE(msgs) ? 0 : -EIO;
+}
+
+static int sw42902_write(struct sw42902 *ts, u16 reg, u32 value)
+{
+ u8 command[6] = { 0x40 | (reg >> 8), reg & 0xff };
+ int error;
+
+ put_unaligned_le32(value, command + 2);
+ error = i2c_master_send(ts->client, command, sizeof(command));
+ if (error < 0)
+ return error;
+ return error == sizeof(command) ? 0 : -EIO;
+}
+
+static void sw42902_release_contacts(struct sw42902 *ts)
+{
+ int i;
+
+ for (i = 0; i < SW42902_MAX_CONTACTS; i++) {
+ input_mt_slot(ts->input, i);
+ input_mt_report_slot_state(ts->input, MT_TOOL_FINGER, false);
+ }
+ input_mt_sync_frame(ts->input);
+ input_sync(ts->input);
+}
+
+static irqreturn_t sw42902_irq(int irq, void *data)
+{
+ struct sw42902 *ts = data;
+ struct input_dev *input = ts->input;
+ u32 status, header;
+ unsigned int count, i;
+ int error;
+
+ error = sw42902_read(ts, SW42902_IC_STATUS, ts->report,
+ sizeof(ts->report));
+ if (error) {
+ dev_err_ratelimited(&ts->client->dev, "report read failed: %d\n", error);
+ sw42902_release_contacts(ts);
+ return IRQ_HANDLED;
+ }
+
+ status = get_unaligned_le32(ts->report + 4);
+ header = get_unaligned_le32(ts->report + 8);
+ /* Only normal absolute-touch reports; ignore pen/gesture/debug IRQs. */
+ if (((status >> 16) & 0xf) != 5 || (header & 0xff))
+ return IRQ_HANDLED;
+
+ count = (header >> 8) & 0x1f;
+ if (count > SW42902_MAX_CONTACTS) {
+ dev_warn_ratelimited(&ts->client->dev, "invalid contact count: %u\n", count);
+ sw42902_release_contacts(ts);
+ return IRQ_HANDLED;
+ }
+
+ /* A palm report cancels all active fingers. */
+ if (header & BIT(31)) {
+ sw42902_release_contacts(ts);
+ return IRQ_HANDLED;
+ }
+
+ /* Pre-scan for palm report to avoid queueing partial touch events */
+ for (i = 0; i < count; i++) {
+ const u8 *contact = ts->report + 36 + 12 * i;
+ u32 a = get_unaligned_le32(contact);
+
+ if ((a & 0x1f) == 15) {
+ sw42902_release_contacts(ts);
+ return IRQ_HANDLED;
+ }
+ }
+
+ for (i = 0; i < count; i++) {
+ const u8 *contact = ts->report + 36 + 12 * i;
+ u32 a = get_unaligned_le32(contact);
+ u32 b = get_unaligned_le32(contact + 4);
+ u32 c = get_unaligned_le32(contact + 8);
+ unsigned int id = a & 0x1f;
+ unsigned int event = (a >> 16) & 3;
+
+ if (id >= SW42902_MAX_CONTACTS || (event != 1 && event != 2))
+ continue;
+
+ input_mt_slot(input, id);
+ input_mt_report_slot_state(input, MT_TOOL_FINGER, true);
+ touchscreen_report_pos(input, &ts->prop, a >> 18, b & 0x3fff, true);
+ input_report_abs(input, ABS_MT_PRESSURE, (b >> 14) & 0xff);
+ input_report_abs(input, ABS_MT_TOUCH_MAJOR, (c >> 4) & 0x3fff);
+ input_report_abs(input, ABS_MT_TOUCH_MINOR, c >> 18);
+ }
+
+ input_mt_sync_frame(input);
+ input_sync(input);
+ return IRQ_HANDLED;
+}
+
+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;
+
+ usleep_range(10000, 11000);
+ gpiod_set_value_cansleep(ts->reset, 0);
+ /* Docomo downstream DT specifies a 90 ms hardware reset delay. */
+ msleep(90);
+
+ return 0;
+}
+
+static int sw42902_start(struct sw42902 *ts)
+{
+ u8 version[4];
+ int error;
+
+ error = sw42902_read(ts, SW42902_VERSION, version, sizeof(version));
+ if (error)
+ return error;
+ if (version[2] != 10 || (version[3] & 0xf) != 4) {
+ dev_err(&ts->client->dev, "unexpected chip/protocol: %u/%u\n",
+ version[2], version[3] & 0xf);
+ return -ENODEV;
+ }
+
+ error = sw42902_write(ts, SW42902_SERIAL_SPI_EN, 0);
+ if (error)
+ return error;
+ error = sw42902_write(ts, SW42902_DEVICE_CTL, 1);
+ if (error)
+ return error;
+ error = sw42902_write(ts, SW42902_INTERRUPT_CTL, 1);
+ if (error)
+ return error;
+ error = sw42902_write(ts, SW42902_DRIVING_CTL, SW42902_DRIVING_STOP);
+ if (error)
+ return error;
+ msleep(30);
+ error = sw42902_write(ts, SW42902_DRIVING_CTL, SW42902_DRIVING_U3);
+ if (error)
+ return error;
+
+ return 0;
+}
+
+static int sw42902_probe(struct i2c_client *client)
+{
+ struct device *dev = &client->dev;
+ struct sw42902 *ts;
+ struct input_dev *input;
+ int error, i;
+
+ if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
+ return -EOPNOTSUPP;
+ if (client->irq <= 0)
+ return dev_err_probe(dev, -EINVAL, "missing interrupt\n");
+
+ ts = devm_kzalloc(dev, sizeof(*ts), GFP_KERNEL);
+ if (!ts)
+ return -ENOMEM;
+ ts->client = client;
+ i2c_set_clientdata(client, ts);
+
+ ts->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
+ if (IS_ERR(ts->reset))
+ return dev_err_probe(dev, PTR_ERR(ts->reset), "reset GPIO\n");
+
+ for (i = 0; i < ARRAY_SIZE(sw42902_supplies); i++)
+ ts->supplies[i].supply = sw42902_supplies[i];
+
+ 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;
+ ts->input = input;
+ input->name = "Silicon Works SW42902";
+ input->id.bustype = BUS_I2C;
+ input_set_abs_params(input, ABS_MT_POSITION_X, 0, 1079, 0, 0);
+ input_set_abs_params(input, ABS_MT_POSITION_Y, 0, 2459, 0, 0);
+ input_set_abs_params(input, ABS_MT_PRESSURE, 0, 255, 0, 0);
+ input_set_abs_params(input, ABS_MT_TOUCH_MAJOR, 0, 16383, 0, 0);
+ input_set_abs_params(input, ABS_MT_TOUCH_MINOR, 0, 16383, 0, 0);
+ touchscreen_parse_properties(input, true, &ts->prop);
+ error = input_mt_init_slots(input, SW42902_MAX_CONTACTS,
+ INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED);
+ if (error)
+ return error;
+ 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;
+
+ error = sw42902_start(ts);
+ if (error)
+ return dev_err_probe(dev, error, "controller initialization failed\n");
+ error = input_register_device(input);
+ if (error)
+ return error;
+ enable_irq(client->irq);
+ dev_info(dev, "SW42902 initialized using existing flash firmware\n");
+ return 0;
+}
+
+static int sw42902_suspend(struct device *dev)
+{
+ struct sw42902 *ts = i2c_get_clientdata(to_i2c_client(dev));
+
+ if (ts->suspended)
+ return 0;
+
+ disable_irq(ts->client->irq);
+ sw42902_release_contacts(ts);
+ sw42902_write(ts, SW42902_DRIVING_CTL, SW42902_DRIVING_STOP);
+ sw42902_power_off(ts);
+ ts->suspended = true;
+
+ return 0;
+}
+
+static int sw42902_resume(struct device *dev)
+{
+ struct sw42902 *ts = i2c_get_clientdata(to_i2c_client(dev));
+ int error;
+
+ if (!ts->suspended)
+ return 0;
+
+ error = sw42902_power_on(ts);
+ if (error)
+ return error;
+
+ error = sw42902_start(ts);
+ if (error) {
+ sw42902_power_off(ts);
+ return error;
+ }
+ enable_irq(ts->client->irq);
+ ts->suspended = false;
+
+ return 0;
+}
+
+static DEFINE_SIMPLE_DEV_PM_OPS(sw42902_pm_ops, sw42902_suspend, sw42902_resume);
+
+static const struct of_device_id sw42902_of_match[] = {
+ { .compatible = "lg,sw42902" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, sw42902_of_match);
+
+static const struct i2c_device_id sw42902_ids[] = {
+ { .name = "sw42902" },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, sw42902_ids);
+
+static struct i2c_driver sw42902_driver = {
+ .driver = {
+ .name = "sw42902",
+ .of_match_table = sw42902_of_match,
+ .pm = pm_sleep_ptr(&sw42902_pm_ops),
+ },
+ .probe = sw42902_probe,
+ .id_table = sw42902_ids,
+};
+module_i2c_driver(sw42902_driver);
+
+MODULE_AUTHOR("Abdur Rofik <rofikcoga@gmail.com>");
+MODULE_DESCRIPTION("Silicon Works SW42902 touchscreen driver");
+MODULE_LICENSE("GPL");
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 07/10] arm64: dts: qcom: sm8250-lg-timelm: enable SW43103 panel
2026-11-18 12:07 [PATCH v2 00/10] arm64: dts: qcom: add LG V60 ThinQ 5G (timelm) support Abdur Rofik
` (5 preceding siblings ...)
2026-11-18 12:07 ` [PATCH v2 06/10] Input: touchscreen: add Silicon Works SW42902 support Abdur Rofik
@ 2026-11-18 12:07 ` Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 08/10] arm64: dts: qcom: sm8250-lg-timelm: add SW42902 touchscreen Abdur Rofik
` (2 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Abdur Rofik @ 2026-11-18 12:07 UTC (permalink / raw)
To: linux-arm-msm
Cc: devicetree, phone-devel, dri-devel, linux-input, linux-kernel,
Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Dmitry Torokhov, Ivon Argel,
Abdur Rofik
Enable MDSS, DSI0, and its PHY. Attach the SW43103 panel with its power
rails, enable and reset GPIOs, and four-lane DSI link.
Signed-off-by: Abdur Rofik <rofikcoga@gmail.com>
---
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts | 37 +++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts b/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts
index 1b2b67486fee7..d307a52cd0e62 100644
--- a/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts
+++ b/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts
@@ -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";
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 08/10] arm64: dts: qcom: sm8250-lg-timelm: add SW42902 touchscreen
2026-11-18 12:07 [PATCH v2 00/10] arm64: dts: qcom: add LG V60 ThinQ 5G (timelm) support Abdur Rofik
` (6 preceding siblings ...)
2026-11-18 12:07 ` [PATCH v2 07/10] arm64: dts: qcom: sm8250-lg-timelm: enable SW43103 panel Abdur Rofik
@ 2026-11-18 12:07 ` Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 09/10] arm64: dts: qcom: sm8250-lg-timelm: enable USB Type-C Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 10/10] arm64: dts: qcom: sm8250-lg-timelm: add QCA6390 Bluetooth Abdur Rofik
9 siblings, 0 replies; 12+ messages in thread
From: Abdur Rofik @ 2026-11-18 12:07 UTC (permalink / raw)
To: linux-arm-msm
Cc: devicetree, phone-devel, dri-devel, linux-input, linux-kernel,
Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Dmitry Torokhov, Ivon Argel,
Abdur Rofik
Describe the SW42902 touchscreen on GENI I2C13 with its interrupt,
reset, regulator supplies, pinctrl, and native 1080x2460 touch area.
Signed-off-by: Abdur Rofik <rofikcoga@gmail.com>
---
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts | 48 +++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts b/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts
index d307a52cd0e62..be5b894b677bb 100644
--- a/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts
+++ b/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts
@@ -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 {
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 09/10] arm64: dts: qcom: sm8250-lg-timelm: enable USB Type-C
2026-11-18 12:07 [PATCH v2 00/10] arm64: dts: qcom: add LG V60 ThinQ 5G (timelm) support Abdur Rofik
` (7 preceding siblings ...)
2026-11-18 12:07 ` [PATCH v2 08/10] arm64: dts: qcom: sm8250-lg-timelm: add SW42902 touchscreen Abdur Rofik
@ 2026-11-18 12:07 ` Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 10/10] arm64: dts: qcom: sm8250-lg-timelm: add QCA6390 Bluetooth Abdur Rofik
9 siblings, 0 replies; 12+ messages in thread
From: Abdur Rofik @ 2026-11-18 12:07 UTC (permalink / raw)
To: linux-arm-msm
Cc: devicetree, phone-devel, dri-devel, linux-input, linux-kernel,
Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Dmitry Torokhov, Ivon Argel,
Abdur Rofik
Enable 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.
Signed-off-by: Abdur Rofik <rofikcoga@gmail.com>
---
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts | 48 +++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts b/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts
index be5b894b677bb..12ca5ea921fff 100644
--- a/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts
+++ b/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts
@@ -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>;
+};
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 10/10] arm64: dts: qcom: sm8250-lg-timelm: add QCA6390 Bluetooth
2026-11-18 12:07 [PATCH v2 00/10] arm64: dts: qcom: add LG V60 ThinQ 5G (timelm) support Abdur Rofik
` (8 preceding siblings ...)
2026-11-18 12:07 ` [PATCH v2 09/10] arm64: dts: qcom: sm8250-lg-timelm: enable USB Type-C Abdur Rofik
@ 2026-11-18 12:07 ` Abdur Rofik
9 siblings, 0 replies; 12+ messages in thread
From: Abdur Rofik @ 2026-11-18 12:07 UTC (permalink / raw)
To: linux-arm-msm
Cc: devicetree, phone-devel, dri-devel, linux-input, linux-kernel,
Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Dmitry Torokhov, Ivon Argel,
Abdur Rofik
Describe the QCA6390 power sequencer with properly voltaged supplies
and enable Bluetooth HCI on GENI UART6.
Signed-off-by: Abdur Rofik <rofikcoga@gmail.com>
---
arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts | 92 +++++++++++++++++++
1 file changed, 92 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts b/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts
index 12ca5ea921fff..3356099696a5e 100644
--- a/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts
+++ b/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts
@@ -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 {
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v2 06/10] Input: touchscreen: add Silicon Works SW42902 support
2026-11-18 12:07 ` [PATCH v2 06/10] Input: touchscreen: add Silicon Works SW42902 support Abdur Rofik
@ 2026-11-18 12:17 ` sashiko-bot
0 siblings, 0 replies; 12+ messages in thread
From: sashiko-bot @ 2026-11-18 12:17 UTC (permalink / raw)
To: Abdur Rofik
Cc: devicetree, dri-devel, linux-input, robh, conor+dt,
dmitry.torokhov
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 <rofikcoga@gmail.com>
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.
> diff --git a/drivers/input/touchscreen/sw42902.c b/drivers/input/touchscreen/sw42902.c
> new file mode 100644
> index 0000000000000..a68bd850bf2e2
> --- /dev/null
> +++ b/drivers/input/touchscreen/sw42902.c
[ ... ]
> +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;
[ ... ]
> +static int sw42902_probe(struct i2c_client *client)
> +{
[ ... ]
> + 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;
[ ... ]
> + 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.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261118120714.31505-1-rofikcoga@gmail.com?part=6
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2026-11-18 12:17 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18 12:07 [PATCH v2 00/10] arm64: dts: qcom: add LG V60 ThinQ 5G (timelm) support Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 01/10] dt-bindings: arm: qcom: add LG V60 ThinQ 5G (timelm) Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 02/10] arm64: dts: qcom: add LG V60 ThinQ 5G (timelm) support Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 03/10] dt-bindings: display: panel: add LG SW43103 Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 04/10] drm/panel: add LG SW43103 panel driver Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 05/10] dt-bindings: input: touchscreen: add Silicon Works SW42902 Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 06/10] Input: touchscreen: add Silicon Works SW42902 support Abdur Rofik
2026-11-18 12:17 ` sashiko-bot
2026-11-18 12:07 ` [PATCH v2 07/10] arm64: dts: qcom: sm8250-lg-timelm: enable SW43103 panel Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 08/10] arm64: dts: qcom: sm8250-lg-timelm: add SW42902 touchscreen Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 09/10] arm64: dts: qcom: sm8250-lg-timelm: enable USB Type-C Abdur Rofik
2026-11-18 12:07 ` [PATCH v2 10/10] arm64: dts: qcom: sm8250-lg-timelm: add QCA6390 Bluetooth Abdur Rofik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox