| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
- /*
- * Orange Pi Zero (original, H2+) as used in the radio: the mainline board
- * file plus what the Armbian setup enabled through overlays
- * (analog-codec, usbhost2, usbhost3, i2c1, user overlay i2c1-400k), the
- * binding the out-of-tree xradio driver needs for the XR819 Wi-Fi, and the
- * radio front panel on i2c1: S1D13700 panel (U1, 0x74) and keys (U2, 0x76).
- *
- * Built by build-kernel.sh inside the kernel tree, with symbols (-@), so
- * extra overlays can still be applied by U-Boot (extlinux "fdtoverlays").
- */
- #include "sun8i-h2-plus-orangepi-zero.dts"
- / {
- model = "Xunlong Orange Pi Zero (radio)";
- /*
- * Without an alias Linux numbers I2C adapters in probe order, so the
- * only enabled controller (i2c1) would be /dev/i2c-0. Pin it to
- * /dev/i2c-1 as under Armbian; dynamic buses (i2c-tiny-usb) start at 2.
- */
- aliases {
- i2c1 = &i2c1;
- };
- };
- /* Line out / mic on the 13-pin header (was overlay "analog-codec"). */
- &codec {
- status = "okay";
- };
- /* USB2/USB3 on the 13-pin header (were overlays "usbhost2", "usbhost3"). */
- &ehci2 {
- status = "okay";
- };
- &ohci2 {
- status = "okay";
- };
- &ehci3 {
- status = "okay";
- };
- &ohci3 {
- status = "okay";
- };
- /*
- * I2C1 on PA18 (SCL) / PA19 (SDA), pins 5/3 of the 26-pin header, carrying
- * the panel and key expanders; 400 kHz (was "i2c1" + user "i2c1-400k").
- * 400 kHz relies on the pull-ups on the panel board: i2c1_pins enables no
- * SoC bias, and the internal ~100 kOhm pull-ups would be too weak anyway.
- */
- &i2c1 {
- pinctrl-names = "default";
- pinctrl-0 = <&i2c1_pins>;
- clock-frequency = <400000>;
- status = "okay";
- /*
- * Radio panel: S1D13700 behind U1, TCA9539 at 0x74. The driver is
- * built in, so fbcon shows the boot log here. Without the panel the
- * probe stops at "expander not responding" and nothing else happens.
- * "k4be" is not in the kernel's vendor-prefixes.yaml and the binding
- * has no schema, so dtbs_check warns about this node; that is expected.
- */
- panel@74 {
- compatible = "k4be,s1d13700-tca9539";
- reg = <0x74>;
- };
- /*
- * U2, TCA9539 at 0x76 (A1=H, A0=L): the keys. INT (open drain, active
- * low) is wired to PA6/PWM1 (pin 7 of the 26-pin header); the SoC's
- * pull-up is enabled in case there is none on the board.
- */
- radio_u2: gpio@76 {
- compatible = "ti,tca9539";
- reg = <0x76>;
- pinctrl-names = "default";
- pinctrl-0 = <&radio_u2_int_pin>;
- gpio-controller;
- #gpio-cells = <2>;
- interrupt-controller;
- #interrupt-cells = <2>;
- interrupt-parent = <&pio>;
- interrupts = <0 6 IRQ_TYPE_LEVEL_LOW>; /* PA6 */
- };
- };
- &pio {
- radio_u2_int_pin: radio-u2-int-pin {
- pins = "PA6";
- function = "irq";
- bias-pull-up;
- };
- };
- / {
- /*
- * Keys are active high, read directly: one pin each to the supply,
- * with an external pull-down. Pins 0-7 are P0.0-7, 8-15 are P1.0-7;
- * P0.0-P0.2 are unused. Same table as radio-keyboard-tca's
- * dts/radio-keys.dts and radio-ui's radio/keypad.py; build-kernel.sh compares
- * the compiled tables and stops if they differ. The input device is
- * named "radio-keys", which radio-ui looks for.
- */
- radio-keys {
- compatible = "gpio-keys";
- label = "radio-keys";
- autorepeat;
- key-next { label = "next"; gpios = <&radio_u2 3 GPIO_ACTIVE_HIGH>; linux,code = <KEY_NEXTSONG>; debounce-interval = <20>; };
- key-left { label = "left"; gpios = <&radio_u2 4 GPIO_ACTIVE_HIGH>; linux,code = <KEY_LEFT>; debounce-interval = <20>; };
- key-down { label = "down"; gpios = <&radio_u2 5 GPIO_ACTIVE_HIGH>; linux,code = <KEY_DOWN>; debounce-interval = <20>; };
- key-up { label = "up"; gpios = <&radio_u2 6 GPIO_ACTIVE_HIGH>; linux,code = <KEY_UP>; debounce-interval = <20>; };
- key-right { label = "right"; gpios = <&radio_u2 7 GPIO_ACTIVE_HIGH>; linux,code = <KEY_RIGHT>; debounce-interval = <20>; };
- key-esc { label = "esc"; gpios = <&radio_u2 8 GPIO_ACTIVE_HIGH>; linux,code = <KEY_ESC>; debounce-interval = <20>; };
- key-ok { label = "ok"; gpios = <&radio_u2 9 GPIO_ACTIVE_HIGH>; linux,code = <KEY_OK>; debounce-interval = <20>; };
- key-menu { label = "menu"; gpios = <&radio_u2 10 GPIO_ACTIVE_HIGH>; linux,code = <KEY_MENU>; debounce-interval = <20>; };
- key-list { label = "list"; gpios = <&radio_u2 11 GPIO_ACTIVE_HIGH>; linux,code = <KEY_LIST>; debounce-interval = <20>; };
- key-stop { label = "stop"; gpios = <&radio_u2 12 GPIO_ACTIVE_HIGH>; linux,code = <KEY_STOPCD>; debounce-interval = <20>; };
- key-pause { label = "pause"; gpios = <&radio_u2 13 GPIO_ACTIVE_HIGH>; linux,code = <KEY_PAUSECD>; debounce-interval = <20>; };
- key-play { label = "play"; gpios = <&radio_u2 14 GPIO_ACTIVE_HIGH>; linux,code = <KEY_PLAYCD>; debounce-interval = <20>; };
- key-prev { label = "prev"; gpios = <&radio_u2 15 GPIO_ACTIVE_HIGH>; linux,code = <KEY_PREVIOUSSONG>; debounce-interval = <20>; };
- };
- };
- /*
- * XR819 on mmc1: the xradio driver matches this compatible and needs the
- * host-wake interrupt on PG10. U-Boot fills in local-mac-address through
- * the ethernet1 alias of the mainline file (derived from the SoC SID).
- */
- &xr819 {
- compatible = "xradio,xr819";
- interrupt-parent = <&pio>;
- interrupts = <6 10 IRQ_TYPE_EDGE_RISING>; /* PG10 */
- interrupt-names = "host-wake";
- };
|