summaryrefslogtreecommitdiff
path: root/arch/arm/boot/dts/overlays/hy28b-overlay.dts
blob: 8018aebde8e557f45ffd63eb86f6c7a1048fe3cb (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
/*
 * Device Tree overlay for HY28b display shield by Texy
 *
 */

/dts-v1/;
/plugin/;

/ {
	compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";

	fragment@0 {
		target = <&spi0>;
		__overlay__ {
			status = "okay";
		};
	};

	fragment@1 {
		target = <&spidev0>;
		__overlay__ {
			status = "disabled";
		};
	};

	fragment@2 {
		target = <&spidev1>;
		__overlay__ {
			status = "disabled";
		};
	};

	fragment@3 {
		target = <&gpio>;
		__overlay__ {
			hy28b_pins: hy28b_pins {
				brcm,pins = <17 25 18>;
				brcm,function = <0 1 1>; /* in out out */
			};
		};
	};

	fragment@4 {
		target = <&spi0>;
		__overlay__ {
			/* needed to avoid dtc warning */
			#address-cells = <1>;
			#size-cells = <0>;

			hy28b: hy28b@0{
				compatible = "ilitek,ili9325";
				reg = <0>;
				pinctrl-names = "default";
				pinctrl-0 = <&hy28b_pins>;

				spi-max-frequency = <48000000>;
				spi-cpol;
				spi-cpha;
				rotate = <270>;
				bgr;
				fps = <50>;
				buswidth = <8>;
				startbyte = <0x70>;
				reset-gpios = <&gpio 25 0>;
				led-gpios = <&gpio 18 1>;

				gamma = "04 1F 4 7 7 0 7 7 6 0\n0F 00 1 7 4 0 0 0 6 7";

				init = <0x10000e7 0x0010
					0x1000000 0x0001
					0x1000001 0x0100
					0x1000002 0x0700
				        0x1000003 0x1030
					0x1000004 0x0000
					0x1000008 0x0207
					0x1000009 0x0000
				        0x100000a 0x0000
					0x100000c 0x0001
					0x100000d 0x0000
					0x100000f 0x0000
				        0x1000010 0x0000
					0x1000011 0x0007
					0x1000012 0x0000
					0x1000013 0x0000
				        0x2000032
					0x1000010 0x1590
					0x1000011 0x0227
				        0x2000032
					0x1000012 0x009c
				        0x2000032
				        0x1000013 0x1900
					0x1000029 0x0023
					0x100002b 0x000e
				        0x2000032
				        0x1000020 0x0000
					0x1000021 0x0000
				        0x2000032
					0x1000050 0x0000
				        0x1000051 0x00ef
					0x1000052 0x0000
					0x1000053 0x013f
					0x1000060 0xa700
				        0x1000061 0x0001
					0x100006a 0x0000
					0x1000080 0x0000
					0x1000081 0x0000
				        0x1000082 0x0000
					0x1000083 0x0000
					0x1000084 0x0000
					0x1000085 0x0000
				        0x1000090 0x0010
					0x1000092 0x0000
					0x1000093 0x0003
					0x1000095 0x0110
				        0x1000097 0x0000
					0x1000098 0x0000
					0x1000007 0x0133
					0x1000020 0x0000
				        0x1000021 0x0000
				        0x2000064>;
				debug = <0>;
			};

			hy28b_ts: hy28b-ts@1 {
				compatible = "ti,ads7846";
				reg = <1>;

				spi-max-frequency = <2000000>;
				interrupts = <17 2>; /* high-to-low edge triggered */
				interrupt-parent = <&gpio>;
				pendown-gpio = <&gpio 17 0>;
				ti,x-plate-ohms = /bits/ 16 <100>;
				ti,pressure-max = /bits/ 16 <255>;
			};
		};
	};
	__overrides__ {
		speed = 	<&hy28b>,"spi-max-frequency:0";
		rotate = 	<&hy28b>,"rotate:0";
		fps = 		<&hy28b>,"fps:0";
		debug = 	<&hy28b>,"debug:0";
		xohms =		<&hy28b_ts>,"ti,x-plate-ohms;0";
		resetgpio =	<&hy28b>,"reset-gpios:4",
				<&hy28b_pins>, "brcm,pins:1";
		ledgpio =	<&hy28b>,"led-gpios:4",
				<&hy28b_pins>, "brcm,pins:2";
	};
};