diff --git a/arch/arm/boot/dts/overlays/vc4-kms-dsi-waveshare-panel-overlay.dts b/arch/arm/boot/dts/overlays/vc4-kms-dsi-waveshare-panel-overlay.dts index 5c1cce1dddcebe..f792a3bd1b3ff5 100644 --- a/arch/arm/boot/dts/overlays/vc4-kms-dsi-waveshare-panel-overlay.dts +++ b/arch/arm/boot/dts/overlays/vc4-kms-dsi-waveshare-panel-overlay.dts @@ -17,7 +17,7 @@ status = "okay"; port { dsi_out: endpoint { - remote-endpoint = <&panel_in>; + remote-endpoint = <&bridge_in>; }; }; }; @@ -26,6 +26,16 @@ fragment@1 { target-path = "/"; __overlay__ { + panel: ws_dsi_panel@1 { + reg = <1>; + compatible = "waveshare,10.1inch-c-panel"; + + port { + panel_in: endpoint { + remote-endpoint = <&bridge_out>; + }; + }; + }; }; }; @@ -36,12 +46,39 @@ #size-cells = <0>; status = "okay"; - panel: panel_disp1@45 { + bridge: bridge@45 { reg = <0x45>; - compatible = "waveshare,10.1inch-panel"; + compatible = "waveshare,dsi2lvds"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + bridge_in: endpoint { + remote-endpoint = <&dsi_out>; + data-lanes = <1 2>; + }; + }; + + port@1 { + reg = <1>; + bridge_out: endpoint { + remote-endpoint = <&panel_in>; + }; + }; + }; + }; + + /* Panels that need the downstream Waveshare panel driver */ + legacy_panel: panel_disp1@45 { + reg = <0x45>; + compatible = "waveshare,10.1inch-e-2lane-panel"; + status = "disabled"; port { - panel_in: endpoint { + legacy_in: endpoint { remote-endpoint = <&dsi_out>; }; }; @@ -81,21 +118,31 @@ }; }; + fragment@6 { + target = <&bridge_in>; + __dormant__ { + data-lanes = <1 2 3 4>; + }; + }; + __overrides__ { 2_8_inch = <&panel>, "compatible=waveshare,2.8inch-panel", + <&bridge>, "compatible=waveshare,dsi2dpi", <&touch>, "touchscreen-size-x:0=480", <&touch>, "touchscreen-size-y:0=640", <&touch>, "touchscreen-inverted-y?", <&touch>, "touchscreen-swapped-x-y?"; - 3_4_inch = <&panel>, "compatible=waveshare,3.4inch-panel", + 3_4_inch = <&panel>, "compatible=waveshare,3.4inch-c-panel", <&touch>, "touchscreen-size-x:0=800", <&touch>, "touchscreen-size-y:0=800"; 4_0_inch = <&panel>, "compatible=waveshare,4.0inch-panel", + <&bridge>, "compatible=waveshare,dsi2dpi", <&touch>, "touchscreen-size-x:0=800", <&touch>, "touchscreen-size-y:0=480", <&touch>, "touchscreen-inverted-x?", <&touch>, "touchscreen-swapped-x-y?"; 7_0_inchC = <&panel>, "compatible=waveshare,7.0inch-c-panel", + <&bridge>, "compatible=waveshare,dsi2dpi", <&touch>, "touchscreen-size-x:0=800", <&touch>, "touchscreen-size-y:0=480"; 7_9_inch = <&panel>, "compatible=waveshare,7.9inch-panel", @@ -103,12 +150,12 @@ <&touch>, "touchscreen-size-y:0=4096", <&touch>, "touchscreen-inverted-x?", <&touch>, "touchscreen-swapped-x-y?"; - 8_0_inch = <&panel>, "compatible=waveshare,8.0inch-panel", + 8_0_inch = <&panel>, "compatible=waveshare,8.0inch-c-panel", <&touch>, "touchscreen-size-x:0=800", <&touch>, "touchscreen-size-y:0=1280", <&touch>, "touchscreen-inverted-x?", <&touch>, "touchscreen-swapped-x-y?"; - 10_1_inch = <&panel>, "compatible=waveshare,10.1inch-panel", + 10_1_inch = <&panel>, "compatible=waveshare,10.1inch-c-panel", <&touch>, "touchscreen-size-x:0=800", <&touch>, "touchscreen-size-y:0=1280", <&touch>, "touchscreen-inverted-x?", @@ -116,40 +163,60 @@ 11_9_inch = <&panel>, "compatible=waveshare,11.9inch-panel", <&touch>, "touchscreen-inverted-x?", <&touch>, "touchscreen-swapped-x-y?"; - 4_0_inchC = <&panel>, "compatible=waveshare,4inch-panel", + 4_0_inchC = <&panel>, "compatible=waveshare,4.0inch-c-panel", <&touch>, "touchscreen-size-x:0=720", <&touch>, "touchscreen-size-y:0=720"; - 5_0_inch = <&panel>, "compatible=waveshare,5.0inch-panel", + 5_0_inch = <&panel>, "compatible=waveshare,5.0inch-d-panel", <&touch>, "touchscreen-inverted-x?", <&touch>, "touchscreen-inverted-y?"; 6_25_inch = <&panel>, "compatible=waveshare,6.25inch-panel", <&touch>, "touchscreen-inverted-x?", <&touch>, "touchscreen-inverted-y?"; - 6_25_inchB = <&panel>, "compatible=waveshare,6.25inch-b-panel", + 6_25_inchB = <&legacy_panel>, "compatible=waveshare,6.25inch-b-panel", + <&legacy_panel>, "status=okay", + <&bridge>, "status=disabled", + <&panel>, "status=disabled", + <&dsi_out>, "remote-endpoint:0=", <&legacy_in>, <&touch>, "touchscreen-inverted-x?", <&touch>, "touchscreen-inverted-y?"; 8_8_inch = <&panel>, "compatible=waveshare,8.8inch-panel"; - 13_3_inch_4lane = <&panel>, "compatible=waveshare,13.3inch-4lane-panel", + 13_3_inch_4lane = <&panel>, "compatible=waveshare,13.3inch-panel", + <&bridge>, "compatible=waveshare,dsi2dpi", + <0>, "+6", <&touch2>, "status=okay"; - 13_3_inch_2lane = <&panel>, "compatible=waveshare,13.3inch-2lane-panel", + 13_3_inch_2lane = <&legacy_panel>, "compatible=waveshare,13.3inch-2lane-panel", + <&legacy_panel>, "status=okay", + <&bridge>, "status=disabled", + <&panel>, "status=disabled", + <&dsi_out>, "remote-endpoint:0=", <&legacy_in>, <&touch2>, "status=okay"; 7_0_inchH = <&panel>, "compatible=waveshare,7.0inch-h-panel", <&touch>, "touchscreen-swapped-x-y?", <&touch>, "touchscreen-inverted-x?"; - 10_1_inchE_4lane = <&panel>, "compatible=waveshare,10.1inch-e-4lane-panel", + 10_1_inchE_4lane = <&legacy_panel>, "compatible=waveshare,10.1inch-e-4lane-panel", + <&legacy_panel>, "status=okay", + <&bridge>, "status=disabled", + <&panel>, "status=disabled", + <&dsi_out>, "remote-endpoint:0=", <&legacy_in>, <&touch>, "touchscreen-swapped-x-y?", <&touch>, "touchscreen-inverted-x?"; - 10_1_inchE_2lane = <&panel>, "compatible=waveshare,10.1inch-e-2lane-panel", + 10_1_inchE_2lane = <&legacy_panel>, "compatible=waveshare,10.1inch-e-2lane-panel", + <&legacy_panel>, "status=okay", + <&bridge>, "status=disabled", + <&panel>, "status=disabled", + <&dsi_out>, "remote-endpoint:0=", <&legacy_in>, <&touch>, "touchscreen-swapped-x-y?", <&touch>, "touchscreen-inverted-x?"; i2c1 = <&i2c_frag>, "target:0=",<&i2c1>, <0>, "-3-4+5"; disable_touch = <&touch>, "status=disabled"; - rotation = <&panel>, "rotation:0"; + rotation = <&panel>, "rotation:0", + <&legacy_panel>, "rotation:0"; invx = <&touch>,"touchscreen-inverted-x?"; invy = <&touch>,"touchscreen-inverted-y?"; swapxy = <&touch>,"touchscreen-swapped-x-y?"; dsi0 = <&dsi_frag>, "target:0=",<&dsi0>, - <&i2c_frag>, "target:0=",<&i2c_csi_dsi0>; + <&i2c_frag>, "target:0=",<&i2c_csi_dsi0>, + <&panel>, "reg:0=0"; }; }; diff --git a/arch/arm/boot/dts/overlays/vc4-kms-dsi-waveshare-panel-v2-overlay.dts b/arch/arm/boot/dts/overlays/vc4-kms-dsi-waveshare-panel-v2-overlay.dts index 5fcddb4da4a262..4e0b355e1301c8 100644 --- a/arch/arm/boot/dts/overlays/vc4-kms-dsi-waveshare-panel-v2-overlay.dts +++ b/arch/arm/boot/dts/overlays/vc4-kms-dsi-waveshare-panel-v2-overlay.dts @@ -18,11 +18,10 @@ status = "okay"; display_mcu: display_mcu@45 { - compatible = "waveshare,touchscreen-panel-regulator"; + compatible = "waveshare,dsi-touch-gpio"; reg = <0x45>; gpio-controller; #gpio-cells = <2>; - enable-gpio = <&display_mcu 2 GPIO_ACTIVE_HIGH>; }; touch: touch@5d { @@ -43,15 +42,27 @@ port { dsi_out: endpoint { remote-endpoint = <&panel_in>; + data-lanes = <1 2>; }; }; + /* + * The supplies and GPIOs cover the names used by all the + * panel drivers: each driver only looks up its own. + */ dsi_panel: dsi_panel@0 { reg = <0>; compatible = "waveshare,10.1-dsi-touch-a"; - reset-gpio = <&display_mcu 1 GPIO_ACTIVE_HIGH>; - iovcc-gpio = <&display_mcu 4 GPIO_ACTIVE_HIGH>; - avdd-gpio = <&display_mcu 0 GPIO_ACTIVE_HIGH>; + reset-gpios = <&display_mcu 1 GPIO_ACTIVE_LOW>; + enable-gpios = <&display_mcu 1 GPIO_ACTIVE_HIGH>; + iovcc-supply = <&ws_iovcc>; + vccio-supply = <&ws_iovcc>; + pp1800-supply = <&ws_iovcc>; + avdd-supply = <&ws_avdd>; + avee-supply = <&ws_avdd>; + vdd-supply = <&ws_avdd>; + vcc-supply = <&ws_avdd>; + power-supply = <&ws_avdd>; backlight = <&display_mcu>; port { @@ -77,6 +88,45 @@ }; }; + fragment@4 { + target-path = "/"; + __overlay__ { + ws_vcc: ws_panel_vcc@1 { + reg = <1>; + compatible = "regulator-fixed"; + regulator-name = "ws_panel_vcc_1"; + gpio = <&display_mcu 8 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-always-on; + }; + + ws_iovcc: ws_panel_iovcc@1 { + reg = <1>; + compatible = "regulator-fixed"; + regulator-name = "ws_panel_iovcc_1"; + gpio = <&display_mcu 4 GPIO_ACTIVE_HIGH>; + startup-delay-us = <20000>; + enable-active-high; + }; + + ws_avdd: ws_panel_avdd@1 { + reg = <1>; + compatible = "regulator-fixed"; + regulator-name = "ws_panel_avdd_1"; + gpio = <&display_mcu 0 GPIO_ACTIVE_HIGH>; + startup-delay-us = <20000>; + enable-active-high; + }; + }; + }; + + fragment@5 { + target = <&dsi_out>; + __dormant__ { + data-lanes = <1 2 3 4>; + }; + }; + __overrides__ { 3_4_inch_c = <&dsi_panel>, "compatible=waveshare,3.4-dsi-touch-c"; 4_0_inch_a = <&dsi_panel>, "compatible=waveshare,4.0-dsi-touch-a"; @@ -93,28 +143,40 @@ 7_0_inch_b = <&dsi_panel>, "compatible=waveshare,7.0-dsi-touch-b"; 7_0_inch_c = <&dsi_panel>, "compatible=waveshare,7.0-dsi-touch-c"; 8_0_inch_a = <&dsi_panel>, "compatible=waveshare,8.0-dsi-touch-a"; - 8_0_inch_a_4lane = <&dsi_panel>, "compatible=waveshare,8.0-dsi-touch-a-4lane"; + 8_0_inch_a_4lane = <&dsi_panel>, "compatible=waveshare,8.0-dsi-touch-a", + <0>, "+5"; 8_8_inch_a = <&dsi_panel>, "compatible=waveshare,8.8-dsi-touch-a", - <&display_mcu>, "pre-power-on?"; + <&dsi_panel>, "vcc-supply:0=", <&ws_iovcc>, + <&dsi_panel>, "vdd-supply:0=", <&ws_vcc>; 9_0_inch_b = <&dsi_panel>, "compatible=waveshare,9.0-dsi-touch-b", <&touch>, "touchscreen-inverted-x"; - 9_0_inch_b_4lane = <&dsi_panel>, "compatible=waveshare,9.0-dsi-touch-b-4lane", - <&touch>, "touchscreen-inverted-x"; + 9_0_inch_b_4lane = <&dsi_panel>, "compatible=waveshare,9.0-dsi-touch-b", + <&touch>, "touchscreen-inverted-x", + <0>, "+5"; 10_1_inch_a = <&dsi_panel>, "compatible=waveshare,10.1-dsi-touch-a"; - 10_1_inch_a_4lane = <&dsi_panel>, "compatible=waveshare,10.1-dsi-touch-a-4lane"; + 10_1_inch_a_4lane = <&dsi_panel>, "compatible=waveshare,10.1-dsi-touch-a", + <0>, "+5"; 10_1_inch_b = <&dsi_panel>, "compatible=waveshare,10.1-dsi-touch-b", <&touch>, "touchscreen-inverted-y"; - 10_1_inch_b_4lane = <&dsi_panel>, "compatible=waveshare,10.1-dsi-touch-b-4lane", - <&touch>, "touchscreen-inverted-y"; + 10_1_inch_b_4lane = <&dsi_panel>, "compatible=waveshare,10.1-dsi-touch-b", + <&touch>, "touchscreen-inverted-y", + <0>, "+5"; 10_1_inch_e_4lane = <&dsi_panel>, "compatible=waveshare,10.1-dsi-touch-e-4lane"; - 12_3_inch_a_4lane = <&dsi_panel>, "compatible=waveshare,12.3-dsi-touch-a-4lane", + 12_3_inch_a_4lane = <&dsi_panel>, "compatible=waveshare,12.3-dsi-touch-a", <&touch>, "touchscreen-swapped-x-y", - <&touch>, "touchscreen-inverted-y"; + <&touch>, "touchscreen-inverted-y", + <0>, "+5"; disable_touch = <&touch>, "status=disabled"; invx = <&touch>,"touchscreen-inverted-x?"; invy = <&touch>,"touchscreen-inverted-y?"; swapxy = <&touch>,"touchscreen-swapped-x-y?"; dsi0 = <&dsi_frag>, "target:0=",<&dsi0>, - <&i2c_frag>, "target:0=",<&i2c_csi_dsi0>; + <&i2c_frag>, "target:0=",<&i2c_csi_dsi0>, + <&ws_vcc>, "reg:0=0", + <&ws_vcc>, "regulator-name=ws_panel_vcc_0", + <&ws_iovcc>, "reg:0=0", + <&ws_iovcc>, "regulator-name=ws_panel_iovcc_0", + <&ws_avdd>, "reg:0=0", + <&ws_avdd>, "regulator-name=ws_panel_avdd_0"; }; }; diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig index 3d2d6932773aa6..2ad6d8b364812b 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig @@ -692,6 +692,7 @@ CONFIG_PINCTRL_MCP23S08=m CONFIG_GPIO_SYSFS=y CONFIG_GPIO_CDEV_V1=y CONFIG_GPIO_BCM_VIRT=y +CONFIG_GPIO_WAVESHARE_DSI_TOUCH=m CONFIG_GPIO_FXL6408=m CONFIG_GPIO_MAX7300=m CONFIG_GPIO_PCA953X=m @@ -765,7 +766,6 @@ CONFIG_REGULATOR_ARIZONA_LDO1=m CONFIG_REGULATOR_ARIZONA_MICSUPP=m CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY=m CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_V2=m -CONFIG_REGULATOR_WAVESHARE_TOUCHSCREEN=m CONFIG_RC_CORE=y CONFIG_BPF_LIRC_MODE2=y CONFIG_LIRC=y @@ -975,9 +975,14 @@ CONFIG_DRM_DISPLAY_CONNECTOR=m CONFIG_DRM_LONTIUM_LT8912B=m CONFIG_DRM_SIMPLE_BRIDGE=m CONFIG_DRM_TOSHIBA_TC358762=m +CONFIG_DRM_WAVESHARE_BRIDGE=m CONFIG_DRM_GUD=m +CONFIG_DRM_PANEL_FOCALTECH_OTA7290B=m +CONFIG_DRM_PANEL_HIMAX_HX83102=m +CONFIG_DRM_PANEL_HIMAX_HX8394=m CONFIG_DRM_PANEL_ILITEK_ILI9806E_SPI=m CONFIG_DRM_PANEL_ILITEK_ILI9881C=m +CONFIG_DRM_PANEL_JADARD_JD9365DA_H3=m CONFIG_DRM_PANEL_JDI_LT070ME05000=m CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m CONFIG_DRM_PANEL_SITRONIX_ST7701=m diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig index 7e4b5339533c53..e4b7e2c2b79e0e 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig @@ -685,6 +685,7 @@ CONFIG_PPS_CLIENT_GPIO=m CONFIG_PINCTRL_MCP23S08=m CONFIG_GPIO_SYSFS=y CONFIG_GPIO_CDEV_V1=y +CONFIG_GPIO_WAVESHARE_DSI_TOUCH=m CONFIG_GPIO_FXL6408=m CONFIG_GPIO_MAX7300=m CONFIG_GPIO_PCA953X=m @@ -758,7 +759,6 @@ CONFIG_REGULATOR_ARIZONA_LDO1=m CONFIG_REGULATOR_ARIZONA_MICSUPP=m CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY=m CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_V2=m -CONFIG_REGULATOR_WAVESHARE_TOUCHSCREEN=m CONFIG_RC_CORE=y CONFIG_BPF_LIRC_MODE2=y CONFIG_LIRC=y @@ -968,9 +968,14 @@ CONFIG_DRM_DISPLAY_CONNECTOR=m CONFIG_DRM_LONTIUM_LT8912B=m CONFIG_DRM_SIMPLE_BRIDGE=m CONFIG_DRM_TOSHIBA_TC358762=m +CONFIG_DRM_WAVESHARE_BRIDGE=m CONFIG_DRM_GUD=m +CONFIG_DRM_PANEL_FOCALTECH_OTA7290B=m +CONFIG_DRM_PANEL_HIMAX_HX83102=m +CONFIG_DRM_PANEL_HIMAX_HX8394=m CONFIG_DRM_PANEL_ILITEK_ILI9806E_SPI=m CONFIG_DRM_PANEL_ILITEK_ILI9881C=m +CONFIG_DRM_PANEL_JADARD_JD9365DA_H3=m CONFIG_DRM_PANEL_JDI_LT070ME05000=m CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m CONFIG_DRM_PANEL_SITRONIX_ST7701=m diff --git a/arch/arm64/configs/bcm2711_defconfig b/arch/arm64/configs/bcm2711_defconfig index c12d6757f0f187..8c5750a202e247 100644 --- a/arch/arm64/configs/bcm2711_defconfig +++ b/arch/arm64/configs/bcm2711_defconfig @@ -780,6 +780,7 @@ CONFIG_PINCTRL_BCM2712=y CONFIG_GPIO_SYSFS=y CONFIG_GPIO_CDEV_V1=y CONFIG_GPIO_BCM_VIRT=y +CONFIG_GPIO_WAVESHARE_DSI_TOUCH=m CONFIG_GPIO_FXL6408=m CONFIG_GPIO_MAX7300=m CONFIG_GPIO_PCA953X=m @@ -858,7 +859,6 @@ CONFIG_REGULATOR_ARIZONA_MICSUPP=m CONFIG_REGULATOR_GPIO=y CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY=m CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_V2=m -CONFIG_REGULATOR_WAVESHARE_TOUCHSCREEN=m CONFIG_REGULATOR_EDATEC_PANEL=m CONFIG_RC_CORE=y CONFIG_BPF_LIRC_MODE2=y @@ -1080,11 +1080,16 @@ CONFIG_DRM_LONTIUM_LT8912B=m CONFIG_DRM_SIMPLE_BRIDGE=m CONFIG_DRM_TOSHIBA_TC358762=m CONFIG_DRM_TI_SN65DSI83=m +CONFIG_DRM_WAVESHARE_BRIDGE=m CONFIG_DRM_GUD=m +CONFIG_DRM_PANEL_FOCALTECH_OTA7290B=m CONFIG_DRM_PANEL_LVDS=m +CONFIG_DRM_PANEL_HIMAX_HX83102=m +CONFIG_DRM_PANEL_HIMAX_HX8394=m CONFIG_DRM_PANEL_ILITEK_IL79600A=m CONFIG_DRM_PANEL_ILITEK_ILI9806E_SPI=m CONFIG_DRM_PANEL_ILITEK_ILI9881C=m +CONFIG_DRM_PANEL_JADARD_JD9365DA_H3=m CONFIG_DRM_PANEL_JDI_LT070ME05000=m CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m CONFIG_DRM_PANEL_SITRONIX_ST7701=m diff --git a/arch/arm64/configs/bcm2711_rt_defconfig b/arch/arm64/configs/bcm2711_rt_defconfig index c8aef86e27c6bb..513ab9a71da5f7 100644 --- a/arch/arm64/configs/bcm2711_rt_defconfig +++ b/arch/arm64/configs/bcm2711_rt_defconfig @@ -779,6 +779,7 @@ CONFIG_PINCTRL_BCM2712=y CONFIG_GPIO_SYSFS=y CONFIG_GPIO_CDEV_V1=y CONFIG_GPIO_BCM_VIRT=y +CONFIG_GPIO_WAVESHARE_DSI_TOUCH=m CONFIG_GPIO_FXL6408=m CONFIG_GPIO_MAX7300=m CONFIG_GPIO_PCA953X=m @@ -857,7 +858,6 @@ CONFIG_REGULATOR_ARIZONA_MICSUPP=m CONFIG_REGULATOR_GPIO=y CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY=m CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_V2=m -CONFIG_REGULATOR_WAVESHARE_TOUCHSCREEN=m CONFIG_REGULATOR_EDATEC_PANEL=m CONFIG_RC_CORE=y CONFIG_BPF_LIRC_MODE2=y @@ -1077,10 +1077,15 @@ CONFIG_DRM_LONTIUM_LT8912B=m CONFIG_DRM_SIMPLE_BRIDGE=m CONFIG_DRM_TOSHIBA_TC358762=m CONFIG_DRM_TI_SN65DSI83=m +CONFIG_DRM_WAVESHARE_BRIDGE=m CONFIG_DRM_GUD=m +CONFIG_DRM_PANEL_FOCALTECH_OTA7290B=m CONFIG_DRM_PANEL_LVDS=m +CONFIG_DRM_PANEL_HIMAX_HX83102=m +CONFIG_DRM_PANEL_HIMAX_HX8394=m CONFIG_DRM_PANEL_ILITEK_ILI9806E_SPI=m CONFIG_DRM_PANEL_ILITEK_ILI9881C=m +CONFIG_DRM_PANEL_JADARD_JD9365DA_H3=m CONFIG_DRM_PANEL_JDI_LT070ME05000=m CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m CONFIG_DRM_PANEL_SITRONIX_ST7701=m diff --git a/arch/arm64/configs/bcm2712_defconfig b/arch/arm64/configs/bcm2712_defconfig index b6acb64c2623c0..8952d0c25e7831 100644 --- a/arch/arm64/configs/bcm2712_defconfig +++ b/arch/arm64/configs/bcm2712_defconfig @@ -781,6 +781,7 @@ CONFIG_PINCTRL_BCM2712=y CONFIG_GPIO_SYSFS=y CONFIG_GPIO_CDEV_V1=y CONFIG_GPIO_BCM_VIRT=y +CONFIG_GPIO_WAVESHARE_DSI_TOUCH=m CONFIG_GPIO_FXL6408=m CONFIG_GPIO_MAX7300=m CONFIG_GPIO_PCA953X=m @@ -859,7 +860,6 @@ CONFIG_REGULATOR_ARIZONA_MICSUPP=m CONFIG_REGULATOR_GPIO=y CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY=m CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_V2=m -CONFIG_REGULATOR_WAVESHARE_TOUCHSCREEN=m CONFIG_REGULATOR_EDATEC_PANEL=m CONFIG_RC_CORE=y CONFIG_BPF_LIRC_MODE2=y @@ -1081,11 +1081,16 @@ CONFIG_DRM_LONTIUM_LT8912B=m CONFIG_DRM_SIMPLE_BRIDGE=m CONFIG_DRM_TOSHIBA_TC358762=m CONFIG_DRM_TI_SN65DSI83=m +CONFIG_DRM_WAVESHARE_BRIDGE=m CONFIG_DRM_GUD=m +CONFIG_DRM_PANEL_FOCALTECH_OTA7290B=m CONFIG_DRM_PANEL_LVDS=m +CONFIG_DRM_PANEL_HIMAX_HX83102=m +CONFIG_DRM_PANEL_HIMAX_HX8394=m CONFIG_DRM_PANEL_ILITEK_IL79600A=m CONFIG_DRM_PANEL_ILITEK_ILI9806E_SPI=m CONFIG_DRM_PANEL_ILITEK_ILI9881C=m +CONFIG_DRM_PANEL_JADARD_JD9365DA_H3=m CONFIG_DRM_PANEL_JDI_LT070ME05000=m CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m CONFIG_DRM_PANEL_SITRONIX_ST7701=m diff --git a/drivers/gpu/drm/panel/panel-himax-hx8394.c b/drivers/gpu/drm/panel/panel-himax-hx8394.c index 4180d4aadf5ebf..440fa07d4aeb3b 100644 --- a/drivers/gpu/drm/panel/panel-himax-hx8394.c +++ b/drivers/gpu/drm/panel/panel-himax-hx8394.c @@ -82,6 +82,7 @@ struct hx8394_panel_desc { unsigned long mode_flags; enum mipi_dsi_pixel_format format; void (*init_sequence)(struct mipi_dsi_multi_context *dsi_ctx); + void (*display_on_sequence)(struct mipi_dsi_multi_context *dsi_ctx); }; static inline struct hx8394 *panel_to_hx8394(struct drm_panel *panel) @@ -708,6 +709,19 @@ static void waveshare_5_0_inch_a_init_sequence(struct mipi_dsi_multi_context *ds 0x40, 0x81, 0x50, 0x00, 0x1a, 0xfc, 0x01); }; +static void waveshare_5_0_inch_a_display_on_sequence(struct mipi_dsi_multi_context *dsi_ctx) +{ + mipi_dsi_msleep(dsi_ctx, 200); + + /* 5.19.3 SETDISP: Set display related register (B2h) */ + mipi_dsi_dcs_write_seq_multi(dsi_ctx, HX8394_CMD_SETDISP, + 0x00, 0x80, 0x64, 0x0c, 0x06, 0x2f, 0x00, 0x00, + 0x00, 0x00, 0xc0, 0x18); + + mipi_dsi_dcs_set_display_on_multi(dsi_ctx); + mipi_dsi_msleep(dsi_ctx, 80); +} + static const struct drm_display_mode waveshare_5_0_inch_a_mode = { .clock = 70000, .hdisplay = 720, @@ -729,6 +743,7 @@ static const struct hx8394_panel_desc waveshare_5_0_inch_a_desc = { MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS, .format = MIPI_DSI_FMT_RGB888, .init_sequence = waveshare_5_0_inch_a_init_sequence, + .display_on_sequence = waveshare_5_0_inch_a_display_on_sequence, }; static const struct drm_display_mode waveshare_5_5_inch_a_mode = { @@ -882,10 +897,14 @@ static int hx8394_enable(struct drm_panel *panel) mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx); - /* Panel is operational 120 msec after reset */ - mipi_dsi_msleep(&dsi_ctx, 120); + if (ctx->desc->display_on_sequence) { + ctx->desc->display_on_sequence(&dsi_ctx); + } else { + /* Panel is operational 120 msec after reset */ + mipi_dsi_msleep(&dsi_ctx, 120); - mipi_dsi_dcs_set_display_on_multi(&dsi_ctx); + mipi_dsi_dcs_set_display_on_multi(&dsi_ctx); + } if (dsi_ctx.accum_err) hx8394_disable(panel); diff --git a/drivers/gpu/drm/panel/panel-waveshare-dsi-v2.c b/drivers/gpu/drm/panel/panel-waveshare-dsi-v2.c index 2dc87c64b4b6b1..7d02510ca4f5ec 100644 --- a/drivers/gpu/drm/panel/panel-waveshare-dsi-v2.c +++ b/drivers/gpu/drm/panel/panel-waveshare-dsi-v2.c @@ -36,10 +36,10 @@ struct ws_panel { struct mipi_dsi_device *dsi; const struct ws_panel_desc *desc; - struct regulator *power; struct gpio_desc *reset; - struct gpio_desc *iovcc; - struct gpio_desc *avdd; + struct regulator *iovcc; + struct regulator *avdd; + bool prepared; enum drm_panel_orientation orientation; }; @@ -73,917 +73,6 @@ struct panel_init_cmd { } \ } -static const struct panel_init_cmd ws_panel_12_3_a_4lane_init[] = { - _INIT_DCS_CMD(0xB9, 0x83, 0x10, 0x2E), - _INIT_DCS_CMD(0xE9, 0xCD), - _INIT_DCS_CMD(0xBB, 0x01), - _INIT_DCS_CMD(0xE9, 0x00), - _INIT_DCS_CMD(0xD1, 0x67, 0x2C, 0xFF, 0x05), - _INIT_DCS_CMD(0xBE, 0x11, 0x96, 0x89), - _INIT_DCS_CMD(0xD9, 0x04, 0x03, 0x04), - _INIT_DCS_CMD(0xB1, 0x10, 0xFA, 0xAF, 0xAF, 0x33, 0x33, 0xB1, 0x4D, - 0x2F, 0x36, 0x36, 0x36, 0x36, 0x22, 0x21, 0x15, 0x00), - _INIT_DCS_CMD(0xB2, 0x00, 0xD0, 0x27, 0x80, 0x00, 0x14, 0x40, 0x2C, - 0x32, 0x02, 0x00, 0x00, 0x15, 0x20, 0xD7, 0x00), - _INIT_DCS_CMD(0xB4, 0x98, 0xA0, 0x01, 0x01, 0x98, 0xA0, 0x68, 0x50, - 0x01, 0xC7, 0x01, 0x58, 0x00, 0xFF, 0x00, 0xFF), - _INIT_DCS_CMD(0xB6, 0x4D, 0x4D, 0xE3), - _INIT_DCS_CMD(0xBF, 0xFC, 0x85, 0x80), - _INIT_DCS_CMD(0xD2, 0x33, 0x33), - _INIT_DCS_CMD(0xD3, 0x00, 0x00, 0x00, 0x00, 0x64, 0x04, 0x00, 0x08, - 0x08, 0x27, 0x27, 0x22, 0x2F, 0x15, 0x15, 0x04, 0x04, - 0x32, 0x10, 0x13, 0x00, 0x13, 0x32, 0x10, 0x1F, 0x00, - 0x02, 0x32, 0x17, 0xFD, 0x00, 0x10, 0x00, 0x00, 0x20, - 0x30, 0x01, 0x55, 0x21, 0x38, 0x01, 0x55, 0x0F), - _INIT_DCS_CMD(0xE0, 0x00, 0x0C, 0x1A, 0x23, 0x2B, 0x4F, 0x64, 0x69, - 0x6C, 0x64, 0x77, 0x77, 0x76, 0x80, 0x79, 0x7E, 0x85, - 0x9A, 0x97, 0x4D, 0x56, 0x64, 0x70, 0x00, 0x0C, 0x1A, - 0x23, 0x2B, 0x4F, 0x64, 0x69, 0x6C, 0x64, 0x77, 0x77, - 0x76, 0x80, 0x79, 0x7E, 0x85, 0x9A, 0x97, 0x4D, 0x56, - 0x64, 0x76), - _INIT_DCS_CMD(0xBD, 0x01), - _INIT_DCS_CMD(0xB1, 0x01, 0x9B, 0x01, 0x31), - _INIT_DCS_CMD(0xCB, 0x80, 0x36, 0x12, 0x16, 0xC0, 0x28, 0x40, 0x84, - 0x22), - _INIT_DCS_CMD(0xD3, 0x01, 0x00, 0xFC, 0x00, 0x00, 0x11, 0x10, 0x00, - 0x0E, 0x00, 0x01), - _INIT_DCS_CMD(0xBD, 0x02), - _INIT_DCS_CMD(0xB4, 0x4E, 0x00, 0x33, 0x11, 0x33, 0x88), - _INIT_DCS_CMD(0xBF, 0xF2, 0x00, 0x02), - _INIT_DCS_CMD(0xBD, 0x00), - _INIT_DCS_CMD(0xC0, 0x23, 0x23, 0x22, 0x11, 0xA2, 0x17, 0x00, 0x80, - 0x00, 0x00, 0x08, 0x00, 0x63, 0x63), - _INIT_DCS_CMD(0xC6, 0xF9), - _INIT_DCS_CMD(0xC7, 0x30), - _INIT_DCS_CMD(0xC8, 0x00, 0x04, 0x04, 0x00, 0x00, 0x82, 0x13, 0x01), - _INIT_DCS_CMD(0xD0, 0x07, 0x04, 0x05), - _INIT_DCS_CMD(0xD5, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x21, 0x20, - 0x21, 0x20, 0x01, 0x00, 0x03, 0x02, 0x05, 0x04, 0x07, - 0x06, 0x1A, 0x1A, 0x1A, 0x1A, 0x9A, 0x9A, 0x9A, 0x9A, - 0x18, 0x18, 0x18, 0x18, 0x21, 0x20, 0x21, 0x20, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18), - _INIT_DCS_CMD(0xD6, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x20, 0x21, - 0x20, 0x21, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x07, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, - 0x18, 0x18, 0x18, 0x18, 0x20, 0x21, 0x20, 0x21, 0x98, - 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98), - _INIT_DCS_CMD(0xBD, 0x01), - _INIT_DCS_CMD(0xE7, 0x00, 0x34, 0x01, 0x88, 0x0E, 0xBE, 0x0F), - _INIT_DCS_CMD(0xBD, 0x00), - _INIT_DCS_CMD(0xC2, 0x43, 0xFF, 0x10), - _INIT_DCS_CMD(0xCC, 0x02), - _INIT_DCS_CMD(0xBD, 0x03), - _INIT_DCS_CMD(0xB2, 0x80), - _INIT_DCS_CMD(0xBD, 0x00), - _INIT_DCS_CMD(0xD8, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x80, 0x2A, 0xAA, 0xAA, - 0xAA, 0xAA, 0x80, 0x2A, 0xAA, 0xAA, 0xAA), - _INIT_DCS_CMD(0xBD, 0x01), - _INIT_DCS_CMD(0xD8, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA), - _INIT_DCS_CMD(0xBD, 0x02), - _INIT_DCS_CMD(0xD8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xF0), - _INIT_DCS_CMD(0xBD, 0x00), - _INIT_DCS_CMD(0x11), - _INIT_DELAY_CMD(120), - _INIT_DCS_CMD(0x29), - _INIT_DELAY_CMD(20), - {}, -}; - -static const struct panel_init_cmd ws_panel_10_1_a_4lane_init[] = { - _INIT_DCS_CMD(0xE0, 0x00), - _INIT_DCS_CMD(0xE1, 0x93), - _INIT_DCS_CMD(0xE2, 0x65), - _INIT_DCS_CMD(0xE3, 0xF8), - _INIT_DCS_CMD(0x80, 0x03), - _INIT_DCS_CMD(0xE0, 0x01), - _INIT_DCS_CMD(0x00, 0x00), - _INIT_DCS_CMD(0x01, 0x3B), - _INIT_DCS_CMD(0x0C, 0x74), - _INIT_DCS_CMD(0x17, 0x00), - _INIT_DCS_CMD(0x18, 0xAF), - _INIT_DCS_CMD(0x19, 0x00), - _INIT_DCS_CMD(0x1A, 0x00), - _INIT_DCS_CMD(0x1B, 0xAF), - _INIT_DCS_CMD(0x1C, 0x00), - _INIT_DCS_CMD(0x35, 0x26), - _INIT_DCS_CMD(0x37, 0x09), - _INIT_DCS_CMD(0x38, 0x04), - _INIT_DCS_CMD(0x39, 0x00), - _INIT_DCS_CMD(0x3A, 0x01), - _INIT_DCS_CMD(0x3C, 0x78), - _INIT_DCS_CMD(0x3D, 0xFF), - _INIT_DCS_CMD(0x3E, 0xFF), - _INIT_DCS_CMD(0x3F, 0x7F), - _INIT_DCS_CMD(0x40, 0x06), - _INIT_DCS_CMD(0x41, 0xA0), - _INIT_DCS_CMD(0x42, 0x81), - _INIT_DCS_CMD(0x43, 0x14), - _INIT_DCS_CMD(0x44, 0x23), - _INIT_DCS_CMD(0x45, 0x28), - _INIT_DCS_CMD(0x55, 0x02), - _INIT_DCS_CMD(0x57, 0x69), - _INIT_DCS_CMD(0x59, 0x0A), - _INIT_DCS_CMD(0x5A, 0x2A), - _INIT_DCS_CMD(0x5B, 0x17), - _INIT_DCS_CMD(0x5D, 0x7F), - _INIT_DCS_CMD(0x5E, 0x6B), - _INIT_DCS_CMD(0x5F, 0x5C), - _INIT_DCS_CMD(0x60, 0x4F), - _INIT_DCS_CMD(0x61, 0x4D), - _INIT_DCS_CMD(0x62, 0x3F), - _INIT_DCS_CMD(0x63, 0x42), - _INIT_DCS_CMD(0x64, 0x2B), - _INIT_DCS_CMD(0x65, 0x44), - _INIT_DCS_CMD(0x66, 0x43), - _INIT_DCS_CMD(0x67, 0x43), - _INIT_DCS_CMD(0x68, 0x63), - _INIT_DCS_CMD(0x69, 0x52), - _INIT_DCS_CMD(0x6A, 0x5A), - _INIT_DCS_CMD(0x6B, 0x4F), - _INIT_DCS_CMD(0x6C, 0x4E), - _INIT_DCS_CMD(0x6D, 0x20), - _INIT_DCS_CMD(0x6E, 0x0F), - _INIT_DCS_CMD(0x6F, 0x00), - _INIT_DCS_CMD(0x70, 0x7F), - _INIT_DCS_CMD(0x71, 0x6B), - _INIT_DCS_CMD(0x72, 0x5C), - _INIT_DCS_CMD(0x73, 0x4F), - _INIT_DCS_CMD(0x74, 0x4D), - _INIT_DCS_CMD(0x75, 0x3F), - _INIT_DCS_CMD(0x76, 0x42), - _INIT_DCS_CMD(0x77, 0x2B), - _INIT_DCS_CMD(0x78, 0x44), - _INIT_DCS_CMD(0x79, 0x43), - _INIT_DCS_CMD(0x7A, 0x43), - _INIT_DCS_CMD(0x7B, 0x63), - _INIT_DCS_CMD(0x7C, 0x52), - _INIT_DCS_CMD(0x7D, 0x5A), - _INIT_DCS_CMD(0x7E, 0x4F), - _INIT_DCS_CMD(0x7F, 0x4E), - _INIT_DCS_CMD(0x80, 0x20), - _INIT_DCS_CMD(0x81, 0x0F), - _INIT_DCS_CMD(0x82, 0x00), - _INIT_DCS_CMD(0xE0, 0x02), - _INIT_DCS_CMD(0x00, 0x02), - _INIT_DCS_CMD(0x01, 0x02), - _INIT_DCS_CMD(0x02, 0x00), - _INIT_DCS_CMD(0x03, 0x00), - _INIT_DCS_CMD(0x04, 0x1E), - _INIT_DCS_CMD(0x05, 0x1E), - _INIT_DCS_CMD(0x06, 0x1F), - _INIT_DCS_CMD(0x07, 0x1F), - _INIT_DCS_CMD(0x08, 0x1F), - _INIT_DCS_CMD(0x09, 0x17), - _INIT_DCS_CMD(0x0A, 0x17), - _INIT_DCS_CMD(0x0B, 0x37), - _INIT_DCS_CMD(0x0C, 0x37), - _INIT_DCS_CMD(0x0D, 0x47), - _INIT_DCS_CMD(0x0E, 0x47), - _INIT_DCS_CMD(0x0F, 0x45), - _INIT_DCS_CMD(0x10, 0x45), - _INIT_DCS_CMD(0x11, 0x4B), - _INIT_DCS_CMD(0x12, 0x4B), - _INIT_DCS_CMD(0x13, 0x49), - _INIT_DCS_CMD(0x14, 0x49), - _INIT_DCS_CMD(0x15, 0x1F), - _INIT_DCS_CMD(0x16, 0x01), - _INIT_DCS_CMD(0x17, 0x01), - _INIT_DCS_CMD(0x18, 0x00), - _INIT_DCS_CMD(0x19, 0x00), - _INIT_DCS_CMD(0x1A, 0x1E), - _INIT_DCS_CMD(0x1B, 0x1E), - _INIT_DCS_CMD(0x1C, 0x1F), - _INIT_DCS_CMD(0x1D, 0x1F), - _INIT_DCS_CMD(0x1E, 0x1F), - _INIT_DCS_CMD(0x1F, 0x17), - _INIT_DCS_CMD(0x20, 0x17), - _INIT_DCS_CMD(0x21, 0x37), - _INIT_DCS_CMD(0x22, 0x37), - _INIT_DCS_CMD(0x23, 0x46), - _INIT_DCS_CMD(0x24, 0x46), - _INIT_DCS_CMD(0x25, 0x44), - _INIT_DCS_CMD(0x26, 0x44), - _INIT_DCS_CMD(0x27, 0x4A), - _INIT_DCS_CMD(0x28, 0x4A), - _INIT_DCS_CMD(0x29, 0x48), - _INIT_DCS_CMD(0x2A, 0x48), - _INIT_DCS_CMD(0x2B, 0x1F), - _INIT_DCS_CMD(0x2C, 0x01), - _INIT_DCS_CMD(0x2D, 0x01), - _INIT_DCS_CMD(0x2E, 0x00), - _INIT_DCS_CMD(0x2F, 0x00), - _INIT_DCS_CMD(0x30, 0x1F), - _INIT_DCS_CMD(0x31, 0x1F), - _INIT_DCS_CMD(0x32, 0x1E), - _INIT_DCS_CMD(0x33, 0x1E), - _INIT_DCS_CMD(0x34, 0x1F), - _INIT_DCS_CMD(0x35, 0x17), - _INIT_DCS_CMD(0x36, 0x17), - _INIT_DCS_CMD(0x37, 0x37), - _INIT_DCS_CMD(0x38, 0x37), - _INIT_DCS_CMD(0x39, 0x08), - _INIT_DCS_CMD(0x3A, 0x08), - _INIT_DCS_CMD(0x3B, 0x0A), - _INIT_DCS_CMD(0x3C, 0x0A), - _INIT_DCS_CMD(0x3D, 0x04), - _INIT_DCS_CMD(0x3E, 0x04), - _INIT_DCS_CMD(0x3F, 0x06), - _INIT_DCS_CMD(0x40, 0x06), - _INIT_DCS_CMD(0x41, 0x1F), - _INIT_DCS_CMD(0x42, 0x02), - _INIT_DCS_CMD(0x43, 0x02), - _INIT_DCS_CMD(0x44, 0x00), - _INIT_DCS_CMD(0x45, 0x00), - _INIT_DCS_CMD(0x46, 0x1F), - _INIT_DCS_CMD(0x47, 0x1F), - _INIT_DCS_CMD(0x48, 0x1E), - _INIT_DCS_CMD(0x49, 0x1E), - _INIT_DCS_CMD(0x4A, 0x1F), - _INIT_DCS_CMD(0x4B, 0x17), - _INIT_DCS_CMD(0x4C, 0x17), - _INIT_DCS_CMD(0x4D, 0x37), - _INIT_DCS_CMD(0x4E, 0x37), - _INIT_DCS_CMD(0x4F, 0x09), - _INIT_DCS_CMD(0x50, 0x09), - _INIT_DCS_CMD(0x51, 0x0B), - _INIT_DCS_CMD(0x52, 0x0B), - _INIT_DCS_CMD(0x53, 0x05), - _INIT_DCS_CMD(0x54, 0x05), - _INIT_DCS_CMD(0x55, 0x07), - _INIT_DCS_CMD(0x56, 0x07), - _INIT_DCS_CMD(0x57, 0x1F), - _INIT_DCS_CMD(0x58, 0x40), - _INIT_DCS_CMD(0x5B, 0x30), - _INIT_DCS_CMD(0x5C, 0x16), - _INIT_DCS_CMD(0x5D, 0x34), - _INIT_DCS_CMD(0x5E, 0x05), - _INIT_DCS_CMD(0x5F, 0x02), - _INIT_DCS_CMD(0x63, 0x00), - _INIT_DCS_CMD(0x64, 0x6A), - _INIT_DCS_CMD(0x67, 0x73), - _INIT_DCS_CMD(0x68, 0x1D), - _INIT_DCS_CMD(0x69, 0x08), - _INIT_DCS_CMD(0x6A, 0x6A), - _INIT_DCS_CMD(0x6B, 0x08), - _INIT_DCS_CMD(0x6C, 0x00), - _INIT_DCS_CMD(0x6D, 0x00), - _INIT_DCS_CMD(0x6E, 0x00), - _INIT_DCS_CMD(0x6F, 0x88), - _INIT_DCS_CMD(0x75, 0xFF), - _INIT_DCS_CMD(0x77, 0xDD), - _INIT_DCS_CMD(0x78, 0x3F), - _INIT_DCS_CMD(0x79, 0x15), - _INIT_DCS_CMD(0x7A, 0x17), - _INIT_DCS_CMD(0x7D, 0x14), - _INIT_DCS_CMD(0x7E, 0x82), - _INIT_DCS_CMD(0xE0, 0x04), - _INIT_DCS_CMD(0x00, 0x0E), - _INIT_DCS_CMD(0x02, 0xB3), - _INIT_DCS_CMD(0x09, 0x61), - _INIT_DCS_CMD(0x0E, 0x48), - _INIT_DCS_CMD(0xE0, 0x00), - _INIT_DCS_CMD(0xE6, 0x02), - _INIT_DCS_CMD(0xE7, 0x0C), - _INIT_DCS_CMD(0x11), - _INIT_DELAY_CMD(120), - _INIT_DCS_CMD(0x29), - _INIT_DELAY_CMD(60), - {}, -}; - -static const struct panel_init_cmd ws_panel_10_1_a_init[] = { - _INIT_DCS_CMD(0xE0, 0x00), - _INIT_DCS_CMD(0xE1, 0x93), - _INIT_DCS_CMD(0xE2, 0x65), - _INIT_DCS_CMD(0xE3, 0xF8), - _INIT_DCS_CMD(0x80, 0x01), - _INIT_DCS_CMD(0xE0, 0x01), - _INIT_DCS_CMD(0x00, 0x00), - _INIT_DCS_CMD(0x01, 0x38), - _INIT_DCS_CMD(0x03, 0x10), - _INIT_DCS_CMD(0x04, 0x38), - _INIT_DCS_CMD(0x0C, 0x74), - _INIT_DCS_CMD(0x17, 0x00), - _INIT_DCS_CMD(0x18, 0xAF), - _INIT_DCS_CMD(0x19, 0x00), - _INIT_DCS_CMD(0x1A, 0x00), - _INIT_DCS_CMD(0x1B, 0xAF), - _INIT_DCS_CMD(0x1C, 0x00), - _INIT_DCS_CMD(0x35, 0x26), - _INIT_DCS_CMD(0x37, 0x09), - _INIT_DCS_CMD(0x38, 0x04), - _INIT_DCS_CMD(0x39, 0x00), - _INIT_DCS_CMD(0x3A, 0x01), - _INIT_DCS_CMD(0x3C, 0x78), - _INIT_DCS_CMD(0x3D, 0xFF), - _INIT_DCS_CMD(0x3E, 0xFF), - _INIT_DCS_CMD(0x3F, 0x7F), - _INIT_DCS_CMD(0x40, 0x06), - _INIT_DCS_CMD(0x41, 0xA0), - _INIT_DCS_CMD(0x42, 0x81), - _INIT_DCS_CMD(0x43, 0x1E), - _INIT_DCS_CMD(0x44, 0x0D), - _INIT_DCS_CMD(0x45, 0x28), - _INIT_DCS_CMD(0x55, 0x02), - _INIT_DCS_CMD(0x57, 0x69), - _INIT_DCS_CMD(0x59, 0x0A), - _INIT_DCS_CMD(0x5A, 0x2A), - _INIT_DCS_CMD(0x5B, 0x17), - _INIT_DCS_CMD(0x5D, 0x7F), - _INIT_DCS_CMD(0x5E, 0x6A), - _INIT_DCS_CMD(0x5F, 0x5B), - _INIT_DCS_CMD(0x60, 0x4F), - _INIT_DCS_CMD(0x61, 0x4A), - _INIT_DCS_CMD(0x62, 0x3D), - _INIT_DCS_CMD(0x63, 0x41), - _INIT_DCS_CMD(0x64, 0x2A), - _INIT_DCS_CMD(0x65, 0x44), - _INIT_DCS_CMD(0x66, 0x43), - _INIT_DCS_CMD(0x67, 0x44), - _INIT_DCS_CMD(0x68, 0x62), - _INIT_DCS_CMD(0x69, 0x52), - _INIT_DCS_CMD(0x6A, 0x59), - _INIT_DCS_CMD(0x6B, 0x4C), - _INIT_DCS_CMD(0x6C, 0x48), - _INIT_DCS_CMD(0x6D, 0x3A), - _INIT_DCS_CMD(0x6E, 0x26), - _INIT_DCS_CMD(0x6F, 0x00), - _INIT_DCS_CMD(0x70, 0x7F), - _INIT_DCS_CMD(0x71, 0x6A), - _INIT_DCS_CMD(0x72, 0x5B), - _INIT_DCS_CMD(0x73, 0x4F), - _INIT_DCS_CMD(0x74, 0x4A), - _INIT_DCS_CMD(0x75, 0x3D), - _INIT_DCS_CMD(0x76, 0x41), - _INIT_DCS_CMD(0x77, 0x2A), - _INIT_DCS_CMD(0x78, 0x44), - _INIT_DCS_CMD(0x79, 0x43), - _INIT_DCS_CMD(0x7A, 0x44), - _INIT_DCS_CMD(0x7B, 0x62), - _INIT_DCS_CMD(0x7C, 0x52), - _INIT_DCS_CMD(0x7D, 0x59), - _INIT_DCS_CMD(0x7E, 0x4C), - _INIT_DCS_CMD(0x7F, 0x48), - _INIT_DCS_CMD(0x80, 0x3A), - _INIT_DCS_CMD(0x81, 0x26), - _INIT_DCS_CMD(0x82, 0x00), - _INIT_DCS_CMD(0xE0, 0x02), - _INIT_DCS_CMD(0x00, 0x42), - _INIT_DCS_CMD(0x01, 0x42), - _INIT_DCS_CMD(0x02, 0x40), - _INIT_DCS_CMD(0x03, 0x40), - _INIT_DCS_CMD(0x04, 0x5E), - _INIT_DCS_CMD(0x05, 0x5E), - _INIT_DCS_CMD(0x06, 0x5F), - _INIT_DCS_CMD(0x07, 0x5F), - _INIT_DCS_CMD(0x08, 0x5F), - _INIT_DCS_CMD(0x09, 0x57), - _INIT_DCS_CMD(0x0A, 0x57), - _INIT_DCS_CMD(0x0B, 0x77), - _INIT_DCS_CMD(0x0C, 0x77), - _INIT_DCS_CMD(0x0D, 0x47), - _INIT_DCS_CMD(0x0E, 0x47), - _INIT_DCS_CMD(0x0F, 0x45), - _INIT_DCS_CMD(0x10, 0x45), - _INIT_DCS_CMD(0x11, 0x4B), - _INIT_DCS_CMD(0x12, 0x4B), - _INIT_DCS_CMD(0x13, 0x49), - _INIT_DCS_CMD(0x14, 0x49), - _INIT_DCS_CMD(0x15, 0x5F), - _INIT_DCS_CMD(0x16, 0x41), - _INIT_DCS_CMD(0x17, 0x41), - _INIT_DCS_CMD(0x18, 0x40), - _INIT_DCS_CMD(0x19, 0x40), - _INIT_DCS_CMD(0x1A, 0x5E), - _INIT_DCS_CMD(0x1B, 0x5E), - _INIT_DCS_CMD(0x1C, 0x5F), - _INIT_DCS_CMD(0x1D, 0x5F), - _INIT_DCS_CMD(0x1E, 0x5F), - _INIT_DCS_CMD(0x1F, 0x57), - _INIT_DCS_CMD(0x20, 0x57), - _INIT_DCS_CMD(0x21, 0x77), - _INIT_DCS_CMD(0x22, 0x77), - _INIT_DCS_CMD(0x23, 0x46), - _INIT_DCS_CMD(0x24, 0x46), - _INIT_DCS_CMD(0x25, 0x44), - _INIT_DCS_CMD(0x26, 0x44), - _INIT_DCS_CMD(0x27, 0x4A), - _INIT_DCS_CMD(0x28, 0x4A), - _INIT_DCS_CMD(0x29, 0x48), - _INIT_DCS_CMD(0x2A, 0x48), - _INIT_DCS_CMD(0x2B, 0x5F), - _INIT_DCS_CMD(0x2C, 0x01), - _INIT_DCS_CMD(0x2D, 0x01), - _INIT_DCS_CMD(0x2E, 0x00), - _INIT_DCS_CMD(0x2F, 0x00), - _INIT_DCS_CMD(0x30, 0x1F), - _INIT_DCS_CMD(0x31, 0x1F), - _INIT_DCS_CMD(0x32, 0x1E), - _INIT_DCS_CMD(0x33, 0x1E), - _INIT_DCS_CMD(0x34, 0x1F), - _INIT_DCS_CMD(0x35, 0x17), - _INIT_DCS_CMD(0x36, 0x17), - _INIT_DCS_CMD(0x37, 0x37), - _INIT_DCS_CMD(0x38, 0x37), - _INIT_DCS_CMD(0x39, 0x08), - _INIT_DCS_CMD(0x3A, 0x08), - _INIT_DCS_CMD(0x3B, 0x0A), - _INIT_DCS_CMD(0x3C, 0x0A), - _INIT_DCS_CMD(0x3D, 0x04), - _INIT_DCS_CMD(0x3E, 0x04), - _INIT_DCS_CMD(0x3F, 0x06), - _INIT_DCS_CMD(0x40, 0x06), - _INIT_DCS_CMD(0x41, 0x1F), - _INIT_DCS_CMD(0x42, 0x02), - _INIT_DCS_CMD(0x43, 0x02), - _INIT_DCS_CMD(0x44, 0x00), - _INIT_DCS_CMD(0x45, 0x00), - _INIT_DCS_CMD(0x46, 0x1F), - _INIT_DCS_CMD(0x47, 0x1F), - _INIT_DCS_CMD(0x48, 0x1E), - _INIT_DCS_CMD(0x49, 0x1E), - _INIT_DCS_CMD(0x4A, 0x1F), - _INIT_DCS_CMD(0x4B, 0x17), - _INIT_DCS_CMD(0x4C, 0x17), - _INIT_DCS_CMD(0x4D, 0x37), - _INIT_DCS_CMD(0x4E, 0x37), - _INIT_DCS_CMD(0x4F, 0x09), - _INIT_DCS_CMD(0x50, 0x09), - _INIT_DCS_CMD(0x51, 0x0B), - _INIT_DCS_CMD(0x52, 0x0B), - _INIT_DCS_CMD(0x53, 0x05), - _INIT_DCS_CMD(0x54, 0x05), - _INIT_DCS_CMD(0x55, 0x07), - _INIT_DCS_CMD(0x56, 0x07), - _INIT_DCS_CMD(0x57, 0x1F), - _INIT_DCS_CMD(0x58, 0x40), - _INIT_DCS_CMD(0x5B, 0x30), - _INIT_DCS_CMD(0x5C, 0x00), - _INIT_DCS_CMD(0x5D, 0x34), - _INIT_DCS_CMD(0x5E, 0x05), - _INIT_DCS_CMD(0x5F, 0x02), - _INIT_DCS_CMD(0x63, 0x00), - _INIT_DCS_CMD(0x64, 0x6A), - _INIT_DCS_CMD(0x67, 0x73), - _INIT_DCS_CMD(0x68, 0x07), - _INIT_DCS_CMD(0x69, 0x08), - _INIT_DCS_CMD(0x6A, 0x6A), - _INIT_DCS_CMD(0x6B, 0x08), - _INIT_DCS_CMD(0x6C, 0x00), - _INIT_DCS_CMD(0x6D, 0x00), - _INIT_DCS_CMD(0x6E, 0x00), - _INIT_DCS_CMD(0x6F, 0x88), - _INIT_DCS_CMD(0x75, 0xFF), - _INIT_DCS_CMD(0x77, 0xDD), - _INIT_DCS_CMD(0x78, 0x2C), - _INIT_DCS_CMD(0x79, 0x15), - _INIT_DCS_CMD(0x7A, 0x17), - _INIT_DCS_CMD(0x7D, 0x14), - _INIT_DCS_CMD(0x7E, 0x82), - _INIT_DCS_CMD(0xE0, 0x04), - _INIT_DCS_CMD(0x00, 0x0E), - _INIT_DCS_CMD(0x02, 0xB3), - _INIT_DCS_CMD(0x09, 0x61), - _INIT_DCS_CMD(0x0E, 0x48), - _INIT_DCS_CMD(0x37, 0x58), - _INIT_DCS_CMD(0x2B, 0x0F), - _INIT_DCS_CMD(0xE0, 0x00), - _INIT_DCS_CMD(0xE6, 0x02), - _INIT_DCS_CMD(0xE7, 0x0C), - _INIT_DCS_CMD(0x11), - _INIT_DELAY_CMD(120), - _INIT_DCS_CMD(0x29), - _INIT_DELAY_CMD(60), - {}, -}; - -static const struct panel_init_cmd ws_panel_10_1_b_4lane_init[] = { - _INIT_DCS_CMD(0xE0, 0x00), - _INIT_DCS_CMD(0xE1, 0x93), - _INIT_DCS_CMD(0xE2, 0x65), - _INIT_DCS_CMD(0xE3, 0xF8), - _INIT_DCS_CMD(0x80, 0x03), - _INIT_DCS_CMD(0xE0, 0x01), - _INIT_DCS_CMD(0x00, 0x00), - _INIT_DCS_CMD(0x01, 0x3D), - _INIT_DCS_CMD(0x03, 0x10), - _INIT_DCS_CMD(0x04, 0x3F), - _INIT_DCS_CMD(0x17, 0x00), - _INIT_DCS_CMD(0x18, 0xBF), - _INIT_DCS_CMD(0x19, 0x01), - _INIT_DCS_CMD(0x1A, 0x00), - _INIT_DCS_CMD(0x1B, 0xBF), - _INIT_DCS_CMD(0x1C, 0x01), - _INIT_DCS_CMD(0x24, 0xFE), - _INIT_DCS_CMD(0x37, 0x19), - _INIT_DCS_CMD(0x38, 0x05), - _INIT_DCS_CMD(0x39, 0x08), - _INIT_DCS_CMD(0x3A, 0x1F), - _INIT_DCS_CMD(0x3C, 0x74), - _INIT_DCS_CMD(0x3D, 0xFF), - _INIT_DCS_CMD(0x3E, 0xFF), - _INIT_DCS_CMD(0x3F, 0xFF), - _INIT_DCS_CMD(0x40, 0x04), - _INIT_DCS_CMD(0x41, 0xA0), - _INIT_DCS_CMD(0x42, 0x7E), - _INIT_DCS_CMD(0x43, 0x1A), - _INIT_DCS_CMD(0x44, 0x0F), - _INIT_DCS_CMD(0x45, 0x24), - _INIT_DCS_CMD(0x55, 0x02), - _INIT_DCS_CMD(0x57, 0xA9), - _INIT_DCS_CMD(0x59, 0x0A), - _INIT_DCS_CMD(0x5A, 0x38), - _INIT_DCS_CMD(0x5B, 0x1A), - _INIT_DCS_CMD(0x5D, 0x7F), - _INIT_DCS_CMD(0x5E, 0x65), - _INIT_DCS_CMD(0x5F, 0x52), - _INIT_DCS_CMD(0x60, 0x44), - _INIT_DCS_CMD(0x61, 0x3D), - _INIT_DCS_CMD(0x62, 0x2D), - _INIT_DCS_CMD(0x63, 0x2D), - _INIT_DCS_CMD(0x64, 0x14), - _INIT_DCS_CMD(0x65, 0x28), - _INIT_DCS_CMD(0x66, 0x25), - _INIT_DCS_CMD(0x67, 0x23), - _INIT_DCS_CMD(0x68, 0x3F), - _INIT_DCS_CMD(0x69, 0x2D), - _INIT_DCS_CMD(0x6A, 0x34), - _INIT_DCS_CMD(0x6B, 0x27), - _INIT_DCS_CMD(0x6C, 0x24), - _INIT_DCS_CMD(0x6D, 0x18), - _INIT_DCS_CMD(0x6E, 0x0A), - _INIT_DCS_CMD(0x6F, 0x00), - _INIT_DCS_CMD(0x70, 0x7F), - _INIT_DCS_CMD(0x71, 0x65), - _INIT_DCS_CMD(0x72, 0x52), - _INIT_DCS_CMD(0x73, 0x44), - _INIT_DCS_CMD(0x74, 0x3D), - _INIT_DCS_CMD(0x75, 0x2D), - _INIT_DCS_CMD(0x76, 0x2D), - _INIT_DCS_CMD(0x77, 0x14), - _INIT_DCS_CMD(0x78, 0x28), - _INIT_DCS_CMD(0x79, 0x25), - _INIT_DCS_CMD(0x7A, 0x23), - _INIT_DCS_CMD(0x7B, 0x3F), - _INIT_DCS_CMD(0x7C, 0x2D), - _INIT_DCS_CMD(0x7D, 0x34), - _INIT_DCS_CMD(0x7E, 0x27), - _INIT_DCS_CMD(0x7F, 0x24), - _INIT_DCS_CMD(0x80, 0x18), - _INIT_DCS_CMD(0x81, 0x0A), - _INIT_DCS_CMD(0x82, 0x00), - _INIT_DCS_CMD(0xE0, 0x02), - _INIT_DCS_CMD(0x00, 0x51), - _INIT_DCS_CMD(0x01, 0x55), - _INIT_DCS_CMD(0x02, 0x50), - _INIT_DCS_CMD(0x03, 0x51), - _INIT_DCS_CMD(0x04, 0x5F), - _INIT_DCS_CMD(0x05, 0x77), - _INIT_DCS_CMD(0x06, 0x57), - _INIT_DCS_CMD(0x07, 0x5F), - _INIT_DCS_CMD(0x08, 0x47), - _INIT_DCS_CMD(0x09, 0x46), - _INIT_DCS_CMD(0x0A, 0x45), - _INIT_DCS_CMD(0x0B, 0x44), - _INIT_DCS_CMD(0x0C, 0x4B), - _INIT_DCS_CMD(0x0D, 0x4A), - _INIT_DCS_CMD(0x0E, 0x49), - _INIT_DCS_CMD(0x0F, 0x48), - _INIT_DCS_CMD(0x10, 0x40), - _INIT_DCS_CMD(0x11, 0x41), - _INIT_DCS_CMD(0x12, 0x5F), - _INIT_DCS_CMD(0x13, 0x5F), - _INIT_DCS_CMD(0x14, 0x5F), - _INIT_DCS_CMD(0x15, 0x5F), - _INIT_DCS_CMD(0x16, 0x51), - _INIT_DCS_CMD(0x17, 0x55), - _INIT_DCS_CMD(0x18, 0x50), - _INIT_DCS_CMD(0x19, 0x51), - _INIT_DCS_CMD(0x1A, 0x5F), - _INIT_DCS_CMD(0x1B, 0x77), - _INIT_DCS_CMD(0x1C, 0x57), - _INIT_DCS_CMD(0x1D, 0x5F), - _INIT_DCS_CMD(0x1E, 0x47), - _INIT_DCS_CMD(0x1F, 0x46), - _INIT_DCS_CMD(0x20, 0x45), - _INIT_DCS_CMD(0x21, 0x44), - _INIT_DCS_CMD(0x22, 0x4B), - _INIT_DCS_CMD(0x23, 0x4A), - _INIT_DCS_CMD(0x24, 0x49), - _INIT_DCS_CMD(0x25, 0x48), - _INIT_DCS_CMD(0x26, 0x40), - _INIT_DCS_CMD(0x27, 0x41), - _INIT_DCS_CMD(0x28, 0x5F), - _INIT_DCS_CMD(0x29, 0x5F), - _INIT_DCS_CMD(0x2A, 0x5F), - _INIT_DCS_CMD(0x2B, 0x5F), - _INIT_DCS_CMD(0x2C, 0x11), - _INIT_DCS_CMD(0x2D, 0x1F), - _INIT_DCS_CMD(0x2E, 0x01), - _INIT_DCS_CMD(0x2F, 0x00), - _INIT_DCS_CMD(0x30, 0x15), - _INIT_DCS_CMD(0x31, 0x17), - _INIT_DCS_CMD(0x32, 0x17), - _INIT_DCS_CMD(0x33, 0x1F), - _INIT_DCS_CMD(0x34, 0x08), - _INIT_DCS_CMD(0x35, 0x09), - _INIT_DCS_CMD(0x36, 0x0A), - _INIT_DCS_CMD(0x37, 0x0B), - _INIT_DCS_CMD(0x38, 0x04), - _INIT_DCS_CMD(0x39, 0x05), - _INIT_DCS_CMD(0x3A, 0x06), - _INIT_DCS_CMD(0x3B, 0x07), - _INIT_DCS_CMD(0x3C, 0x11), - _INIT_DCS_CMD(0x3D, 0x10), - _INIT_DCS_CMD(0x3E, 0x1F), - _INIT_DCS_CMD(0x3F, 0x1F), - _INIT_DCS_CMD(0x40, 0x1F), - _INIT_DCS_CMD(0x41, 0x1F), - _INIT_DCS_CMD(0x42, 0x11), - _INIT_DCS_CMD(0x43, 0x1F), - _INIT_DCS_CMD(0x44, 0x01), - _INIT_DCS_CMD(0x45, 0x00), - _INIT_DCS_CMD(0x46, 0x15), - _INIT_DCS_CMD(0x47, 0x17), - _INIT_DCS_CMD(0x48, 0x17), - _INIT_DCS_CMD(0x49, 0x1F), - _INIT_DCS_CMD(0x4A, 0x08), - _INIT_DCS_CMD(0x4B, 0x09), - _INIT_DCS_CMD(0x4C, 0x0A), - _INIT_DCS_CMD(0x4D, 0x0B), - _INIT_DCS_CMD(0x4E, 0x04), - _INIT_DCS_CMD(0x4F, 0x05), - _INIT_DCS_CMD(0x50, 0x06), - _INIT_DCS_CMD(0x51, 0x07), - _INIT_DCS_CMD(0x52, 0x11), - _INIT_DCS_CMD(0x53, 0x10), - _INIT_DCS_CMD(0x54, 0x1F), - _INIT_DCS_CMD(0x55, 0x1F), - _INIT_DCS_CMD(0x56, 0x1F), - _INIT_DCS_CMD(0x57, 0x1F), - _INIT_DCS_CMD(0x58, 0x40), - _INIT_DCS_CMD(0x5B, 0x10), - _INIT_DCS_CMD(0x5C, 0x07), - _INIT_DCS_CMD(0x5D, 0x40), - _INIT_DCS_CMD(0x5E, 0x01), - _INIT_DCS_CMD(0x5F, 0x02), - _INIT_DCS_CMD(0x60, 0x40), - _INIT_DCS_CMD(0x61, 0x01), - _INIT_DCS_CMD(0x62, 0x02), - _INIT_DCS_CMD(0x63, 0x06), - _INIT_DCS_CMD(0x64, 0x66), - _INIT_DCS_CMD(0x65, 0x55), - _INIT_DCS_CMD(0x66, 0x13), - _INIT_DCS_CMD(0x67, 0x73), - _INIT_DCS_CMD(0x68, 0x09), - _INIT_DCS_CMD(0x69, 0x06), - _INIT_DCS_CMD(0x6A, 0x66), - _INIT_DCS_CMD(0x6B, 0x08), - _INIT_DCS_CMD(0x6C, 0x00), - _INIT_DCS_CMD(0x6D, 0x04), - _INIT_DCS_CMD(0x6E, 0x04), - _INIT_DCS_CMD(0x6F, 0x88), - _INIT_DCS_CMD(0x75, 0xE3), - _INIT_DCS_CMD(0x76, 0x00), - _INIT_DCS_CMD(0x77, 0xD5), - _INIT_DCS_CMD(0x78, 0x2A), - _INIT_DCS_CMD(0x79, 0x21), - _INIT_DCS_CMD(0x7A, 0x00), - _INIT_DCS_CMD(0x7D, 0x06), - _INIT_DCS_CMD(0x7E, 0x66), - _INIT_DCS_CMD(0xE0, 0x04), - _INIT_DCS_CMD(0x00, 0x0E), - _INIT_DCS_CMD(0x02, 0xB3), - _INIT_DCS_CMD(0x09, 0x60), - _INIT_DCS_CMD(0x0E, 0x48), - _INIT_DCS_CMD(0x37, 0x58), - _INIT_DCS_CMD(0x2B, 0x0F), - _INIT_DCS_CMD(0xE0, 0x05), - _INIT_DCS_CMD(0x15, 0x1D), - _INIT_DCS_CMD(0xE0, 0x00), - _INIT_DCS_CMD(0x11), - _INIT_DELAY_CMD(120), - _INIT_DCS_CMD(0x29), - _INIT_DELAY_CMD(5), - _INIT_DCS_CMD(0x35), - {}, -}; - -static const struct panel_init_cmd ws_panel_10_1_b_init[] = { - _INIT_DCS_CMD(0xE0, 0x00), - _INIT_DCS_CMD(0xE1, 0x93), - _INIT_DCS_CMD(0xE2, 0x65), - _INIT_DCS_CMD(0xE3, 0xF8), - _INIT_DCS_CMD(0x80, 0x01), - _INIT_DCS_CMD(0xE0, 0x01), - _INIT_DCS_CMD(0x00, 0x00), - _INIT_DCS_CMD(0x01, 0x3D), - _INIT_DCS_CMD(0x03, 0x10), - _INIT_DCS_CMD(0x04, 0x3F), - _INIT_DCS_CMD(0x17, 0x00), - _INIT_DCS_CMD(0x18, 0xBF), - _INIT_DCS_CMD(0x19, 0x01), - _INIT_DCS_CMD(0x1A, 0x00), - _INIT_DCS_CMD(0x1B, 0xBF), - _INIT_DCS_CMD(0x1C, 0x01), - _INIT_DCS_CMD(0x24, 0xFE), - _INIT_DCS_CMD(0x37, 0x19), - _INIT_DCS_CMD(0x38, 0x05), - _INIT_DCS_CMD(0x39, 0x08), - _INIT_DCS_CMD(0x3A, 0x1F), - _INIT_DCS_CMD(0x3C, 0x74), - _INIT_DCS_CMD(0x3D, 0xFF), - _INIT_DCS_CMD(0x3E, 0xFF), - _INIT_DCS_CMD(0x3F, 0xFF), - _INIT_DCS_CMD(0x40, 0x04), - _INIT_DCS_CMD(0x41, 0xA0), - _INIT_DCS_CMD(0x42, 0x7E), - _INIT_DCS_CMD(0x43, 0x1A), - _INIT_DCS_CMD(0x44, 0x0F), - _INIT_DCS_CMD(0x45, 0x24), - _INIT_DCS_CMD(0x55, 0x02), - _INIT_DCS_CMD(0x57, 0xA9), - _INIT_DCS_CMD(0x59, 0x0A), - _INIT_DCS_CMD(0x5A, 0x38), - _INIT_DCS_CMD(0x5B, 0x1A), - _INIT_DCS_CMD(0x5D, 0x7F), - _INIT_DCS_CMD(0x5E, 0x65), - _INIT_DCS_CMD(0x5F, 0x52), - _INIT_DCS_CMD(0x60, 0x44), - _INIT_DCS_CMD(0x61, 0x3D), - _INIT_DCS_CMD(0x62, 0x2D), - _INIT_DCS_CMD(0x63, 0x2D), - _INIT_DCS_CMD(0x64, 0x14), - _INIT_DCS_CMD(0x65, 0x28), - _INIT_DCS_CMD(0x66, 0x25), - _INIT_DCS_CMD(0x67, 0x23), - _INIT_DCS_CMD(0x68, 0x3F), - _INIT_DCS_CMD(0x69, 0x2D), - _INIT_DCS_CMD(0x6A, 0x34), - _INIT_DCS_CMD(0x6B, 0x27), - _INIT_DCS_CMD(0x6C, 0x24), - _INIT_DCS_CMD(0x6D, 0x18), - _INIT_DCS_CMD(0x6E, 0x0A), - _INIT_DCS_CMD(0x6F, 0x00), - _INIT_DCS_CMD(0x70, 0x7F), - _INIT_DCS_CMD(0x71, 0x65), - _INIT_DCS_CMD(0x72, 0x52), - _INIT_DCS_CMD(0x73, 0x44), - _INIT_DCS_CMD(0x74, 0x3D), - _INIT_DCS_CMD(0x75, 0x2D), - _INIT_DCS_CMD(0x76, 0x2D), - _INIT_DCS_CMD(0x77, 0x14), - _INIT_DCS_CMD(0x78, 0x28), - _INIT_DCS_CMD(0x79, 0x25), - _INIT_DCS_CMD(0x7A, 0x23), - _INIT_DCS_CMD(0x7B, 0x3F), - _INIT_DCS_CMD(0x7C, 0x2D), - _INIT_DCS_CMD(0x7D, 0x34), - _INIT_DCS_CMD(0x7E, 0x27), - _INIT_DCS_CMD(0x7F, 0x24), - _INIT_DCS_CMD(0x80, 0x18), - _INIT_DCS_CMD(0x81, 0x0A), - _INIT_DCS_CMD(0x82, 0x00), - _INIT_DCS_CMD(0xE0, 0x02), - _INIT_DCS_CMD(0x00, 0x51), - _INIT_DCS_CMD(0x01, 0x55), - _INIT_DCS_CMD(0x02, 0x50), - _INIT_DCS_CMD(0x03, 0x51), - _INIT_DCS_CMD(0x04, 0x5F), - _INIT_DCS_CMD(0x05, 0x77), - _INIT_DCS_CMD(0x06, 0x57), - _INIT_DCS_CMD(0x07, 0x5F), - _INIT_DCS_CMD(0x08, 0x47), - _INIT_DCS_CMD(0x09, 0x46), - _INIT_DCS_CMD(0x0A, 0x45), - _INIT_DCS_CMD(0x0B, 0x44), - _INIT_DCS_CMD(0x0C, 0x4B), - _INIT_DCS_CMD(0x0D, 0x4A), - _INIT_DCS_CMD(0x0E, 0x49), - _INIT_DCS_CMD(0x0F, 0x48), - _INIT_DCS_CMD(0x10, 0x40), - _INIT_DCS_CMD(0x11, 0x41), - _INIT_DCS_CMD(0x12, 0x5F), - _INIT_DCS_CMD(0x13, 0x5F), - _INIT_DCS_CMD(0x14, 0x5F), - _INIT_DCS_CMD(0x15, 0x5F), - _INIT_DCS_CMD(0x16, 0x51), - _INIT_DCS_CMD(0x17, 0x55), - _INIT_DCS_CMD(0x18, 0x50), - _INIT_DCS_CMD(0x19, 0x51), - _INIT_DCS_CMD(0x1A, 0x5F), - _INIT_DCS_CMD(0x1B, 0x77), - _INIT_DCS_CMD(0x1C, 0x57), - _INIT_DCS_CMD(0x1D, 0x5F), - _INIT_DCS_CMD(0x1E, 0x47), - _INIT_DCS_CMD(0x1F, 0x46), - _INIT_DCS_CMD(0x20, 0x45), - _INIT_DCS_CMD(0x21, 0x44), - _INIT_DCS_CMD(0x22, 0x4B), - _INIT_DCS_CMD(0x23, 0x4A), - _INIT_DCS_CMD(0x24, 0x49), - _INIT_DCS_CMD(0x25, 0x48), - _INIT_DCS_CMD(0x26, 0x40), - _INIT_DCS_CMD(0x27, 0x41), - _INIT_DCS_CMD(0x28, 0x5F), - _INIT_DCS_CMD(0x29, 0x5F), - _INIT_DCS_CMD(0x2A, 0x5F), - _INIT_DCS_CMD(0x2B, 0x5F), - _INIT_DCS_CMD(0x2C, 0x11), - _INIT_DCS_CMD(0x2D, 0x1F), - _INIT_DCS_CMD(0x2E, 0x01), - _INIT_DCS_CMD(0x2F, 0x00), - _INIT_DCS_CMD(0x30, 0x15), - _INIT_DCS_CMD(0x31, 0x17), - _INIT_DCS_CMD(0x32, 0x17), - _INIT_DCS_CMD(0x33, 0x1F), - _INIT_DCS_CMD(0x34, 0x08), - _INIT_DCS_CMD(0x35, 0x09), - _INIT_DCS_CMD(0x36, 0x0A), - _INIT_DCS_CMD(0x37, 0x0B), - _INIT_DCS_CMD(0x38, 0x04), - _INIT_DCS_CMD(0x39, 0x05), - _INIT_DCS_CMD(0x3A, 0x06), - _INIT_DCS_CMD(0x3B, 0x07), - _INIT_DCS_CMD(0x3C, 0x11), - _INIT_DCS_CMD(0x3D, 0x10), - _INIT_DCS_CMD(0x3E, 0x1F), - _INIT_DCS_CMD(0x3F, 0x1F), - _INIT_DCS_CMD(0x40, 0x1F), - _INIT_DCS_CMD(0x41, 0x1F), - _INIT_DCS_CMD(0x42, 0x11), - _INIT_DCS_CMD(0x43, 0x1F), - _INIT_DCS_CMD(0x44, 0x01), - _INIT_DCS_CMD(0x45, 0x00), - _INIT_DCS_CMD(0x46, 0x15), - _INIT_DCS_CMD(0x47, 0x17), - _INIT_DCS_CMD(0x48, 0x17), - _INIT_DCS_CMD(0x49, 0x1F), - _INIT_DCS_CMD(0x4A, 0x08), - _INIT_DCS_CMD(0x4B, 0x09), - _INIT_DCS_CMD(0x4C, 0x0A), - _INIT_DCS_CMD(0x4D, 0x0B), - _INIT_DCS_CMD(0x4E, 0x04), - _INIT_DCS_CMD(0x4F, 0x05), - _INIT_DCS_CMD(0x50, 0x06), - _INIT_DCS_CMD(0x51, 0x07), - _INIT_DCS_CMD(0x52, 0x11), - _INIT_DCS_CMD(0x53, 0x10), - _INIT_DCS_CMD(0x54, 0x1F), - _INIT_DCS_CMD(0x55, 0x1F), - _INIT_DCS_CMD(0x56, 0x1F), - _INIT_DCS_CMD(0x57, 0x1F), - _INIT_DCS_CMD(0x58, 0x40), - _INIT_DCS_CMD(0x5B, 0x10), - _INIT_DCS_CMD(0x5C, 0x07), - _INIT_DCS_CMD(0x5D, 0x40), - _INIT_DCS_CMD(0x5E, 0x01), - _INIT_DCS_CMD(0x5F, 0x02), - _INIT_DCS_CMD(0x60, 0x40), - _INIT_DCS_CMD(0x61, 0x01), - _INIT_DCS_CMD(0x62, 0x02), - _INIT_DCS_CMD(0x63, 0x06), - _INIT_DCS_CMD(0x64, 0x66), - _INIT_DCS_CMD(0x65, 0x55), - _INIT_DCS_CMD(0x66, 0x13), - _INIT_DCS_CMD(0x67, 0x73), - _INIT_DCS_CMD(0x68, 0x09), - _INIT_DCS_CMD(0x69, 0x06), - _INIT_DCS_CMD(0x6A, 0x66), - _INIT_DCS_CMD(0x6B, 0x08), - _INIT_DCS_CMD(0x6C, 0x00), - _INIT_DCS_CMD(0x6D, 0x04), - _INIT_DCS_CMD(0x6E, 0x04), - _INIT_DCS_CMD(0x6F, 0x88), - _INIT_DCS_CMD(0x75, 0xE3), - _INIT_DCS_CMD(0x76, 0x00), - _INIT_DCS_CMD(0x77, 0xD5), - _INIT_DCS_CMD(0x78, 0x2A), - _INIT_DCS_CMD(0x79, 0x21), - _INIT_DCS_CMD(0x7A, 0x00), - _INIT_DCS_CMD(0x7D, 0x06), - _INIT_DCS_CMD(0x7E, 0x66), - _INIT_DCS_CMD(0xE0, 0x04), - _INIT_DCS_CMD(0x00, 0x0E), - _INIT_DCS_CMD(0x02, 0xB3), - _INIT_DCS_CMD(0x09, 0x60), - _INIT_DCS_CMD(0x0E, 0x48), - _INIT_DCS_CMD(0x37, 0x58), - _INIT_DCS_CMD(0x2B, 0x0F), - _INIT_DCS_CMD(0xE0, 0x05), - _INIT_DCS_CMD(0x15, 0x1D), - _INIT_DCS_CMD(0xE0, 0x00), - _INIT_DCS_CMD(0x11), - _INIT_DELAY_CMD(120), - _INIT_DCS_CMD(0x29), - _INIT_DELAY_CMD(5), - _INIT_DCS_CMD(0x35), - {}, -}; - static const struct panel_init_cmd ws_panel_10_1_e_4lane_init[] = { _INIT_DCS_CMD(0x11), _INIT_DELAY_CMD(120), @@ -992,195 +81,6 @@ static const struct panel_init_cmd ws_panel_10_1_e_4lane_init[] = { {}, }; -static const struct panel_init_cmd ws_panel_8_8_a_init[] = { - _INIT_DCS_CMD(0x11), - _INIT_DELAY_CMD(120), - _INIT_DCS_CMD(0x29), - _INIT_DELAY_CMD(50), - {}, -}; - -static const struct panel_init_cmd ws_panel_8_a_4lane_init[] = { - _INIT_DCS_CMD(0xE0, 0x00), _INIT_DCS_CMD(0xE1, 0x93), - _INIT_DCS_CMD(0xE2, 0x65), _INIT_DCS_CMD(0xE3, 0xF8), - _INIT_DCS_CMD(0x80, 0x03), _INIT_DCS_CMD(0xE0, 0x01), - _INIT_DCS_CMD(0x00, 0x00), _INIT_DCS_CMD(0x01, 0x7E), - _INIT_DCS_CMD(0x03, 0x00), _INIT_DCS_CMD(0x04, 0x65), - _INIT_DCS_CMD(0x0C, 0x74), _INIT_DCS_CMD(0x17, 0x00), - _INIT_DCS_CMD(0x18, 0xB7), _INIT_DCS_CMD(0x19, 0x00), - _INIT_DCS_CMD(0x1A, 0x00), _INIT_DCS_CMD(0x1B, 0xB7), - _INIT_DCS_CMD(0x1C, 0x00), _INIT_DCS_CMD(0x24, 0xFE), - _INIT_DCS_CMD(0x37, 0x19), _INIT_DCS_CMD(0x38, 0x05), - _INIT_DCS_CMD(0x39, 0x00), _INIT_DCS_CMD(0x3A, 0x01), - _INIT_DCS_CMD(0x3B, 0x01), _INIT_DCS_CMD(0x3C, 0x70), - _INIT_DCS_CMD(0x3D, 0xFF), _INIT_DCS_CMD(0x3E, 0xFF), - _INIT_DCS_CMD(0x3F, 0xFF), _INIT_DCS_CMD(0x40, 0x06), - _INIT_DCS_CMD(0x41, 0xA0), _INIT_DCS_CMD(0x43, 0x1E), - _INIT_DCS_CMD(0x44, 0x0F), _INIT_DCS_CMD(0x45, 0x28), - _INIT_DCS_CMD(0x4B, 0x04), _INIT_DCS_CMD(0x55, 0x02), - _INIT_DCS_CMD(0x56, 0x01), _INIT_DCS_CMD(0x57, 0xA9), - _INIT_DCS_CMD(0x58, 0x0A), _INIT_DCS_CMD(0x59, 0x0A), - _INIT_DCS_CMD(0x5A, 0x37), _INIT_DCS_CMD(0x5B, 0x19), - _INIT_DCS_CMD(0x5D, 0x78), _INIT_DCS_CMD(0x5E, 0x63), - _INIT_DCS_CMD(0x5F, 0x54), _INIT_DCS_CMD(0x60, 0x49), - _INIT_DCS_CMD(0x61, 0x45), _INIT_DCS_CMD(0x62, 0x38), - _INIT_DCS_CMD(0x63, 0x3D), _INIT_DCS_CMD(0x64, 0x28), - _INIT_DCS_CMD(0x65, 0x43), _INIT_DCS_CMD(0x66, 0x41), - _INIT_DCS_CMD(0x67, 0x43), _INIT_DCS_CMD(0x68, 0x62), - _INIT_DCS_CMD(0x69, 0x50), _INIT_DCS_CMD(0x6A, 0x57), - _INIT_DCS_CMD(0x6B, 0x49), _INIT_DCS_CMD(0x6C, 0x44), - _INIT_DCS_CMD(0x6D, 0x37), _INIT_DCS_CMD(0x6E, 0x23), - _INIT_DCS_CMD(0x6F, 0x10), _INIT_DCS_CMD(0x70, 0x78), - _INIT_DCS_CMD(0x71, 0x63), _INIT_DCS_CMD(0x72, 0x54), - _INIT_DCS_CMD(0x73, 0x49), _INIT_DCS_CMD(0x74, 0x45), - _INIT_DCS_CMD(0x75, 0x38), _INIT_DCS_CMD(0x76, 0x3D), - _INIT_DCS_CMD(0x77, 0x28), _INIT_DCS_CMD(0x78, 0x43), - _INIT_DCS_CMD(0x79, 0x41), _INIT_DCS_CMD(0x7A, 0x43), - _INIT_DCS_CMD(0x7B, 0x62), _INIT_DCS_CMD(0x7C, 0x50), - _INIT_DCS_CMD(0x7D, 0x57), _INIT_DCS_CMD(0x7E, 0x49), - _INIT_DCS_CMD(0x7F, 0x44), _INIT_DCS_CMD(0x80, 0x37), - _INIT_DCS_CMD(0x81, 0x23), _INIT_DCS_CMD(0x82, 0x10), - _INIT_DCS_CMD(0xE0, 0x02), _INIT_DCS_CMD(0x00, 0x47), - _INIT_DCS_CMD(0x01, 0x47), _INIT_DCS_CMD(0x02, 0x45), - _INIT_DCS_CMD(0x03, 0x45), _INIT_DCS_CMD(0x04, 0x4B), - _INIT_DCS_CMD(0x05, 0x4B), _INIT_DCS_CMD(0x06, 0x49), - _INIT_DCS_CMD(0x07, 0x49), _INIT_DCS_CMD(0x08, 0x41), - _INIT_DCS_CMD(0x09, 0x1F), _INIT_DCS_CMD(0x0A, 0x1F), - _INIT_DCS_CMD(0x0B, 0x1F), _INIT_DCS_CMD(0x0C, 0x1F), - _INIT_DCS_CMD(0x0D, 0x1F), _INIT_DCS_CMD(0x0E, 0x1F), - _INIT_DCS_CMD(0x0F, 0x5F), _INIT_DCS_CMD(0x10, 0x5F), - _INIT_DCS_CMD(0x11, 0x57), _INIT_DCS_CMD(0x12, 0x77), - _INIT_DCS_CMD(0x13, 0x35), _INIT_DCS_CMD(0x14, 0x1F), - _INIT_DCS_CMD(0x15, 0x1F), _INIT_DCS_CMD(0x16, 0x46), - _INIT_DCS_CMD(0x17, 0x46), _INIT_DCS_CMD(0x18, 0x44), - _INIT_DCS_CMD(0x19, 0x44), _INIT_DCS_CMD(0x1A, 0x4A), - _INIT_DCS_CMD(0x1B, 0x4A), _INIT_DCS_CMD(0x1C, 0x48), - _INIT_DCS_CMD(0x1D, 0x48), _INIT_DCS_CMD(0x1E, 0x40), - _INIT_DCS_CMD(0x1F, 0x1F), _INIT_DCS_CMD(0x20, 0x1F), - _INIT_DCS_CMD(0x21, 0x1F), _INIT_DCS_CMD(0x22, 0x1F), - _INIT_DCS_CMD(0x23, 0x1F), _INIT_DCS_CMD(0x24, 0x1F), - _INIT_DCS_CMD(0x25, 0x5F), _INIT_DCS_CMD(0x26, 0x5F), - _INIT_DCS_CMD(0x27, 0x57), _INIT_DCS_CMD(0x28, 0x77), - _INIT_DCS_CMD(0x29, 0x35), _INIT_DCS_CMD(0x2A, 0x1F), - _INIT_DCS_CMD(0x2B, 0x1F), _INIT_DCS_CMD(0x58, 0x40), - _INIT_DCS_CMD(0x59, 0x00), _INIT_DCS_CMD(0x5A, 0x00), - _INIT_DCS_CMD(0x5B, 0x10), _INIT_DCS_CMD(0x5C, 0x06), - _INIT_DCS_CMD(0x5D, 0x40), _INIT_DCS_CMD(0x5E, 0x01), - _INIT_DCS_CMD(0x5F, 0x02), _INIT_DCS_CMD(0x60, 0x30), - _INIT_DCS_CMD(0x61, 0x01), _INIT_DCS_CMD(0x62, 0x02), - _INIT_DCS_CMD(0x63, 0x03), _INIT_DCS_CMD(0x64, 0x6B), - _INIT_DCS_CMD(0x65, 0x05), _INIT_DCS_CMD(0x66, 0x0C), - _INIT_DCS_CMD(0x67, 0x73), _INIT_DCS_CMD(0x68, 0x09), - _INIT_DCS_CMD(0x69, 0x03), _INIT_DCS_CMD(0x6A, 0x56), - _INIT_DCS_CMD(0x6B, 0x08), _INIT_DCS_CMD(0x6C, 0x00), - _INIT_DCS_CMD(0x6D, 0x04), _INIT_DCS_CMD(0x6E, 0x04), - _INIT_DCS_CMD(0x6F, 0x88), _INIT_DCS_CMD(0x70, 0x00), - _INIT_DCS_CMD(0x71, 0x00), _INIT_DCS_CMD(0x72, 0x06), - _INIT_DCS_CMD(0x73, 0x7B), _INIT_DCS_CMD(0x74, 0x00), - _INIT_DCS_CMD(0x75, 0xF8), _INIT_DCS_CMD(0x76, 0x00), - _INIT_DCS_CMD(0x77, 0xD5), _INIT_DCS_CMD(0x78, 0x2E), - _INIT_DCS_CMD(0x79, 0x12), _INIT_DCS_CMD(0x7A, 0x03), - _INIT_DCS_CMD(0x7B, 0x00), _INIT_DCS_CMD(0x7C, 0x00), - _INIT_DCS_CMD(0x7D, 0x03), _INIT_DCS_CMD(0x7E, 0x7B), - _INIT_DCS_CMD(0xE0, 0x04), _INIT_DCS_CMD(0x00, 0x0E), - _INIT_DCS_CMD(0x02, 0xB3), _INIT_DCS_CMD(0x09, 0x60), - _INIT_DCS_CMD(0x0E, 0x2A), _INIT_DCS_CMD(0x36, 0x59), - _INIT_DCS_CMD(0xE0, 0x00), _INIT_DCS_CMD(0x11), - _INIT_DELAY_CMD(120), _INIT_DCS_CMD(0x29), - _INIT_DELAY_CMD(60), {}, -}; - -static const struct panel_init_cmd ws_panel_8_a_init[] = { - _INIT_DCS_CMD(0xE0, 0x00), _INIT_DCS_CMD(0xE1, 0x93), - _INIT_DCS_CMD(0xE2, 0x65), _INIT_DCS_CMD(0xE3, 0xF8), - _INIT_DCS_CMD(0x80, 0x01), _INIT_DCS_CMD(0xE0, 0x01), - _INIT_DCS_CMD(0x00, 0x00), _INIT_DCS_CMD(0x01, 0x4E), - _INIT_DCS_CMD(0x03, 0x00), _INIT_DCS_CMD(0x04, 0x65), - _INIT_DCS_CMD(0x0C, 0x74), _INIT_DCS_CMD(0x17, 0x00), - _INIT_DCS_CMD(0x18, 0xB7), _INIT_DCS_CMD(0x19, 0x00), - _INIT_DCS_CMD(0x1A, 0x00), _INIT_DCS_CMD(0x1B, 0xB7), - _INIT_DCS_CMD(0x1C, 0x00), _INIT_DCS_CMD(0x24, 0xFE), - _INIT_DCS_CMD(0x37, 0x19), _INIT_DCS_CMD(0x38, 0x05), - _INIT_DCS_CMD(0x39, 0x00), _INIT_DCS_CMD(0x3A, 0x01), - _INIT_DCS_CMD(0x3B, 0x01), _INIT_DCS_CMD(0x3C, 0x70), - _INIT_DCS_CMD(0x3D, 0xFF), _INIT_DCS_CMD(0x3E, 0xFF), - _INIT_DCS_CMD(0x3F, 0xFF), _INIT_DCS_CMD(0x40, 0x06), - _INIT_DCS_CMD(0x41, 0xA0), _INIT_DCS_CMD(0x43, 0x1E), - _INIT_DCS_CMD(0x44, 0x0F), _INIT_DCS_CMD(0x45, 0x28), - _INIT_DCS_CMD(0x4B, 0x04), _INIT_DCS_CMD(0x55, 0x02), - _INIT_DCS_CMD(0x56, 0x01), _INIT_DCS_CMD(0x57, 0xA9), - _INIT_DCS_CMD(0x58, 0x0A), _INIT_DCS_CMD(0x59, 0x0A), - _INIT_DCS_CMD(0x5A, 0x37), _INIT_DCS_CMD(0x5B, 0x19), - _INIT_DCS_CMD(0x5D, 0x78), _INIT_DCS_CMD(0x5E, 0x63), - _INIT_DCS_CMD(0x5F, 0x54), _INIT_DCS_CMD(0x60, 0x49), - _INIT_DCS_CMD(0x61, 0x45), _INIT_DCS_CMD(0x62, 0x38), - _INIT_DCS_CMD(0x63, 0x3D), _INIT_DCS_CMD(0x64, 0x28), - _INIT_DCS_CMD(0x65, 0x43), _INIT_DCS_CMD(0x66, 0x41), - _INIT_DCS_CMD(0x67, 0x43), _INIT_DCS_CMD(0x68, 0x62), - _INIT_DCS_CMD(0x69, 0x50), _INIT_DCS_CMD(0x6A, 0x57), - _INIT_DCS_CMD(0x6B, 0x49), _INIT_DCS_CMD(0x6C, 0x44), - _INIT_DCS_CMD(0x6D, 0x37), _INIT_DCS_CMD(0x6E, 0x23), - _INIT_DCS_CMD(0x6F, 0x10), _INIT_DCS_CMD(0x70, 0x78), - _INIT_DCS_CMD(0x71, 0x63), _INIT_DCS_CMD(0x72, 0x54), - _INIT_DCS_CMD(0x73, 0x49), _INIT_DCS_CMD(0x74, 0x45), - _INIT_DCS_CMD(0x75, 0x38), _INIT_DCS_CMD(0x76, 0x3D), - _INIT_DCS_CMD(0x77, 0x28), _INIT_DCS_CMD(0x78, 0x43), - _INIT_DCS_CMD(0x79, 0x41), _INIT_DCS_CMD(0x7A, 0x43), - _INIT_DCS_CMD(0x7B, 0x62), _INIT_DCS_CMD(0x7C, 0x50), - _INIT_DCS_CMD(0x7D, 0x57), _INIT_DCS_CMD(0x7E, 0x49), - _INIT_DCS_CMD(0x7F, 0x44), _INIT_DCS_CMD(0x80, 0x37), - _INIT_DCS_CMD(0x81, 0x23), _INIT_DCS_CMD(0x82, 0x10), - _INIT_DCS_CMD(0xE0, 0x02), _INIT_DCS_CMD(0x00, 0x47), - _INIT_DCS_CMD(0x01, 0x47), _INIT_DCS_CMD(0x02, 0x45), - _INIT_DCS_CMD(0x03, 0x45), _INIT_DCS_CMD(0x04, 0x4B), - _INIT_DCS_CMD(0x05, 0x4B), _INIT_DCS_CMD(0x06, 0x49), - _INIT_DCS_CMD(0x07, 0x49), _INIT_DCS_CMD(0x08, 0x41), - _INIT_DCS_CMD(0x09, 0x1F), _INIT_DCS_CMD(0x0A, 0x1F), - _INIT_DCS_CMD(0x0B, 0x1F), _INIT_DCS_CMD(0x0C, 0x1F), - _INIT_DCS_CMD(0x0D, 0x1F), _INIT_DCS_CMD(0x0E, 0x1F), - _INIT_DCS_CMD(0x0F, 0x5F), _INIT_DCS_CMD(0x10, 0x5F), - _INIT_DCS_CMD(0x11, 0x57), _INIT_DCS_CMD(0x12, 0x77), - _INIT_DCS_CMD(0x13, 0x35), _INIT_DCS_CMD(0x14, 0x1F), - _INIT_DCS_CMD(0x15, 0x1F), _INIT_DCS_CMD(0x16, 0x46), - _INIT_DCS_CMD(0x17, 0x46), _INIT_DCS_CMD(0x18, 0x44), - _INIT_DCS_CMD(0x19, 0x44), _INIT_DCS_CMD(0x1A, 0x4A), - _INIT_DCS_CMD(0x1B, 0x4A), _INIT_DCS_CMD(0x1C, 0x48), - _INIT_DCS_CMD(0x1D, 0x48), _INIT_DCS_CMD(0x1E, 0x40), - _INIT_DCS_CMD(0x1F, 0x1F), _INIT_DCS_CMD(0x20, 0x1F), - _INIT_DCS_CMD(0x21, 0x1F), _INIT_DCS_CMD(0x22, 0x1F), - _INIT_DCS_CMD(0x23, 0x1F), _INIT_DCS_CMD(0x24, 0x1F), - _INIT_DCS_CMD(0x25, 0x5F), _INIT_DCS_CMD(0x26, 0x5F), - _INIT_DCS_CMD(0x27, 0x57), _INIT_DCS_CMD(0x28, 0x77), - _INIT_DCS_CMD(0x29, 0x35), _INIT_DCS_CMD(0x2A, 0x1F), - _INIT_DCS_CMD(0x2B, 0x1F), _INIT_DCS_CMD(0x58, 0x40), - _INIT_DCS_CMD(0x59, 0x00), _INIT_DCS_CMD(0x5A, 0x00), - _INIT_DCS_CMD(0x5B, 0x10), _INIT_DCS_CMD(0x5C, 0x06), - _INIT_DCS_CMD(0x5D, 0x40), _INIT_DCS_CMD(0x5E, 0x01), - _INIT_DCS_CMD(0x5F, 0x02), _INIT_DCS_CMD(0x60, 0x30), - _INIT_DCS_CMD(0x61, 0x01), _INIT_DCS_CMD(0x62, 0x02), - _INIT_DCS_CMD(0x63, 0x03), _INIT_DCS_CMD(0x64, 0x6B), - _INIT_DCS_CMD(0x65, 0x05), _INIT_DCS_CMD(0x66, 0x0C), - _INIT_DCS_CMD(0x67, 0x73), _INIT_DCS_CMD(0x68, 0x09), - _INIT_DCS_CMD(0x69, 0x03), _INIT_DCS_CMD(0x6A, 0x56), - _INIT_DCS_CMD(0x6B, 0x08), _INIT_DCS_CMD(0x6C, 0x00), - _INIT_DCS_CMD(0x6D, 0x04), _INIT_DCS_CMD(0x6E, 0x04), - _INIT_DCS_CMD(0x6F, 0x88), _INIT_DCS_CMD(0x70, 0x00), - _INIT_DCS_CMD(0x71, 0x00), _INIT_DCS_CMD(0x72, 0x06), - _INIT_DCS_CMD(0x73, 0x7B), _INIT_DCS_CMD(0x74, 0x00), - _INIT_DCS_CMD(0x75, 0xF8), _INIT_DCS_CMD(0x76, 0x00), - _INIT_DCS_CMD(0x77, 0xD5), _INIT_DCS_CMD(0x78, 0x2E), - _INIT_DCS_CMD(0x79, 0x12), _INIT_DCS_CMD(0x7A, 0x03), - _INIT_DCS_CMD(0x7B, 0x00), _INIT_DCS_CMD(0x7C, 0x00), - _INIT_DCS_CMD(0x7D, 0x03), _INIT_DCS_CMD(0x7E, 0x7B), - _INIT_DCS_CMD(0xE0, 0x04), _INIT_DCS_CMD(0x00, 0x0E), - _INIT_DCS_CMD(0x02, 0xB3), _INIT_DCS_CMD(0x09, 0x60), - _INIT_DCS_CMD(0x0E, 0x2A), _INIT_DCS_CMD(0x36, 0x59), - _INIT_DCS_CMD(0x37, 0x58), _INIT_DCS_CMD(0x2B, 0x0F), - _INIT_DCS_CMD(0xE0, 0x00), _INIT_DCS_CMD(0x11), - _INIT_DELAY_CMD(120), _INIT_DCS_CMD(0x29), - _INIT_DELAY_CMD(60), {}, -}; - static const struct panel_init_cmd ws_panel_7_a_init[] = { _INIT_DCS_CMD(0xFF, 0x98, 0x81, 0x03), _INIT_DCS_CMD(0x01, 0x00), @@ -1469,103 +369,6 @@ static const struct panel_init_cmd ws_panel_6_25_a_init[] = { {}, }; -static const struct panel_init_cmd ws_panel_5_5_a_init[] = { - _INIT_DCS_CMD(0xB9, 0xFF, 0x83, 0x94), - _INIT_DCS_CMD(0xBA, 0x61, 0x03, 0x68, 0x6B, 0xB2, 0xC0), - _INIT_DCS_CMD(0xB1, 0x48, 0x12, 0x72, 0x09, 0x32, 0x54, 0x71, 0x71, - 0x57, 0x47), - _INIT_DCS_CMD(0xB2, 0x00, 0x80, 0x64, 0x0C, 0x0D, 0x2F), - _INIT_DCS_CMD(0xB4, 0x73, 0x74, 0x73, 0x74, 0x73, 0x74, 0x01, 0x0C, - 0x86, 0x75, 0x00, 0x3F, 0x73, 0x74, 0x73, 0x74, 0x73, - 0x74, 0x01, 0x0C, 0x86), - _INIT_DCS_CMD(0xB6, 0x86, 0x86), - _INIT_DCS_CMD(0xD3, 0x00, 0x00, 0x07, 0x07, 0x40, 0x07, 0x0C, 0x00, - 0x08, 0x10, 0x08, 0x00, 0x08, 0x54, 0x15, 0x0A, 0x05, - 0x0A, 0x02, 0x15, 0x06, 0x05, 0x06, 0x47, 0x44, 0x0A, - 0x0A, 0x4B, 0x10, 0x07, 0x07, 0x0C, 0x40), - _INIT_DCS_CMD(0xD5, 0x1C, 0x1C, 0x1D, 0x1D, 0x00, 0x01, 0x02, 0x03, - 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x24, - 0x25, 0x18, 0x18, 0x26, 0x27, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x20, 0x21, 0x18, 0x18, 0x18, 0x18), - _INIT_DCS_CMD(0xD6, 0x1C, 0x1C, 0x1D, 0x1D, 0x07, 0x06, 0x05, 0x04, - 0x03, 0x02, 0x01, 0x00, 0x0B, 0x0A, 0x09, 0x08, 0x21, - 0x20, 0x18, 0x18, 0x27, 0x26, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x25, 0x24, 0x18, 0x18, 0x18, 0x18), - _INIT_DCS_CMD(0xE0, 0x00, 0x13, 0x21, 0x28, 0x2B, 0x2E, 0x32, 0x2F, - 0x61, 0x6E, 0x7E, 0x7B, 0x80, 0x8F, 0x91, 0x93, 0x9D, - 0x9D, 0x97, 0xA4, 0xB1, 0x57, 0x55, 0x58, 0x5D, 0x60, - 0x67, 0x74, 0x7F, 0x00, 0x13, 0x21, 0x28, 0x2B, 0x2E, - 0x32, 0x2F, 0x61, 0x6E, 0x7D, 0x7B, 0x7F, 0x8E, 0x90, - 0x93, 0x9C, 0x9D, 0x98, 0xA4, 0xB1, 0x58, 0x55, 0x59, - 0x5E, 0x61, 0x68, 0x76, 0x7F), - _INIT_DCS_CMD(0xC0, 0x1F, 0x31), - _INIT_DCS_CMD(0xCC, 0x07), - _INIT_DCS_CMD(0xD4, 0x02), - _INIT_DCS_CMD(0xBD, 0x02), - _INIT_DCS_CMD(0xD8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF), - _INIT_DCS_CMD(0xBD, 0x00), - _INIT_DCS_CMD(0xBD, 0x01), - _INIT_DCS_CMD(0xB1, 0x00), - _INIT_DCS_CMD(0xBD, 0x00), - _INIT_DCS_CMD(0xC6, 0xED), - _INIT_DCS_CMD(0xC7, 0x00, 0xC0), - _INIT_DCS_CMD(0x11), - _INIT_DELAY_CMD(120), - _INIT_DCS_CMD(0x29), - _INIT_DELAY_CMD(50), - {}, -}; - -static const struct panel_init_cmd ws_panel_5_a_init[] = { - _INIT_DCS_CMD(0xB9, 0xFF, 0x83, 0x94), - _INIT_DCS_CMD(0xB1, 0x48, 0x0A, 0x6A, 0x09, 0x33, 0x54, 0x71, 0x71, - 0x2E, 0x45), - _INIT_DCS_CMD(0xBA, 0x61, 0x03, 0x68, 0x6B, 0xB2, 0xC0), - _INIT_DCS_CMD(0xB2, 0x00, 0x80, 0x64, 0x0C, 0x06, 0x2F), - _INIT_DCS_CMD(0xB4, 0x1C, 0x78, 0x1C, 0x78, 0x1C, 0x78, 0x01, 0x0C, - 0x86, 0x75, 0x00, 0x3F, 0x1C, 0x78, 0x1C, 0x78, 0x1C, - 0x78, 0x01, 0x0C, 0x86), - _INIT_DCS_CMD(0xD3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, - 0x32, 0x10, 0x05, 0x00, 0x05, 0x32, 0x13, 0xC1, 0x00, - 0x01, 0x32, 0x10, 0x08, 0x00, 0x00, 0x37, 0x03, 0x07, - 0x07, 0x37, 0x05, 0x05, 0x37, 0x0C, 0x40), - _INIT_DCS_CMD(0xD5, 0x18, 0x18, 0x18, 0x18, 0x22, 0x23, 0x20, 0x21, - 0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x19), - _INIT_DCS_CMD(0xD6, 0x18, 0x18, 0x19, 0x19, 0x21, 0x20, 0x23, 0x22, - 0x03, 0x02, 0x01, 0x00, 0x07, 0x06, 0x05, 0x04, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x19, 0x19, 0x18, 0x18), - _INIT_DCS_CMD(0xE0, 0x07, 0x08, 0x09, 0x0D, 0x10, 0x14, 0x16, 0x13, - 0x24, 0x36, 0x48, 0x4A, 0x58, 0x6F, 0x76, 0x80, 0x97, - 0xA5, 0xA8, 0xB5, 0xC6, 0x62, 0x63, 0x68, 0x6F, 0x72, - 0x78, 0x7F, 0x7F, 0x00, 0x02, 0x08, 0x0D, 0x0C, 0x0E, - 0x0F, 0x10, 0x24, 0x36, 0x48, 0x4A, 0x58, 0x6F, 0x78, - 0x82, 0x99, 0xA4, 0xA0, 0xB1, 0xC0, 0x5E, 0x5E, 0x64, - 0x6B, 0x6C, 0x73, 0x7F, 0x7F), - _INIT_DCS_CMD(0xCC, 0x0B), - _INIT_DCS_CMD(0xC0, 0x1F, 0x73), - _INIT_DCS_CMD(0xB6, 0x6B, 0x6B), - _INIT_DCS_CMD(0xD4, 0x02), - _INIT_DCS_CMD(0xBD, 0x01), - _INIT_DCS_CMD(0xB1, 0x00), - _INIT_DCS_CMD(0xBD, 0x00), - _INIT_DCS_CMD(0xBF, 0x40, 0x81, 0x50, 0x00, 0x1A, 0xFC, 0x01), - _INIT_DCS_CMD(0x11), - _INIT_DELAY_CMD(200), - _INIT_DCS_CMD(0xB2, 0x00, 0x80, 0x64, 0x0C, 0x06, 0x2F, 0x00, 0x00, - 0x00, 0x00, 0xC0, 0x18), - _INIT_DCS_CMD(0x29), - _INIT_DELAY_CMD(80), - {}, -}; - static const struct panel_init_cmd ws_panel_5_b_init[] = { _INIT_DCS_CMD(0x11), _INIT_DELAY_CMD(120), @@ -1671,212 +474,6 @@ static const struct panel_init_cmd ws_panel_4_a_init[] = { {}, }; -static const struct panel_init_cmd ws_panel_4_c_init[] = { - _INIT_DCS_CMD(0xE0, 0x00), _INIT_DCS_CMD(0xE1, 0x93), - _INIT_DCS_CMD(0xE2, 0x65), _INIT_DCS_CMD(0xE3, 0xF8), - _INIT_DCS_CMD(0x80, 0x01), _INIT_DCS_CMD(0xE0, 0x01), - _INIT_DCS_CMD(0x00, 0x00), _INIT_DCS_CMD(0x01, 0x41), - _INIT_DCS_CMD(0x03, 0x10), _INIT_DCS_CMD(0x04, 0x44), - _INIT_DCS_CMD(0x17, 0x00), _INIT_DCS_CMD(0x18, 0xD0), - _INIT_DCS_CMD(0x19, 0x00), _INIT_DCS_CMD(0x1A, 0x00), - _INIT_DCS_CMD(0x1B, 0xD0), _INIT_DCS_CMD(0x1C, 0x00), - _INIT_DCS_CMD(0x24, 0xFE), _INIT_DCS_CMD(0x35, 0x26), - _INIT_DCS_CMD(0x37, 0x09), _INIT_DCS_CMD(0x38, 0x04), - _INIT_DCS_CMD(0x39, 0x08), _INIT_DCS_CMD(0x3A, 0x0A), - _INIT_DCS_CMD(0x3C, 0x78), _INIT_DCS_CMD(0x3D, 0xFF), - _INIT_DCS_CMD(0x3E, 0xFF), _INIT_DCS_CMD(0x3F, 0xFF), - _INIT_DCS_CMD(0x40, 0x04), _INIT_DCS_CMD(0x41, 0x64), - _INIT_DCS_CMD(0x42, 0xC7), _INIT_DCS_CMD(0x43, 0x18), - _INIT_DCS_CMD(0x44, 0x0B), _INIT_DCS_CMD(0x45, 0x14), - _INIT_DCS_CMD(0x55, 0x02), _INIT_DCS_CMD(0x57, 0x49), - _INIT_DCS_CMD(0x59, 0x0A), _INIT_DCS_CMD(0x5A, 0x1B), - _INIT_DCS_CMD(0x5B, 0x19), _INIT_DCS_CMD(0x5D, 0x7F), - _INIT_DCS_CMD(0x5E, 0x56), _INIT_DCS_CMD(0x5F, 0x43), - _INIT_DCS_CMD(0x60, 0x37), _INIT_DCS_CMD(0x61, 0x33), - _INIT_DCS_CMD(0x62, 0x25), _INIT_DCS_CMD(0x63, 0x2A), - _INIT_DCS_CMD(0x64, 0x16), _INIT_DCS_CMD(0x65, 0x30), - _INIT_DCS_CMD(0x66, 0x2F), _INIT_DCS_CMD(0x67, 0x32), - _INIT_DCS_CMD(0x68, 0x53), _INIT_DCS_CMD(0x69, 0x43), - _INIT_DCS_CMD(0x6A, 0x4C), _INIT_DCS_CMD(0x6B, 0x40), - _INIT_DCS_CMD(0x6C, 0x3D), _INIT_DCS_CMD(0x6D, 0x31), - _INIT_DCS_CMD(0x6E, 0x20), _INIT_DCS_CMD(0x6F, 0x0F), - _INIT_DCS_CMD(0x70, 0x7F), _INIT_DCS_CMD(0x71, 0x56), - _INIT_DCS_CMD(0x72, 0x43), _INIT_DCS_CMD(0x73, 0x37), - _INIT_DCS_CMD(0x74, 0x33), _INIT_DCS_CMD(0x75, 0x25), - _INIT_DCS_CMD(0x76, 0x2A), _INIT_DCS_CMD(0x77, 0x16), - _INIT_DCS_CMD(0x78, 0x30), _INIT_DCS_CMD(0x79, 0x2F), - _INIT_DCS_CMD(0x7A, 0x32), _INIT_DCS_CMD(0x7B, 0x53), - _INIT_DCS_CMD(0x7C, 0x43), _INIT_DCS_CMD(0x7D, 0x4C), - _INIT_DCS_CMD(0x7E, 0x40), _INIT_DCS_CMD(0x7F, 0x3D), - _INIT_DCS_CMD(0x80, 0x31), _INIT_DCS_CMD(0x81, 0x20), - _INIT_DCS_CMD(0x82, 0x0F), _INIT_DCS_CMD(0xE0, 0x02), - _INIT_DCS_CMD(0x00, 0x5F), _INIT_DCS_CMD(0x01, 0x5F), - _INIT_DCS_CMD(0x02, 0x5E), _INIT_DCS_CMD(0x03, 0x5E), - _INIT_DCS_CMD(0x04, 0x50), _INIT_DCS_CMD(0x05, 0x48), - _INIT_DCS_CMD(0x06, 0x48), _INIT_DCS_CMD(0x07, 0x4A), - _INIT_DCS_CMD(0x08, 0x4A), _INIT_DCS_CMD(0x09, 0x44), - _INIT_DCS_CMD(0x0A, 0x44), _INIT_DCS_CMD(0x0B, 0x46), - _INIT_DCS_CMD(0x0C, 0x46), _INIT_DCS_CMD(0x0D, 0x5F), - _INIT_DCS_CMD(0x0E, 0x5F), _INIT_DCS_CMD(0x0F, 0x57), - _INIT_DCS_CMD(0x10, 0x57), _INIT_DCS_CMD(0x11, 0x77), - _INIT_DCS_CMD(0x12, 0x77), _INIT_DCS_CMD(0x13, 0x40), - _INIT_DCS_CMD(0x14, 0x42), _INIT_DCS_CMD(0x15, 0x5F), - _INIT_DCS_CMD(0x16, 0x5F), _INIT_DCS_CMD(0x17, 0x5F), - _INIT_DCS_CMD(0x18, 0x5E), _INIT_DCS_CMD(0x19, 0x5E), - _INIT_DCS_CMD(0x1A, 0x50), _INIT_DCS_CMD(0x1B, 0x49), - _INIT_DCS_CMD(0x1C, 0x49), _INIT_DCS_CMD(0x1D, 0x4B), - _INIT_DCS_CMD(0x1E, 0x4B), _INIT_DCS_CMD(0x1F, 0x45), - _INIT_DCS_CMD(0x20, 0x45), _INIT_DCS_CMD(0x21, 0x47), - _INIT_DCS_CMD(0x22, 0x47), _INIT_DCS_CMD(0x23, 0x5F), - _INIT_DCS_CMD(0x24, 0x5F), _INIT_DCS_CMD(0x25, 0x57), - _INIT_DCS_CMD(0x26, 0x57), _INIT_DCS_CMD(0x27, 0x77), - _INIT_DCS_CMD(0x28, 0x77), _INIT_DCS_CMD(0x29, 0x41), - _INIT_DCS_CMD(0x2A, 0x43), _INIT_DCS_CMD(0x2B, 0x5F), - _INIT_DCS_CMD(0x2C, 0x1E), _INIT_DCS_CMD(0x2D, 0x1E), - _INIT_DCS_CMD(0x2E, 0x1F), _INIT_DCS_CMD(0x2F, 0x1F), - _INIT_DCS_CMD(0x30, 0x10), _INIT_DCS_CMD(0x31, 0x07), - _INIT_DCS_CMD(0x32, 0x07), _INIT_DCS_CMD(0x33, 0x05), - _INIT_DCS_CMD(0x34, 0x05), _INIT_DCS_CMD(0x35, 0x0B), - _INIT_DCS_CMD(0x36, 0x0B), _INIT_DCS_CMD(0x37, 0x09), - _INIT_DCS_CMD(0x38, 0x09), _INIT_DCS_CMD(0x39, 0x1F), - _INIT_DCS_CMD(0x3A, 0x1F), _INIT_DCS_CMD(0x3B, 0x17), - _INIT_DCS_CMD(0x3C, 0x17), _INIT_DCS_CMD(0x3D, 0x17), - _INIT_DCS_CMD(0x3E, 0x17), _INIT_DCS_CMD(0x3F, 0x03), - _INIT_DCS_CMD(0x40, 0x01), _INIT_DCS_CMD(0x41, 0x1F), - _INIT_DCS_CMD(0x42, 0x1E), _INIT_DCS_CMD(0x43, 0x1E), - _INIT_DCS_CMD(0x44, 0x1F), _INIT_DCS_CMD(0x45, 0x1F), - _INIT_DCS_CMD(0x46, 0x10), _INIT_DCS_CMD(0x47, 0x06), - _INIT_DCS_CMD(0x48, 0x06), _INIT_DCS_CMD(0x49, 0x04), - _INIT_DCS_CMD(0x4A, 0x04), _INIT_DCS_CMD(0x4B, 0x0A), - _INIT_DCS_CMD(0x4C, 0x0A), _INIT_DCS_CMD(0x4D, 0x08), - _INIT_DCS_CMD(0x4E, 0x08), _INIT_DCS_CMD(0x4F, 0x1F), - _INIT_DCS_CMD(0x50, 0x1F), _INIT_DCS_CMD(0x51, 0x17), - _INIT_DCS_CMD(0x52, 0x17), _INIT_DCS_CMD(0x53, 0x17), - _INIT_DCS_CMD(0x54, 0x17), _INIT_DCS_CMD(0x55, 0x02), - _INIT_DCS_CMD(0x56, 0x00), _INIT_DCS_CMD(0x57, 0x1F), - _INIT_DCS_CMD(0xE0, 0x02), _INIT_DCS_CMD(0x58, 0x40), - _INIT_DCS_CMD(0x59, 0x00), _INIT_DCS_CMD(0x5A, 0x00), - _INIT_DCS_CMD(0x5B, 0x30), _INIT_DCS_CMD(0x5C, 0x01), - _INIT_DCS_CMD(0x5D, 0x30), _INIT_DCS_CMD(0x5E, 0x01), - _INIT_DCS_CMD(0x5F, 0x02), _INIT_DCS_CMD(0x60, 0x30), - _INIT_DCS_CMD(0x61, 0x03), _INIT_DCS_CMD(0x62, 0x04), - _INIT_DCS_CMD(0x63, 0x04), _INIT_DCS_CMD(0x64, 0xA6), - _INIT_DCS_CMD(0x65, 0x43), _INIT_DCS_CMD(0x66, 0x30), - _INIT_DCS_CMD(0x67, 0x73), _INIT_DCS_CMD(0x68, 0x05), - _INIT_DCS_CMD(0x69, 0x04), _INIT_DCS_CMD(0x6A, 0x7F), - _INIT_DCS_CMD(0x6B, 0x08), _INIT_DCS_CMD(0x6C, 0x00), - _INIT_DCS_CMD(0x6D, 0x04), _INIT_DCS_CMD(0x6E, 0x04), - _INIT_DCS_CMD(0x6F, 0x88), _INIT_DCS_CMD(0x75, 0xD9), - _INIT_DCS_CMD(0x76, 0x00), _INIT_DCS_CMD(0x77, 0x33), - _INIT_DCS_CMD(0x78, 0x43), _INIT_DCS_CMD(0xE0, 0x00), - _INIT_DCS_CMD(0x11), _INIT_DELAY_CMD(120), - _INIT_DCS_CMD(0x29), _INIT_DELAY_CMD(5), - _INIT_DCS_CMD(0x35, 0x00), {}, -}; - -static const struct panel_init_cmd ws_panel_3_4_c_init[] = { - _INIT_DCS_CMD(0xE0, 0x00), _INIT_DCS_CMD(0xE1, 0x93), - _INIT_DCS_CMD(0xE2, 0x65), _INIT_DCS_CMD(0xE3, 0xF8), - _INIT_DCS_CMD(0x80, 0x01), _INIT_DCS_CMD(0xE0, 0x01), - _INIT_DCS_CMD(0x00, 0x00), _INIT_DCS_CMD(0x01, 0x41), - _INIT_DCS_CMD(0x03, 0x10), _INIT_DCS_CMD(0x04, 0x44), - _INIT_DCS_CMD(0x17, 0x00), _INIT_DCS_CMD(0x18, 0xD0), - _INIT_DCS_CMD(0x19, 0x00), _INIT_DCS_CMD(0x1A, 0x00), - _INIT_DCS_CMD(0x1B, 0xD0), _INIT_DCS_CMD(0x1C, 0x00), - _INIT_DCS_CMD(0x24, 0xFE), _INIT_DCS_CMD(0x35, 0x26), - _INIT_DCS_CMD(0x37, 0x09), _INIT_DCS_CMD(0x38, 0x04), - _INIT_DCS_CMD(0x39, 0x08), _INIT_DCS_CMD(0x3A, 0x0A), - _INIT_DCS_CMD(0x3C, 0x78), _INIT_DCS_CMD(0x3D, 0xFF), - _INIT_DCS_CMD(0x3E, 0xFF), _INIT_DCS_CMD(0x3F, 0xFF), - _INIT_DCS_CMD(0x40, 0x00), _INIT_DCS_CMD(0x41, 0x64), - _INIT_DCS_CMD(0x42, 0xC7), _INIT_DCS_CMD(0x43, 0x18), - _INIT_DCS_CMD(0x44, 0x0B), _INIT_DCS_CMD(0x45, 0x14), - _INIT_DCS_CMD(0x55, 0x02), _INIT_DCS_CMD(0x57, 0x49), - _INIT_DCS_CMD(0x59, 0x0A), _INIT_DCS_CMD(0x5A, 0x1B), - _INIT_DCS_CMD(0x5B, 0x19), _INIT_DCS_CMD(0x5D, 0x7F), - _INIT_DCS_CMD(0x5E, 0x56), _INIT_DCS_CMD(0x5F, 0x43), - _INIT_DCS_CMD(0x60, 0x37), _INIT_DCS_CMD(0x61, 0x33), - _INIT_DCS_CMD(0x62, 0x25), _INIT_DCS_CMD(0x63, 0x2A), - _INIT_DCS_CMD(0x64, 0x16), _INIT_DCS_CMD(0x65, 0x30), - _INIT_DCS_CMD(0x66, 0x2F), _INIT_DCS_CMD(0x67, 0x32), - _INIT_DCS_CMD(0x68, 0x53), _INIT_DCS_CMD(0x69, 0x43), - _INIT_DCS_CMD(0x6A, 0x4C), _INIT_DCS_CMD(0x6B, 0x40), - _INIT_DCS_CMD(0x6C, 0x3D), _INIT_DCS_CMD(0x6D, 0x31), - _INIT_DCS_CMD(0x6E, 0x20), _INIT_DCS_CMD(0x6F, 0x0F), - _INIT_DCS_CMD(0x70, 0x7F), _INIT_DCS_CMD(0x71, 0x56), - _INIT_DCS_CMD(0x72, 0x43), _INIT_DCS_CMD(0x73, 0x37), - _INIT_DCS_CMD(0x74, 0x33), _INIT_DCS_CMD(0x75, 0x25), - _INIT_DCS_CMD(0x76, 0x2A), _INIT_DCS_CMD(0x77, 0x16), - _INIT_DCS_CMD(0x78, 0x30), _INIT_DCS_CMD(0x79, 0x2F), - _INIT_DCS_CMD(0x7A, 0x32), _INIT_DCS_CMD(0x7B, 0x53), - _INIT_DCS_CMD(0x7C, 0x43), _INIT_DCS_CMD(0x7D, 0x4C), - _INIT_DCS_CMD(0x7E, 0x40), _INIT_DCS_CMD(0x7F, 0x3D), - _INIT_DCS_CMD(0x80, 0x31), _INIT_DCS_CMD(0x81, 0x20), - _INIT_DCS_CMD(0x82, 0x0F), _INIT_DCS_CMD(0xE0, 0x02), - _INIT_DCS_CMD(0x00, 0x5F), _INIT_DCS_CMD(0x01, 0x5F), - _INIT_DCS_CMD(0x02, 0x5E), _INIT_DCS_CMD(0x03, 0x5E), - _INIT_DCS_CMD(0x04, 0x50), _INIT_DCS_CMD(0x05, 0x48), - _INIT_DCS_CMD(0x06, 0x48), _INIT_DCS_CMD(0x07, 0x4A), - _INIT_DCS_CMD(0x08, 0x4A), _INIT_DCS_CMD(0x09, 0x44), - _INIT_DCS_CMD(0x0A, 0x44), _INIT_DCS_CMD(0x0B, 0x46), - _INIT_DCS_CMD(0x0C, 0x46), _INIT_DCS_CMD(0x0D, 0x5F), - _INIT_DCS_CMD(0x0E, 0x5F), _INIT_DCS_CMD(0x0F, 0x57), - _INIT_DCS_CMD(0x10, 0x57), _INIT_DCS_CMD(0x11, 0x77), - _INIT_DCS_CMD(0x12, 0x77), _INIT_DCS_CMD(0x13, 0x40), - _INIT_DCS_CMD(0x14, 0x42), _INIT_DCS_CMD(0x15, 0x5F), - _INIT_DCS_CMD(0x16, 0x5F), _INIT_DCS_CMD(0x17, 0x5F), - _INIT_DCS_CMD(0x18, 0x5E), _INIT_DCS_CMD(0x19, 0x5E), - _INIT_DCS_CMD(0x1A, 0x50), _INIT_DCS_CMD(0x1B, 0x49), - _INIT_DCS_CMD(0x1C, 0x49), _INIT_DCS_CMD(0x1D, 0x4B), - _INIT_DCS_CMD(0x1E, 0x4B), _INIT_DCS_CMD(0x1F, 0x45), - _INIT_DCS_CMD(0x20, 0x45), _INIT_DCS_CMD(0x21, 0x47), - _INIT_DCS_CMD(0x22, 0x47), _INIT_DCS_CMD(0x23, 0x5F), - _INIT_DCS_CMD(0x24, 0x5F), _INIT_DCS_CMD(0x25, 0x57), - _INIT_DCS_CMD(0x26, 0x57), _INIT_DCS_CMD(0x27, 0x77), - _INIT_DCS_CMD(0x28, 0x77), _INIT_DCS_CMD(0x29, 0x41), - _INIT_DCS_CMD(0x2A, 0x43), _INIT_DCS_CMD(0x2B, 0x5F), - _INIT_DCS_CMD(0x2C, 0x1E), _INIT_DCS_CMD(0x2D, 0x1E), - _INIT_DCS_CMD(0x2E, 0x1F), _INIT_DCS_CMD(0x2F, 0x1F), - _INIT_DCS_CMD(0x30, 0x10), _INIT_DCS_CMD(0x31, 0x07), - _INIT_DCS_CMD(0x32, 0x07), _INIT_DCS_CMD(0x33, 0x05), - _INIT_DCS_CMD(0x34, 0x05), _INIT_DCS_CMD(0x35, 0x0B), - _INIT_DCS_CMD(0x36, 0x0B), _INIT_DCS_CMD(0x37, 0x09), - _INIT_DCS_CMD(0x38, 0x09), _INIT_DCS_CMD(0x39, 0x1F), - _INIT_DCS_CMD(0x3A, 0x1F), _INIT_DCS_CMD(0x3B, 0x17), - _INIT_DCS_CMD(0x3C, 0x17), _INIT_DCS_CMD(0x3D, 0x17), - _INIT_DCS_CMD(0x3E, 0x17), _INIT_DCS_CMD(0x3F, 0x03), - _INIT_DCS_CMD(0x40, 0x01), _INIT_DCS_CMD(0x41, 0x1F), - _INIT_DCS_CMD(0x42, 0x1E), _INIT_DCS_CMD(0x43, 0x1E), - _INIT_DCS_CMD(0x44, 0x1F), _INIT_DCS_CMD(0x45, 0x1F), - _INIT_DCS_CMD(0x46, 0x10), _INIT_DCS_CMD(0x47, 0x06), - _INIT_DCS_CMD(0x48, 0x06), _INIT_DCS_CMD(0x49, 0x04), - _INIT_DCS_CMD(0x4A, 0x04), _INIT_DCS_CMD(0x4B, 0x0A), - _INIT_DCS_CMD(0x4C, 0x0A), _INIT_DCS_CMD(0x4D, 0x08), - _INIT_DCS_CMD(0x4E, 0x08), _INIT_DCS_CMD(0x4F, 0x1F), - _INIT_DCS_CMD(0x50, 0x1F), _INIT_DCS_CMD(0x51, 0x17), - _INIT_DCS_CMD(0x52, 0x17), _INIT_DCS_CMD(0x53, 0x17), - _INIT_DCS_CMD(0x54, 0x17), _INIT_DCS_CMD(0x55, 0x02), - _INIT_DCS_CMD(0x56, 0x00), _INIT_DCS_CMD(0x57, 0x1F), - _INIT_DCS_CMD(0xE0, 0x02), _INIT_DCS_CMD(0x58, 0x40), - _INIT_DCS_CMD(0x59, 0x00), _INIT_DCS_CMD(0x5A, 0x00), - _INIT_DCS_CMD(0x5B, 0x30), _INIT_DCS_CMD(0x5C, 0x01), - _INIT_DCS_CMD(0x5D, 0x30), _INIT_DCS_CMD(0x5E, 0x01), - _INIT_DCS_CMD(0x5F, 0x02), _INIT_DCS_CMD(0x60, 0x30), - _INIT_DCS_CMD(0x61, 0x03), _INIT_DCS_CMD(0x62, 0x04), - _INIT_DCS_CMD(0x63, 0x04), _INIT_DCS_CMD(0x64, 0xA6), - _INIT_DCS_CMD(0x65, 0x43), _INIT_DCS_CMD(0x66, 0x30), - _INIT_DCS_CMD(0x67, 0x73), _INIT_DCS_CMD(0x68, 0x05), - _INIT_DCS_CMD(0x69, 0x04), _INIT_DCS_CMD(0x6A, 0x7F), - _INIT_DCS_CMD(0x6B, 0x08), _INIT_DCS_CMD(0x6C, 0x00), - _INIT_DCS_CMD(0x6D, 0x04), _INIT_DCS_CMD(0x6E, 0x04), - _INIT_DCS_CMD(0x6F, 0x88), _INIT_DCS_CMD(0x75, 0xD9), - _INIT_DCS_CMD(0x76, 0x00), _INIT_DCS_CMD(0x77, 0x33), - _INIT_DCS_CMD(0x78, 0x43), _INIT_DCS_CMD(0xE0, 0x00), - _INIT_DCS_CMD(0x11), _INIT_DELAY_CMD(120), - _INIT_DCS_CMD(0x29), _INIT_DELAY_CMD(5), - _INIT_DCS_CMD(0x35, 0x00), {}, -}; - static inline struct ws_panel *panel_to_ws(struct drm_panel *panel) { return container_of(panel, struct ws_panel, panel); @@ -1921,29 +518,49 @@ static int ws_panel_init_dcs_cmd(struct ws_panel *ts) return 0; } +static void ws_panel_power_off(struct ws_panel *ctx) +{ + if (ctx->reset) { + gpiod_set_value_cansleep(ctx->reset, 1); + msleep(20); + } + + regulator_disable(ctx->avdd); + msleep(20); + + regulator_disable(ctx->iovcc); + msleep(20); + + ctx->prepared = false; +} + static int ws_panel_prepare(struct drm_panel *panel) { struct ws_panel *ctx = panel_to_ws(panel); int ret; - if (ctx->iovcc) { - gpiod_set_value_cansleep(ctx->iovcc, 1); - msleep(20); - } + ret = regulator_enable(ctx->iovcc); + if (ret) + return ret; + msleep(20); - if (ctx->avdd) { - gpiod_set_value_cansleep(ctx->avdd, 1); - msleep(20); + ret = regulator_enable(ctx->avdd); + if (ret) { + regulator_disable(ctx->iovcc); + return ret; } + msleep(20); /* And reset it */ if (ctx->reset) { - gpiod_set_value_cansleep(ctx->reset, 0); - msleep(60); gpiod_set_value_cansleep(ctx->reset, 1); msleep(60); + gpiod_set_value_cansleep(ctx->reset, 0); + msleep(60); } + ctx->prepared = true; + ret = ws_panel_init_dcs_cmd(ctx); if (ret < 0) dev_err(panel->dev, "failed to init panel: %d\n", ret); @@ -1958,80 +575,11 @@ static int ws_panel_unprepare(struct drm_panel *panel) mipi_dsi_dcs_set_display_off(ctx->dsi); mipi_dsi_dcs_enter_sleep_mode(ctx->dsi); - if (ctx->reset) { - gpiod_set_value_cansleep(ctx->reset, 0); - msleep(20); - } - - if (ctx->avdd) { - gpiod_set_value_cansleep(ctx->avdd, 0); - msleep(20); - } - - if (ctx->iovcc) { - gpiod_set_value_cansleep(ctx->iovcc, 0); - msleep(20); - } + ws_panel_power_off(ctx); return 0; } -static const struct drm_display_mode ws_panel_12_3_a_4lane_mode = { - .clock = 95000, - .hdisplay = 720, - .hsync_start = 720 + 10, - .hsync_end = 720 + 10 + 10, - .htotal = 720 + 10 + 10 + 12, - .vdisplay = 1920, - .vsync_start = 1920 + 64, - .vsync_end = 1920 + 64 + 18, - .vtotal = 1920 + 64 + 18 + 4, - .width_mm = 109, - .height_mm = 292, -}; - -static const struct drm_display_mode ws_panel_10_1_a_mode = { - .clock = 71000, - .hdisplay = 800, - .hsync_start = 800 + 40, - .hsync_end = 800 + 40 + 30, - .htotal = 800 + 40 + 30 + 20, - .vdisplay = 1280, - .vsync_start = 1280 + 20, - .vsync_end = 1280 + 20 + 20, - .vtotal = 1280 + 20 + 20 + 4, - .width_mm = 135, - .height_mm = 216, -}; - -static const struct drm_display_mode ws_panel_10_1_b_4lane_mode = { - .clock = 66000, - .hdisplay = 720, - .hsync_start = 720 + 60, - .hsync_end = 720 + 60 + 60, - .htotal = 720 + 60 + 60 + 4, - .vdisplay = 1280, - .vsync_start = 1280 + 16, - .vsync_end = 1280 + 16 + 12, - .vtotal = 1280 + 16 + 12 + 4, - .width_mm = 125, - .height_mm = 222, -}; - -static const struct drm_display_mode ws_panel_10_1_b_mode = { - .clock = 69000, - .hdisplay = 720, - .hsync_start = 720 + 50, - .hsync_end = 720 + 50 + 50, - .htotal = 720 + 50 + 50 + 50, - .vdisplay = 1280, - .vsync_start = 1280 + 26, - .vsync_end = 1280 + 26 + 12, - .vtotal = 1280 + 26 + 12 + 4, - .width_mm = 125, - .height_mm = 222, -}; - static const struct drm_display_mode ws_panel_10_1_e_4lane_mode = { .clock = 155000, .hdisplay = 1200, @@ -2046,62 +594,6 @@ static const struct drm_display_mode ws_panel_10_1_e_4lane_mode = { .height_mm = 216, }; -static const struct drm_display_mode ws_panel_9_b_4lane_mode = { - .clock = 66000, - .hdisplay = 720, - .hsync_start = 720 + 60, - .hsync_end = 720 + 60 + 60, - .htotal = 720 + 60 + 60 + 4, - .vdisplay = 1280, - .vsync_start = 1280 + 16, - .vsync_end = 1280 + 16 + 12, - .vtotal = 1280 + 16 + 12 + 4, - .width_mm = 114, - .height_mm = 196, -}; - -static const struct drm_display_mode ws_panel_9_b_mode = { - .clock = 69000, - .hdisplay = 720, - .hsync_start = 720 + 50, - .hsync_end = 720 + 50 + 50, - .htotal = 720 + 50 + 50 + 50, - .vdisplay = 1280, - .vsync_start = 1280 + 26, - .vsync_end = 1280 + 26 + 12, - .vtotal = 1280 + 26 + 12 + 4, - .width_mm = 114, - .height_mm = 196, -}; - -static const struct drm_display_mode ws_panel_8_8_a_mode = { - .clock = 75000, - .hdisplay = 480, - .hsync_start = 480 + 50, - .hsync_end = 480 + 50 + 50, - .htotal = 480 + 50 + 50 + 50, - .vdisplay = 1920, - .vsync_start = 1920 + 20, - .vsync_end = 1920 + 20 + 20, - .vtotal = 1920 + 20 + 20 + 20, - .width_mm = 68, - .height_mm = 219, -}; - -static const struct drm_display_mode ws_panel_8_a_mode = { - .clock = 71000, - .hdisplay = 800, - .hsync_start = 800 + 40, - .hsync_end = 800 + 40 + 30, - .htotal = 800 + 40 + 30 + 20, - .vdisplay = 1280, - .vsync_start = 1280 + 30, - .vsync_end = 1280 + 30 + 12, - .vtotal = 1280 + 30 + 12 + 4, - .width_mm = 107, - .height_mm = 172, -}; - static const struct drm_display_mode ws_panel_7_a_mode = { .clock = 83333, .hdisplay = 720, @@ -2144,34 +636,6 @@ static const struct drm_display_mode ws_panel_6_25_a_mode = { .height_mm = 110, }; -static const struct drm_display_mode ws_panel_5_5_a_mode = { - .clock = 65000, - .hdisplay = 720, - .hsync_start = 720 + 50, - .hsync_end = 720 + 50 + 50, - .htotal = 720 + 50 + 50 + 10, - .vdisplay = 1280, - .vsync_start = 1280 + 15, - .vsync_end = 1280 + 15 + 12, - .vtotal = 1280 + 15 + 12 + 4, - .width_mm = 62, - .height_mm = 110, -}; - -static const struct drm_display_mode ws_panel_5_a_mode = { - .clock = 70000, - .hdisplay = 720, - .hsync_start = 720 + 40, - .hsync_end = 720 + 40 + 30, - .htotal = 720 + 40 + 30 + 20, - .vdisplay = 1280, - .vsync_start = 1280 + 30, - .vsync_end = 1280 + 30 + 10, - .vtotal = 1280 + 30 + 10 + 4, - .width_mm = 62, - .height_mm = 110, -}; - static const struct drm_display_mode ws_panel_5_b_mode = { .clock = 70000, .hdisplay = 720, @@ -2214,34 +678,6 @@ static const struct drm_display_mode ws_panel_4_a_mode = { .height_mm = 86, }; -static const struct drm_display_mode ws_panel_4_c_mode = { - .clock = 36500, - .hdisplay = 720, - .hsync_start = 720 + 40, - .hsync_end = 720 + 40 + 20, - .htotal = 720 + 40 + 20 + 20, - .vdisplay = 720, - .vsync_start = 720 + 24, - .vsync_end = 720 + 24 + 4, - .vtotal = 720 + 24 + 4 + 12, - .width_mm = 88, - .height_mm = 88, -}; - -static const struct drm_display_mode ws_panel_3_4_c_mode = { - .clock = 44300, - .hdisplay = 800, - .hsync_start = 800 + 40, - .hsync_end = 800 + 40 + 20, - .htotal = 800 + 40 + 20 + 20, - .vdisplay = 800, - .vsync_start = 800 + 24, - .vsync_end = 800 + 24 + 4, - .vtotal = 800 + 24 + 4 + 12, - .width_mm = 88, - .height_mm = 88, -}; - static int ws_panel_get_modes(struct drm_panel *panel, struct drm_connector *connector) { @@ -2307,15 +743,15 @@ static int ws_panel_dsi_probe(struct mipi_dsi_device *dsi) return dev_err_probe(&dsi->dev, PTR_ERR(ctx->reset), "Couldn't get our reset GPIO\n"); - ctx->iovcc = devm_gpiod_get_optional(&dsi->dev, "iovcc", GPIOD_ASIS); + ctx->iovcc = devm_regulator_get(&dsi->dev, "iovcc"); if (IS_ERR(ctx->iovcc)) return dev_err_probe(&dsi->dev, PTR_ERR(ctx->iovcc), - "Couldn't get our iovcc GPIO\n"); + "Couldn't get our iovcc supply\n"); - ctx->avdd = devm_gpiod_get_optional(&dsi->dev, "avdd", GPIOD_ASIS); + ctx->avdd = devm_regulator_get(&dsi->dev, "avdd"); if (IS_ERR(ctx->avdd)) return dev_err_probe(&dsi->dev, PTR_ERR(ctx->avdd), - "Couldn't get our avdd GPIO\n"); + "Couldn't get our avdd supply\n"); ret = drm_of_get_panel_orientation(dsi->dev.of_node, &ctx->orientation); if (ret) { @@ -2348,88 +784,18 @@ static void ws_panel_dsi_remove(struct mipi_dsi_device *dsi) mipi_dsi_detach(dsi); drm_panel_remove(&ctx->panel); - if (ctx->reset) { - gpiod_set_value_cansleep(ctx->reset, 0); - msleep(20); - } - - if (ctx->avdd) { - gpiod_set_value_cansleep(ctx->avdd, 0); - msleep(20); - } - - if (ctx->iovcc) { - gpiod_set_value_cansleep(ctx->iovcc, 0); - msleep(20); - } + if (ctx->prepared) + ws_panel_power_off(ctx); } static void ws_panel_dsi_shutdown(struct mipi_dsi_device *dsi) { struct ws_panel *ctx = mipi_dsi_get_drvdata(dsi); - if (ctx->reset) { - dev_info(&dsi->dev, "shutdown\n"); - gpiod_set_value_cansleep(ctx->reset, 0); - msleep(20); - } - - if (ctx->avdd) { - gpiod_set_value_cansleep(ctx->avdd, 0); - msleep(20); - } - - if (ctx->iovcc) { - gpiod_set_value_cansleep(ctx->iovcc, 0); - msleep(20); - } + if (ctx->prepared) + ws_panel_power_off(ctx); } -static const struct ws_panel_desc ws_panel_12_3_inch_a_4lane_desc = { - .init = ws_panel_12_3_a_4lane_init, - .mode = &ws_panel_12_3_a_4lane_mode, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | - MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS, - .lanes = 4, - .format = MIPI_DSI_FMT_RGB888, -}; - -static const struct ws_panel_desc ws_panel_10_1_inch_a_4lane_desc = { - .init = ws_panel_10_1_a_4lane_init, - .mode = &ws_panel_10_1_a_mode, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | - MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS, - .lanes = 4, - .format = MIPI_DSI_FMT_RGB888, -}; - -static const struct ws_panel_desc ws_panel_10_1_inch_a_desc = { - .init = ws_panel_10_1_a_init, - .mode = &ws_panel_10_1_a_mode, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | - MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS, - .lanes = 2, - .format = MIPI_DSI_FMT_RGB888, -}; - -static const struct ws_panel_desc ws_panel_10_1_inch_b_4lane_desc = { - .init = ws_panel_10_1_b_4lane_init, - .mode = &ws_panel_10_1_b_4lane_mode, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | - MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS, - .lanes = 4, - .format = MIPI_DSI_FMT_RGB888, -}; - -static const struct ws_panel_desc ws_panel_10_1_inch_b_desc = { - .init = ws_panel_10_1_b_init, - .mode = &ws_panel_10_1_b_mode, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | - MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS, - .lanes = 2, - .format = MIPI_DSI_FMT_RGB888, -}; - static const struct ws_panel_desc ws_panel_10_1_inch_e_4lane_desc = { .init = ws_panel_10_1_e_4lane_init, .mode = &ws_panel_10_1_e_4lane_mode, @@ -2439,51 +805,6 @@ static const struct ws_panel_desc ws_panel_10_1_inch_e_4lane_desc = { .format = MIPI_DSI_FMT_RGB888, }; -static const struct ws_panel_desc ws_panel_9_inch_b_4lane_desc = { - .init = ws_panel_10_1_b_4lane_init, - .mode = &ws_panel_9_b_4lane_mode, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | - MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS, - .lanes = 4, - .format = MIPI_DSI_FMT_RGB888, -}; - -static const struct ws_panel_desc ws_panel_9_inch_b_desc = { - .init = ws_panel_10_1_b_init, - .mode = &ws_panel_9_b_mode, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | - MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS, - .lanes = 2, - .format = MIPI_DSI_FMT_RGB888, -}; - -static const struct ws_panel_desc ws_panel_8_8_inch_a_desc = { - .init = ws_panel_8_8_a_init, - .mode = &ws_panel_8_8_a_mode, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | - MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS, - .lanes = 2, - .format = MIPI_DSI_FMT_RGB888, -}; - -static const struct ws_panel_desc ws_panel_8_inch_a_4lane_desc = { - .init = ws_panel_8_a_4lane_init, - .mode = &ws_panel_8_a_mode, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | - MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS, - .lanes = 4, - .format = MIPI_DSI_FMT_RGB888, -}; - -static const struct ws_panel_desc ws_panel_8_inch_a_desc = { - .init = ws_panel_8_a_init, - .mode = &ws_panel_8_a_mode, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | - MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS, - .lanes = 2, - .format = MIPI_DSI_FMT_RGB888, -}; - static const struct ws_panel_desc ws_panel_7_inch_a_desc = { .init = ws_panel_7_a_init, .mode = &ws_panel_7_a_mode, @@ -2511,24 +832,6 @@ static const struct ws_panel_desc ws_panel_6_25_inch_a_desc = { .format = MIPI_DSI_FMT_RGB888, }; -static const struct ws_panel_desc ws_panel_5_5_inch_a_desc = { - .init = ws_panel_5_5_a_init, - .mode = &ws_panel_5_5_a_mode, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | - MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS, - .lanes = 2, - .format = MIPI_DSI_FMT_RGB888, -}; - -static const struct ws_panel_desc ws_panel_5_inch_a_desc = { - .init = ws_panel_5_a_init, - .mode = &ws_panel_5_a_mode, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | - MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS, - .lanes = 2, - .format = MIPI_DSI_FMT_RGB888, -}; - static const struct ws_panel_desc ws_panel_5_inch_b_desc = { .init = ws_panel_5_b_init, .mode = &ws_panel_5_b_mode, @@ -2556,61 +859,16 @@ static const struct ws_panel_desc ws_panel_4_inch_a_desc = { .format = MIPI_DSI_FMT_RGB888, }; -static const struct ws_panel_desc ws_panel_4_inch_c_desc = { - .init = ws_panel_4_c_init, - .mode = &ws_panel_4_c_mode, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | - MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS, - .lanes = 2, - .format = MIPI_DSI_FMT_RGB888, -}; - -static const struct ws_panel_desc ws_panel_3_4_inch_c_desc = { - .init = ws_panel_3_4_c_init, - .mode = &ws_panel_3_4_c_mode, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | - MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS, - .lanes = 2, - .format = MIPI_DSI_FMT_RGB888, -}; - static const struct of_device_id ws_panel_of_match[] = { - { .compatible = "waveshare,12.3-dsi-touch-a-4lane", - &ws_panel_12_3_inch_a_4lane_desc }, - { .compatible = "waveshare,10.1-dsi-touch-a-4lane", - &ws_panel_10_1_inch_a_4lane_desc }, - { .compatible = "waveshare,10.1-dsi-touch-a", - &ws_panel_10_1_inch_a_desc }, - { .compatible = "waveshare,10.1-dsi-touch-b-4lane", - &ws_panel_10_1_inch_b_4lane_desc }, - { .compatible = "waveshare,10.1-dsi-touch-b", - &ws_panel_10_1_inch_b_desc }, { .compatible = "waveshare,10.1-dsi-touch-e-4lane", &ws_panel_10_1_inch_e_4lane_desc }, - { .compatible = "waveshare,9.0-dsi-touch-b-4lane", - &ws_panel_9_inch_b_4lane_desc }, - { .compatible = "waveshare,9.0-dsi-touch-b", &ws_panel_9_inch_b_desc }, - { .compatible = "waveshare,8.8-dsi-touch-a", - &ws_panel_8_8_inch_a_desc }, - { .compatible = "waveshare,8.0-dsi-touch-a-4lane", - &ws_panel_8_inch_a_4lane_desc }, - { .compatible = "waveshare,8.0-dsi-touch-a", &ws_panel_8_inch_a_desc }, - { .compatible = "waveshare,7.0-dsi-touch-a", &ws_panel_7_inch_a_desc }, { .compatible = "waveshare,7.0-dsi-touch-b", &ws_panel_7_inch_a_desc }, { .compatible = "waveshare,7.0-dsi-touch-c", &ws_panel_7_inch_c_desc }, - { .compatible = "waveshare,6.25-dsi-touch-a", - &ws_panel_6_25_inch_a_desc }, - { .compatible = "waveshare,5.5-dsi-touch-a", - &ws_panel_5_5_inch_a_desc }, - { .compatible = "waveshare,5.0-dsi-touch-a", &ws_panel_5_inch_a_desc }, - { .compatible = "waveshare,5.0-dsi-touch-a-v2", - &ws_panel_5_inch_b_desc }, + { .compatible = "waveshare,6.25-dsi-touch-a", &ws_panel_6_25_inch_a_desc }, + { .compatible = "waveshare,5.0-dsi-touch-a-v2", &ws_panel_5_inch_b_desc }, { .compatible = "waveshare,5.0-dsi-touch-b", &ws_panel_5_inch_b_desc }, { .compatible = "waveshare,4.3-dsi-touch-a", &ws_panel_4_3_inch_a_desc }, { .compatible = "waveshare,4.0-dsi-touch-a", &ws_panel_4_inch_a_desc }, - { .compatible = "waveshare,4.0-dsi-touch-c", &ws_panel_4_inch_c_desc }, - { .compatible = "waveshare,3.4-dsi-touch-c", - &ws_panel_3_4_inch_c_desc }, {} }; MODULE_DEVICE_TABLE(of, ws_panel_of_match); diff --git a/drivers/gpu/drm/panel/panel-waveshare-dsi.c b/drivers/gpu/drm/panel/panel-waveshare-dsi.c index cd28d20aac26db..74c502322c8acf 100644 --- a/drivers/gpu/drm/panel/panel-waveshare-dsi.c +++ b/drivers/gpu/drm/panel/panel-waveshare-dsi.c @@ -1,9 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -/* - * Copyright © 2023 Raspberry Pi Ltd - * - * Based on panel-raspberrypi-touchscreen by Broadcom - */ #include #include @@ -39,214 +34,6 @@ struct ws_panel_data { unsigned long mode_flags; }; -/* 2.8inch 480x640 - * https://www.waveshare.com/product/raspberry-pi/displays/2.8inch-dsi-lcd.htm - */ -static const struct drm_display_mode ws_panel_2_8_mode = { - .clock = 50000, - .hdisplay = 480, - .hsync_start = 480 + 150, - .hsync_end = 480 + 150 + 50, - .htotal = 480 + 150 + 50 + 150, - .vdisplay = 640, - .vsync_start = 640 + 150, - .vsync_end = 640 + 150 + 50, - .vtotal = 640 + 150 + 50 + 150, -}; - -static const struct ws_panel_data ws_panel_2_8_data = { - .mode = &ws_panel_2_8_mode, - .lanes = 2, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS, -}; - -/* 3.4inch 800x800 Round - * https://www.waveshare.com/product/displays/lcd-oled/3.4inch-dsi-lcd-c.htm - */ -static const struct drm_display_mode ws_panel_3_4_mode = { - .clock = 50000, - .hdisplay = 800, - .hsync_start = 800 + 32, - .hsync_end = 800 + 32 + 6, - .htotal = 800 + 32 + 6 + 120, - .vdisplay = 800, - .vsync_start = 800 + 8, - .vsync_end = 800 + 8 + 4, - .vtotal = 800 + 8 + 4 + 16, -}; - -static const struct ws_panel_data ws_panel_3_4_data = { - .mode = &ws_panel_3_4_mode, - .lanes = 2, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS, -}; - -/* 4.0inch 480x800 - * https://www.waveshare.com/product/raspberry-pi/displays/4inch-dsi-lcd.htm - */ -static const struct drm_display_mode ws_panel_4_0_mode = { - .clock = 50000, - .hdisplay = 480, - .hsync_start = 480 + 150, - .hsync_end = 480 + 150 + 100, - .htotal = 480 + 150 + 100 + 150, - .vdisplay = 800, - .vsync_start = 800 + 20, - .vsync_end = 800 + 20 + 100, - .vtotal = 800 + 20 + 100 + 20, -}; - -static const struct ws_panel_data ws_panel_4_0_data = { - .mode = &ws_panel_4_0_mode, - .lanes = 2, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS, -}; - -/* 7.0inch C 1024x600 - * https://www.waveshare.com/product/raspberry-pi/displays/lcd-oled/7inch-dsi-lcd-c-with-case-a.htm - */ -static const struct drm_display_mode ws_panel_7_0_c_mode = { - .clock = 50000, - .hdisplay = 1024, - .hsync_start = 1024 + 100, - .hsync_end = 1024 + 100 + 100, - .htotal = 1024 + 100 + 100 + 100, - .vdisplay = 600, - .vsync_start = 600 + 10, - .vsync_end = 600 + 10 + 10, - .vtotal = 600 + 10 + 10 + 10, -}; - -static const struct ws_panel_data ws_panel_7_0_c_data = { - .mode = &ws_panel_7_0_c_mode, - .lanes = 2, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS, -}; - -/* 7.9inch 400x1280 - * https://www.waveshare.com/product/raspberry-pi/displays/7.9inch-dsi-lcd.htm - */ -static const struct drm_display_mode ws_panel_7_9_mode = { - .clock = 50000, - .hdisplay = 400, - .hsync_start = 400 + 40, - .hsync_end = 400 + 40 + 30, - .htotal = 400 + 40 + 30 + 40, - .vdisplay = 1280, - .vsync_start = 1280 + 20, - .vsync_end = 1280 + 20 + 10, - .vtotal = 1280 + 20 + 10 + 20, -}; - -static const struct ws_panel_data ws_panel_7_9_data = { - .mode = &ws_panel_7_9_mode, - .lanes = 2, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS, -}; - -/* 8.0inch or 10.1inch 1280x800 - * https://www.waveshare.com/product/raspberry-pi/displays/8inch-dsi-lcd-c.htm - * https://www.waveshare.com/product/raspberry-pi/displays/10.1inch-dsi-lcd-c.htm - */ -static const struct drm_display_mode ws_panel_10_1_mode = { - .clock = 83333, - .hdisplay = 1280, - .hsync_start = 1280 + 156, - .hsync_end = 1280 + 156 + 20, - .htotal = 1280 + 156 + 20 + 40, - .vdisplay = 800, - .vsync_start = 800 + 40, - .vsync_end = 800 + 40 + 48, - .vtotal = 800 + 40 + 48 + 40, -}; - -static const struct ws_panel_data ws_panel_10_1_data = { - .mode = &ws_panel_10_1_mode, - .lanes = 2, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS, -}; - -/* 11.9inch 320x1480 - * https://www.waveshare.com/product/raspberry-pi/displays/11.9inch-dsi-lcd.htm - */ -static const struct drm_display_mode ws_panel_11_9_mode = { - .clock = 50000, - .hdisplay = 320, - .hsync_start = 320 + 60, - .hsync_end = 320 + 60 + 60, - .htotal = 320 + 60 + 60 + 60, - .vdisplay = 1480, - .vsync_start = 1480 + 60, - .vsync_end = 1480 + 60 + 60, - .vtotal = 1480 + 60 + 60 + 60, -}; - -static const struct ws_panel_data ws_panel_11_9_data = { - .mode = &ws_panel_11_9_mode, - .lanes = 2, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS, -}; - -static const struct drm_display_mode ws_panel_4_mode = { - .clock = 50000, - .hdisplay = 720, - .hsync_start = 720 + 32, - .hsync_end = 720 + 32 + 200, - .htotal = 720 + 32 + 200 + 120, - .vdisplay = 720, - .vsync_start = 720 + 8, - .vsync_end = 720 + 8 + 4, - .vtotal = 720 + 8 + 4 + 16, -}; - -static const struct ws_panel_data ws_panel_4_data = { - .mode = &ws_panel_4_mode, - .lanes = 2, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS, -}; - -/* 5.0inch 720x1280 - * https://www.waveshare.com/5inch-dsi-lcd-d.htm - */ -static const struct drm_display_mode ws_panel_5_0_mode = { - .clock = 83333, - .hdisplay = 720, - .hsync_start = 720 + 100, - .hsync_end = 720 + 100 + 80, - .htotal = 720 + 100 + 80 + 100, - .vdisplay = 1280, - .vsync_start = 1280 + 20, - .vsync_end = 1280 + 20 + 20, - .vtotal = 1280 + 20 + 20 + 20, -}; - -static const struct ws_panel_data ws_panel_5_0_data = { - .mode = &ws_panel_5_0_mode, - .lanes = 2, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS, -}; - -/* 6.25inch 720x1560 - * https://www.waveshare.com/6.25inch-dsi-lcd.htm - */ -static const struct drm_display_mode ws_panel_6_25_mode = { - .clock = 83333, - .hdisplay = 720, - .hsync_start = 720 + 50, - .hsync_end = 720 + 50 + 50, - .htotal = 720 + 50 + 50 + 50, - .vdisplay = 1560, - .vsync_start = 1560 + 20, - .vsync_end = 1560 + 20 + 20, - .vtotal = 1560 + 20 + 20 + 20, -}; - -static const struct ws_panel_data ws_panel_6_25_data = { - .mode = &ws_panel_6_25_mode, - .lanes = 2, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS, -}; - /* 6.25inch B 720x1560 * https://www.waveshare.com/6.25inch-dsi-lcd-b.htm */ @@ -268,45 +55,6 @@ static const struct ws_panel_data ws_panel_6_25_b_data = { .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS, }; -/* 8.8inch 480x1920 - * https://www.waveshare.com/8.8inch-dsi-lcd.htm - */ -static const struct drm_display_mode ws_panel_8_8_mode = { - .clock = 83333, - .hdisplay = 480, - .hsync_start = 480 + 50, - .hsync_end = 480 + 50 + 50, - .htotal = 480 + 50 + 50 + 50, - .vdisplay = 1920, - .vsync_start = 1920 + 20, - .vsync_end = 1920 + 20 + 20, - .vtotal = 1920 + 20 + 20 + 20, -}; - -static const struct ws_panel_data ws_panel_8_8_data = { - .mode = &ws_panel_8_8_mode, - .lanes = 2, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS, -}; - -static const struct drm_display_mode ws_panel_13_3_4lane_mode = { - .clock = 148500, - .hdisplay = 1920, - .hsync_start = 1920 + 88, - .hsync_end = 1920 + 88 + 44, - .htotal = 1920 + 88 + 44 + 148, - .vdisplay = 1080, - .vsync_start = 1080 + 4, - .vsync_end = 1080 + 4 + 5, - .vtotal = 1080 + 4 + 5 + 36, -}; - -static const struct ws_panel_data ws_panel_13_3_4lane_data = { - .mode = &ws_panel_13_3_4lane_mode, - .lanes = 4, - .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_LPM, -}; - static const struct drm_display_mode ws_panel_13_3_2lane_mode = { .clock = 83333, .hdisplay = 1920, @@ -325,27 +73,6 @@ static const struct ws_panel_data ws_panel_13_3_2lane_data = { .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_LPM, }; -/* 7.0inch 1280x720 - * https://www.waveshare.com/7inch-dsi-lcd-h.htm - */ -static const struct drm_display_mode ws_panel_7_0_h_mode = { - .clock = 83333, - .hdisplay = 1280, - .hsync_start = 1280 + 64, - .hsync_end = 1280 + 64 + 64, - .htotal = 1280 + 64 + 64 + 64, - .vdisplay = 720, - .vsync_start = 720 + 64, - .vsync_end = 720 + 64 + 64, - .vtotal = 720 + 64 + 64 + 64, -}; - -static const struct ws_panel_data ws_panel_7_0_h_data = { - .mode = &ws_panel_7_0_h_mode, - .lanes = 2, - .mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS, -}; - /* 10.1inch DSI LCD (E) * https://www.waveshare.com/10.1inch-dsi-lcd-e.htm */ @@ -640,53 +367,11 @@ static void ws_panel_shutdown(struct i2c_client *i2c) static const struct of_device_id ws_panel_of_ids[] = { { - .compatible = "waveshare,2.8inch-panel", - .data = &ws_panel_2_8_data, - }, { - .compatible = "waveshare,3.4inch-panel", - .data = &ws_panel_3_4_data, - }, { - .compatible = "waveshare,4.0inch-panel", - .data = &ws_panel_4_0_data, - }, { - .compatible = "waveshare,7.0inch-c-panel", - .data = &ws_panel_7_0_c_data, - }, { - .compatible = "waveshare,7.9inch-panel", - .data = &ws_panel_7_9_data, - }, { - .compatible = "waveshare,8.0inch-panel", - .data = &ws_panel_10_1_data, - }, { - .compatible = "waveshare,10.1inch-panel", - .data = &ws_panel_10_1_data, - }, { - .compatible = "waveshare,11.9inch-panel", - .data = &ws_panel_11_9_data, - }, { - .compatible = "waveshare,4inch-panel", - .data = &ws_panel_4_data, - }, { - .compatible = "waveshare,5.0inch-panel", - .data = &ws_panel_5_0_data, - }, { - .compatible = "waveshare,6.25inch-panel", - .data = &ws_panel_6_25_data, - }, { .compatible = "waveshare,6.25inch-b-panel", .data = &ws_panel_6_25_b_data, - }, { - .compatible = "waveshare,8.8inch-panel", - .data = &ws_panel_8_8_data, - }, { - .compatible = "waveshare,13.3inch-4lane-panel", - .data = &ws_panel_13_3_4lane_data, }, { .compatible = "waveshare,13.3inch-2lane-panel", .data = &ws_panel_13_3_2lane_data, - }, { - .compatible = "waveshare,7.0inch-h-panel", - .data = &ws_panel_7_0_h_data, }, { .compatible = "waveshare,10.1inch-e-4lane-panel", .data = &ws_panel_10_1_e_4lane_data, diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 06bfc14e81b112..e1bdc807ad7bd2 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -1265,16 +1265,6 @@ config REGULATOR_RASPBERRYPI_TOUCHSCREEN_V2 unit. The regulator is used to enable power to the display and to control backlight PWM. -config REGULATOR_WAVESHARE_TOUCHSCREEN - tristate "Waveshare touchscreen panel regulator" - depends on BACKLIGHT_CLASS_DEVICE - depends on I2C - select REGMAP_I2C - help - This driver supports regulator on the waveshare - touchscreen unit. The regulator is used to enable power to the - display and to control backlight. - config REGULATOR_RC5T583 tristate "RICOH RC5T583 Power regulators" depends on MFD_RC5T583 diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile index d1655fae9dd66d..8f49f307948d70 100644 --- a/drivers/regulator/Makefile +++ b/drivers/regulator/Makefile @@ -147,7 +147,6 @@ obj-$(CONFIG_REGULATOR_PBIAS) += pbias-regulator.o obj-$(CONFIG_REGULATOR_RAA215300) += raa215300.o obj-$(CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY) += rpi-panel-attiny-regulator.o obj-$(CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_V2) += rpi-panel-v2-regulator.o -obj-$(CONFIG_REGULATOR_WAVESHARE_TOUCHSCREEN) += waveshare-panel-regulator.o obj-$(CONFIG_REGULATOR_RC5T583) += rc5t583-regulator.o obj-$(CONFIG_REGULATOR_RK808) += rk808-regulator.o obj-$(CONFIG_REGULATOR_RN5T618) += rn5t618-regulator.o diff --git a/drivers/regulator/waveshare-panel-regulator.c b/drivers/regulator/waveshare-panel-regulator.c deleted file mode 100644 index 534307ba7e7c3a..00000000000000 --- a/drivers/regulator/waveshare-panel-regulator.c +++ /dev/null @@ -1,336 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Copyright (C) 2024 Waveshare International Limited - * - * Based on rpi-panel-v2-regulator.c by Dave Stevenson - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* I2C registers of the microcontroller. */ -#define REG_TP 0x94 -#define REG_LCD 0x95 -#define REG_PWM 0x96 -#define REG_SIZE 0x97 -#define REG_ID 0x98 -#define REG_VERSION 0x99 - -#define NUM_GPIO 16 /* Treat BL_ENABLE, LCD_RESET, TP_RESET as GPIOs */ - -struct waveshare_panel_lcd { - struct mutex dir_lock; - struct mutex pwr_lock; - struct regmap *regmap; - u16 poweron_state; - u16 direction_state; - - struct gpio_chip gc; - struct gpio_desc *enable; -}; - -static const struct regmap_config waveshare_panel_regmap_config = { - .reg_bits = 8, - .val_bits = 8, - .max_register = REG_PWM, -}; - -static int waveshare_panel_gpio_direction_in(struct gpio_chip *gc, - unsigned int offset) -{ - struct waveshare_panel_lcd *state = gpiochip_get_data(gc); - - mutex_lock(&state->dir_lock); - state->direction_state |= BIT(offset); - mutex_unlock(&state->dir_lock); - - return 0; -} - -static int waveshare_panel_gpio_direction_out(struct gpio_chip *gc, - unsigned int offset, int val) -{ - struct waveshare_panel_lcd *state = gpiochip_get_data(gc); - u16 last_val; - - mutex_lock(&state->dir_lock); - state->direction_state &= ~BIT(offset); - mutex_unlock(&state->dir_lock); - - mutex_lock(&state->pwr_lock); - last_val = state->poweron_state; - if (val) - last_val |= BIT(offset); - else - last_val &= ~BIT(offset); - - state->poweron_state = last_val; - mutex_unlock(&state->pwr_lock); - - regmap_write(state->regmap, REG_TP, last_val >> 8); - regmap_write(state->regmap, REG_LCD, last_val & 0xff); - - return 0; -} - -static int waveshare_panel_gpio_get_direction(struct gpio_chip *gc, - unsigned int offset) -{ - struct waveshare_panel_lcd *state = gpiochip_get_data(gc); - u16 last_val; - - mutex_lock(&state->dir_lock); - last_val = state->direction_state; - mutex_unlock(&state->dir_lock); - - if (last_val & BIT(offset)) - return GPIO_LINE_DIRECTION_IN; - else - return GPIO_LINE_DIRECTION_OUT; -} - -static int waveshare_panel_gpio_get(struct gpio_chip *gc, unsigned int offset) -{ - struct waveshare_panel_lcd *state = gpiochip_get_data(gc); - u16 pwr_state; - - mutex_lock(&state->pwr_lock); - pwr_state = state->poweron_state & BIT(offset); - mutex_unlock(&state->pwr_lock); - - if (pwr_state) - return 1; - else - return 0; -} - -static int waveshare_panel_gpio_set(struct gpio_chip *gc, unsigned int offset, - int value) -{ - struct waveshare_panel_lcd *state = gpiochip_get_data(gc); - u16 last_val; - - if (offset >= NUM_GPIO) - return -EINVAL; - - mutex_lock(&state->pwr_lock); - - last_val = state->poweron_state; - if (value) - last_val |= BIT(offset); - else - last_val &= ~BIT(offset); - - state->poweron_state = last_val; - - regmap_write(state->regmap, REG_TP, last_val >> 8); - regmap_write(state->regmap, REG_LCD, last_val & 0xff); - - mutex_unlock(&state->pwr_lock); - return 0; -} - -static int waveshare_panel_update_status(struct backlight_device *bl) -{ - struct waveshare_panel_lcd *state = bl_get_data(bl); - int brightness = bl->props.brightness; - - if (bl->props.power != FB_BLANK_UNBLANK || - bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK)) - brightness = 0; - - if (state->enable) { - if (brightness) - gpiod_set_value_cansleep(state->enable, - 1); // Enable BL_EN - else - gpiod_set_value_cansleep(state->enable, - 0); // Disable BL_EN - } - - return regmap_write(state->regmap, REG_PWM, brightness); -} - -static const struct backlight_ops waveshare_panel_bl = { - .update_status = waveshare_panel_update_status, -}; - -static int waveshare_panel_i2c_read(struct i2c_client *client, u8 reg, - unsigned int *buf) -{ - struct i2c_msg msgs[1]; - u8 addr_buf[1] = { reg }; - u8 data_buf[1] = { - 0, - }; - int ret; - - /* Write register address */ - msgs[0].addr = client->addr; - msgs[0].flags = 0; - msgs[0].len = ARRAY_SIZE(addr_buf); - msgs[0].buf = addr_buf; - - ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)); - if (ret != ARRAY_SIZE(msgs)) - return -EIO; - - usleep_range(5000, 10000); - - /* Read data from register */ - msgs[0].addr = client->addr; - msgs[0].flags = I2C_M_RD; - msgs[0].len = 1; - msgs[0].buf = data_buf; - - ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)); - if (ret != ARRAY_SIZE(msgs)) - return -EIO; - - *buf = data_buf[0]; - return 0; -} - -/* - * I2C driver interface functions - */ -static int waveshare_panel_i2c_probe(struct i2c_client *i2c) -{ - struct backlight_properties props = {}; - struct backlight_device *bl; - struct waveshare_panel_lcd *state; - struct regmap *regmap; - unsigned int data; - bool pre_power_on; - int ret; - - state = devm_kzalloc(&i2c->dev, sizeof(*state), GFP_KERNEL); - if (!state) - return -ENOMEM; - - mutex_init(&state->dir_lock); - mutex_init(&state->pwr_lock); - - i2c_set_clientdata(i2c, state); - - regmap = devm_regmap_init_i2c(i2c, &waveshare_panel_regmap_config); - if (IS_ERR(regmap)) { - ret = PTR_ERR(regmap); - dev_err(&i2c->dev, "Failed to allocate register map: %d\n", - ret); - goto error; - } - - pre_power_on = device_property_read_bool(&i2c->dev, "pre-power-on"); - - ret = waveshare_panel_i2c_read(i2c, REG_ID, &data); - if (ret == 0) - dev_info(&i2c->dev, "waveshare panel hw id = 0x%x\n", data); - - ret = waveshare_panel_i2c_read(i2c, REG_SIZE, &data); - if (ret == 0) - dev_info(&i2c->dev, "waveshare panel size = %d\n", data); - - ret = waveshare_panel_i2c_read(i2c, REG_VERSION, &data); - if (ret == 0) - dev_info(&i2c->dev, "waveshare panel mcu version = 0x%x\n", - data); - - state->direction_state = 0; - state->poweron_state = BIT(9) | BIT(8); // Enable VCC - if (pre_power_on) - state->poweron_state |= BIT(4) | BIT(1) | BIT(0); - regmap_write(regmap, REG_TP, state->poweron_state >> 8); - regmap_write(regmap, REG_LCD, state->poweron_state & 0xff); - if (pre_power_on) - msleep(200); - else - msleep(20); - - state->regmap = regmap; - state->gc.parent = &i2c->dev; - state->gc.label = i2c->name; - state->gc.owner = THIS_MODULE; - state->gc.base = -1; - state->gc.ngpio = NUM_GPIO; - - state->gc.get = waveshare_panel_gpio_get; - state->gc.set = waveshare_panel_gpio_set; - state->gc.direction_input = waveshare_panel_gpio_direction_in; - state->gc.direction_output = waveshare_panel_gpio_direction_out; - state->gc.get_direction = waveshare_panel_gpio_get_direction; - state->gc.can_sleep = true; - - ret = devm_gpiochip_add_data(&i2c->dev, &state->gc, state); - if (ret) { - dev_err(&i2c->dev, "Failed to create gpiochip: %d\n", ret); - goto error; - } - - state->enable = - devm_gpiod_get_optional(&i2c->dev, "enable", GPIOD_OUT_LOW); - if (IS_ERR(state->enable)) - return dev_err_probe(&i2c->dev, PTR_ERR(state->enable), - "Couldn't get our enable GPIO\n"); - - props.type = BACKLIGHT_RAW; - props.max_brightness = 255; - bl = devm_backlight_device_register(&i2c->dev, dev_name(&i2c->dev), - &i2c->dev, state, - &waveshare_panel_bl, &props); - if (IS_ERR(bl)) - return PTR_ERR(bl); - - bl->props.brightness = 255; - - return 0; - -error: - mutex_destroy(&state->dir_lock); - mutex_destroy(&state->pwr_lock); - return ret; -} - -static void waveshare_panel_i2c_remove(struct i2c_client *client) -{ - struct waveshare_panel_lcd *state = i2c_get_clientdata(client); - - mutex_destroy(&state->dir_lock); - mutex_destroy(&state->pwr_lock); -} - -static void waveshare_panel_i2c_shutdown(struct i2c_client *client) -{ - struct waveshare_panel_lcd *state = i2c_get_clientdata(client); - - regmap_write(state->regmap, REG_PWM, 0); -} - -static const struct of_device_id waveshare_panel_dt_ids[] = { - { .compatible = "waveshare,touchscreen-panel-regulator" }, - {}, -}; -MODULE_DEVICE_TABLE(of, waveshare_panel_dt_ids); - -static struct i2c_driver waveshare_panel_regulator_driver = { - .driver = { - .name = "waveshare_touchscreen", - .of_match_table = of_match_ptr(waveshare_panel_dt_ids), - }, - .probe = waveshare_panel_i2c_probe, - .remove = waveshare_panel_i2c_remove, - .shutdown = waveshare_panel_i2c_shutdown, -}; - -module_i2c_driver(waveshare_panel_regulator_driver); - -MODULE_AUTHOR("Waveshare Team "); -MODULE_DESCRIPTION("Regulator device driver for Waveshare touchscreen"); -MODULE_LICENSE("GPL");