Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause |
| 2 | /* |
| 3 | * Copyright (C) 2019-2020 Marek Vasut <marex@denx.de> |
| 4 | */ |
| 5 | |
| 6 | #include <dt-bindings/input/input.h> |
| 7 | #include <dt-bindings/pwm/pwm.h> |
| 8 | |
| 9 | / { |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 10 | clk_ext_audio_codec: clock-codec { |
| 11 | compatible = "fixed-clock"; |
| 12 | #clock-cells = <0>; |
| 13 | clock-frequency = <24000000>; |
| 14 | }; |
| 15 | |
| 16 | display_bl: display-bl { |
| 17 | compatible = "pwm-backlight"; |
| 18 | pwms = <&pwm2 3 500000 PWM_POLARITY_INVERTED>; |
| 19 | brightness-levels = <0 16 22 30 40 55 75 102 138 188 255>; |
| 20 | default-brightness-level = <8>; |
| 21 | enable-gpios = <&gpioi 0 GPIO_ACTIVE_HIGH>; |
| 22 | power-supply = <®_panel_bl>; |
| 23 | status = "okay"; |
| 24 | }; |
| 25 | |
| 26 | gpio-keys-polled { |
| 27 | compatible = "gpio-keys-polled"; |
| 28 | poll-interval = <20>; |
| 29 | |
| 30 | /* |
| 31 | * The EXTi IRQ line 3 is shared with ethernet, |
| 32 | * so mark this as polled GPIO key. |
| 33 | */ |
| 34 | button-0 { |
| 35 | label = "TA1-GPIO-A"; |
| 36 | linux,code = <KEY_A>; |
| 37 | gpios = <&gpiof 3 GPIO_ACTIVE_LOW>; |
| 38 | }; |
| 39 | |
| 40 | /* |
| 41 | * The EXTi IRQ line 6 is shared with touchscreen, |
| 42 | * so mark this as polled GPIO key. |
| 43 | */ |
| 44 | button-1 { |
| 45 | label = "TA2-GPIO-B"; |
| 46 | linux,code = <KEY_B>; |
| 47 | gpios = <&gpiod 6 GPIO_ACTIVE_LOW>; |
| 48 | }; |
| 49 | |
| 50 | /* |
| 51 | * The EXTi IRQ line 0 is shared with PMIC, |
| 52 | * so mark this as polled GPIO key. |
| 53 | */ |
| 54 | button-2 { |
| 55 | label = "TA3-GPIO-C"; |
| 56 | linux,code = <KEY_C>; |
| 57 | gpios = <&gpiog 0 GPIO_ACTIVE_LOW>; |
| 58 | }; |
| 59 | }; |
| 60 | |
| 61 | gpio-keys { |
| 62 | compatible = "gpio-keys"; |
| 63 | |
| 64 | button-3 { |
| 65 | label = "TA4-GPIO-D"; |
| 66 | linux,code = <KEY_D>; |
| 67 | gpios = <&gpiod 12 GPIO_ACTIVE_LOW>; |
| 68 | wakeup-source; |
| 69 | }; |
| 70 | }; |
| 71 | |
| 72 | led { |
| 73 | compatible = "gpio-leds"; |
| 74 | |
| 75 | led-0 { |
| 76 | label = "green:led5"; |
| 77 | gpios = <&gpioc 6 GPIO_ACTIVE_HIGH>; |
| 78 | default-state = "off"; |
| 79 | status = "disabled"; |
| 80 | }; |
| 81 | |
| 82 | led-1 { |
| 83 | label = "green:led6"; |
| 84 | gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>; |
| 85 | default-state = "off"; |
| 86 | }; |
| 87 | |
| 88 | led-2 { |
| 89 | label = "green:led7"; |
| 90 | gpios = <&gpioi 2 GPIO_ACTIVE_HIGH>; |
| 91 | default-state = "off"; |
| 92 | }; |
| 93 | |
| 94 | led-3 { |
| 95 | label = "green:led8"; |
| 96 | gpios = <&gpioi 3 GPIO_ACTIVE_HIGH>; |
| 97 | default-state = "off"; |
| 98 | }; |
| 99 | }; |
| 100 | |
| 101 | panel { |
| 102 | compatible = "edt,etm0700g0edh6"; |
| 103 | backlight = <&display_bl>; |
| 104 | power-supply = <®_panel_bl>; |
| 105 | |
| 106 | port { |
| 107 | lcd_panel_in: endpoint { |
| 108 | remote-endpoint = <&lcd_display_out>; |
| 109 | }; |
| 110 | }; |
| 111 | }; |
| 112 | |
| 113 | reg_panel_bl: regulator-panel-bl { |
| 114 | compatible = "regulator-fixed"; |
| 115 | regulator-name = "panel_backlight"; |
| 116 | regulator-min-microvolt = <3300000>; |
| 117 | regulator-max-microvolt = <3300000>; |
| 118 | vin-supply = <®_panel_supply>; |
| 119 | }; |
| 120 | |
| 121 | reg_panel_supply: regulator-panel-supply { |
| 122 | compatible = "regulator-fixed"; |
| 123 | regulator-name = "panel_supply"; |
| 124 | regulator-min-microvolt = <24000000>; |
| 125 | regulator-max-microvolt = <24000000>; |
| 126 | }; |
| 127 | |
| 128 | sound { |
| 129 | compatible = "audio-graph-card"; |
| 130 | widgets = "Headphone", "Headphone Jack", |
| 131 | "Line", "Line In Jack", |
| 132 | "Microphone", "Microphone Jack"; |
| 133 | routing = "Headphone Jack", "HP_OUT", |
| 134 | "LINE_IN", "Line In Jack", |
| 135 | "MIC_IN", "Microphone Jack", |
| 136 | "Microphone Jack", "Mic Bias"; |
| 137 | dais = <&sai2a_port &sai2b_port>; |
| 138 | status = "okay"; |
| 139 | }; |
| 140 | }; |
| 141 | |
| 142 | &cec { |
| 143 | pinctrl-names = "default"; |
| 144 | pinctrl-0 = <&cec_pins_a>; |
| 145 | status = "okay"; |
| 146 | }; |
| 147 | |
| 148 | &i2c2 { /* Header X22 */ |
| 149 | pinctrl-names = "default"; |
| 150 | pinctrl-0 = <&i2c2_pins_a>; |
| 151 | i2c-scl-rising-time-ns = <185>; |
| 152 | i2c-scl-falling-time-ns = <20>; |
| 153 | status = "okay"; |
| 154 | /* spare dmas for other usage */ |
| 155 | /delete-property/dmas; |
| 156 | /delete-property/dma-names; |
| 157 | status = "okay"; |
| 158 | }; |
| 159 | |
| 160 | &i2c5 { /* Header X21 */ |
| 161 | pinctrl-names = "default"; |
| 162 | pinctrl-0 = <&i2c5_pins_a>; |
| 163 | i2c-scl-rising-time-ns = <185>; |
| 164 | i2c-scl-falling-time-ns = <20>; |
| 165 | status = "okay"; |
| 166 | /* spare dmas for other usage */ |
| 167 | /delete-property/dmas; |
| 168 | /delete-property/dma-names; |
| 169 | |
| 170 | sgtl5000: codec@a { |
| 171 | compatible = "fsl,sgtl5000"; |
| 172 | reg = <0x0a>; |
| 173 | #sound-dai-cells = <0>; |
| 174 | clocks = <&clk_ext_audio_codec>; |
| 175 | VDDA-supply = <&v3v3>; |
| 176 | VDDIO-supply = <&vdd>; |
| 177 | |
| 178 | sgtl5000_port: port { |
| 179 | #address-cells = <1>; |
| 180 | #size-cells = <0>; |
| 181 | |
| 182 | sgtl5000_tx_endpoint: endpoint@0 { |
| 183 | reg = <0>; |
| 184 | remote-endpoint = <&sai2a_endpoint>; |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 185 | }; |
| 186 | |
| 187 | sgtl5000_rx_endpoint: endpoint@1 { |
| 188 | reg = <1>; |
| 189 | remote-endpoint = <&sai2b_endpoint>; |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 190 | }; |
| 191 | }; |
| 192 | |
| 193 | }; |
| 194 | |
| 195 | touchscreen@38 { |
| 196 | compatible = "edt,edt-ft5406"; |
| 197 | reg = <0x38>; |
| 198 | interrupt-parent = <&gpioc>; |
| 199 | interrupts = <6 IRQ_TYPE_EDGE_FALLING>; /* GPIO E */ |
| 200 | }; |
| 201 | }; |
| 202 | |
| 203 | <dc { |
| 204 | pinctrl-names = "default", "sleep"; |
| 205 | pinctrl-0 = <<dc_pins_b>; |
| 206 | pinctrl-1 = <<dc_sleep_pins_b>; |
| 207 | status = "okay"; |
| 208 | |
| 209 | port { |
| 210 | lcd_display_out: endpoint { |
| 211 | remote-endpoint = <&lcd_panel_in>; |
| 212 | }; |
| 213 | }; |
| 214 | }; |
| 215 | |
| 216 | &sai2 { |
| 217 | clocks = <&rcc SAI2>, <&rcc PLL3_Q>, <&rcc PLL3_R>; |
| 218 | clock-names = "pclk", "x8k", "x11k"; |
| 219 | pinctrl-names = "default", "sleep"; |
| 220 | pinctrl-0 = <&sai2a_pins_b &sai2b_pins_b>; |
| 221 | pinctrl-1 = <&sai2a_sleep_pins_b &sai2b_sleep_pins_b>; |
| 222 | status = "okay"; |
| 223 | |
| 224 | sai2a: audio-controller@4400b004 { |
| 225 | #clock-cells = <0>; |
| 226 | dma-names = "tx"; |
| 227 | clocks = <&rcc SAI2_K>; |
| 228 | clock-names = "sai_ck"; |
| 229 | status = "okay"; |
| 230 | |
| 231 | sai2a_port: port { |
| 232 | sai2a_endpoint: endpoint { |
| 233 | remote-endpoint = <&sgtl5000_tx_endpoint>; |
Tom Rini | 9c8af15 | 2024-12-24 12:03:04 -0600 | [diff] [blame] | 234 | bitclock-master; |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 235 | dai-format = "i2s"; |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 236 | dai-tdm-slot-num = <2>; |
| 237 | dai-tdm-slot-width = <16>; |
Tom Rini | 9c8af15 | 2024-12-24 12:03:04 -0600 | [diff] [blame] | 238 | frame-master; |
| 239 | mclk-fs = <256>; |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 240 | }; |
| 241 | }; |
| 242 | }; |
| 243 | |
| 244 | sai2b: audio-controller@4400b024 { |
| 245 | dma-names = "rx"; |
| 246 | st,sync = <&sai2a 2>; |
| 247 | clocks = <&rcc SAI2_K>, <&sai2a>; |
| 248 | clock-names = "sai_ck", "MCLK"; |
| 249 | status = "okay"; |
| 250 | |
| 251 | sai2b_port: port { |
| 252 | sai2b_endpoint: endpoint { |
| 253 | remote-endpoint = <&sgtl5000_rx_endpoint>; |
Tom Rini | 9c8af15 | 2024-12-24 12:03:04 -0600 | [diff] [blame] | 254 | bitclock-master; |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 255 | dai-format = "i2s"; |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 256 | dai-tdm-slot-num = <2>; |
| 257 | dai-tdm-slot-width = <16>; |
Tom Rini | 9c8af15 | 2024-12-24 12:03:04 -0600 | [diff] [blame] | 258 | frame-master; |
| 259 | mclk-fs = <256>; |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 260 | }; |
| 261 | }; |
| 262 | }; |
| 263 | }; |
| 264 | |
| 265 | &timers2 { |
| 266 | /* spare dmas for other usage (un-delete to enable pwm capture) */ |
| 267 | /delete-property/dmas; |
| 268 | /delete-property/dma-names; |
| 269 | status = "okay"; |
| 270 | pwm2: pwm { |
| 271 | pinctrl-0 = <&pwm2_pins_a>; |
| 272 | pinctrl-names = "default"; |
| 273 | status = "okay"; |
| 274 | }; |
| 275 | timer@1 { |
| 276 | status = "okay"; |
| 277 | }; |
| 278 | }; |
| 279 | |
| 280 | &usart3 { |
| 281 | pinctrl-names = "default"; |
| 282 | pinctrl-0 = <&usart3_pins_a>; |
| 283 | /delete-property/dmas; |
| 284 | /delete-property/dma-names; |
| 285 | status = "okay"; |
| 286 | }; |
| 287 | |
| 288 | &uart8 { |
| 289 | pinctrl-names = "default"; |
| 290 | pinctrl-0 = <&uart8_pins_a &uart8_rtscts_pins_a>; |
| 291 | uart-has-rtscts; |
| 292 | /delete-property/dmas; |
| 293 | /delete-property/dma-names; |
| 294 | status = "okay"; |
| 295 | }; |
| 296 | |
| 297 | &usbh_ehci { |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 298 | status = "okay"; |
| 299 | }; |
| 300 | |
| 301 | &usbotg_hs { |
| 302 | dr_mode = "otg"; |
| 303 | pinctrl-0 = <&usbotg_hs_pins_a>; |
| 304 | pinctrl-names = "default"; |
| 305 | phy-names = "usb2-phy"; |
| 306 | phys = <&usbphyc_port1 0>; |
| 307 | vbus-supply = <&vbus_otg>; |
| 308 | status = "okay"; |
| 309 | }; |
| 310 | |
| 311 | &usbphyc { |
| 312 | status = "okay"; |
| 313 | }; |
| 314 | |
| 315 | &usbphyc_port0 { |
| 316 | phy-supply = <&vdd_usb>; |
| 317 | }; |
| 318 | |
| 319 | &usbphyc_port1 { |
| 320 | phy-supply = <&vdd_usb>; |
| 321 | }; |