From e2636e2f51857c6d21d19a6429645035c062bae3 Mon Sep 17 00:00:00 2001 From: Miguel Fuertes Date: Sat, 11 Oct 2025 18:33:49 +0200 Subject: [PATCH] changes --- display.dts | 135 ++++++++++++++++++ display_kernel | 6 + msm89xx/config-6.12 | 8 +- ...4-dts-qcom-add-msm8916-generic-mf68e.patch | 77 +++++++++- 4 files changed, 219 insertions(+), 7 deletions(-) create mode 100644 display.dts create mode 100644 display_kernel diff --git a/display.dts b/display.dts new file mode 100644 index 0000000..854ef9c --- /dev/null +++ b/display.dts @@ -0,0 +1,135 @@ +// SPDX-License-Identifier: GPL-2.0-only + +/dts-v1/; + +#include "msm8916-ufi.dtsi" +#include + +/ { + model = "MF68E 4G LTE Mobile WiFi Router"; + compatible = "generic,mf68e", "qcom,msm8916"; + + bat: battery { + compatible = "simple-battery"; + voltage-min-design-microvolt = <3400000>; + voltage-max-design-microvolt = <4350000>; + energy-full-design-microwatt-hours = <11100000>; + charge-full-design-microamp-hours = <3000000>; + + ocv-capacity-celsius = <25>; + ocv-capacity-table-0 = <4330000 100>, <4265000 95>, + <4208000 90>, <4154000 85>, <4102000 80>, + <4063000 75>, <4006000 70>, <3972000 65>, + <3931000 60>, <3880000 55>, <3841000 50>, + <3817000 45>, <3798000 40>, <3783000 35>, + <3767000 30>, <3747000 25>, <3729000 20>, + <3700000 16>, <3687000 13>, <3683000 11>, + <3681000 10>, <3680000 9>, <3678000 8>, + <3674000 7>, <3666000 6>, <3641000 5>, + <3597000 4>, <3537000 3>, <3457000 2>, + <3336000 1>, <3000000 0>; + }; + + usb_id: usb-id { + compatible = "linux,extcon-usb-gpio"; + id-gpios = <&tlmm 110 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&usb_id_default>; + }; + + backlight: backlight { + compatible = "gpio-backlight"; + gpios = <&tlmm 98 GPIO_ACTIVE_HIGH>; + default-on; + }; +}; + +&pm8916_bms { + status = "okay"; + monitored-battery = <&bat>; + power-supplies = <&pm8916_charger>; +}; + +&pm8916_charger { + status = "okay"; + monitored-battery = <&bat>; + qcom,fast-charge-safe-current = <900000>; + qcom,fast-charge-safe-voltage = <4350000>; +}; + +/* Panel SPI ST7735S 128x128 */ +&spi5 { + status = "okay"; + + panel@0 { + compatible = "sitronix,st7735r"; + reg = <0>; + spi-max-frequency = <16000000>; + + reset-gpios = <&tlmm 25 GPIO_ACTIVE_LOW>; + dc-gpios = <&tlmm 24 GPIO_ACTIVE_HIGH>; + backlight = <&backlight>; + + width = <128>; + height = <128>; + rotation = <0>; + + vdd-supply = <&pm8916_l17>; + vddio-supply = <&pm8916_l6>; + + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&panel_default>; + pinctrl-1 = <&panel_sleep>; + }; +}; + +&usb { + status = "okay"; + extcon = <&usb_id>, <&usb_id>; +}; + +&usb_hs_phy { + extcon = <&usb_id>; +}; + +&tlmm { + usb_id_default: usb-id-default-state { + pins = "gpio110"; + function = "gpio"; + drive-strength = <8>; + bias-pull-up; + }; + + panel_default: panel-default-state { + reset-pins { + pins = "gpio25"; + function = "gpio"; + drive-strength = <8>; + bias-disable; + output-high; + }; + + dc-pins { + pins = "gpio24"; + function = "gpio"; + drive-strength = <8>; + bias-disable; + }; + + enable-pins { + pins = "gpio97"; + function = "gpio"; + drive-strength = <8>; + bias-disable; + output-high; + }; + }; + + panel_sleep: panel-sleep-state { + pins = "gpio24", "gpio25", "gpio97"; + function = "gpio"; + drive-strength = <2>; + bias-pull-down; + output-low; + }; +}; diff --git a/display_kernel b/display_kernel new file mode 100644 index 0000000..4664250 --- /dev/null +++ b/display_kernel @@ -0,0 +1,6 @@ +CONFIG_SPI=y +CONFIG_SPI_QUP=y +CONFIG_DRM_MIPI_DBI=y +CONFIG_TINYDRM=y +CONFIG_TINYDRM_ST7735R=m +CONFIG_BACKLIGHT_GPIO=y diff --git a/msm89xx/config-6.12 b/msm89xx/config-6.12 index b3de424..b73786f 100644 --- a/msm89xx/config-6.12 +++ b/msm89xx/config-6.12 @@ -323,6 +323,7 @@ CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y CONFIG_AUTOFS_FS=y CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BACKLIGHT_GPIO=y CONFIG_BACKLIGHT_PWM=y CONFIG_BATTERY_PM8916_BMS_VM=y CONFIG_BATTERY_PM8916_BMS=y @@ -467,6 +468,7 @@ CONFIG_DMA_SHARED_BUFFER=y CONFIG_DMA_VIRTUAL_CHANNELS=y CONFIG_DMADEVICES=y CONFIG_DNOTIFY=y +CONFIG_DRM_MIPI_DBI=y CONFIG_DST_CACHE=y CONFIG_DT_IDLE_GENPD=y CONFIG_DT_IDLE_STATES=y @@ -888,6 +890,8 @@ CONFIG_SPI_DYNAMIC=y CONFIG_SPI_GPIO=y CONFIG_SPI_MASTER=y CONFIG_SPI_QUP=y +CONFIG_SPI_QUP=y +CONFIG_SPI=y CONFIG_SPI=y CONFIG_SPLIT_PMD_PTLOCKS=y CONFIG_SPLIT_PTE_PTLOCKS=y @@ -926,6 +930,8 @@ CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_TIME_NS=y CONFIG_TIMER_OF=y CONFIG_TIMER_PROBE=y +CONFIG_TINYDRM_ST7735R=m +CONFIG_TINYDRM=y CONFIG_TOOLS_SUPPORT_RELR=y CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y @@ -991,4 +997,4 @@ CONFIG_ZLIB_INFLATE=y CONFIG_ZONE_DMA32=y CONFIG_ZSTD_COMMON=y CONFIG_ZSTD_COMPRESS=y -CONFIG_ZSTD_DECOMPRESS=y \ No newline at end of file +CONFIG_ZSTD_DECOMPRESS=y diff --git a/msm89xx/patches-6.12/802-arm64-dts-qcom-add-msm8916-generic-mf68e.patch b/msm89xx/patches-6.12/802-arm64-dts-qcom-add-msm8916-generic-mf68e.patch index 95af41f..cf9e355 100644 --- a/msm89xx/patches-6.12/802-arm64-dts-qcom-add-msm8916-generic-mf68e.patch +++ b/msm89xx/patches-6.12/802-arm64-dts-qcom-add-msm8916-generic-mf68e.patch @@ -1,15 +1,15 @@ # From: hkfuertes -# Date: Sat, 11 Oct 2025 15:45:00 +0200 -# Subject: [PATCH] arm64: dts: qcom: Add MF68E MiFi router +# Date: Sat, 11 Oct 2025 18:25:00 +0200 +# Subject: [PATCH] arm64: dts: qcom: Add MF68E MiFi router with ST7735S SPI display # # Add device tree for MF68E 4G LTE MiFi router based on MSM8916. +# Includes ST7735S 128x128 SPI display panel configuration. # # Signed-off-by: hkfuertes -Index: linux-6.12.51/arch/arm64/boot/dts/qcom/msm8916-generic-mf68e.dts -=================================================================== + --- /dev/null -+++ linux-6.12.51/arch/arm64/boot/dts/qcom/msm8916-generic-mf68e.dts -@@ -0,0 +1,70 @@ ++++ b/arch/arm64/boot/dts/qcom/msm8916-generic-mf68e.dts +@@ -0,0 +1,130 @@ +// SPDX-License-Identifier: GPL-2.0-only + +/dts-v1/; @@ -48,6 +48,12 @@ Index: linux-6.12.51/arch/arm64/boot/dts/qcom/msm8916-generic-mf68e.dts + pinctrl-names = "default"; + pinctrl-0 = <&usb_id_default>; + }; ++ ++ backlight: backlight { ++ compatible = "gpio-backlight"; ++ gpios = <&tlmm 98 GPIO_ACTIVE_HIGH>; ++ default-on; ++ }; +}; + +&pm8916_bms { @@ -63,6 +69,32 @@ Index: linux-6.12.51/arch/arm64/boot/dts/qcom/msm8916-generic-mf68e.dts + qcom,fast-charge-safe-voltage = <4350000>; +}; + ++/* ST7735S 128x128 SPI Display Panel */ ++&spi5 { ++ status = "okay"; ++ ++ panel@0 { ++ compatible = "sitronix,st7735r"; ++ reg = <0>; ++ spi-max-frequency = <16000000>; ++ ++ reset-gpios = <&tlmm 25 GPIO_ACTIVE_LOW>; ++ dc-gpios = <&tlmm 24 GPIO_ACTIVE_HIGH>; ++ backlight = <&backlight>; ++ ++ width = <128>; ++ height = <128>; ++ rotation = <0>; ++ ++ vdd-supply = <&pm8916_l17>; ++ vddio-supply = <&pm8916_l6>; ++ ++ pinctrl-names = "default", "sleep"; ++ pinctrl-0 = <&panel_default>; ++ pinctrl-1 = <&panel_sleep>; ++ }; ++}; ++ +&usb { + status = "okay"; + extcon = <&usb_id>, <&usb_id>; @@ -79,4 +111,37 @@ Index: linux-6.12.51/arch/arm64/boot/dts/qcom/msm8916-generic-mf68e.dts + drive-strength = <8>; + bias-pull-up; + }; ++ ++ panel_default: panel-default-state { ++ reset-pins { ++ pins = "gpio25"; ++ function = "gpio"; ++ drive-strength = <8>; ++ bias-disable; ++ output-high; ++ }; ++ ++ dc-pins { ++ pins = "gpio24"; ++ function = "gpio"; ++ drive-strength = <8>; ++ bias-disable; ++ }; ++ ++ enable-pins { ++ pins = "gpio97"; ++ function = "gpio"; ++ drive-strength = <8>; ++ bias-disable; ++ output-high; ++ }; ++ }; ++ ++ panel_sleep: panel-sleep-state { ++ pins = "gpio24", "gpio25", "gpio97"; ++ function = "gpio"; ++ drive-strength = <2>; ++ bias-pull-down; ++ output-low; ++ }; +};