/* * Device tree overlay for the radio front panel on an Allwinner board. * * Plain numbers instead of #include, so it also works with armbian-add-overlay. * * TO CHECK against the actual board before use: * - root compatible, and the i2c bus in fragment@0 (i2c0) * - the U2 INT line: placeholder PA6 (<0 6 ...> = bank A, pin 6). Without * INT (the USB test board), gpio-keys cannot work: use compatible * "gpio-keys-polled" with poll-interval = <20>, or `radio-ui i2c`, which * polls U2 itself and must then not have this overlay loaded. * * U1 (0x74) is left to the s1d13700-tca driver and must not bind to pca953x; * it also drives the backlight (P1.0), which the driver registers as * radio-backlight. * For the i2c-dev frontend, remove the panel@74 node. */ /dts-v1/; /plugin/; / { compatible = "allwinner,sun8i-h3"; fragment@0 { target = <&i2c0>; __overlay__ { #address-cells = <1>; #size-cells = <0>; clock-frequency = <400000>; status = "okay"; panel@74 { compatible = "k4be,s1d13700-tca9539"; reg = <0x74>; }; radio_u2: gpio@76 { compatible = "ti,tca9539"; reg = <0x76>; gpio-controller; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; interrupt-parent = <&pio>; interrupts = <0 6 8>; /* PA6, level low: PLACEHOLDER */ }; }; }; fragment@1 { target-path = "/"; __overlay__ { /* * Keys are active high and read directly: one pin each to * the supply, with an external pull-down. Pins 0-7 are * P0.0-7, pins 8-15 are P1.0-7; P0.0-P0.2 are unused. Flag * 0 = GPIO_ACTIVE_HIGH. Same table as radio/keypad.py. */ radio-keys { compatible = "gpio-keys"; autorepeat; next { label = "next"; gpios = <&radio_u2 3 0>; linux,code = <163>; debounce-interval = <20>; }; left { label = "left"; gpios = <&radio_u2 4 0>; linux,code = <105>; debounce-interval = <20>; }; down { label = "down"; gpios = <&radio_u2 5 0>; linux,code = <108>; debounce-interval = <20>; }; up { label = "up"; gpios = <&radio_u2 6 0>; linux,code = <103>; debounce-interval = <20>; }; right { label = "right"; gpios = <&radio_u2 7 0>; linux,code = <106>; debounce-interval = <20>; }; esc { label = "esc"; gpios = <&radio_u2 8 0>; linux,code = <1>; debounce-interval = <20>; }; ok { label = "ok"; gpios = <&radio_u2 9 0>; linux,code = <352>; debounce-interval = <20>; }; menu { label = "menu"; gpios = <&radio_u2 10 0>; linux,code = <139>; debounce-interval = <20>; }; list { label = "list"; gpios = <&radio_u2 11 0>; linux,code = <395>; debounce-interval = <20>; }; stop { label = "stop"; gpios = <&radio_u2 12 0>; linux,code = <166>; debounce-interval = <20>; }; pause { label = "pause"; gpios = <&radio_u2 13 0>; linux,code = <201>; debounce-interval = <20>; }; play { label = "play"; gpios = <&radio_u2 14 0>; linux,code = <200>; debounce-interval = <20>; }; prev { label = "prev"; gpios = <&radio_u2 15 0>; linux,code = <165>; debounce-interval = <20>; }; }; }; }; };