From 48f2e0423672b284a83be3288c835dfa29d7719a Mon Sep 17 00:00:00 2001 From: Hefei <3066883572@qq.com> Date: Fri, 18 Sep 2026 18:41:37 +0800 Subject: [PATCH] drm/panel: add VIEWE 7 inch JD9365TX in-cell DSI panel Add the panel driver, Jadard in-cell touch, I2C backlight, DT bindings and overlays for Raspberry Pi 4 and Pi 5. Signed-off-by: Hefei <3066883572@qq.com> --- .../display/panel/viewe,jd9365tx.yaml | 76 ++ .../input/touchscreen/jadard,jd9365tx.yaml | 64 ++ .../leds/backlight/viewe,i2c-backlight.yaml | 49 ++ arch/arm/boot/dts/overlays/Makefile | 2 + arch/arm/boot/dts/overlays/README | 23 + .../vc4-kms-dsi-viewe-7inch-overlay.dts | 116 +++ .../vc4-kms-dsi-viewe-7inch-pi5-overlay.dts | 115 +++ arch/arm64/configs/bcm2711_defconfig | 4 + arch/arm64/configs/bcm2712_defconfig | 4 + drivers/gpu/drm/panel/Kconfig | 11 + drivers/gpu/drm/panel/Makefile | 1 + .../gpu/drm/panel/panel-viewe-jd9365tx-init.h | 54 ++ drivers/gpu/drm/panel/panel-viewe-jd9365tx.c | 671 ++++++++++++++++++ drivers/input/touchscreen/Kconfig | 12 + drivers/input/touchscreen/Makefile | 2 + drivers/input/touchscreen/jadard_jd9365tx.c | 500 +++++++++++++ drivers/video/backlight/Kconfig | 14 + drivers/video/backlight/Makefile | 2 + drivers/video/backlight/viewe_bl_i2c.c | 106 +++ drivers/video/backlight/viewe_dsi_i2c_bus.c | 62 ++ drivers/video/backlight/viewe_dsi_i2c_bus.h | 13 + 21 files changed, 1901 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/viewe,jd9365tx.yaml create mode 100644 Documentation/devicetree/bindings/input/touchscreen/jadard,jd9365tx.yaml create mode 100644 Documentation/devicetree/bindings/leds/backlight/viewe,i2c-backlight.yaml create mode 100644 arch/arm/boot/dts/overlays/vc4-kms-dsi-viewe-7inch-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/vc4-kms-dsi-viewe-7inch-pi5-overlay.dts create mode 100644 drivers/gpu/drm/panel/panel-viewe-jd9365tx-init.h create mode 100644 drivers/gpu/drm/panel/panel-viewe-jd9365tx.c create mode 100644 drivers/input/touchscreen/jadard_jd9365tx.c create mode 100644 drivers/video/backlight/viewe_bl_i2c.c create mode 100644 drivers/video/backlight/viewe_dsi_i2c_bus.c create mode 100644 drivers/video/backlight/viewe_dsi_i2c_bus.h diff --git a/Documentation/devicetree/bindings/display/panel/viewe,jd9365tx.yaml b/Documentation/devicetree/bindings/display/panel/viewe,jd9365tx.yaml new file mode 100644 index 0000000000000..b15d6db3a09b6 --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/viewe,jd9365tx.yaml @@ -0,0 +1,76 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/viewe,jd9365tx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: VIEWE 7.0" 720x1280 Jadard JD9365TX MIPI-DSI in-cell panel + +maintainers: + - Hefei <3066883572@qq.com> + +description: | + The VIEWE 7KF82 module is a 720x1280 RGB888 video-mode MIPI-DSI panel + based on Jadard JD9365TX. It uses two DSI data lanes and exposes in-cell + touch over I2C on the same FPC. + +allOf: + - $ref: panel-common.yaml# + +properties: + compatible: + const: viewe,7kf82 + + reg: + maxItems: 1 + + vdd-supply: + description: Panel VDD supply, usually 3.3V + + iovcc-supply: + description: Panel IO voltage supply, usually 3.3V + + vccio-supply: + description: Alternate name for iovcc-supply + + reset-gpios: + description: Optional panel reset GPIO (omit if board uses POR only). + maxItems: 1 + + backlight: true + rotation: true + port: true + +required: + - compatible + - reg + - vdd-supply + +anyOf: + - required: [iovcc-supply] + - required: [vccio-supply] + +additionalProperties: false + +examples: + - | + dsi { + #address-cells = <1>; + #size-cells = <0>; + + panel@0 { + compatible = "viewe,7kf82"; + reg = <0>; + vdd-supply = <®_vdd>; + iovcc-supply = <®_iovcc>; + backlight = <&viewe_bl>; + + port { + endpoint { + remote-endpoint = <&dsi_out>; + data-lanes = <0 1>; + }; + }; + }; + }; +... diff --git a/Documentation/devicetree/bindings/input/touchscreen/jadard,jd9365tx.yaml b/Documentation/devicetree/bindings/input/touchscreen/jadard,jd9365tx.yaml new file mode 100644 index 0000000000000..2ad0ba1af7bd0 --- /dev/null +++ b/Documentation/devicetree/bindings/input/touchscreen/jadard,jd9365tx.yaml @@ -0,0 +1,64 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/touchscreen/jadard,jd9365tx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Jadard JD9365TX in-cell touchscreen + +maintainers: + - Hefei <3066883572@qq.com> + +description: | + In-cell touch integrated with Jadard JD9365TX DSI panels. The module FPC + often exposes only I2C (no interrupt GPIO); the driver polls coordinate + reports. + +allOf: + - $ref: touchscreen.yaml# + +properties: + compatible: + enum: + - jadard,jd9365tx + - jadard,jd9365tx-tp + + reg: + maxItems: 1 + + jadard,poll-interval-ms: + description: Polling interval in milliseconds (default 16) + minimum: 8 + maximum: 100 + + jadard,max-touch-number: + description: Maximum simultaneous contacts + minimum: 1 + maximum: 10 + + jadard,coord-addr: + description: Optional fixed coordinate SRAM address override + $ref: /schemas/types.yaml#/definitions/uint32 + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + touchscreen@68 { + compatible = "jadard,jd9365tx"; + reg = <0x68>; + touchscreen-size-x = <720>; + touchscreen-size-y = <1280>; + jadard,poll-interval-ms = <16>; + jadard,max-touch-number = <10>; + }; + }; +... diff --git a/Documentation/devicetree/bindings/leds/backlight/viewe,i2c-backlight.yaml b/Documentation/devicetree/bindings/leds/backlight/viewe,i2c-backlight.yaml new file mode 100644 index 0000000000000..d28e5b4dac786 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/backlight/viewe,i2c-backlight.yaml @@ -0,0 +1,49 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/backlight/viewe,i2c-backlight.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: VIEWE I2C panel backlight + +maintainers: + - Hefei <3066883572@qq.com> + +description: | + Simple I2C backlight used on VIEWE DSI modules. Default protocol is device + address 0x45, register 0x86, brightness 0..255. + +allOf: + - $ref: common.yaml# + +properties: + compatible: + const: viewe,i2c-backlight + + reg: + maxItems: 1 + + default-brightness: + description: Brightness applied at probe (0..255) + minimum: 0 + maximum: 255 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + backlight@45 { + compatible = "viewe,i2c-backlight"; + reg = <0x45>; + default-brightness = <200>; + }; + }; +... diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile index 3ca704516da0c..4d0d199388c30 100644 --- a/arch/arm/boot/dts/overlays/Makefile +++ b/arch/arm/boot/dts/overlays/Makefile @@ -362,6 +362,8 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ vc4-kms-dsi-waveshare-800x480.dtbo \ vc4-kms-dsi-waveshare-panel.dtbo \ vc4-kms-dsi-waveshare-panel-v2.dtbo \ + vc4-kms-dsi-viewe-7inch.dtbo \ + vc4-kms-dsi-viewe-7inch-pi5.dtbo \ vc4-kms-kippah-7inch.dtbo \ vc4-kms-v3d.dtbo \ vc4-kms-v3d-pi4.dtbo \ diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README index 64aab639e4984..7ecb2e98e937e 100644 --- a/arch/arm/boot/dts/overlays/README +++ b/arch/arm/boot/dts/overlays/README @@ -6239,6 +6239,29 @@ Params: 3_4_inch_c 3.4" 800x800 2lane the default DSI1 and i2c_csi_dsi). +Name: vc4-kms-dsi-viewe-7inch +Info: Enable the VIEWE 7" 720x1280 JD9365TX in-cell DSI panel. + 2-lane, for Raspberry Pi 3/4 on DSI1. +Load: dtoverlay=vc4-kms-dsi-viewe-7inch, +Params: rotation Display rotation {0,90,180,270} + notouch Disable the touch controller + nobl Disable the backlight + invx Touchscreen inverted x axis + invy Touchscreen inverted y axis + swapxy Touchscreen swapped x y axis + + +Name: vc4-kms-dsi-viewe-7inch-pi5 +Info: Enable the VIEWE 7" panel on Raspberry Pi 5 DISP1. +Load: dtoverlay=vc4-kms-dsi-viewe-7inch-pi5, +Params: rotation Display rotation {0,90,180,270} + notouch Disable the touch controller + nobl Disable the backlight + invx Touchscreen inverted x axis + invy Touchscreen inverted y axis + swapxy Touchscreen swapped x y axis + + Name: vc4-kms-kippah-7inch Info: This overlay is now deprecated - see vc4-kms-dpi-panel,kippah-7inch Load: diff --git a/arch/arm/boot/dts/overlays/vc4-kms-dsi-viewe-7inch-overlay.dts b/arch/arm/boot/dts/overlays/vc4-kms-dsi-viewe-7inch-overlay.dts new file mode 100644 index 0000000000000..cbccdfb270ddb --- /dev/null +++ b/arch/arm/boot/dts/overlays/vc4-kms-dsi-viewe-7inch-overlay.dts @@ -0,0 +1,116 @@ +/* + * dtoverlay=vc4-kms-dsi-viewe-7inch + * VIEWE 7" 720x1280 JD9365TX, DSI1 + i2c_csi_dsi (Pi 3/4). + * Pi 5: use vc4-kms-dsi-viewe-7inch-pi5. + */ + +/dts-v1/; +/plugin/; + +/ { + compatible = "brcm,bcm2835"; + + fragment@0 { + target = <&dsi1>; + __overlay__ { + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + + port { + dsi_out: endpoint { + remote-endpoint = <&panel_in>; + data-lanes = <0 1>; + }; + }; + + panel: panel@0 { + compatible = "viewe,7kf82"; + reg = <0>; + status = "okay"; + + vdd-supply = <&vdd_viewe7>; + iovcc-supply = <&iovcc_viewe7>; + backlight = <&viewe_bl>; + + port { + panel_in: endpoint { + remote-endpoint = <&dsi_out>; + data-lanes = <0 1>; + }; + }; + }; + }; + }; + + fragment@1 { + target-path = "/"; + __overlay__ { + vdd_viewe7: regulator-vdd-viewe7 { + compatible = "regulator-fixed"; + regulator-name = "vdd-viewe7"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + iovcc_viewe7: regulator-iovcc-viewe7 { + compatible = "regulator-fixed"; + regulator-name = "iovcc-viewe7"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + }; + }; + + fragment@2 { + target = <&i2c_csi_dsi>; + __overlay__ { + status = "okay"; + clock-frequency = <100000>; + #address-cells = <1>; + #size-cells = <0>; + + jadard_tp: touch@68 { + compatible = "jadard,jd9365tx-tp"; + reg = <0x68>; + touchscreen-size-x = <720>; + touchscreen-size-y = <1280>; + jadard,max-touch-number = <10>; + jadard,poll-interval-ms = <16>; + status = "okay"; + }; + + viewe_bl: bl@45 { + compatible = "viewe,i2c-backlight"; + reg = <0x45>; + default-brightness = <200>; + status = "okay"; + }; + }; + }; + + fragment@3 { + target = <&i2c0if>; + __overlay__ { + status = "okay"; + }; + }; + + fragment@4 { + target = <&i2c0mux>; + __overlay__ { + status = "okay"; + }; + }; + + __overrides__ { + rotation = <&panel>, "rotation:0"; + notouch = <&jadard_tp>, "status=disabled"; + nobl = <&viewe_bl>, "status=disabled"; + invx = <&jadard_tp>, "touchscreen-inverted-x?"; + invy = <&jadard_tp>, "touchscreen-inverted-y?"; + swapxy = <&jadard_tp>, "touchscreen-swapped-x-y?"; + }; +}; diff --git a/arch/arm/boot/dts/overlays/vc4-kms-dsi-viewe-7inch-pi5-overlay.dts b/arch/arm/boot/dts/overlays/vc4-kms-dsi-viewe-7inch-pi5-overlay.dts new file mode 100644 index 0000000000000..d35145b48fdf7 --- /dev/null +++ b/arch/arm/boot/dts/overlays/vc4-kms-dsi-viewe-7inch-pi5-overlay.dts @@ -0,0 +1,115 @@ +/* + * dtoverlay=vc4-kms-dsi-viewe-7inch-pi5 + * VIEWE 7" 720x1280 JD9365TX, DISP1 + i2c_csi_dsi1 (Pi 5). + */ + +/dts-v1/; +/plugin/; + +/ { + compatible = "brcm,bcm2835"; + + fragment@0 { + target = <&dsi1>; + __overlay__ { + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + + port { + dsi_out: endpoint { + remote-endpoint = <&panel_in>; + data-lanes = <0 1>; + }; + }; + + panel: panel@0 { + compatible = "viewe,7kf82"; + reg = <0>; + status = "okay"; + + vdd-supply = <&vdd_viewe7>; + iovcc-supply = <&iovcc_viewe7>; + backlight = <&viewe_bl>; + + port { + panel_in: endpoint { + remote-endpoint = <&dsi_out>; + data-lanes = <0 1>; + }; + }; + }; + }; + }; + + fragment@1 { + target-path = "/"; + __overlay__ { + vdd_viewe7: regulator-vdd-viewe7 { + compatible = "regulator-fixed"; + regulator-name = "vdd-viewe7"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + iovcc_viewe7: regulator-iovcc-viewe7 { + compatible = "regulator-fixed"; + regulator-name = "iovcc-viewe7"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + }; + }; + + fragment@2 { + target = <&i2c_csi_dsi1>; + __overlay__ { + status = "okay"; + clock-frequency = <100000>; + #address-cells = <1>; + #size-cells = <0>; + + jadard_tp: touch@68 { + compatible = "jadard,jd9365tx-tp"; + reg = <0x68>; + touchscreen-size-x = <720>; + touchscreen-size-y = <1280>; + jadard,max-touch-number = <10>; + jadard,poll-interval-ms = <16>; + status = "okay"; + }; + + viewe_bl: bl@45 { + compatible = "viewe,i2c-backlight"; + reg = <0x45>; + default-brightness = <200>; + status = "okay"; + }; + }; + }; + + fragment@3 { + target = <&i2c0if>; + __overlay__ { + status = "okay"; + }; + }; + + fragment@4 { + target = <&i2c0mux>; + __overlay__ { + status = "okay"; + }; + }; + + __overrides__ { + rotation = <&panel>, "rotation:0"; + notouch = <&jadard_tp>, "status=disabled"; + nobl = <&viewe_bl>, "status=disabled"; + invx = <&jadard_tp>, "touchscreen-inverted-x?"; + invy = <&jadard_tp>, "touchscreen-inverted-y?"; + swapxy = <&jadard_tp>, "touchscreen-swapped-x-y?"; + }; +}; diff --git a/arch/arm64/configs/bcm2711_defconfig b/arch/arm64/configs/bcm2711_defconfig index 753fcdf918b4a..732b1994ca1d3 100644 --- a/arch/arm64/configs/bcm2711_defconfig +++ b/arch/arm64/configs/bcm2711_defconfig @@ -710,6 +710,7 @@ CONFIG_TOUCHSCREEN_GOODIX=m CONFIG_TOUCHSCREEN_ILI210X=m CONFIG_TOUCHSCREEN_ILITEK=m CONFIG_TOUCHSCREEN_ILITEK_V3=m +CONFIG_TOUCHSCREEN_JADARD_JD9365TX=m CONFIG_TOUCHSCREEN_EDT_FT5X06=m CONFIG_TOUCHSCREEN_RASPBERRYPI_FW=m CONFIG_TOUCHSCREEN_USB_COMPOSITE=m @@ -1089,6 +1090,7 @@ CONFIG_DRM_PANEL_ILITEK_ILI9806E=m CONFIG_DRM_PANEL_ILITEK_ILI9806E_SPI=m CONFIG_DRM_PANEL_ILITEK_ILI9881C=m CONFIG_DRM_PANEL_JDI_LT070ME05000=m +CONFIG_DRM_PANEL_VIEWE_JD9365TX=m CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m CONFIG_DRM_PANEL_SITRONIX_ST7701=m CONFIG_DRM_PANEL_SIMPLE=m @@ -1126,6 +1128,8 @@ CONFIG_BACKLIGHT_PWM=m CONFIG_BACKLIGHT_RPI=m CONFIG_BACKLIGHT_LM3630A=m CONFIG_BACKLIGHT_GPIO=m +CONFIG_VIEWE_DSI_I2C_BUS=m +CONFIG_BACKLIGHT_VIEWE_I2C=m CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y CONFIG_LOGO=y # CONFIG_LOGO_LINUX_MONO is not set diff --git a/arch/arm64/configs/bcm2712_defconfig b/arch/arm64/configs/bcm2712_defconfig index 04aaa031f6b44..b8390a3540db1 100644 --- a/arch/arm64/configs/bcm2712_defconfig +++ b/arch/arm64/configs/bcm2712_defconfig @@ -713,6 +713,7 @@ CONFIG_TOUCHSCREEN_GOODIX=m CONFIG_TOUCHSCREEN_ILI210X=m CONFIG_TOUCHSCREEN_ILITEK=m CONFIG_TOUCHSCREEN_ILITEK_V3=m +CONFIG_TOUCHSCREEN_JADARD_JD9365TX=m CONFIG_TOUCHSCREEN_EDT_FT5X06=m CONFIG_TOUCHSCREEN_RASPBERRYPI_FW=m CONFIG_TOUCHSCREEN_USB_COMPOSITE=m @@ -1091,6 +1092,7 @@ CONFIG_DRM_PANEL_ILITEK_ILI9806E=m CONFIG_DRM_PANEL_ILITEK_ILI9806E_SPI=m CONFIG_DRM_PANEL_ILITEK_ILI9881C=m CONFIG_DRM_PANEL_JDI_LT070ME05000=m +CONFIG_DRM_PANEL_VIEWE_JD9365TX=m CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m CONFIG_DRM_PANEL_SITRONIX_ST7701=m CONFIG_DRM_PANEL_SIMPLE=m @@ -1128,6 +1130,8 @@ CONFIG_BACKLIGHT_PWM=m CONFIG_BACKLIGHT_RPI=m CONFIG_BACKLIGHT_LM3630A=m CONFIG_BACKLIGHT_GPIO=m +CONFIG_VIEWE_DSI_I2C_BUS=m +CONFIG_BACKLIGHT_VIEWE_I2C=m CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y CONFIG_LOGO=y # CONFIG_LOGO_LINUX_MONO is not set diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 3100640512aaf..ad1eee34b8bd9 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -324,6 +324,17 @@ config DRM_PANEL_INNOLUX_P079ZCA 24 bit RGB per pixel. It provides a MIPI DSI interface to the host and has a built-in LED backlight. +config DRM_PANEL_VIEWE_JD9365TX + tristate "VIEWE 7\" JD9365TX DSI panel" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y here to enable the VIEWE 7" 720x1280 Jadard JD9365TX + MIPI-DSI panel. + + If unsure, say N. + config DRM_PANEL_JADARD_JD9365DA_H3 tristate "Jadard JD9365DA-H3 WXGA DSI panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 75f6bf2729a60..29334890d7b00 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -33,6 +33,7 @@ obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9881C) += panel-ilitek-ili9881c.o obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9882T) += panel-ilitek-ili9882t.o obj-$(CONFIG_DRM_PANEL_INNOLUX_EJ030NA) += panel-innolux-ej030na.o obj-$(CONFIG_DRM_PANEL_INNOLUX_P079ZCA) += panel-innolux-p079zca.o +obj-$(CONFIG_DRM_PANEL_VIEWE_JD9365TX) += panel-viewe-jd9365tx.o obj-$(CONFIG_DRM_PANEL_JADARD_JD9365DA_H3) += panel-jadard-jd9365da-h3.o obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o obj-$(CONFIG_DRM_PANEL_JDI_LPM102A188A) += panel-jdi-lpm102a188a.o diff --git a/drivers/gpu/drm/panel/panel-viewe-jd9365tx-init.h b/drivers/gpu/drm/panel/panel-viewe-jd9365tx-init.h new file mode 100644 index 0000000000000..9d7bd7fddb6f0 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-viewe-jd9365tx-init.h @@ -0,0 +1,54 @@ + JD_CMD_DELAY(1, 0xDF, 0x90, 0x84, 0x14), + JD_CMD(0xDE, 0x00), + JD_CMD_DELAY(1, 0xBB, 0x46, 0x55, 0xB5, 0x22, 0x22, 0x55), + JD_CMD(0xDE, 0x02), + JD_CMD_DELAY(1, 0xB7, 0x16, 0x00, 0x6E, 0x44, 0x77), + JD_CMD(0xDE, 0x00), + JD_CMD_DELAY(1, 0xB3, 0x00, 0x01, 0x50, 0x50, 0x3C, 0x3C, 0xA0, 0x00, 0x20, 0xB6), + JD_CMD_DELAY(1, 0xBC, 0x0C, 0x28, 0x88), + JD_CMD_DELAY(1, 0xBD, 0x00, 0x5C, 0x56), + JD_CMD_DELAY(1, 0xBF, 0x10, 0x35, 0xC3), + JD_CMD_DELAY(1, 0xC0, 0xBD, 0xBD), + JD_CMD_DELAY(1, 0xC3, 0x03, 0x09, 0x00, 0x04, 0x2B, 0xE2), + JD_CMD_DELAY(1, 0xC4, 0x05, 0xE3, 0x0D, 0xD1, 0x05, 0x2C, 0x06, 0x51, 0x06, 0x51, 0x06, 0x51, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0), + JD_CMD_DELAY(1, 0xC5, 0x01, 0x00, 0x8C, 0x00, 0x5E, 0x01, 0x7D, 0x09, 0x60, 0x02, 0xD0, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0E, 0x01, 0x92, 0x02, 0x00, 0x02, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00), + JD_CMD_DELAY(1, 0xC6, 0x00, 0xE4, 0x00, 0xC8, 0x00, 0x1D, 0x28, 0x82, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01), + JD_CMD_DELAY(1, 0xC8, 0x20, 0x80, 0xB4), + JD_CMD_DELAY(1, 0xCB, 0x7C, 0x66, 0x57, 0x42, 0x32, 0x2A, 0x1B, 0x1F, 0x0A, 0x26, 0x27, 0x25, 0x44, 0x32, 0x41, 0x35, 0x35, 0x2B, 0x1E, 0x14, 0x06, 0x7C, 0x66, 0x57, 0x42, 0x32, 0x2A, 0x1B, 0x1F, 0x0A, 0x26, 0x27, 0x2D, 0x4C, 0x3A, 0x41, 0x35, 0x35, 0x2B, 0x1E, 0x14, 0x06), + /* 2-lane: 0x31, 4-lane: 0x33 */ + JD_CMD_DELAY(1, 0xCC, 0x31), + JD_CMD_DELAY(1, 0xCD, 0x23, 0x0E, 0x23, 0x0E, 0x23, 0x0E, 0x23, 0x0E, 0x23, 0x23, 0x22, 0x22), + JD_CMD_DELAY(1, 0xCE, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA), + JD_CMD_DELAY(1, 0xCF, 0x40, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0x00, 0x00, 0x00), + JD_CMD_DELAY(1, 0xD0, 0x00, 0x3F, 0x3F, 0x64, 0x64, 0x3F, 0x3F, 0x3E, 0x3E, 0x2A, 0x2B, 0x3F, 0x3F, 0x1F, 0x1D, 0x1B, 0x19, 0x17, 0x15, 0x13, 0x11, 0x01, 0x03), + JD_CMD_DELAY(1, 0xD1, 0x00, 0x3F, 0x3F, 0x64, 0x64, 0x3F, 0x3F, 0x3E, 0x3E, 0x2A, 0x2B, 0x3F, 0x3F, 0x1E, 0x1C, 0x1A, 0x18, 0x16, 0x14, 0x12, 0x10, 0x00, 0x02), + JD_CMD_DELAY(1, 0xD2, 0x00, 0x3F, 0x3F, 0x24, 0x24, 0x3F, 0x3F, 0x3E, 0x3E, 0x2A, 0x2B, 0x3F, 0x3F, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E, 0x02, 0x00), + JD_CMD_DELAY(1, 0xD3, 0x00, 0xBF, 0xBF, 0xA4, 0xA4, 0xBF, 0x3F, 0x3E, 0x3E, 0x2A, 0x2B, 0x3F, 0x3F, 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F, 0x03, 0x01), + JD_CMD_DELAY(1, 0xD4, 0x00, 0x60, 0x0C, 0x01, 0x03, 0x20, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x05, 0x1D, 0x01, 0x23, 0x45, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x05, 0x20, 0x05, 0x22, 0x01, 0x03, 0x80, 0x0A, 0x00, 0x0A, 0x05, 0x24, 0x05, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x20, 0x00), + JD_CMD_DELAY(1, 0xD5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x0A, 0x78, 0x00, 0x00, 0x05, 0xE6, 0xF7, 0xA0, 0x0F, 0x08, 0x08, 0x10, 0x00, 0x2F, 0x04), + JD_CMD_DELAY(1, 0xD7, 0x00, 0x09, 0x7D, 0x09, 0x7D, 0x09, 0x7D, 0x09, 0x7D, 0x09, 0x7D, 0x09, 0x7D, 0x09, 0x7D), + JD_CMD(0xDE, 0x01), + JD_CMD_DELAY(1, 0xC7, 0x14, 0x14, 0x04, 0x04, 0x47), + JD_CMD_DELAY(1, 0xCD, 0x30, 0x53), + JD_CMD_DELAY(1, 0xCE, 0x09, 0x00, 0xE0, 0x00, 0xE0), + JD_CMD(0xDE, 0x02), + JD_CMD_DELAY(1, 0xB3, 0x4A, 0xA3, 0xE2, 0x2F, 0x43), + JD_CMD_DELAY(1, 0xB4, 0x7F), + JD_CMD_DELAY(1, 0xBB, 0x00, 0x7D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x40, 0x43, 0x04), + JD_CMD_DELAY(1, 0xBD, 0x1B), + JD_CMD_DELAY(1, 0xBF, 0x0F, 0x03), + JD_CMD_DELAY(1, 0xC1, 0x50, 0x40, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00), + JD_CMD_DELAY(1, 0xC2, 0x02, 0x42, 0x50, 0x00, 0x02, 0xE0, 0x31), + JD_CMD_DELAY(1, 0xC3, 0x20, 0xFF), + JD_CMD_DELAY(1, 0xC4, 0x00, 0x11, 0x07, 0x00, 0x0E, 0x01, 0x08), + JD_CMD_DELAY(1, 0xC6, 0x4A, 0x00), + JD_CMD_DELAY(1, 0xE5, 0x00, 0x70, 0x70, 0x19, 0xC8, 0x09, 0x00, 0x42, 0x01, 0x30, 0x05, 0x00, 0x00, 0x05, 0x07), + JD_CMD_DELAY(1, 0xE6, 0x10, 0x0F, 0x88, 0x00, 0x00), + JD_CMD_DELAY(1, 0xE9, 0x10, 0xA0, 0xA0), + JD_CMD_DELAY(1, 0xEC, 0x10, 0x77, 0x0D), + JD_CMD(0xDE, 0x03), + JD_CMD_DELAY(1, 0xD1, 0x00, 0x00, 0x39, 0xFF, 0x08), + JD_CMD_DELAY(1, 0xED, 0x00), + JD_CMD(0xDE, 0x00), + /* TEAR_ON only; Sleep Out / Display On are sent in enable() after video starts */ + JD_CMD_DELAY(30, 0x35), diff --git a/drivers/gpu/drm/panel/panel-viewe-jd9365tx.c b/drivers/gpu/drm/panel/panel-viewe-jd9365tx.c new file mode 100644 index 0000000000000..160000b3b9967 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-viewe-jd9365tx.c @@ -0,0 +1,671 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * DRM panel driver for VIEWE 7" 720x1280 Jadard JD9365TX (module 7KF82) + * + * 2-lane MIPI-DSI video mode. Optional reset-gpios; many FPCs use POR only. + * Backlight is a separate I2C device on the same FPC. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include