radio-panel.dts 2.8 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)
  9. *
  10. * U1 (0x74) is left to the s1d13700-tca driver and must not bind to pca953x.
  11. * For the i2c-dev frontend, remove the panel@74 node.
  12. */
  13. /dts-v1/;
  14. /plugin/;
  15. / {
  16. compatible = "allwinner,sun8i-h3";
  17. fragment@0 {
  18. target = <&i2c0>;
  19. __overlay__ {
  20. #address-cells = <1>;
  21. #size-cells = <0>;
  22. clock-frequency = <400000>;
  23. status = "okay";
  24. panel@74 {
  25. compatible = "k4be,s1d13700-tca9539";
  26. reg = <0x74>;
  27. };
  28. radio_u2: gpio@75 {
  29. compatible = "ti,tca9539";
  30. reg = <0x75>;
  31. gpio-controller;
  32. #gpio-cells = <2>;
  33. interrupt-controller;
  34. #interrupt-cells = <2>;
  35. interrupt-parent = <&pio>;
  36. interrupts = <0 6 8>; /* PA6, level low: PLACEHOLDER */
  37. };
  38. };
  39. };
  40. fragment@1 {
  41. target-path = "/";
  42. __overlay__ {
  43. /*
  44. * Keys are active low and read directly: one pin each, with
  45. * a 10k pull-up (the TCA9539 has none). Pins 0-7 are P0.0-7,
  46. * pins 8-15 are P1.0-7. Flag 1 = GPIO_ACTIVE_LOW.
  47. */
  48. radio-keys {
  49. compatible = "gpio-keys";
  50. autorepeat;
  51. esc { label = "esc"; gpios = <&radio_u2 0 1>; linux,code = <1>; debounce-interval = <20>; };
  52. next { label = "next"; gpios = <&radio_u2 1 1>; linux,code = <163>; debounce-interval = <20>; };
  53. stop { label = "stop"; gpios = <&radio_u2 2 1>; linux,code = <166>; debounce-interval = <20>; };
  54. menu { label = "menu"; gpios = <&radio_u2 3 1>; linux,code = <139>; debounce-interval = <20>; };
  55. list { label = "list"; gpios = <&radio_u2 4 1>; linux,code = <395>; debounce-interval = <20>; };
  56. up { label = "up"; gpios = <&radio_u2 5 1>; linux,code = <103>; debounce-interval = <20>; };
  57. prev { label = "prev"; gpios = <&radio_u2 6 1>; linux,code = <165>; debounce-interval = <20>; };
  58. right { label = "right"; gpios = <&radio_u2 7 1>; linux,code = <106>; debounce-interval = <20>; };
  59. down { label = "down"; gpios = <&radio_u2 8 1>; linux,code = <108>; debounce-interval = <20>; };
  60. pause { label = "pause"; gpios = <&radio_u2 9 1>; linux,code = <201>; debounce-interval = <20>; };
  61. ok { label = "ok"; gpios = <&radio_u2 10 1>; linux,code = <352>; debounce-interval = <20>; };
  62. left { label = "left"; gpios = <&radio_u2 11 1>; linux,code = <105>; debounce-interval = <20>; };
  63. play { label = "play"; gpios = <&radio_u2 12 1>; linux,code = <200>; debounce-interval = <20>; };
  64. };
  65. radio-backlight {
  66. compatible = "gpio-backlight";
  67. gpios = <&radio_u2 13 0>; /* P1.5, active high */
  68. default-on;
  69. };
  70. };
  71. };
  72. };