diff --git a/Documentation/devicetree/bindings/spi/spi-gpio.yaml b/Documentation/devicetree/bindings/spi/spi-gpio.yaml index 0d0b6d9dad1ca4..9136f081f42045 100644 --- a/Documentation/devicetree/bindings/spi/spi-gpio.yaml +++ b/Documentation/devicetree/bindings/spi/spi-gpio.yaml @@ -43,6 +43,10 @@ properties: with no chip select is connected. $ref: "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/schemas/types.yaml#/definitions/uint32" + sck-idle-input: + description: Make SCK an input when inactive. + type: boolean + # Deprecated properties gpio-sck: false gpio-miso: false diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile index f1d1e759a7899e..e8a4c26faac4c1 100644 --- a/arch/arm/boot/dts/overlays/Makefile +++ b/arch/arm/boot/dts/overlays/Makefile @@ -235,6 +235,9 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ vc4-fkms-v3d.dtbo \ vc4-fkms-v3d-pi4.dtbo \ vc4-kms-dpi-generic.dtbo \ + vc4-kms-dpi-hyperpixel2r.dtbo \ + vc4-kms-dpi-hyperpixel4.dtbo \ + vc4-kms-dpi-hyperpixel4sq.dtbo \ vc4-kms-dpi-panel.dtbo \ vc4-kms-dsi-7inch.dtbo \ vc4-kms-dsi-lt070me05000.dtbo \ diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README index b471feabe99d4d..6c4883f4658b2e 100644 --- a/arch/arm/boot/dts/overlays/README +++ b/arch/arm/boot/dts/overlays/README @@ -3676,6 +3676,39 @@ Params: clock-frequency Display clock frequency (Hz) rotate Display rotation {0,90,180,270} (default 0) +Name: vc4-kms-dpi-hyperpixel2r +Info: Enable the KMS drivers for the Pimoroni HyperPixel2 Round DPI display. + Requires vc4-kms-v3d to be loaded. +Load: dtoverlay=vc4-kms-dpi-hyperpixel2r,= +Params: disable-touch Disables the touch controller + touchscreen-inverted-x Inverts X direction of touch controller + touchscreen-inverted-y Inverts Y direction of touch controller + touchscreen-swapped-x-y Swaps X & Y axes of touch controller + rotate Display rotation {0,90,180,270} (default 0) + + +Name: vc4-kms-dpi-hyperpixel4 +Info: Enable the KMS drivers for the Pimoroni HyperPixel4 DPI display. + Requires vc4-kms-v3d to be loaded. +Load: dtoverlay=vc4-kms-dpi-hyperpixel4,= +Params: disable-touch Disables the touch controller + touchscreen-inverted-x Inverts X direction of touch controller + touchscreen-inverted-y Inverts Y direction of touch controller + touchscreen-swapped-x-y Swaps X & Y axes of touch controller + rotate Display rotation {0,90,180,270} (default 0) + + +Name: vc4-kms-dpi-hyperpixel4sq +Info: Enable the KMS drivers for the Pimoroni HyperPixel4 Square DPI display. + Requires vc4-kms-v3d to be loaded. +Load: dtoverlay=vc4-kms-dpi-hyperpixel4sq,= +Params: disable-touch Disables the touch controller + touchscreen-inverted-x Inverts X direction of touch controller + touchscreen-inverted-y Inverts Y direction of touch controller + touchscreen-swapped-x-y Swaps X & Y axes of touch controller + rotate Display rotation {0,90,180,270} (default 0) + + Name: vc4-kms-dpi-panel Info: Enable a preconfigured KMS DPI panel. Requires vc4-kms-v3d to be loaded. diff --git a/arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel.dtsi b/arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel.dtsi new file mode 100644 index 00000000000000..585402a3b9b49a --- /dev/null +++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel.dtsi @@ -0,0 +1,94 @@ +/* + * vc4-kms-dpi-hyperpixel4.dtsi + * Commmon initialisation for HyperPixel DPI displays + */ + +#include +#include + +/ { + compatible = "brcm,bcm2835"; + + fragment@0 { + target-path = "/"; + __overlay__ { + spi { + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&spi_pins>; + pinctrl-names = "default"; + + sck-gpios = <&gpio 27 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio 26 GPIO_ACTIVE_HIGH>; + cs-gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + num-chipselects = <1>; + sck-idle-input; + + panel: display@0 { + reg = <0>; + /* 100 kHz */ + spi-max-frequency = <100000>; + backlight = <&backlight>; + rotation = <0>; + + port { + panel_in: endpoint { + remote-endpoint = <&dpi_out>; + }; + }; + }; + }; + + backlight: backlight { + compatible = "gpio-backlight"; + gpios = <&gpio 19 0>; + }; + }; + }; + + fragment@1 { + target = <&dpi>; + __overlay__ { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&dpi_18bit_cpadhi_gpio0>; + + port { + dpi_out: endpoint { + remote-endpoint = <&panel_in>; + }; + }; + }; + }; + + fragment@2 { + target = <&gpio>; + __overlay__ { + spi_pins: hyperpixel4_spi_pins { + brcm,pins = <27 18 26>; + brcm,pull = ; + brcm,function = <0>; + }; + }; + }; + + fragment@3 { + target-path = "/"; + __overlay__ { + i2c_gpio: i2c@0 { + compatible = "i2c-gpio"; + gpios = <&gpio 10 0 /* sda */ + &gpio 11 0>; /* scl */ + i2c-gpio,delay-us = <4>; /* ~100 kHz */ + #address-cells = <1>; + #size-cells = <0>; + }; + }; + }; + + __overrides__ { + rotate = <&panel>, "rotation:0"; + }; +}; diff --git a/arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel2r-overlay.dts b/arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel2r-overlay.dts new file mode 100644 index 00000000000000..4cd9d6a55c48bd --- /dev/null +++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel2r-overlay.dts @@ -0,0 +1,114 @@ +/* + * vc4-kms-dpi-hyperpixel2r-overlay.dts + */ + +#include +#include + +/dts-v1/; +/plugin/; + +/ { + compatible = "brcm,bcm2835"; + + fragment@0 { + target-path = "/"; + __overlay__ { + spi { + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&spi_pins>; + pinctrl-names = "default"; + + sck-gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio 10 GPIO_ACTIVE_HIGH>; + cs-gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + num-chipselects = <1>; + + panel: display@0 { + compatible = "pimoroni,hyperpixel2round"; + reg = <0>; + /* 100 kHz */ + spi-max-frequency = <100000>; + backlight = <&backlight>; + rotation = <0>; + + port { + panel_in: endpoint { + remote-endpoint = <&dpi_out>; + }; + }; + }; + }; + + backlight: backlight { + compatible = "gpio-backlight"; + gpios = <&gpio 19 0>; + }; + }; + }; + + fragment@1 { + target = <&dpi>; + __overlay__ { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&dpi_18bit_cpadhi_gpio0>; + + port { + dpi_out: endpoint { + remote-endpoint = <&panel_in>; + }; + }; + }; + }; + + fragment@2 { + target = <&gpio>; + __overlay__ { + spi_pins: hyperpixel4_spi_pins { + brcm,pins = <27 18 26>; + brcm,pull = ; + brcm,function = <0>; + }; + }; + }; + + fragment@3 { + target-path = "/"; + __overlay__ { + i2c_gpio: i2c@0 { + compatible = "i2c-gpio"; + status = "disabled"; + + gpios = <&gpio 10 GPIO_ACTIVE_HIGH /* sda */ + &gpio 11 GPIO_ACTIVE_HIGH>; /* scl */ + i2c-gpio,delay-us = <4>; /* ~100 kHz */ + #address-cells = <1>; + #size-cells = <0>; + + polytouch: edt-ft5x06@15 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "edt,edt-ft5406"; + reg = <0x15>; + interrupt-parent = <&gpio>; + interrupts = <27 0x02>; + touchscreen-size-x = <240>; + touchscreen-size-y = <240>; + }; + }; + }; + }; + + __overrides__ { + disable-touch = <0>,"-3"; + touchscreen-inverted-x = <&polytouch>,"touchscreen-inverted-x?"; + touchscreen-inverted-y = <&polytouch>,"touchscreen-inverted-y!"; + touchscreen-swapped-x-y = <&polytouch>,"touchscreen-swapped-x-y!"; + rotate = <&panel>, "rotation:0"; + }; + +}; diff --git a/arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel4-overlay.dts b/arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel4-overlay.dts new file mode 100644 index 00000000000000..eafc25ad79fff7 --- /dev/null +++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel4-overlay.dts @@ -0,0 +1,57 @@ +/* + * vc4-kms-dpi-hyperpixel4sq-overlay.dts + */ + +/dts-v1/; +/plugin/; + +#include "vc4-kms-dpi-hyperpixel.dtsi" + +&panel { + compatible = "pimoroni,hyperpixel4"; +}; + +/ { + fragment@11 { + target = <&i2c_gpio>; + __overlay__ { + /* needed to avoid dtc warning */ + #address-cells = <1>; + #size-cells = <0>; + ft6236_14: ft6236@14 { + compatible = "goodix,gt911"; + reg = <0x14>; + interrupt-parent = <&gpio>; + interrupts = <27 2>; + touchscreen-size-x = <480>; + touchscreen-size-y = <800>; + touchscreen-x-mm = <51>; + touchscreen-y-mm = <85>; + touchscreen-inverted-y; + touchscreen-swapped-x-y; + }; + ft6236_5d: ft6236@5d { + compatible = "goodix,gt911"; + reg = <0x5d>; + interrupt-parent = <&gpio>; + interrupts = <27 2>; + touchscreen-size-x = <480>; + touchscreen-size-y = <800>; + touchscreen-x-mm = <51>; + touchscreen-y-mm = <85>; + touchscreen-inverted-y; + touchscreen-swapped-x-y; + }; + }; + }; + + __overrides__ { + disable-touch = <0>,"-3-11"; + touchscreen-inverted-x = <&ft6236_14>,"touchscreen-inverted-x?", + <&ft6236_5d>,"touchscreen-inverted-x?"; + touchscreen-inverted-y = <&ft6236_14>,"touchscreen-inverted-y!", + <&ft6236_5d>,"touchscreen-inverted-y!"; + touchscreen-swapped-x-y = <&ft6236_14>,"touchscreen-swapped-x-y!", + <&ft6236_5d>,"touchscreen-swapped-x-y!"; + }; +}; diff --git a/arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel4sq-overlay.dts b/arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel4sq-overlay.dts new file mode 100644 index 00000000000000..700046348ecf0d --- /dev/null +++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel4sq-overlay.dts @@ -0,0 +1,36 @@ +/* + * vc4-kms-dpi-hyperpixel4-overlay.dts + */ + +/dts-v1/; +/plugin/; + +#include "vc4-kms-dpi-hyperpixel.dtsi" + +&panel { + compatible = "pimoroni,hyperpixel4square"; +}; + +/ { + fragment@11 { + target = <&i2c_gpio>; + __overlay__ { + polytouch: edt-ft5x06@48 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "edt,edt-ft5406"; + reg = <0x48>; + interrupt-parent = <&gpio>; + interrupts = <27 0x02>; + touchscreen-size-x = <720>; + touchscreen-size-y = <720>; + }; + }; + }; + __overrides__ { + disable-touch = <0>,"-3-11"; + touchscreen-inverted-x = <&polytouch>,"touchscreen-inverted-x?"; + touchscreen-inverted-y = <&polytouch>,"touchscreen-inverted-y!"; + touchscreen-swapped-x-y = <&polytouch>,"touchscreen-swapped-x-y!"; + }; +}; diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig index bbbcba4e31e3e5..3e4a19f9723814 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig @@ -883,8 +883,11 @@ CONFIG_DRM=m CONFIG_DRM_LOAD_EDID_FIRMWARE=y CONFIG_DRM_UDL=m CONFIG_DRM_PANEL_SIMPLE=m +CONFIG_DRM_PANEL_ILITEK_ILI9806E=m CONFIG_DRM_PANEL_JDI_LT070ME05000=m CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m +CONFIG_DRM_PANEL_SITRONIX_ST7701=m +CONFIG_DRM_PANEL_TPO_Y17P=m CONFIG_DRM_DISPLAY_CONNECTOR=m CONFIG_DRM_SIMPLE_BRIDGE=m CONFIG_DRM_TOSHIBA_TC358762=m diff --git a/arch/arm/configs/bcm2711_defconfig b/arch/arm/configs/bcm2711_defconfig index 0c81d577d370e0..31078727f192fe 100644 --- a/arch/arm/configs/bcm2711_defconfig +++ b/arch/arm/configs/bcm2711_defconfig @@ -898,9 +898,12 @@ CONFIG_DRM=m CONFIG_DRM_LOAD_EDID_FIRMWARE=y CONFIG_DRM_UDL=m CONFIG_DRM_PANEL_SIMPLE=m +CONFIG_DRM_PANEL_ILITEK_ILI9806E=m CONFIG_DRM_PANEL_ILITEK_ILI9881C=m CONFIG_DRM_PANEL_JDI_LT070ME05000=m CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m +CONFIG_DRM_PANEL_SITRONIX_ST7701=m +CONFIG_DRM_PANEL_TPO_Y17P=m CONFIG_DRM_DISPLAY_CONNECTOR=m CONFIG_DRM_SIMPLE_BRIDGE=m CONFIG_DRM_TOSHIBA_TC358762=m diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig index 9bc5fcb8dd001b..dac2e00b60b0e2 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig @@ -876,8 +876,11 @@ CONFIG_DRM=m CONFIG_DRM_LOAD_EDID_FIRMWARE=y CONFIG_DRM_UDL=m CONFIG_DRM_PANEL_SIMPLE=m +CONFIG_DRM_PANEL_ILITEK_ILI9806E=m CONFIG_DRM_PANEL_JDI_LT070ME05000=m CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m +CONFIG_DRM_PANEL_SITRONIX_ST7701=m +CONFIG_DRM_PANEL_TPO_Y17P=m CONFIG_DRM_DISPLAY_CONNECTOR=m CONFIG_DRM_SIMPLE_BRIDGE=m CONFIG_DRM_TOSHIBA_TC358762=m diff --git a/arch/arm64/configs/bcm2711_defconfig b/arch/arm64/configs/bcm2711_defconfig index 9edca6580164e5..3525540eaad4ca 100644 --- a/arch/arm64/configs/bcm2711_defconfig +++ b/arch/arm64/configs/bcm2711_defconfig @@ -903,9 +903,12 @@ CONFIG_DRM=m CONFIG_DRM_LOAD_EDID_FIRMWARE=y CONFIG_DRM_UDL=m CONFIG_DRM_PANEL_SIMPLE=m +CONFIG_DRM_PANEL_ILITEK_ILI9806E=m CONFIG_DRM_PANEL_ILITEK_ILI9881C=m CONFIG_DRM_PANEL_JDI_LT070ME05000=m CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m +CONFIG_DRM_PANEL_SITRONIX_ST7701=m +CONFIG_DRM_PANEL_TPO_Y17P=m CONFIG_DRM_DISPLAY_CONNECTOR=m CONFIG_DRM_SIMPLE_BRIDGE=m CONFIG_DRM_TOSHIBA_TC358762=m diff --git a/arch/arm64/configs/bcmrpi3_defconfig b/arch/arm64/configs/bcmrpi3_defconfig index 6210be66f700f4..98c473412018f7 100644 --- a/arch/arm64/configs/bcmrpi3_defconfig +++ b/arch/arm64/configs/bcmrpi3_defconfig @@ -824,8 +824,11 @@ CONFIG_DRM=m CONFIG_DRM_LOAD_EDID_FIRMWARE=y CONFIG_DRM_UDL=m CONFIG_DRM_PANEL_SIMPLE=m +CONFIG_DRM_PANEL_ILITEK_ILI9806E=m CONFIG_DRM_PANEL_JDI_LT070ME05000=m CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m +CONFIG_DRM_PANEL_SITRONIX_ST7701=m +CONFIG_DRM_PANEL_TPO_Y17P=m CONFIG_DRM_DISPLAY_CONNECTOR=m CONFIG_DRM_SIMPLE_BRIDGE=m CONFIG_DRM_TOSHIBA_TC358762=m diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 418638e6e3b0a0..b492c88420db53 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -137,6 +137,17 @@ config DRM_PANEL_ILITEK_ILI9341 QVGA (240x320) RGB panels. support serial & parallel rgb interface. +config DRM_PANEL_ILITEK_ILI9806E + tristate "Ilitek ILI9806E-based panels" + depends on OF && SPI + depends on DRM_KMS_HELPER + depends on DRM_KMS_CMA_HELPER + depends on BACKLIGHT_CLASS_DEVICE + select DRM_MIPI_DBI + help + Say Y if you want to enable support for panels based on the + Ilitek ILI9806e controller. + config DRM_PANEL_ILITEK_ILI9881C tristate "Ilitek ILI9881C-based panels" depends on OF @@ -547,6 +558,17 @@ config DRM_PANEL_SONY_ACX565AKM Say Y here if you want to enable support for the Sony ACX565AKM 800x600 3.5" panel (found on the Nokia N900). +config DRM_PANEL_TPO_Y17P + tristate "TDO Y17P-based panels" + depends on OF && SPI + depends on DRM_KMS_HELPER + depends on DRM_KMS_CMA_HELPER + depends on BACKLIGHT_CLASS_DEVICE + select DRM_MIPI_DBI + help + Say Y if you want to enable support for panels based on the + TDO Y17P controller. + config DRM_PANEL_TDO_TL070WSH30 tristate "TDO TL070WSH30 DSI panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index c8132050bcec00..b7810a7e7f861f 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -12,6 +12,7 @@ obj-$(CONFIG_DRM_PANEL_FEIXIN_K101_IM2BA02) += panel-feixin-k101-im2ba02.o obj-$(CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D) += panel-feiyang-fy07024di26a30d.o obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) += panel-ilitek-ili9322.o obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9341) += panel-ilitek-ili9341.o +obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9806E) += panel-ilitek-ili9806e.o obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9881C) += panel-ilitek-ili9881c.o obj-$(CONFIG_DRM_PANEL_INNOLUX_EJ030NA) += panel-innolux-ej030na.o obj-$(CONFIG_DRM_PANEL_INNOLUX_P079ZCA) += panel-innolux-p079zca.o @@ -57,6 +58,7 @@ obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o obj-$(CONFIG_DRM_PANEL_SONY_ACX424AKP) += panel-sony-acx424akp.o obj-$(CONFIG_DRM_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o obj-$(CONFIG_DRM_PANEL_TDO_TL070WSH30) += panel-tdo-tl070wsh30.o +obj-$(CONFIG_DRM_PANEL_TPO_Y17P) += panel-tdo-y17p.o obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += panel-tpo-td028ttec1.o obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9806e.c b/drivers/gpu/drm/panel/panel-ilitek-ili9806e.c new file mode 100644 index 00000000000000..90300f0de477fa --- /dev/null +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9806e.c @@ -0,0 +1,486 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Ilitek ILI9806E TFT LCD drm_panel driver. + * + * Copyright (C) 2022 Raspberry Pi Ltd + * + * Derived from drivers/drm/gpu/panel/panel-sitronix-st7789v.c + * Copyright (C) 2017 Free Electrons + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include