aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.15/950-0085-rpi_display-add-backlight-driver-and-overlay.patch
blob: 957bd3cae529506a322c4f21ae02dcdf33ddb9c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
From a69fe8364ec161c1c9a2c5691beea97b20ee664f Mon Sep 17 00:00:00 2001
From: P33M <P33M@github.com>
Date: Wed, 21 Oct 2015 14:55:21 +0100
Subject: [PATCH] rpi_display: add backlight driver and overlay

Add a mailbox-driven backlight controller for the Raspberry Pi DSI
touchscreen display. Requires updated GPU firmware to recognise the
mailbox request.

Signed-off-by: Gordon Hollingworth <gordon@raspberrypi.org>

Add Raspberry Pi firmware driver to the dependencies of backlight driver

Otherwise the backlight driver fails to build if the firmware
loading driver is not in the kernel

Signed-off-by: Alex Riesen <alexander.riesen@cetitec.com>
---
 drivers/video/backlight/Kconfig         |   7 ++
 drivers/video/backlight/Makefile        |   1 +
 drivers/video/backlight/rpi_backlight.c | 119 ++++++++++++++++++++++++
 3 files changed, 127 insertions(+)
 create mode 100644 drivers/video/backlight/rpi_backlight.c

--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -248,6 +248,13 @@ config BACKLIGHT_PWM
 	  If you have a LCD backlight adjustable by PWM, say Y to enable
 	  this driver.
 
+config BACKLIGHT_RPI
+	tristate "Raspberry Pi display firmware driven backlight"
+	depends on RASPBERRYPI_FIRMWARE
+	help
+	  If you have the Raspberry Pi DSI touchscreen display, say Y to
+	  enable the mailbox-controlled backlight driver.
+
 config BACKLIGHT_DA903X
 	tristate "Backlight Driver for DA9030/DA9034 using WLED"
 	depends on PMIC_DA903X
--- a/drivers/video/backlight/Makefile
+++ b/drivers/video/backlight/Makefile
@@ -49,6 +49,7 @@ obj-$(CONFIG_BACKLIGHT_PANDORA)		+= pand
 obj-$(CONFIG_BACKLIGHT_PCF50633)	+= pcf50633-backlight.o
 obj-$(CONFIG_BACKLIGHT_PWM)		+= pwm_bl.o
 obj-$(CONFIG_BACKLIGHT_QCOM_WLED)	+= qcom-wled.o
+obj-$(CONFIG_BACKLIGHT_RPI)			+= rpi_backlight.o
 obj-$(CONFIG_BACKLIGHT_RT4831)		+= rt4831-backlight.o
 obj-$(CONFIG_BACKLIGHT_SAHARA)		+= kb3886_bl.o
 obj-$(CONFIG_BACKLIGHT_SKY81452)	+= sky81452-backlight.o
--- /dev/null
+++ b/drivers/video/backlight/rpi_backlight.c
@@ -0,0 +1,119 @@
+/*
+ * rpi_bl.c - Backlight controller through VPU
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/backlight.h>
+#include <linux/err.h>
+#include <linux/fb.h>
+#include <linux/gpio.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_gpio.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include <soc/bcm2835/raspberrypi-firmware.h>
+
+struct rpi_backlight {
+	struct device *dev;
+	struct device *fbdev;
+	struct rpi_firmware *fw;
+};
+
+static int rpi_backlight_update_status(struct backlight_device *bl)
+{
+	struct rpi_backlight *gbl = bl_get_data(bl);
+	int brightness = bl->props.brightness;
+	int ret;
+
+	if (bl->props.power != FB_BLANK_UNBLANK ||
+	    bl->props.fb_blank != FB_BLANK_UNBLANK ||
+	    bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
+		brightness = 0;
+
+	ret = rpi_firmware_property(gbl->fw,
+			RPI_FIRMWARE_FRAMEBUFFER_SET_BACKLIGHT,
+			&brightness, sizeof(brightness));
+	if (ret) {
+		dev_err(gbl->dev, "Failed to set brightness\n");
+		return ret;
+	}
+
+	if (brightness < 0) {
+		dev_err(gbl->dev, "Backlight change failed\n");
+		return -EAGAIN;
+	}
+
+	return 0;
+}
+
+static const struct backlight_ops rpi_backlight_ops = {
+	.options	= BL_CORE_SUSPENDRESUME,
+	.update_status	= rpi_backlight_update_status,
+};
+
+static int rpi_backlight_probe(struct platform_device *pdev)
+{
+	struct backlight_properties props;
+	struct backlight_device *bl;
+	struct rpi_backlight *gbl;
+	struct device_node *fw_node;
+
+	gbl = devm_kzalloc(&pdev->dev, sizeof(*gbl), GFP_KERNEL);
+	if (gbl == NULL)
+		return -ENOMEM;
+
+	gbl->dev = &pdev->dev;
+
+	fw_node = of_parse_phandle(pdev->dev.of_node, "firmware", 0);
+	if (!fw_node) {
+		dev_err(&pdev->dev, "Missing firmware node\n");
+		return -ENOENT;
+	}
+
+	gbl->fw = rpi_firmware_get(fw_node);
+	if (!gbl->fw)
+		return -EPROBE_DEFER;
+
+	memset(&props, 0, sizeof(props));
+	props.type = BACKLIGHT_RAW;
+	props.max_brightness = 255;
+	bl = devm_backlight_device_register(&pdev->dev, dev_name(&pdev->dev),
+					&pdev->dev, gbl, &rpi_backlight_ops,
+					&props);
+	if (IS_ERR(bl)) {
+		dev_err(&pdev->dev, "failed to register backlight\n");
+		return PTR_ERR(bl);
+	}
+
+	bl->props.brightness = 255;
+	backlight_update_status(bl);
+
+	platform_set_drvdata(pdev, bl);
+	return 0;
+}
+
+static const struct of_device_id rpi_backlight_of_match[] = {
+	{ .compatible = "raspberrypi,rpi-backlight" },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, rpi_backlight_of_match);
+
+static struct platform_driver rpi_backlight_driver = {
+	.driver		= {
+		.name		= "rpi-backlight",
+		.of_match_table = of_match_ptr(rpi_backlight_of_match),
+	},
+	.probe		= rpi_backlight_probe,
+};
+
+module_platform_driver(rpi_backlight_driver);
+
+MODULE_AUTHOR("Gordon Hollingworth <gordon@raspberrypi.org>");
+MODULE_DESCRIPTION("Raspberry Pi mailbox based Backlight Driver");
+MODULE_LICENSE("GPL");
id='n602' href='#n602'>602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775
From c218d35ede9474ffa6231e8be88c8ad28044ca2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Wed, 3 Nov 2021 12:21:14 +0100
Subject: [PATCH] overlays: Add fbtft overlay
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Add an overlay that provides much of the functionality that fbtft_device did.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
---
 arch/arm/boot/dts/overlays/Makefile          |   1 +
 arch/arm/boot/dts/overlays/README            | 124 ++++
 arch/arm/boot/dts/overlays/fbtft-overlay.dts | 611 +++++++++++++++++++
 3 files changed, 736 insertions(+)
 create mode 100644 arch/arm/boot/dts/overlays/fbtft-overlay.dts

--- a/arch/arm/boot/dts/overlays/Makefile
+++ b/arch/arm/boot/dts/overlays/Makefile
@@ -49,6 +49,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
 	enc28j60.dtbo \
 	enc28j60-spi2.dtbo \
 	exc3000.dtbo \
+	fbtft.dtbo \
 	fe-pi-audio.dtbo \
 	fsm-demo.dtbo \
 	ghost-amp.dtbo \
--- a/arch/arm/boot/dts/overlays/README
+++ b/arch/arm/boot/dts/overlays/README
@@ -857,6 +857,130 @@ Params: interrupt               GPIO use
         swapxy                  Touchscreen swapped x y axis
 
 
+Name:   fbtft
+Info:   Overlay for SPI-connected displays using the fbtft drivers.
+
+        This overlay seeks to replace the functionality provided by fbtft_device
+        which is now gone from the kernel.
+
+        Most displays from fbtft_device have been ported over.
+        Example:
+          dtoverlay=fbtft,spi0-0,rpi-display,reset_pin=23,dc_pin=24,led_pin=18,rotate=270
+
+        It is also possible to specify the controller (this will use the default
+        init sequence in the driver).
+        Example:
+          dtoverlay=fbtft,spi0-0,ili9341,bgr,reset_pin=23,dc_pin=24,led_pin=18,rotate=270
+
+        For devices on spi1 or spi2, the interfaces should be enabled
+        with one of the spi1-1/2/3cs and/or spi2-1/2/3cs overlays.
+
+        The following features of fbtft_device have not been ported over:
+        - parallel bus is not supported
+        - the init property which overrides the controller initialization
+          sequence is not supported as a parameter due to memory limitations in
+          the bootloader responsible for applying the overlay.
+
+        See https://github.com/notro/fbtft/wiki/FBTFT-RPI-overlays for how to
+        create an overlay.
+
+Load:   dtoverlay=fbtft,<param>=<val>
+Params:
+        spi<n>-<m>              Configure device at spi<n>, cs<m>
+                                (boolean, required)
+        speed                   SPI bus speed in Hz (default 32000000)
+        cpha                    Shifted clock phase (CPHA) mode
+        cpol                    Inverse clock polarity (CPOL) mode
+
+        adafruit18              Adafruit 1.8
+        adafruit22              Adafruit 2.2 (old)
+        adafruit22a             Adafruit 2.2
+        adafruit28              Adafruit 2.8
+        adafruit13m             Adafruit 1.3 OLED
+        admatec_c-berry28       C-Berry28
+        dogs102                 EA DOGS102
+        er_tftm050_2            ER-TFTM070-2
+        er_tftm070_5            ER-TFTM070-5
+        ew24ha0                 EW24HA0
+        ew24ha0_9bit            EW24HA0 in 9-bit mode
+        freetronicsoled128      Freetronics OLED128
+        hy28a                   HY28A
+        hy28b                   HY28B
+        itdb28_spi              ITDB02-2.8 with SPI interface circuit
+        mi0283qt-2              Watterott MI0283QT-2
+        mi0283qt-9a             Watterott MI0283QT-9A
+        nokia3310               Nokia 3310
+        nokia3310a              Nokia 3310a
+        nokia5110               Nokia 5110
+        piscreen                PiScreen
+        pitft                   Adafruit PiTFT 2.8
+        pioled                  ILSoft OLED
+        rpi-display             Watterott rpi-display
+        sainsmart18             Sainsmart 1.8
+        sainsmart32_spi         Sainsmart 3.2 with SPI interfce circuit
+        tinylcd35               TinyLCD 3.5
+        tm022hdh26              Tianma TM022HDH26
+        tontec35_9481           Tontect 3.5 with ILI9481 controller
+        tontec35_9486           Tontect 3.5 with ILI9486 controller
+        waveshare32b            Waveshare 3.2
+        waveshare22             Waveshare 2.2
+
+        bd663474                BD663474 display controller
+        hx8340bn                HX8340BN display controller
+        hx8347d                 HX8347D display controller
+        hx8353d                 HX8353D display controller
+        hx8357d                 HX8357D display controller
+        ili9163                 ILI9163 display controller
+        ili9320                 ILI9320 display controller
+        ili9325                 ILI9325 display controller
+        ili9340                 ILI9340 display controller
+        ili9341                 ILI9341 display controller
+        ili9481                 ILI9481 display controller
+        ili9486                 ILI9486 display controller
+        pcd8544                 PCD8544 display controller
+        ra8875                  RA8875 display controller
+        s6d02a1                 S6D02A1 display controller
+        s6d1121                 S6D1121 display controller
+        seps525                 SEPS525 display controller
+        sh1106                  SH1106 display controller
+        ssd1289                 SSD1289 display controller
+        ssd1305                 SSD1305 display controller
+        ssd1306                 SSD1306 display controller
+        ssd1325                 SSD1325 display controller
+        ssd1331                 SSD1331 display controller
+        ssd1351                 SSD1351 display controller
+        st7735r                 ST7735R display controller
+        st7789v                 ST7789V display controller
+        tls8204                 TLS8204 display controller
+        uc1611                  UC1611 display controller
+        uc1701                  UC1701 display controller
+        upd161704               UPD161704 display controller
+
+        width                   Display width in pixels
+        height                  Display height in pixels
+        regwidth                Display controller register width (default is
+                                driver specific)
+        buswidth                Display bus interface width (default 8)
+        debug                   Debug output level {0-7}
+        rotate                  Display rotation {0, 90, 180, 270} (counter
+                                clockwise). Not supported by all drivers.
+        bgr                     Enable BGR mode (default off). Use if Red and
+                                Blue are swapped. Not supported by all drivers.
+        fps                     Frames per second (default 30). In effect this
+                                states how long the driver will wait after video
+                                memory has been changed until display update
+                                transfer is started.
+        txbuflen                Length of the FBTFT transmit buffer
+                                (default 4096)
+        startbyte               Sets the Start byte used by fb_ili9320,
+                                fb_ili9325 and fb_hx8347d. Common value is 0x70.
+        gamma                   String representation of Gamma Curve(s). Driver
+                                specific. Not supported by all drivers.
+        reset_pin               GPIO pin for RESET
+        dc_pin                  GPIO pin for D/C
+        led_pin                 GPIO pin for LED backlight
+
+
 Name:   fe-pi-audio
 Info:   Configures the Fe-Pi Audio Sound Card
 Load:   dtoverlay=fe-pi-audio
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/fbtft-overlay.dts
@@ -0,0 +1,611 @@
+/*
+ * Device Tree overlay for fbtft drivers
+ */
+
+/dts-v1/;
+/plugin/;
+
+/ {
+	compatible = "brcm,bcm2835";
+
+	/* adafruit18 */
+	fragment@0 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "sitronix,st7735r";
+			spi-max-frequency = <32000000>;
+			gamma = "02 1c 07 12 37 32 29 2d 29 25 2B 39 00 01 03 10\n03 1d 07 06 2E 2C 29 2D 2E 2E 37 3F 00 00 02 10";
+		};
+	};
+
+	/* adafruit22 */
+	fragment@1 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "himax,hx8340bn";
+			spi-max-frequency = <32000000>;
+			buswidth = <9>;
+			bgr;
+		};
+	};
+
+	/* adafruit22a */
+	fragment@2 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "ilitek,ili9340";
+			spi-max-frequency = <32000000>;
+			bgr;
+		};
+	};
+
+	/* adafruit28 */
+	fragment@3 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "ilitek,ili9341";
+			spi-max-frequency = <32000000>;
+			bgr;
+		};
+	};
+
+	/* adafruit13m */
+	fragment@4 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "solomon,ssd1306";
+			spi-max-frequency = <16000000>;
+		};
+	};
+
+	/* admatec_c-berry28 */
+	fragment@5 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "sitronix,st7789v";
+			spi-max-frequency = <48000000>;
+			init = <0x01000011
+				0x02000078
+				0x0100003A 0x05
+				0x010000B2 0x0C 0x0C 0x00 0x33 0x33
+				0x010000B7 0x35
+				0x010000C2 0x01 0xFF
+				0x010000C3 0x17
+				0x010000C4 0x20
+				0x010000BB 0x17
+				0x010000C5 0x20
+				0x010000D0 0xA4 0xA1
+				0x01000029>;
+			gamma = "D0 00 14 15 13 2C 42 43 4E 09 16 14 18 21\nD0 00 14 15 13 0B 43 55 53 0C 17 14 23 20";
+		};
+	};
+
+	/* dogs102 */
+	fragment@6 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "UltraChip,uc1701";
+			spi-max-frequency = <8000000>;
+			bgr;
+		};
+	};
+
+	/* er_tftm050_2 */
+	fragment@7 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "raio,ra8875";
+			spi-max-frequency = <5000000>;
+			spi-cpha;
+			spi-cpol;
+			width = <480>;
+			height = <272>;
+			bgr;
+		};
+	};
+
+	/* er_tftm070_5 */
+	fragment@8 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "raio,ra8875";
+			spi-max-frequency = <5000000>;
+			spi-cpha;
+			spi-cpol;
+			width = <800>;
+			height = <480>;
+			bgr;
+		};
+	};
+
+	/* ew24ha0 */
+	fragment@9 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "ultrachip,uc1611";
+			spi-max-frequency = <32000000>;
+			spi-cpha;
+			spi-cpol;
+		};
+	};
+
+	/* ew24ha0_9bit */
+	fragment@10 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "ultrachip,uc1611";
+			spi-max-frequency = <32000000>;
+			spi-cpha;
+			spi-cpol;
+			buswidth = <9>;
+		};
+	};
+
+	/* freetronicsoled128 */
+	fragment@11 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "solomon,ssd1351";
+			spi-max-frequency = <20000000>;
+			backlight = <2>; /* FBTFT_ONBOARD_BACKLIGHT */
+			bgr;
+		};
+	};
+
+	/* hy28a */
+	fragment@12 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "ilitek,ili9320";
+			spi-max-frequency = <32000000>;
+			spi-cpha;
+			spi-cpol;
+			startbyte = <0x70>;
+			bgr;
+		};
+	};
+
+	/* hy28b */
+	fragment@13 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "ilitek,ili9325";
+			spi-max-frequency = <48000000>;
+			spi-cpha;
+			spi-cpol;
+			init = <0x010000e7 0x0010
+				0x01000000 0x0001
+				0x01000001 0x0100
+				0x01000002 0x0700
+				0x01000003 0x1030
+				0x01000004 0x0000
+				0x01000008 0x0207
+				0x01000009 0x0000
+				0x0100000a 0x0000
+				0x0100000c 0x0001
+				0x0100000d 0x0000
+				0x0100000f 0x0000
+				0x01000010 0x0000
+				0x01000011 0x0007
+				0x01000012 0x0000
+				0x01000013 0x0000
+				0x02000032
+				0x01000010 0x1590
+				0x01000011 0x0227
+				0x02000032
+				0x01000012 0x009c
+				0x02000032
+				0x01000013 0x1900
+				0x01000029 0x0023
+				0x0100002b 0x000e
+				0x02000032
+				0x01000020 0x0000
+				0x01000021 0x0000
+				0x02000032
+				0x01000050 0x0000
+				0x01000051 0x00ef
+				0x01000052 0x0000
+				0x01000053 0x013f
+				0x01000060 0xa700
+				0x01000061 0x0001
+				0x0100006a 0x0000
+				0x01000080 0x0000
+				0x01000081 0x0000
+				0x01000082 0x0000
+				0x01000083 0x0000
+				0x01000084 0x0000
+				0x01000085 0x0000
+				0x01000090 0x0010
+				0x01000092 0x0000
+				0x01000093 0x0003
+				0x01000095 0x0110
+				0x01000097 0x0000
+				0x01000098 0x0000
+				0x01000007 0x0133
+				0x01000020 0x0000
+				0x01000021 0x0000
+				0x02000064>;
+			startbyte = <0x70>;
+			bgr;
+			fps = <50>;
+			gamma = "04 1F 4 7 7 0 7 7 6 0\n0F 00 1 7 4 0 0 0 6 7";
+		};
+	};
+
+	/* itdb28_spi */
+	fragment@14 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "ilitek,ili9325";
+			spi-max-frequency = <32000000>;
+			bgr;
+		};
+	};
+
+	/* mi0283qt-2 */
+	fragment@15 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "himax,hx8347d";
+			spi-max-frequency = <32000000>;
+			startbyte = <0x70>;
+			bgr;
+		};
+	};
+
+	/* mi0283qt-9a */
+	fragment@16 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "ilitek,ili9341";
+			spi-max-frequency = <32000000>;
+			buswidth = <9>;
+			bgr;
+		};
+	};
+
+	/* nokia3310 */
+	fragment@17 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "philips,pcd8544";
+			spi-max-frequency = <400000>;
+		};
+	};
+
+	/* nokia3310a */
+	fragment@18 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "teralane,tls8204";
+			spi-max-frequency = <1000000>;
+		};
+	};
+
+	/* nokia5110 */
+	fragment@19 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "ilitek,ili9163";
+			spi-max-frequency = <12000000>;
+			bgr;
+		};
+	};
+
+	/* piscreen */
+	fragment@20 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "ilitek,ili9486";
+			spi-max-frequency = <32000000>;
+			regwidth = <16>;
+			bgr;
+		};
+	};
+
+	/* pitft */
+	fragment@21 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "ilitek,ili9340";
+			spi-max-frequency = <32000000>;
+			init = <0x01000001
+				0x02000005
+				0x01000028
+				0x010000EF 0x03 0x80 0x02
+				0x010000CF 0x00 0xC1 0x30
+				0x010000ED 0x64 0x03 0x12 0x81
+				0x010000E8 0x85 0x00 0x78
+				0x010000CB 0x39 0x2C 0x00 0x34 0x02
+				0x010000F7 0x20
+				0x010000EA 0x00 0x00
+				0x010000C0 0x23
+				0x010000C1 0x10
+				0x010000C5 0x3E 0x28
+				0x010000C7 0x86
+				0x0100003A 0x55
+				0x010000B1 0x00 0x18
+				0x010000B6 0x08 0x82 0x27
+				0x010000F2 0x00
+				0x01000026 0x01
+				0x010000E0 0x0F 0x31 0x2B 0x0C 0x0E 0x08 0x4E 0xF1 0x37 0x07 0x10 0x03 0x0E 0x09 0x00
+				0x010000E1 0x00 0x0E 0x14 0x03 0x11 0x07 0x31 0xC1 0x48 0x08 0x0F 0x0C 0x31 0x36 0x0F
+				0x01000011
+				0x02000064
+				0x01000029
+				0x02000014>;
+			bgr;
+		};
+	};
+
+	/* pioled */
+	fragment@22 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "solomon,ssd1351";
+			spi-max-frequency = <20000000>;
+			bgr;
+			gamma = "0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4";
+		};
+	};
+
+	/* rpi-display */
+	fragment@23 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "ilitek,ili9341";
+			spi-max-frequency = <32000000>;
+			bgr;
+		};
+	};
+
+	/* sainsmart18 */
+	fragment@24 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "sitronix,st7735r";
+			spi-max-frequency = <32000000>;
+		};
+	};
+
+	/* sainsmart32_spi */
+	fragment@25 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "solomon,ssd1289";
+			spi-max-frequency = <16000000>;
+			bgr;
+		};
+	};
+
+	/* tinylcd35 */
+	fragment@26 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "neosec,tinylcd";
+			spi-max-frequency = <32000000>;
+			bgr;
+		};
+	};
+
+	/* tm022hdh26 */
+	fragment@27 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "ilitek,ili9341";
+			spi-max-frequency = <32000000>;
+			bgr;
+		};
+	};
+
+	/* tontec35_9481 - boards before 02 July 2014 */
+	fragment@28 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "ilitek,ili9481";
+			spi-max-frequency = <128000000>;
+			spi-cpha;
+			spi-cpol;
+			bgr;
+		};
+	};
+
+	/* tontec35_9486 - boards after 02 July 2014 */
+	fragment@29 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "ilitek,ili9486";
+			spi-max-frequency = <128000000>;
+			spi-cpha;
+			spi-cpol;
+			bgr;
+		};
+	};
+
+	/* waveshare32b */
+	fragment@30 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "ilitek,ili9340";
+			spi-max-frequency = <48000000>;
+			init = <0x010000CB 0x39 0x2C 0x00 0x34 0x02
+				0x010000CF 0x00 0xC1 0x30
+				0x010000E8 0x85 0x00 0x78
+				0x010000EA 0x00 0x00
+				0x010000ED 0x64 0x03 0x12 0x81
+				0x010000F7 0x20
+				0x010000C0 0x23
+				0x010000C1 0x10
+				0x010000C5 0x3E 0x28
+				0x010000C7 0x86
+				0x01000036 0x28
+				0x0100003A 0x55
+				0x010000B1 0x00 0x18
+				0x010000B6 0x08 0x82 0x27
+				0x010000F2 0x00
+				0x01000026 0x01
+				0x010000E0 0x0F 0x31 0x2B 0x0C 0x0E 0x08 0x4E 0xF1 0x37 0x07 0x10 0x03 0x0E 0x09 0x00
+				0x010000E1 0x00 0x0E 0x14 0x03 0x11 0x07 0x31 0xC1 0x48 0x08 0x0F 0x0C 0x31 0x36 0x0F
+				0x01000011
+				0x02000078
+				0x01000029
+				0x0100002C>;
+			bgr;
+		};
+	};
+
+	/* waveshare22 */
+	fragment@31 {
+		target = <&display>;
+		__dormant__ {
+			compatible = "hitachi,bd663474";
+			spi-max-frequency = <32000000>;
+			spi-cpha;
+			spi-cpol;
+		};
+	};
+
+	spidev_fragment: fragment@100 {
+		target-path = "spi0/spidev@0";
+		__overlay__ {
+			status = "disabled";
+		};
+	};
+
+	display_fragment: fragment@101 {
+		target = <&spi0>;
+		__overlay__ {
+			/* needed to avoid dtc warning */
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			status = "okay";
+
+			display: display@0{
+				reg = <0>;
+				spi-max-frequency = <32000000>;
+				fps = <30>;
+				buswidth = <8>;
+			};
+		};
+	};
+
+	__overrides__ {
+		spi0-0        = <&display_fragment>, "target:0=",<&spi0>,
+				<&spidev_fragment>, "target-path=spi0/spidev@0",
+				<&display>, "reg:0=0";
+		spi0-1        = <&display_fragment>, "target:0=",<&spi0>,
+				<&spidev_fragment>, "target-path=spi0/spidev@1",
+				<&display>, "reg:0=1";
+		spi1-0        = <&display_fragment>, "target:0=",<&spi1>,
+				<&spidev_fragment>, "target-path=spi1/spidev@0",
+				<&display>, "reg:0=0";
+		spi1-1        = <&display_fragment>, "target:0=",<&spi1>,
+				<&spidev_fragment>, "target-path=spi1/spidev@1",
+				<&display>, "reg:0=1";
+		spi1-2        = <&display_fragment>, "target:0=",<&spi1>,
+				<&spidev_fragment>, "target-path=spi1/spidev@2",
+				<&display>, "reg:0=2";
+		spi2-0        = <&display_fragment>, "target:0=",<&spi2>,
+				<&spidev_fragment>, "target-path=spi2/spidev@0",
+				<&display>, "reg:0=0";
+		spi2-1        = <&display_fragment>, "target:0=",<&spi2>,
+				<&spidev_fragment>, "target-path=spi2/spidev@1",
+				<&display>, "reg:0=1";
+		spi2-2        = <&display_fragment>, "target:0=",<&spi2>,
+				<&spidev_fragment>, "target-path=spi2/spidev@2",
+				<&display>, "reg:0=2";
+
+		speed         = <&display>, "spi-max-frequency:0";
+		cpha          = <&display>, "spi-cpha?";
+		cpol          = <&display>, "spi-cpol?";
+
+		/* Displays */
+		adafruit18    = <0>, "+0";
+		adafruit22    = <0>, "+1";
+		adafruit22a   = <0>, "+2";
+		adafruit28    = <0>, "+3";
+		adafruit13m   = <0>, "+4";
+		admatec_c-berry28 = <0>, "+5";
+		dogs102       = <0>, "+6";
+		er_tftm050_2  = <0>, "+7";
+		er_tftm070_5  = <0>, "+8";
+		ew24ha0       = <0>, "+9";
+		ew24ha0_9bit  = <0>, "+10";
+		freetronicsoled128 = <0>, "+11";
+		hy28a         = <0>, "+12";
+		hy28b         = <0>, "+13";
+		itdb28_spi    = <0>, "+14";
+		mi0283qt-2    = <0>, "+15";
+		mi0283qt-9a   = <0>, "+16";
+		nokia3310     = <0>, "+17";
+		nokia3310a    = <0>, "+18";
+		nokia5110     = <0>, "+19";
+		piscreen      = <0>, "+20";
+		pitft         = <0>, "+21";
+		pioled        = <0>, "+22";
+		rpi-display   = <0>, "+23";
+		sainsmart18   = <0>, "+24";
+		sainsmart32_spi = <0>, "+25";
+		tinylcd35     = <0>, "+26";
+		tm022hdh26    = <0>, "+27";
+		tontec35_9481 = <0>, "+28";
+		tontec35_9486 = <0>, "+29";
+		waveshare32b  = <0>, "+30";
+		waveshare22   = <0>, "+31";
+
+		/* Controllers */
+		bd663474      = <&display>, "compatible=hitachi,bd663474";
+		hx8340bn      = <&display>, "compatible=himax,hx8340bn";
+		hx8347d       = <&display>, "compatible=himax,hx8347d";
+		hx8353d       = <&display>, "compatible=himax,hx8353d";
+		hx8357d       = <&display>, "compatible=himax,hx8357d";
+		ili9163       = <&display>, "compatible=ilitek,ili9163";
+		ili9320       = <&display>, "compatible=ilitek,ili9320";
+		ili9325       = <&display>, "compatible=ilitek,ili9325";
+		ili9340       = <&display>, "compatible=ilitek,ili9340";
+		ili9341       = <&display>, "compatible=ilitek,ili9341";
+		ili9481       = <&display>, "compatible=ilitek,ili9481";
+		ili9486       = <&display>, "compatible=ilitek,ili9486";
+		pcd8544       = <&display>, "compatible=philips,pcd8544";
+		ra8875        = <&display>, "compatible=raio,ra8875";
+		s6d02a1       = <&display>, "compatible=samsung,s6d02a1";
+		s6d1121       = <&display>, "compatible=samsung,s6d1121";
+		seps525       = <&display>, "compatible=syncoam,seps525";
+		sh1106        = <&display>, "compatible=sinowealth,sh1106";
+		ssd1289       = <&display>, "compatible=solomon,ssd1289";
+		ssd1305       = <&display>, "compatible=solomon,ssd1305";
+		ssd1306       = <&display>, "compatible=solomon,ssd1306";
+		ssd1325       = <&display>, "compatible=solomon,ssd1325";
+		ssd1331       = <&display>, "compatible=solomon,ssd1331";
+		ssd1351       = <&display>, "compatible=solomon,ssd1351";
+		st7735r       = <&display>, "compatible=sitronix,st7735r";
+		st7789v       = <&display>, "compatible=sitronix,st7789v";
+		tls8204       = <&display>, "compatible=teralane,tls8204";
+		uc1611        = <&display>, "compatible=ultrachip,uc1611";
+		uc1701        = <&display>, "compatible=UltraChip,uc1701";
+		upd161704     = <&display>, "compatible=nec,upd161704";
+
+		width         = <&display>, "width:0";
+		height        = <&display>, "height:0";
+		regwidth      = <&display>, "regwidth:0";
+		buswidth      = <&display>, "buswidth:0";
+		debug         = <&display>, "debug:0";
+		rotate        = <&display>, "rotate:0";
+		bgr           = <&display>, "bgr?";
+		fps           = <&display>, "fps:0";
+		txbuflen      = <&display>, "txbuflen:0";
+		startbyte     = <&display>, "startbyte:0";
+		gamma         = <&display>, "gamma";
+
+		reset_pin     = <&display>, "reset-gpios:0=", <&gpio>,
+				<&display>, "reset-gpios:4",
+				<&display>, "reset-gpios:8=1"; /* GPIO_ACTIVE_LOW */
+		dc_pin        = <&display>, "dc-gpios:0=", <&gpio>,
+				<&display>, "dc-gpios:4",
+				<&display>, "dc-gpios:8=0"; /* GPIO_ACTIVE_HIGH */
+		led_pin       = <&display>, "led-gpios:0=", <&gpio>,
+				<&display>, "led-gpios:4",
+				<&display>, "led-gpios:8=0"; /* GPIO_ACTIVE_HIGH */
+	};
+};