brcm2708: add linux 4.19 support
[oweals/openwrt.git] / target / linux / brcm2708 / patches-4.19 / 950-0426-BCM2708-Add-core-Device-Tree-support-ilitek251x.patch
1 From 7b15bdfee1c922d6c3e92329cd23a45e77e036ae Mon Sep 17 00:00:00 2001
2 From: Samuel Hsu <hsu@distec.de>
3 Date: Mon, 8 Apr 2019 17:06:44 +0200
4 Subject: [PATCH 426/703] BCM2708: Add core Device Tree support, ilitek251x
5
6 Signed-off-by: Samuel Hsu <hsu@distec.de>
7 ---
8  arch/arm/boot/dts/overlays/Makefile           |  1 +
9  arch/arm/boot/dts/overlays/README             | 11 +++++
10  .../boot/dts/overlays/ilitek251x-overlay.dts  | 45 +++++++++++++++++++
11  3 files changed, 57 insertions(+)
12  create mode 100644 arch/arm/boot/dts/overlays/ilitek251x-overlay.dts
13
14 --- a/arch/arm/boot/dts/overlays/Makefile
15 +++ b/arch/arm/boot/dts/overlays/Makefile
16 @@ -67,6 +67,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
17         i2c0-bcm2708.dtbo \
18         i2c1-bcm2708.dtbo \
19         i2s-gpio28-31.dtbo \
20 +       ilitek251x.dtbo \
21         iqaudio-dac.dtbo \
22         iqaudio-dacplus.dtbo \
23         iqaudio-digi-wm8804-audio.dtbo \
24 --- a/arch/arm/boot/dts/overlays/README
25 +++ b/arch/arm/boot/dts/overlays/README
26 @@ -1146,6 +1146,17 @@ Load:   dtoverlay=i2s-gpio28-31
27  Params: <None>
28  
29  
30 +Name:   ilitek251x
31 +Info:   Enables I2C connected Ilitek 251x multiple touch controller using
32 +        GPIO 4 (pin 7 on GPIO header) for interrupt.
33 +Load:   dtoverlay=ilitek251x,<param>=<val>
34 +Params: interrupt               GPIO used for interrupt (default 4)
35 +        sizex                   Touchscreen size x, horizontal resolution of
36 +                                touchscreen (in pixels)
37 +        sizey                   Touchscreen size y, vertical resolution of
38 +                                touchscreen (in pixels)
39 +
40 +
41  Name:   iqaudio-dac
42  Info:   Configures the IQaudio DAC audio card
43  Load:   dtoverlay=iqaudio-dac,<param>
44 --- /dev/null
45 +++ b/arch/arm/boot/dts/overlays/ilitek251x-overlay.dts
46 @@ -0,0 +1,45 @@
47 +// Device tree overlay for I2C connected Ilitek multiple touch controller
48 +/dts-v1/;
49 +/plugin/;
50 +
51 + / {
52 +       compatible = "brcm,bcm2708";
53 +
54 +       fragment@0 {
55 +               target = <&gpio>;
56 +               __overlay__ {           
57 +                       ili251x_pins: ili251x_pins {
58 +                               brcm,pins = <4>; // interrupt
59 +                               brcm,function = <0>; // in
60 +                               brcm,pull = <2>; // pull-up //
61 +                       };
62 +               };
63 +       };
64 +
65 +       fragment@1 {
66 +               target = <&i2c1>;
67 +               __overlay__ {
68 +                       #address-cells = <1>;
69 +                       #size-cells = <0>;
70 +                       status = "okay";
71 +
72 +                       ili251x: ili251x@41 {
73 +                               compatible = "ilitek,ili251x";
74 +                               reg = <0x41>;
75 +                               pinctrl-names = "default";
76 +                               pinctrl-0 = <&ili251x_pins>;
77 +                               interrupt-parent = <&gpio>;
78 +                               interrupts = <4 8>; // high-to-low edge triggered
79 +                               touchscreen-size-x = <16384>;
80 +                               touchscreen-size-y = <9600>;
81 +                       };
82 +               };
83 +       };
84 +
85 +       __overrides__ {
86 +               interrupt = <&ili251x_pins>,"brcm,pins:0",
87 +                       <&ili251x>,"interrupts:0";
88 +               sizex = <&ili251x>,"touchscreen-size-x:0";
89 +               sizey = <&ili251x>,"touchscreen-size-y:0";
90 +       };
91 +};