brcm2708: add linux 4.19 support
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.19 / 950-0314-overlays-Add-ssd1306-overlay-for-OLED-display.patch
1 From f6ed9ece5ed29ca16dc021ce0e9ab64bf4c879cb Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Mon, 21 Jan 2019 21:17:27 +0000
4 Subject: [PATCH 314/703] overlays: Add ssd1306 overlay for OLED display
5
6 See: https://github.com/raspberrypi/firmware/issues/1098
7
8 Signed-off-by: mincepi <mincepi@gmail.com>
9 ---
10 arch/arm/boot/dts/overlays/Makefile | 1 +
11 arch/arm/boot/dts/overlays/README | 31 ++++++++++++++++
12 .../arm/boot/dts/overlays/ssd1306-overlay.dts | 36 +++++++++++++++++++
13 3 files changed, 68 insertions(+)
14 create mode 100644 arch/arm/boot/dts/overlays/ssd1306-overlay.dts
15
16 --- a/arch/arm/boot/dts/overlays/Makefile
17 +++ b/arch/arm/boot/dts/overlays/Makefile
18 @@ -135,6 +135,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
19 spi2-1cs.dtbo \
20 spi2-2cs.dtbo \
21 spi2-3cs.dtbo \
22 + ssd1306.dtbo \
23 superaudioboard.dtbo \
24 sx150x.dtbo \
25 tc358743.dtbo \
26 --- a/arch/arm/boot/dts/overlays/README
27 +++ b/arch/arm/boot/dts/overlays/README
28 @@ -1950,6 +1950,37 @@ Params: cs0_pin GPIO pin
29 is 'okay' or enabled).
30
31
32 +Name: ssd1306
33 +Info: Overlay for activation of SSD1306 over I2C OLED display framebuffer.
34 +Load: dtoverlay=ssd1306,<param>=<val>
35 +Params: address Location in display memory of first character.
36 + (default=0)
37 + width Width of display. (default=128)
38 + height Height of display. (default=64)
39 + offset virtual channel a. (default=0)
40 + normal Has no effect on displays tested. (default=not
41 + set)
42 + sequential Set this if every other scan line is missing.
43 + (default=not set)
44 + remapped Set this if display is garbled. (default=not
45 + set)
46 + inverted Set this if display is inverted and mirrored.
47 + (default=not set)
48 +
49 + Examples:
50 + Typical usage for 128x64 display: dtoverlay=ssd1306,inverted
51 +
52 + Typical usage for 128x32 display: dtoverlay=ssd1306,inverted,sequential
53 +
54 + i2c_baudrate=400000 will speed up the display.
55 +
56 + i2c_baudrate=1000000 seems to work even though it's not officially
57 + supported by the hardware, and is faster still.
58 +
59 + For more information refer to the device datasheet at:
60 + https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf
61 +
62 +
63 Name: superaudioboard
64 Info: Configures the SuperAudioBoard sound card
65 Load: dtoverlay=superaudioboard,<param>=<val>
66 --- /dev/null
67 +++ b/arch/arm/boot/dts/overlays/ssd1306-overlay.dts
68 @@ -0,0 +1,36 @@
69 +// Overlay for SSD1306 128x64 and 128x32 OLED displays
70 +/dts-v1/;
71 +/plugin/;
72 +
73 +/ {
74 + compatible = "brcm,bcm2718";
75 +
76 + fragment@0 {
77 + target = <&i2c1>;
78 + __overlay__ {
79 + status = "okay";
80 +
81 + #address-cells = <1>;
82 + #size-cells = <0>;
83 +
84 + ssd1306: oled@3c{
85 + compatible = "solomon,ssd1306fb-i2c";
86 + reg = <0x3c>;
87 + solomon,width = <128>;
88 + solomon,height = <64>;
89 + solomon,page-offset = <0>;
90 + };
91 + };
92 + };
93 +
94 + __overrides__ {
95 + address = <&ssd1306>,"reg:0";
96 + width = <&ssd1306>,"solomon,width:0";
97 + height = <&ssd1306>,"solomon,height:0";
98 + offset = <&ssd1306>,"solomon,page-offset:0";
99 + normal = <&ssd1306>,"solomon,segment-no-remap?";
100 + sequential = <&ssd1306>,"solomon,com-seq?";
101 + remapped = <&ssd1306>,"solomon,com-lrremap?";
102 + inverted = <&ssd1306>,"solomon,com-invdir?";
103 + };
104 +};