1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Copyright 2013 Crystalfontz America, Inc.
4 * 				  Free Electrons
5 */
6
7/*
8 * The CFA-10055 is an expansion board for the CFA-10036 module and
9 * CFA-10037, thus we need to include the CFA-10037 DTS.
10 */
11#include "imx28-cfa10037.dts"
12
13/ {
14	model = "Crystalfontz CFA-10055 Board";
15	compatible = "crystalfontz,cfa10055", "crystalfontz,cfa10037", "crystalfontz,cfa10036", "fsl,imx28";
16
17	spi-2 {
18		compatible = "spi-gpio";
19		pinctrl-names = "default";
20		pinctrl-0 = <&spi2_pins_cfa10055>;
21		status = "okay";
22		sck-gpios = <&gpio2 16 0>;
23		mosi-gpios = <&gpio2 17 0>;
24		miso-gpios = <&gpio2 18 0>;
25		cs-gpios = <&gpio3 5 0>;
26		num-chipselects = <1>;
27		#address-cells = <1>;
28		#size-cells = <0>;
29
30		hx8357: hx8357@0 {
31			compatible = "himax,hx8357b", "himax,hx8357";
32			reg = <0>;
33			spi-max-frequency = <100000>;
34			spi-cpol;
35			spi-cpha;
36			gpios-reset = <&gpio3 30 0>;
37		};
38	};
39
40	backlight {
41		compatible = "pwm-backlight";
42		pwms = <&pwm 3 5000000>;
43		brightness-levels = <0 4 8 16 32 64 128 255>;
44		default-brightness-level = <6>;
45	};
46};
47
48&lcdif {
49	pinctrl-names = "default";
50	pinctrl-0 = <&lcdif_18bit_pins_cfa10055
51		     &lcdif_pins_cfa10055
52		     &lcdif_pins_cfa10055_pullup>;
53	display = <&display0>;
54	status = "okay";
55
56	display0: display0 {
57		bits-per-pixel = <32>;
58		bus-width = <18>;
59
60		display-timings {
61			native-mode = <&timing0>;
62			timing0: timing0 {
63				clock-frequency = <9216000>;
64				hactive = <320>;
65				vactive = <480>;
66				hback-porch = <2>;
67				hfront-porch = <2>;
68				vback-porch = <2>;
69				vfront-porch = <2>;
70				hsync-len = <15>;
71				vsync-len = <15>;
72				hsync-active = <0>;
73				vsync-active = <0>;
74				de-active = <1>;
75				pixelclk-active = <1>;
76			};
77		};
78	};
79};
80
81&lradc {
82	fsl,lradc-touchscreen-wires = <4>;
83	status = "okay";
84};
85
86&pinctrl {
87	spi2_pins_cfa10055: spi2-cfa10055@0 {
88		reg = <0>;
89		fsl,pinmux-ids = <
90			MX28_PAD_SSP2_SCK__GPIO_2_16
91			MX28_PAD_SSP2_MOSI__GPIO_2_17
92			MX28_PAD_SSP2_MISO__GPIO_2_18
93			MX28_PAD_AUART1_TX__GPIO_3_5
94		>;
95		fsl,drive-strength = <MXS_DRIVE_8mA>;
96		fsl,voltage = <MXS_VOLTAGE_HIGH>;
97		fsl,pull-up = <MXS_PULL_ENABLE>;
98	};
99
100	lcdif_18bit_pins_cfa10055: lcdif-18bit@0 {
101		reg = <0>;
102		fsl,pinmux-ids = <
103			MX28_PAD_LCD_D00__LCD_D0
104			MX28_PAD_LCD_D01__LCD_D1
105			MX28_PAD_LCD_D02__LCD_D2
106			MX28_PAD_LCD_D03__LCD_D3
107			MX28_PAD_LCD_D04__LCD_D4
108			MX28_PAD_LCD_D05__LCD_D5
109			MX28_PAD_LCD_D06__LCD_D6
110			MX28_PAD_LCD_D07__LCD_D7
111			MX28_PAD_LCD_D08__LCD_D8
112			MX28_PAD_LCD_D09__LCD_D9
113			MX28_PAD_LCD_D10__LCD_D10
114			MX28_PAD_LCD_D11__LCD_D11
115			MX28_PAD_LCD_D12__LCD_D12
116			MX28_PAD_LCD_D13__LCD_D13
117			MX28_PAD_LCD_D14__LCD_D14
118			MX28_PAD_LCD_D15__LCD_D15
119			MX28_PAD_LCD_D16__LCD_D16
120			MX28_PAD_LCD_D17__LCD_D17
121		>;
122		fsl,drive-strength = <MXS_DRIVE_4mA>;
123		fsl,voltage = <MXS_VOLTAGE_HIGH>;
124		fsl,pull-up = <MXS_PULL_DISABLE>;
125	};
126
127	lcdif_pins_cfa10055: lcdif-evk@0 {
128		reg = <0>;
129		fsl,pinmux-ids = <
130			MX28_PAD_LCD_RD_E__LCD_VSYNC
131			MX28_PAD_LCD_WR_RWN__LCD_HSYNC
132			MX28_PAD_LCD_RS__LCD_DOTCLK
133			MX28_PAD_LCD_CS__LCD_ENABLE
134		>;
135		fsl,drive-strength = <MXS_DRIVE_4mA>;
136		fsl,voltage = <MXS_VOLTAGE_HIGH>;
137		fsl,pull-up = <MXS_PULL_DISABLE>;
138	};
139
140	lcdif_pins_cfa10055_pullup: lcdif-10055-pullup@0 {
141		reg = <0>;
142		fsl,pinmux-ids = <
143			MX28_PAD_LCD_RESET__GPIO_3_30
144		>;
145		fsl,drive-strength = <MXS_DRIVE_4mA>;
146		fsl,voltage = <MXS_VOLTAGE_HIGH>;
147		fsl,pull-up = <MXS_PULL_ENABLE>;
148	};
149};
150
151&pwm {
152	pinctrl-names = "default";
153	pinctrl-0 = <&pwm3_pins_b>;
154	status = "okay";
155};
156