Merge tag 'v5.15.57' into rpi-5.15.y
[platform/kernel/linux-rpi.git] / arch / arm / boot / dts / overlays / ads7846-overlay.dts
1 /*
2  * Generic Device Tree overlay for the ADS7846 touch controller
3  *
4  */
5
6 /dts-v1/;
7 /plugin/;
8
9 / {
10         compatible = "brcm,bcm2835";
11
12         fragment@0 {
13                 target = <&spi0>;
14                 __overlay__ {
15                         status = "okay";
16                 };
17         };
18
19         fragment@1 {
20                 target = <&spidev0>;
21                 __overlay__ {
22                         status = "disabled";
23                 };
24         };
25
26         fragment@2 {
27                 target = <&spidev1>;
28                 __overlay__ {
29                         status = "disabled";
30                 };
31         };
32
33         fragment@3 {
34                 target = <&gpio>;
35                 __overlay__ {
36                         ads7846_pins: ads7846_pins {
37                                 brcm,pins = <255>; /* illegal default value */
38                                 brcm,function = <0>; /* in */
39                                 brcm,pull = <0>; /* none */
40                         };
41                 };
42         };
43
44         fragment@4 {
45                 target = <&spi0>;
46                 __overlay__ {
47                         /* needed to avoid dtc warning */
48                         #address-cells = <1>;
49                         #size-cells = <0>;
50
51                         ads7846: ads7846@1 {
52                                 compatible = "ti,ads7846";
53                                 reg = <1>;
54                                 pinctrl-names = "default";
55                                 pinctrl-0 = <&ads7846_pins>;
56
57                                 spi-max-frequency = <2000000>;
58                                 interrupts = <255 2>; /* high-to-low edge triggered */
59                                 interrupt-parent = <&gpio>;
60                                 pendown-gpio = <&gpio 255 0>;
61
62                                 /* driver defaults */
63                                 ti,x-min = /bits/ 16 <0>;
64                                 ti,y-min = /bits/ 16 <0>;
65                                 ti,x-max = /bits/ 16 <0x0FFF>;
66                                 ti,y-max = /bits/ 16 <0x0FFF>;
67                                 ti,pressure-min = /bits/ 16 <0>;
68                                 ti,pressure-max = /bits/ 16 <0xFFFF>;
69                                 ti,x-plate-ohms = /bits/ 16 <400>;
70                         };
71                 };
72         };
73         __overrides__ {
74                 cs =     <&ads7846>,"reg:0";
75                 speed =  <&ads7846>,"spi-max-frequency:0";
76                 penirq = <&ads7846_pins>,"brcm,pins:0", /* REQUIRED */
77                          <&ads7846>,"interrupts:0",
78                          <&ads7846>,"pendown-gpio:4";
79                 penirq_pull = <&ads7846_pins>,"brcm,pull:0";
80                 swapxy = <&ads7846>,"ti,swap-xy?";
81                 xmin =   <&ads7846>,"ti,x-min;0";
82                 ymin =   <&ads7846>,"ti,y-min;0";
83                 xmax =   <&ads7846>,"ti,x-max;0";
84                 ymax =   <&ads7846>,"ti,y-max;0";
85                 pmin =   <&ads7846>,"ti,pressure-min;0";
86                 pmax =   <&ads7846>,"ti,pressure-max;0";
87                 xohms =  <&ads7846>,"ti,x-plate-ohms;0";
88         };
89 };