0002-sound-device-tree-node.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. From 7723d70bebd749ef24fef19db52d827c7fd7f858 Mon Sep 17 00:00:00 2001
  2. From: David Lechner <david@lechnology.com>
  3. Date: Tue, 7 Feb 2017 13:22:09 -0600
  4. Subject: ARM: da850-lego-ev3: Add device tree node for sound
  5. This adds a device tree node for sound on LEGO MINDSTORMS EV3. The EV3
  6. uses one of the SoC PWMs connected to an amplifier to create sound from
  7. a speaker.
  8. The PWM is passed through a low-pass filter, so it is actually possible
  9. to do PCM playback, but there is no existing driver, so just using
  10. pwm-beeper for now, since it is also a compatible mode of operation.
  11. Signed-off-by: David Lechner <david@lechnology.com>
  12. Signed-off-by: Sekhar Nori <nsekhar@ti.com>
  13. ---
  14. arch/arm/boot/dts/da850-lego-ev3.dts | 31 +++++++++++++++++++++++++++++++
  15. 1 file changed, 31 insertions(+)
  16. diff --git a/arch/arm/boot/dts/da850-lego-ev3.dts b/arch/arm/boot/dts/da850-lego-ev3.dts
  17. index 0309537..c20580a 100644
  18. --- a/arch/arm/boot/dts/da850-lego-ev3.dts
  19. +++ b/arch/arm/boot/dts/da850-lego-ev3.dts
  20. @@ -123,6 +123,14 @@
  21. pinctrl-0 = <&system_power_pin>;
  22. };
  23. + sound {
  24. + compatible = "pwm-beeper";
  25. + pinctrl-names = "default";
  26. + pinctrl-0 = <&ehrpwm0b_pins>;
  27. + pwms = <&ehrpwm0 1 1000000 0>;
  28. + amp-supply = <&amp>;
  29. + };
  30. +
  31. /*
  32. * This is a 5V current limiting regulator that is shared by USB,
  33. * the sensor (input) ports, the motor (output) ports and the A/DC.
  34. @@ -152,6 +160,18 @@
  35. regulator-boot-on;
  36. vin-supply = <&vcc5v>;
  37. };
  38. +
  39. + /*
  40. + * This is the amplifier for the speaker.
  41. + */
  42. + amp: regulator3 {
  43. + pinctrl-names = "default";
  44. + pinctrl-0 = <&amp_pins>;
  45. + compatible = "regulator-fixed";
  46. + regulator-name = "amp";
  47. + gpio = <&gpio 111 GPIO_ACTIVE_HIGH>;
  48. + enable-active-high;
  49. + };
  50. };
  51. &pmx_core {
  52. @@ -208,6 +228,13 @@
  53. 0x4c 0x00008000 0x0000f000
  54. >;
  55. };
  56. +
  57. + amp_pins: pinmux_amp_pins {
  58. + pinctrl-single,bits = <
  59. + /* GP6[15] */
  60. + 0x34 0x00000008 0x0000000f
  61. + >;
  62. + };
  63. };
  64. &pinconf {
  65. @@ -316,6 +343,10 @@
  66. };
  67. };
  68. +&ehrpwm0 {
  69. + status = "okay";
  70. +};
  71. +
  72. &gpio {
  73. status = "okay";
  74. };
  75. --
  76. cgit v1.1