diff --git a/arch/arm/boot/dts/imx28-brain-2g.dtsi b/arch/arm/boot/dts/imx28-brain-2g.dtsi index 1d89780223bf..3b688935bbf3 100644 --- a/arch/arm/boot/dts/imx28-brain-2g.dtsi +++ b/arch/arm/boot/dts/imx28-brain-2g.dtsi @@ -95,6 +95,22 @@ status = "okay"; }; + ssp2: spi@80014000 { + compatible = "fsl,imx28-spi"; + pinctrl-names = "default"; + pinctrl-0 = <&slcd_pins>; + clock-frequency = <16000000>; + status = "okay"; + + slcd@0 { + reg = <0>; + compatible = "brain,st7586"; + spi-max-frequency = <16000000>; + reset-gpios = <&gpio2 18 GPIO_ACTIVE_HIGH>; + rotation = <180>; + }; + }; + pinctrl@80018000 { pinctrl-names = "default"; pinctrl-0 = <&hog_pins_3v3_pullup &hog_pins_3v3_nopull &hog_pins_1v8_nopull>; @@ -140,6 +156,7 @@ fsl,pinmux-ids = < MX28_PAD_AUART1_RX__PWM_0 MX28_PAD_AUART1_TX__PWM_1 + MX28_PAD_PWM2__PWM_2 MX28_PAD_PWM4__PWM_4 MX28_PAD_SAIF1_SDATA0__GPIO_3_26 >; @@ -177,6 +194,19 @@ fsl,voltage = ; fsl,pull-up = ; }; + + slcd_pins: spi2@0 { + reg = <0>; + fsl,pinmux-ids = < + MX28_PAD_SSP2_SCK__SSP2_SCK + MX28_PAD_SSP2_MOSI__SSP2_CMD + MX28_PAD_SSP2_MISO__GPIO_2_18 + MX28_PAD_SSP2_SS0__SSP2_D3 + >; + fsl,drive-strength = ; + fsl,voltage = ; + fsl,pull-up = ; + }; }; brainlcd: lcdif@80030000 { @@ -284,13 +314,20 @@ audio-codec = <&sgtl5000>; }; - backlight_display: backlight { + backlight_display: backlight@0 { compatible = "pwm-backlight"; pwms = <&pwm 0 50000>, <&pwm 1 50000>; brightness-levels = <0 4 8 16 32 64 128 255>; default-brightness-level = <4>; //Set 4 for identification on probing }; + slcd_backlight: backlight@1 { + compatible = "pwm-backlight"; + pwms = <&pwm 2 50000>; + brightness-levels = <0 63 127 255>; + default-brightness-level = <3>; + }; + buzzer_cold: buzzer_cold { compatible = "regulator-fixed"; regulator-name = "fixed-supply"; diff --git a/drivers/gpu/drm/tiny/Kconfig b/drivers/gpu/drm/tiny/Kconfig index d093083595d7..5b30e205105d 100644 --- a/drivers/gpu/drm/tiny/Kconfig +++ b/drivers/gpu/drm/tiny/Kconfig @@ -108,6 +108,18 @@ config TINYDRM_ST7586 If M is selected the module will be called st7586. +config TINYDRM_BRAIN_ST7586 + tristate "DRM support for Sitronix ST7586 display panels on Sharp Brain" + depends on DRM && SPI + select DRM_KMS_HELPER + select DRM_KMS_CMA_HELPER + select DRM_MIPI_DBI + help + DRM driver for the following Sitronix ST7586 panels: + * Sharp Brain 240x120 LCD + + If M is selected the module will be called brain-st7586. + config TINYDRM_ST7735R tristate "DRM support for Sitronix ST7735R display panels" depends on DRM && SPI diff --git a/drivers/gpu/drm/tiny/Makefile b/drivers/gpu/drm/tiny/Makefile index a7c1962c6564..2712edeeab11 100644 --- a/drivers/gpu/drm/tiny/Makefile +++ b/drivers/gpu/drm/tiny/Makefile @@ -9,4 +9,5 @@ obj-$(CONFIG_TINYDRM_BRAIN_2G) += brain-lq050j1ug01.o obj-$(CONFIG_TINYDRM_MI0283QT) += mi0283qt.o obj-$(CONFIG_TINYDRM_REPAPER) += repaper.o obj-$(CONFIG_TINYDRM_ST7586) += st7586.o +obj-$(CONFIG_TINYDRM_BRAIN_ST7586) += brain-st7586.o obj-$(CONFIG_TINYDRM_ST7735R) += st7735r.o diff --git a/drivers/gpu/drm/tiny/brain-st7586.c b/drivers/gpu/drm/tiny/brain-st7586.c new file mode 100644 index 000000000000..ced526ca3cfb --- /dev/null +++ b/drivers/gpu/drm/tiny/brain-st7586.c @@ -0,0 +1,443 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * DRM driver for Sitronix ST7586 panels for Brain 2nd SubLCD + * + * Copyright 2021 Suguru Saito + * + * based on st7586.c + * Copyright 2017 David Lechner + */ + +#include +#include +#include +#include +#include +#include +#include