From c8f3f35a76edb67b78ebf513bd1a11ce94f3626c Mon Sep 17 00:00:00 2001 From: Erikas Bitovtas Date: Wed, 8 Oct 2025 21:20:19 +0300 Subject: [PATCH 1/4] UPSTREAM: dt-bindings: arm: qcom: Add Asus ZenFone 2 Laser/Selfie Add a compatible for Asus ZenFone 2 Laser/Selfie (1080p) Signed-off-by: Erikas Bitovtas Acked-by: Rob Herring (Arm) Link: https://lore.kernel.org/r/20251008182106.217340-2-xerikasxx@gmail.com Signed-off-by: Bjorn Andersson --- 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 ae43b35565808e..f25d5ae65279a5 100644 --- a/Documentation/devicetree/bindings/arm/qcom.yaml +++ b/Documentation/devicetree/bindings/arm/qcom.yaml @@ -182,6 +182,7 @@ properties: - items: - enum: + - asus,z00t - huawei,kiwi - longcheer,l9100 - samsung,a7 From bd077d9f66b84947b79f98f4fcd716a11abe8489 Mon Sep 17 00:00:00 2001 From: Erikas Bitovtas Date: Wed, 8 Oct 2025 21:20:20 +0300 Subject: [PATCH 2/4] UPSTREAM: arm64: dts: qcom: msm8939-asus-z00t: add initial device tree Add an initial device tree for Asus ZenFone 2 Laser/Selfie. This includes support for: - UART - USB - Internal storage - MicroSD - Volume keys - Touchscreen: Focaltech FT5306 - Accelerometer: Invensense MPU6515 - Magnetometer: Asahi Kasei AK09911 - Vibrator - Audio input and output - Modem Signed-off-by: Erikas Bitovtas Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20251008182106.217340-3-xerikasxx@gmail.com Signed-off-by: Bjorn Andersson --- arch/arm64/boot/dts/qcom/Makefile | 1 + .../arm64/boot/dts/qcom/msm8939-asus-z00t.dts | 256 ++++++++++++++++++ 2 files changed, 257 insertions(+) create mode 100644 arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile index 032632b97b0fb2..9cbe31b78f8e72 100644 --- a/arch/arm64/boot/dts/qcom/Makefile +++ b/arch/arm64/boot/dts/qcom/Makefile @@ -79,6 +79,7 @@ dtb-$(CONFIG_ARCH_QCOM) += msm8916-yiming-uz801v3.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8917-xiaomi-riva.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8929-wingtech-wt82918hd.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8939-alcatel-idol3.dtb +dtb-$(CONFIG_ARCH_QCOM) += msm8939-asus-z00t.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8939-huawei-kiwi.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8939-longcheer-l9100.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8939-samsung-a7.dtb diff --git a/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts b/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts new file mode 100644 index 00000000000000..ebb548e62e02b9 --- /dev/null +++ b/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts @@ -0,0 +1,256 @@ +// SPDX-License-Identifier: GPL-2.0-only + +/dts-v1/; + +#include "msm8939-pm8916.dtsi" +#include "msm8916-modem-qdsp6.dtsi" + +#include +#include +#include + +/ { + model = "Asus ZenFone 2 Laser/Selfie (1080p)"; + compatible = "asus,z00t", "qcom,msm8939"; + chassis-type = "handset"; + + aliases { + mmc0 = &sdhc_1; + mmc1 = &sdhc_2; + serial0 = &blsp_uart2; + }; + + chosen { + stdout-path = "serial0"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + pinctrl-0 = <&gpio_keys_default>; + pinctrl-names = "default"; + + button-volume-up { + label = "Volume Up"; + gpios = <&tlmm 107 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <15>; + }; + + button-volume-down { + label = "Volume Down"; + gpios = <&tlmm 117 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <15>; + }; + }; + + reg_sd_vmmc: regulator-sdcard-vmmc { + compatible = "regulator-fixed"; + regulator-name = "sdcard-vmmc"; + regulator-min-microvolt = <2950000>; + regulator-max-microvolt = <2950000>; + + gpio = <&tlmm 87 GPIO_ACTIVE_HIGH>; + enable-active-high; + + startup-delay-us = <200>; + + pinctrl-0 = <&sd_vmmc_en_default>; + pinctrl-names = "default"; + }; + + usb_id: usb-id { + compatible = "linux,extcon-usb-gpio"; + id-gpios = <&tlmm 110 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&usb_id_default>; + pinctrl-names = "default"; + }; +}; + +&blsp_i2c2 { + status = "okay"; + + magnetometer@c { + compatible = "asahi-kasei,ak09911"; + reg = <0x0c>; + + vdd-supply = <&pm8916_l8>; + vid-supply = <&pm8916_l6>; + + reset-gpios = <&tlmm 112 GPIO_ACTIVE_LOW>; + pinctrl-0 = <&mag_reset_default>; + pinctrl-names = "default"; + }; + + imu@68 { + compatible = "invensense,mpu6515"; + reg = <0x68>; + + interrupts-extended = <&tlmm 36 IRQ_TYPE_EDGE_RISING>; + + vdd-supply = <&pm8916_l8>; + vddio-supply = <&pm8916_l6>; + + pinctrl-0 = <&imu_default>; + pinctrl-names = "default"; + + mount-matrix = "0", "1", "0", + "-1", "0", "0", + "0", "0", "1"; + }; +}; + +&blsp_i2c5 { + status = "okay"; + + touchscreen@38 { + compatible = "edt,edt-ft5306"; + reg = <0x38>; + + interrupts-extended = <&tlmm 13 IRQ_TYPE_EDGE_FALLING>; + + reset-gpios = <&tlmm 12 GPIO_ACTIVE_LOW>; + + vcc-supply = <&pm8916_l8>; + iovcc-supply = <&pm8916_l6>; + + touchscreen-size-x = <1080>; + touchscreen-size-y = <1920>; + + pinctrl-0 = <&touchscreen_default>; + pinctrl-names = "default"; + }; +}; + +&blsp_uart2 { + pinctrl-0 = <&blsp_uart2_console_default>; + pinctrl-1 = <&blsp_uart2_console_sleep>; + pinctrl-names = "default", "sleep"; + + status = "okay"; +}; + +&mpss_mem { + reg = <0x0 0x86800000 0x0 0x5500000>; +}; + +&pm8916_codec { + qcom,micbias-lvl = <2800>; + qcom,mbhc-vthreshold-low = <75 150 237 450 500>; + qcom,mbhc-vthreshold-high = <75 150 237 450 500>; + qcom,micbias1-ext-cap; + qcom,hphl-jack-type-normally-open; + + status = "okay"; +}; + +&pm8916_vib { + status = "okay"; +}; + +&sdhc_1 { + status = "okay"; +}; + +&sdhc_2 { + vmmc-supply = <®_sd_vmmc>; + + pinctrl-0 = <&sdc2_default &sdc2_cd_default>; + pinctrl-1 = <&sdc2_sleep &sdc2_cd_default>; + pinctrl-names = "default", "sleep"; + cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; + + status = "okay"; +}; + +&sound { + audio-routing = + "AMIC1", "MIC BIAS External1", + "AMIC2", "MIC BIAS Internal2", + "AMIC3", "MIC BIAS External1"; + + status = "okay"; +}; + +&usb { + extcon = <&usb_id>, <&usb_id>; + + status = "okay"; +}; + +&usb_hs_phy { + extcon = <&usb_id>; +}; + +&wcnss { + status = "okay"; +}; + +&wcnss_iris { + compatible = "qcom,wcn3660b"; +}; + +&wcnss_mem { + status = "okay"; +}; + +&tlmm { + touchscreen_default: touchscreen-default-state { + reset-pins { + pins = "gpio12"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + + touch-pins { + pins = "gpio13"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + }; + + imu_default: imu-default-state { + pins = "gpio36"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + + sdc2_cd_default: sdc2-cd-default-state { + pins = "gpio38"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + + sd_vmmc_en_default: sd-vmmc-en-default-state { + pins = "gpio87"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + + gpio_keys_default: gpio-keys-default-state { + pins = "gpio107", "gpio117"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + + usb_id_default: usb-id-default-state { + pins = "gpio110"; + function = "gpio"; + drive-strength = <8>; + bias-pull-up; + }; + + mag_reset_default: mag-reset-default-state { + pins = "gpio112"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; +}; From 8ee2d1b4a1eaa60bea99f8bb115afc4ef902883c Mon Sep 17 00:00:00 2001 From: lmdpdg Date: Sat, 13 Sep 2025 21:15:38 +0300 Subject: [PATCH 3/4] squash! MSM8916: drm/panel: Generate using linux-mdss-dsi-panel-driver-generator X-Code-Generator: msm8916-mainline/linux-panel-drivers@9743013 Signed-off-by: lmdpdg --- .../gpu/drm/panel/msm8916-generated/Kconfig | 4 + .../gpu/drm/panel/msm8916-generated/Makefile | 1 + .../panel-asus-z00t-tm5p5-nt35596.c | 294 ++++++++++++++++++ 3 files changed, 299 insertions(+) create mode 100644 drivers/gpu/drm/panel/msm8916-generated/panel-asus-z00t-tm5p5-nt35596.c diff --git a/drivers/gpu/drm/panel/msm8916-generated/Kconfig b/drivers/gpu/drm/panel/msm8916-generated/Kconfig index 29fa5b62b0d287..b0e03b81e6737d 100644 --- a/drivers/gpu/drm/panel/msm8916-generated/Kconfig +++ b/drivers/gpu/drm/panel/msm8916-generated/Kconfig @@ -25,6 +25,10 @@ config DRM_PANEL_ASUS_Z00L_OTM1284A tristate "Asus Z00L OTM1284A" default DRM_PANEL_MSM8916_GENERATED +config DRM_PANEL_ASUS_Z00T_TM5P5_NT35596 + tristate "Asus Z00T TM5P5 NT35596" + default DRM_PANEL_MSM8916_GENERATED + config DRM_PANEL_ASUS_Z010D_R69339 tristate "Asus Z010D R69339" default DRM_PANEL_MSM8916_GENERATED diff --git a/drivers/gpu/drm/panel/msm8916-generated/Makefile b/drivers/gpu/drm/panel/msm8916-generated/Makefile index 5bb29dfb34d29f..cdfe3e3e66ccc9 100644 --- a/drivers/gpu/drm/panel/msm8916-generated/Makefile +++ b/drivers/gpu/drm/panel/msm8916-generated/Makefile @@ -3,6 +3,7 @@ obj-$(CONFIG_DRM_PANEL_ALCATEL_AUO_HX8394D) += panel-alcatel-auo-hx8394d.o obj-$(CONFIG_DRM_PANEL_ALCATEL_IDOL3_NT35596) += panel-alcatel-idol3-nt35596.o obj-$(CONFIG_DRM_PANEL_ALCATEL_IDOL3_R63315) += panel-alcatel-idol3-r63315.o obj-$(CONFIG_DRM_PANEL_ASUS_Z00L_OTM1284A) += panel-asus-z00l-otm1284a.o +obj-$(CONFIG_DRM_PANEL_ASUS_Z00T_TM5P5_NT35596) += panel-asus-z00t-tm5p5-nt35596.o obj-$(CONFIG_DRM_PANEL_ASUS_Z010D_R69339) += panel-asus-z010d-r69339.o obj-$(CONFIG_DRM_PANEL_GPLUS_FL8005A_HX8394D) += panel-gplus-fl8005a-hx8394d.o obj-$(CONFIG_DRM_PANEL_HUAWEI_BOE_OTM8019A) += panel-huawei-boe-otm8019a.o diff --git a/drivers/gpu/drm/panel/msm8916-generated/panel-asus-z00t-tm5p5-nt35596.c b/drivers/gpu/drm/panel/msm8916-generated/panel-asus-z00t-tm5p5-nt35596.c new file mode 100644 index 00000000000000..a1b1f5437e129e --- /dev/null +++ b/drivers/gpu/drm/panel/msm8916-generated/panel-asus-z00t-tm5p5-nt35596.c @@ -0,0 +1,294 @@ +// SPDX-License-Identifier: GPL-2.0-only +// Copyright (c) 2025 FIXME +// Generated with linux-mdss-dsi-panel-driver-generator from vendor device tree: +// Copyright (c) 2013, The Linux Foundation. All rights reserved. (FIXME) + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +struct tm5p5_nt35596 { + struct drm_panel panel; + struct mipi_dsi_device *dsi; + struct regulator *supply; + struct gpio_desc *reset_gpio; + struct gpio_desc *backlight_gpio; +}; + +static inline struct tm5p5_nt35596 *to_tm5p5_nt35596(struct drm_panel *panel) +{ + return container_of(panel, struct tm5p5_nt35596, panel); +} + +static void tm5p5_nt35596_reset(struct tm5p5_nt35596 *ctx) +{ + gpiod_set_value_cansleep(ctx->reset_gpio, 0); + usleep_range(1000, 2000); + gpiod_set_value_cansleep(ctx->reset_gpio, 1); + usleep_range(1000, 2000); + gpiod_set_value_cansleep(ctx->reset_gpio, 0); + usleep_range(15000, 16000); +} + +static int tm5p5_nt35596_on(struct tm5p5_nt35596 *ctx) +{ + struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi }; + + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0xff, 0x05); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0xfb, 0x01); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0xc5, 0x31); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0xff, 0x04); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x01, 0x84); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x05, 0x25); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x06, 0x01); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x07, 0x20); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x08, 0x06); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x09, 0x08); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x0a, 0x10); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x0b, 0x10); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x0c, 0x10); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x0d, 0x14); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x0e, 0x14); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x0f, 0x14); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x10, 0x14); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x11, 0x14); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x12, 0x14); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x17, 0xf3); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x18, 0xc0); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x19, 0xc0); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x1a, 0xc0); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x1b, 0xb3); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x1c, 0xb3); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x1d, 0xb3); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x1e, 0xb3); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x1f, 0xb3); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x20, 0xb3); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0xfb, 0x01); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0xff, 0x00); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0xfb, 0x01); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x35, 0x01); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0xd3, 0x06); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0xd4, 0x04); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x51, 0x0d); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x53, 0x24); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x5e, 0x0d); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x11, 0x00); + mipi_dsi_msleep(&dsi_ctx, 100); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0x29, 0x00); + + return dsi_ctx.accum_err; +} + +static int tm5p5_nt35596_off(struct tm5p5_nt35596 *ctx) +{ + struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi }; + + mipi_dsi_dcs_set_display_off_multi(&dsi_ctx); + mipi_dsi_msleep(&dsi_ctx, 60); + mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx); + // WARNING: Ignoring weird NULL_PACKET + mipi_dsi_msleep(&dsi_ctx, 72); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x4f, 0x01); + + return dsi_ctx.accum_err; +} + +static int tm5p5_nt35596_prepare(struct drm_panel *panel) +{ + struct tm5p5_nt35596 *ctx = to_tm5p5_nt35596(panel); + struct device *dev = &ctx->dsi->dev; + int ret; + + ret = regulator_enable(ctx->supply); + if (ret < 0) { + dev_err(dev, "Failed to enable regulator: %d\n", ret); + return ret; + } + + tm5p5_nt35596_reset(ctx); + + ret = tm5p5_nt35596_on(ctx); + if (ret < 0) { + dev_err(dev, "Failed to initialize panel: %d\n", ret); + gpiod_set_value_cansleep(ctx->reset_gpio, 1); + regulator_disable(ctx->supply); + return ret; + } + + return 0; +} + +static int tm5p5_nt35596_unprepare(struct drm_panel *panel) +{ + struct tm5p5_nt35596 *ctx = to_tm5p5_nt35596(panel); + struct device *dev = &ctx->dsi->dev; + int ret; + + ret = tm5p5_nt35596_off(ctx); + if (ret < 0) + dev_err(dev, "Failed to un-initialize panel: %d\n", ret); + + gpiod_set_value_cansleep(ctx->reset_gpio, 1); + regulator_disable(ctx->supply); + + return 0; +} + +static const struct drm_display_mode tm5p5_nt35596_mode = { + .clock = (1080 + 100 + 8 + 16) * (1920 + 4 + 2 + 4) * 60 / 1000, + .hdisplay = 1080, + .hsync_start = 1080 + 100, + .hsync_end = 1080 + 100 + 8, + .htotal = 1080 + 100 + 8 + 16, + .vdisplay = 1920, + .vsync_start = 1920 + 4, + .vsync_end = 1920 + 4 + 2, + .vtotal = 1920 + 4 + 2 + 4, + .width_mm = 68, + .height_mm = 121, + .type = DRM_MODE_TYPE_DRIVER, +}; + +static int tm5p5_nt35596_get_modes(struct drm_panel *panel, + struct drm_connector *connector) +{ + return drm_connector_helper_get_modes_fixed(connector, &tm5p5_nt35596_mode); +} + +static const struct drm_panel_funcs tm5p5_nt35596_panel_funcs = { + .prepare = tm5p5_nt35596_prepare, + .unprepare = tm5p5_nt35596_unprepare, + .get_modes = tm5p5_nt35596_get_modes, +}; + +static int tm5p5_nt35596_bl_update_status(struct backlight_device *bl) +{ + struct mipi_dsi_device *dsi = bl_get_data(bl); + struct tm5p5_nt35596 *ctx = mipi_dsi_get_drvdata(dsi); + u16 brightness = backlight_get_brightness(bl); + int ret; + + gpiod_set_value_cansleep(ctx->backlight_gpio, !!brightness); + + dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; + + ret = mipi_dsi_dcs_set_display_brightness(dsi, brightness); + if (ret < 0) + return ret; + + dsi->mode_flags |= MIPI_DSI_MODE_LPM; + + return 0; +} + +static const struct backlight_ops tm5p5_nt35596_bl_ops = { + .update_status = tm5p5_nt35596_bl_update_status, +}; + +static struct backlight_device * +tm5p5_nt35596_create_backlight(struct mipi_dsi_device *dsi) +{ + struct device *dev = &dsi->dev; + const struct backlight_properties props = { + .type = BACKLIGHT_RAW, + .brightness = 255, + .max_brightness = 255, + }; + + return devm_backlight_device_register(dev, dev_name(dev), dev, dsi, + &tm5p5_nt35596_bl_ops, &props); +} + +static int tm5p5_nt35596_probe(struct mipi_dsi_device *dsi) +{ + struct device *dev = &dsi->dev; + struct tm5p5_nt35596 *ctx; + int ret; + + ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); + if (!ctx) + return -ENOMEM; + + ctx->supply = devm_regulator_get(dev, "power"); + if (IS_ERR(ctx->supply)) + return dev_err_probe(dev, PTR_ERR(ctx->supply), + "Failed to get power regulator\n"); + + ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); + if (IS_ERR(ctx->reset_gpio)) + return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), + "Failed to get reset-gpios\n"); + + ctx->backlight_gpio = devm_gpiod_get(dev, "backlight", GPIOD_OUT_LOW); + if (IS_ERR(ctx->backlight_gpio)) + return dev_err_probe(dev, PTR_ERR(ctx->backlight_gpio), + "Failed to get backlight-gpios\n"); + + ctx->dsi = dsi; + mipi_dsi_set_drvdata(dsi, ctx); + + dsi->lanes = 4; + dsi->format = MIPI_DSI_FMT_RGB888; + dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | + MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_NO_EOT_PACKET | + MIPI_DSI_CLOCK_NON_CONTINUOUS | MIPI_DSI_MODE_LPM; + + drm_panel_init(&ctx->panel, dev, &tm5p5_nt35596_panel_funcs, + DRM_MODE_CONNECTOR_DSI); + ctx->panel.prepare_prev_first = true; + + ctx->panel.backlight = tm5p5_nt35596_create_backlight(dsi); + if (IS_ERR(ctx->panel.backlight)) + return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight), + "Failed to create backlight\n"); + + drm_panel_add(&ctx->panel); + + ret = mipi_dsi_attach(dsi); + if (ret < 0) { + drm_panel_remove(&ctx->panel); + return dev_err_probe(dev, ret, "Failed to attach to DSI host\n"); + } + + return 0; +} + +static void tm5p5_nt35596_remove(struct mipi_dsi_device *dsi) +{ + struct tm5p5_nt35596 *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->panel); +} + +static const struct of_device_id tm5p5_nt35596_of_match[] = { + { .compatible = "asus,z00t-tm5p5-nt35596" }, // FIXME + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, tm5p5_nt35596_of_match); + +static struct mipi_dsi_driver tm5p5_nt35596_driver = { + .probe = tm5p5_nt35596_probe, + .remove = tm5p5_nt35596_remove, + .driver = { + .name = "panel-asus-z00t-tm5p5-nt35596", + .of_match_table = tm5p5_nt35596_of_match, + }, +}; +module_mipi_dsi_driver(tm5p5_nt35596_driver); + +MODULE_AUTHOR("linux-mdss-dsi-panel-driver-generator "); // FIXME +MODULE_DESCRIPTION("DRM driver for tm5p5 nt35596 1080p video mode dsi panel"); +MODULE_LICENSE("GPL"); From b9b3fcad3c68c55d1f8a9bc65e6c82c6f89ba0ea Mon Sep 17 00:00:00 2001 From: Erikas Bitovtas Date: Sat, 13 Sep 2025 22:04:38 +0300 Subject: [PATCH 4/4] arm64: dts: qcom: msm8939-asus-z00t: add panel This commit adds support for the panel used in Asus ZenFone 2 Laser/Selfie. The panel used in this device is tm5p5-nt35596. Signed-off-by: Erikas Bitovtas --- .../arm64/boot/dts/qcom/msm8939-asus-z00t.dts | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts b/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts index ebb548e62e02b9..a258825e71c8e0 100644 --- a/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts +++ b/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts @@ -131,6 +131,51 @@ status = "okay"; }; +&gpu { + status = "okay"; +}; + +&mdss { + status = "okay"; +}; + +&mdss_dsi0 { + pinctrl-0 = <&mdss_default>; + pinctrl-1 = <&mdss_sleep>; + pinctrl-names = "default", "sleep"; + + status = "okay"; + + panel@0 { + compatible = "asus,z00t-panel"; + reg = <0>; + + reset-gpios = <&tlmm 25 GPIO_ACTIVE_LOW>; + backlight-gpios = <&tlmm 21 GPIO_ACTIVE_HIGH>; + power-supply = <&pm8916_l8>; + + pinctrl-0 = <&lcd_bl_en_default>; + pinctrl-names = "default"; + + port { + panel_in: endpoint { + remote-endpoint = <&mdss_dsi0_out>; + }; + }; + }; +}; + +&mdss_dsi0_out { + data-lanes = <0 1 2 3>; + remote-endpoint = <&panel_in>; +}; + +&mdss_dsi0_phy { + qcom,dsi-phy-regulator-ldo-mode; + + status = "okay"; +}; + &mpss_mem { reg = <0x0 0x86800000 0x0 0x5500000>; }; @@ -212,6 +257,27 @@ }; }; + lcd_bl_en_default: lcd-bl-en-default-state { + pins = "gpio21"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + + mdss_default: mdss-default-state { + pins = "gpio25"; + function = "gpio"; + drive-strength = <8>; + bias-disable; + }; + + mdss_sleep: mdss-sleep-state { + pins = "gpio25"; + function = "gpio"; + drive-strength = <2>; + bias-pull-down; + }; + imu_default: imu-default-state { pins = "gpio36"; function = "gpio";