radio-panel.dts 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * Device tree overlay for the radio front panel on an Allwinner board.
  3. *
  4. * Plain numbers instead of #include, so it also works with armbian-add-overlay.
  5. *
  6. * TO CHECK against the actual board before use:
  7. * - root compatible, and the i2c bus in fragment@0 (i2c0)
  8. * - the U2 INT line: placeholder PA6 (<0 6 ...> = bank A, pin 6). Without
  9. * INT (the USB test board), gpio-keys cannot work: use compatible
  10. * "gpio-keys-polled" with poll-interval = <20>, or `radio-ui i2c`, which
  11. * polls U2 itself and must then not have this overlay loaded.
  12. *
  13. * U1 (0x74) is left to the s1d13700-tca driver and must not bind to pca953x;
  14. * it also drives the backlight (P1.0), which the driver registers as
  15. * radio-backlight.
  16. * For the i2c-dev frontend, remove the panel@74 node.
  17. */
  18. /dts-v1/;
  19. /plugin/;
  20. / {
  21. compatible = "allwinner,sun8i-h3";
  22. fragment@0 {
  23. target = <&i2c0>;
  24. __overlay__ {
  25. #address-cells = <1>;
  26. #size-cells = <0>;
  27. clock-frequency = <400000>;
  28. status = "okay";
  29. panel@74 {
  30. compatible = "k4be,s1d13700-tca9539";
  31. reg = <0x74>;
  32. };
  33. radio_u2: gpio@76 {
  34. compatible = "ti,tca9539";
  35. reg = <0x76>;
  36. gpio-controller;
  37. #gpio-cells = <2>;
  38. interrupt-controller;
  39. #interrupt-cells = <2>;
  40. interrupt-parent = <&pio>;
  41. interrupts = <0 6 8>; /* PA6, level low: PLACEHOLDER */
  42. };
  43. };
  44. };
  45. fragment@1 {
  46. target-path = "/";
  47. __overlay__ {
  48. /*
  49. * Keys are active high and read directly: one pin each to
  50. * the supply, with an external pull-down. Pins 0-7 are
  51. * P0.0-7, pins 8-15 are P1.0-7; P0.0-P0.2 are unused. Flag
  52. * 0 = GPIO_ACTIVE_HIGH. Same table as radio/keypad.py.
  53. */
  54. radio-keys {
  55. compatible = "gpio-keys";
  56. autorepeat;
  57. next { label = "next"; gpios = <&radio_u2 3 0>; linux,code = <163>; debounce-interval = <20>; };
  58. left { label = "left"; gpios = <&radio_u2 4 0>; linux,code = <105>; debounce-interval = <20>; };
  59. down { label = "down"; gpios = <&radio_u2 5 0>; linux,code = <108>; debounce-interval = <20>; };
  60. up { label = "up"; gpios = <&radio_u2 6 0>; linux,code = <103>; debounce-interval = <20>; };
  61. right { label = "right"; gpios = <&radio_u2 7 0>; linux,code = <106>; debounce-interval = <20>; };
  62. esc { label = "esc"; gpios = <&radio_u2 8 0>; linux,code = <1>; debounce-interval = <20>; };
  63. ok { label = "ok"; gpios = <&radio_u2 9 0>; linux,code = <352>; debounce-interval = <20>; };
  64. menu { label = "menu"; gpios = <&radio_u2 10 0>; linux,code = <139>; debounce-interval = <20>; };
  65. list { label = "list"; gpios = <&radio_u2 11 0>; linux,code = <395>; debounce-interval = <20>; };
  66. stop { label = "stop"; gpios = <&radio_u2 12 0>; linux,code = <166>; debounce-interval = <20>; };
  67. pause { label = "pause"; gpios = <&radio_u2 13 0>; linux,code = <201>; debounce-interval = <20>; };
  68. play { label = "play"; gpios = <&radio_u2 14 0>; linux,code = <200>; debounce-interval = <20>; };
  69. prev { label = "prev"; gpios = <&radio_u2 15 0>; linux,code = <165>; debounce-interval = <20>; };
  70. };
  71. };
  72. };
  73. };