A/C and Sound device tree nodes for LEGO MINDSTORMS EV3
Subsystems (2)
cover A/C and Sound device tree nodes for LEGO MINDSTORMS EV3
This series adds device tree nodes for an analog/digital convert and for sound on LEGO MINDSTORMS EV3. The device tree bindings for these nodes have been acked and the drivers used by these nodes have been in linux-next for a couple weeks now and as far as I know, will be included in mainline v4.11.
This series has been tested on LEGO MINDSTORMS EV3 using next-20170207 merged with linux-davinci/master.
David Lechner (3):
ARM: da850-lego-ev3: Add device tree node for A/DC
ARM: davinci_all_defconfig: Enable TI ADS7950
ARM: da850-lego-ev3: Add device tree node for sound
arch/arm/boot/dts/da850-lego-ev3.dts | 52 ++++++++++++++++++++++++++++++++++ arch/arm/configs/davinci_all_defconfig | 4 +-- 2 files changed, 53 insertions(+), 3 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/3 ARM: da850-lego-ev3: Add device tree node for A/DC
This adds a node for the TI ADS7957 analog/digital converter on LEGO MINDSTORMS EV3 as well as a regulator node that is used by the A/DC node.
--- arch/arm/boot/dts/da850-lego-ev3.dts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
arch/arm/boot/dts/da850-lego-ev3.dts +21 -0
@@ -139,6 +139,19 @@ enable-active-high; regulator-boot-on; }; + + /* + * This is a simple voltage divider on VCC5V to provide a 2.5V + * reference signal to the ADC. + */ + adc_ref: regulator2 { + compatible = "regulator-fixed"; + regulator-name = "adc ref"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + regulator-boot-on; + vin-supply = <&vcc5v>; + }; }; &pmx_core {
@@ -293,6 +306,14 @@ }; }; }; + + adc: adc at 3 { + compatible = "ti,ads7957"; + reg = <3>; + #io-channel-cells = <1>; + spi-max-frequency = <10000000>; + vref-supply = <&adc_ref>; + }; }; &gpio {
Signature · 1 line
2.7.4
PATCH 2/3 ARM: davinci_all_defconfig: Enable TI ADS7950
In reply to David LechnerThis enables the TI ADS7950 IIO driver. This is used on LEGO MINDSTORMS EV3. The other IIO configs removed in this patch are selected by CONFIG_TI_ADS7950, so they are not actually being desabled.
--- arch/arm/configs/davinci_all_defconfig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
arch/arm/configs/davinci_all_defconfig +1 -3
@@ -204,12 +204,10 @@ CONFIG_MEMORY=y CONFIG_TI_AEMIF=m CONFIG_DA8XX_DDRCTL=y CONFIG_IIO=m -CONFIG_IIO_BUFFER=y CONFIG_IIO_BUFFER_CB=m -CONFIG_IIO_KFIFO_BUF=m -CONFIG_IIO_TRIGGER=y CONFIG_IIO_SW_DEVICE=m CONFIG_IIO_SW_TRIGGER=m +CONFIG_TI_ADS7950=m CONFIG_IIO_HRTIMER_TRIGGER=m CONFIG_IIO_SYSFS_TRIGGER=m CONFIG_PWM=y
Signature · 1 line
2.7.4
PATCH 3/3 ARM: da850-lego-ev3: Add device tree node for sound
In reply to David LechnerThis 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.
--- arch/arm/boot/dts/da850-lego-ev3.dts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
arch/arm/boot/dts/da850-lego-ev3.dts +31 -0
@@ -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"; };
Signature · 1 line
2.7.4
Quoted 7 lines · David Lechner
This series adds device tree nodes for an analog/digital convert and for sound on LEGO MINDSTORMS EV3. The device tree bindings for these nodes have been acked and the drivers used by these nodes have been in linux-next for a couple weeks now and as far as I know, will be included in mainline v4.11.
This series has been tested on LEGO MINDSTORMS EV3 using next-20170207 merged with linux-davinci/master.
Looks good to me. Will wait for device tree maintainers. And also for v4.11-rc1 to come out.
Thanks,
Sekhar
Quoted 11 lines · Sekhar Nori
Quoted 7 lines · David Lechner
This series adds device tree nodes for an analog/digital convert and for sound on LEGO MINDSTORMS EV3. The device tree bindings for these nodes have been acked and the drivers used by these nodes have been in linux-next for a couple weeks now and as far as I know, will be included in mainline v4.11.
This series has been tested on LEGO MINDSTORMS EV3 using next-20170207 merged with linux-davinci/master.
Looks good to me. Will wait for device tree maintainers. And also for v4.11-rc1 to come out.
Applied now.
Thanks,
Sekhar