From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755539AbdBGUj4 (ORCPT ); Tue, 7 Feb 2017 15:39:56 -0500 Received: from vern.gendns.com ([206.190.152.46]:36983 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932273AbdBGUjy (ORCPT ); Tue, 7 Feb 2017 15:39:54 -0500 From: David Lechner To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Cc: David Lechner , Sekhar Nori , Kevin Hilman , Rob Herring , Mark Rutland , linux-kernel@vger.kernel.org Subject: [PATCH 3/3] ARM: da850-lego-ev3: Add device tree node for sound Date: Tue, 7 Feb 2017 13:22:09 -0600 Message-Id: <1486495329-2789-4-git-send-email-david@lechnology.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1486495329-2789-1-git-send-email-david@lechnology.com> References: <1486495329-2789-1-git-send-email-david@lechnology.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds a device tree node for sound on LEGO MINDSTORMS EV3. The EV3 uses one of the SoC PWMs connected to an amplifier to create sound from a speaker. The PWM is passed through a low-pass filter, so it is actually possible to do PCM playback, but there is no existing driver, so just using pwm-beeper for now, since it is also a compatible mode of operation. Signed-off-by: David Lechner --- arch/arm/boot/dts/da850-lego-ev3.dts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/arch/arm/boot/dts/da850-lego-ev3.dts b/arch/arm/boot/dts/da850-lego-ev3.dts index 0309537..c20580a 100644 --- a/arch/arm/boot/dts/da850-lego-ev3.dts +++ b/arch/arm/boot/dts/da850-lego-ev3.dts @@ -123,6 +123,14 @@ pinctrl-0 = <&system_power_pin>; }; + sound { + compatible = "pwm-beeper"; + pinctrl-names = "default"; + pinctrl-0 = <&ehrpwm0b_pins>; + pwms = <&ehrpwm0 1 1000000 0>; + amp-supply = <&>; + }; + /* * This is a 5V current limiting regulator that is shared by USB, * the sensor (input) ports, the motor (output) ports and the A/DC. @@ -152,6 +160,18 @@ regulator-boot-on; vin-supply = <&vcc5v>; }; + + /* + * This is the amplifier for the speaker. + */ + amp: regulator3 { + pinctrl-names = "default"; + pinctrl-0 = <&_pins>; + compatible = "regulator-fixed"; + regulator-name = "amp"; + gpio = <&gpio 111 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; }; &pmx_core { @@ -208,6 +228,13 @@ 0x4c 0x00008000 0x0000f000 >; }; + + amp_pins: pinmux_amp_pins { + pinctrl-single,bits = < + /* GP6[15] */ + 0x34 0x00000008 0x0000000f + >; + }; }; &pinconf { @@ -316,6 +343,10 @@ }; }; +&ehrpwm0 { + status = "okay"; +}; + &gpio { status = "okay"; }; -- 2.7.4