From 8a81ff173c5c9a0ab1df84fab17971dbcce8490a Mon Sep 17 00:00:00 2001 From: David Lechner Date: Tue, 7 Feb 2017 13:22:07 -0600 Subject: [PATCH 1/6] 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. Signed-off-by: David Lechner Signed-off-by: Sekhar Nori --- arch/arm/boot/dts/da850-lego-ev3.dts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/arch/arm/boot/dts/da850-lego-ev3.dts b/arch/arm/boot/dts/da850-lego-ev3.dts index 112ec92064ce..03095372ce68 100644 --- a/arch/arm/boot/dts/da850-lego-ev3.dts +++ b/arch/arm/boot/dts/da850-lego-ev3.dts @@ -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@3 { + compatible = "ti,ads7957"; + reg = <3>; + #io-channel-cells = <1>; + spi-max-frequency = <10000000>; + vref-supply = <&adc_ref>; + }; }; &gpio { From 7723d70bebd749ef24fef19db52d827c7fd7f858 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Tue, 7 Feb 2017 13:22:09 -0600 Subject: [PATCH 2/6] ARM: da850-lego-ev3: Add device tree node for sound 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 Signed-off-by: Sekhar Nori --- 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 03095372ce68..c20580a7356e 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"; }; From c42d37c72a812a8052c5f742044071a104c63bd0 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Tue, 28 Feb 2017 17:15:13 +0100 Subject: [PATCH 3/6] ARM: dts: da850-evm: fix whitespace errors The da850-evm dts file contains whitespace errors in the vpif node. This patch fixes them. Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori --- arch/arm/boot/dts/da850-evm.dts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts index d15107cba765..336a69d70595 100644 --- a/arch/arm/boot/dts/da850-evm.dts +++ b/arch/arm/boot/dts/da850-evm.dts @@ -299,14 +299,14 @@ /* VPIF capture port */ port { vpif_ch0: endpoint@0 { - reg = <0>; - bus-width = <8>; + reg = <0>; + bus-width = <8>; }; vpif_ch1: endpoint@1 { - reg = <1>; - bus-width = <8>; - data-shift = <8>; + reg = <1>; + bus-width = <8>; + data-shift = <8>; }; }; }; From 5ff94828b1def0853888a4d8ebfb077dcd544b91 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Tue, 28 Feb 2017 17:15:14 +0100 Subject: [PATCH 4/6] ARM: dts: da850: add vpif video display pins Add a new pinctrl sub-node for vpif display pins. Move VP_CLKIN3 and VP_CLKIN2 to the display node where they actually belong (vide section 36.2.2 of the OMAP-L138 technical reference manual). Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori --- arch/arm/boot/dts/da850.dtsi | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi index 92d633d1da68..5150331ef904 100644 --- a/arch/arm/boot/dts/da850.dtsi +++ b/arch/arm/boot/dts/da850.dtsi @@ -216,8 +216,21 @@ 0x3c 0x11111111 0xffffffff /* VP_DIN[8..9] */ 0x40 0x00000011 0x000000ff - /* VP_CLKIN3, VP_CLKIN2 */ - 0x4c 0x00010100 0x000f0f00 + >; + }; + vpif_display_pins: vpif_display_pins { + pinctrl-single,bits = < + /* VP_DOUT[2..7] */ + 0x40 0x11111100 0xffffff00 + /* VP_DOUT[10..15,0..1] */ + 0x44 0x11111111 0xffffffff + /* VP_DOUT[8..9] */ + 0x48 0x00000011 0x000000ff + /* + * VP_CLKOUT3, VP_CLKIN3, + * VP_CLKOUT2, VP_CLKIN2 + */ + 0x4c 0x00111100 0x00ffff00 >; }; }; From 2aabeffec6df47732a436ad12f73bdf0a7f1df93 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Tue, 28 Feb 2017 17:15:15 +0100 Subject: [PATCH 5/6] ARM: dts: da850-evm: add IO expander node on UI card We need the expander to be probed to allow the VPIF controller to receive interrupts from the video decoder. Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori --- arch/arm/boot/dts/da850-evm.dts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts index 336a69d70595..c863fd73e2f3 100644 --- a/arch/arm/boot/dts/da850-evm.dts +++ b/arch/arm/boot/dts/da850-evm.dts @@ -9,6 +9,7 @@ */ /dts-v1/; #include "da850.dtsi" +#include / { compatible = "ti,da850-evm", "ti,da850"; @@ -78,7 +79,10 @@ DRVDD-supply = <&vbat>; DVDD-supply = <&vbat>; }; - + tca6416: gpio@20 { + compatible = "ti,tca6416"; + reg = <0x20>; + }; }; wdt: wdt@21000 { status = "okay"; From f8914131f7da23ab604efd8d1b95a416e5d8fc44 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Tue, 28 Feb 2017 17:15:16 +0100 Subject: [PATCH 6/6] ARM: dts: da850-evm: add the output port to the vpif node Extend the vpif node with an output port with a single channel. NOTE: this is still mostly just hardware description - the actual driver is registered using pdata-quirks. We need the node however for correct pin control function selection. Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori --- arch/arm/boot/dts/da850-evm.dts | 15 +++++++++++---- arch/arm/boot/dts/da850.dtsi | 8 +++++++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts index c863fd73e2f3..8d244cd76c36 100644 --- a/arch/arm/boot/dts/da850-evm.dts +++ b/arch/arm/boot/dts/da850-evm.dts @@ -297,20 +297,27 @@ &vpif { pinctrl-names = "default"; - pinctrl-0 = <&vpif_capture_pins>; + pinctrl-0 = <&vpif_capture_pins>, <&vpif_display_pins>; status = "okay"; /* VPIF capture port */ - port { - vpif_ch0: endpoint@0 { + port@0 { + vpif_input_ch0: endpoint@0 { reg = <0>; bus-width = <8>; }; - vpif_ch1: endpoint@1 { + vpif_input_ch1: endpoint@1 { reg = <1>; bus-width = <8>; data-shift = <8>; }; }; + + /* VPIF display port */ + port@1 { + vpif_output_ch0: endpoint { + bus-width = <8>; + }; + }; }; diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi index 5150331ef904..c708155767f3 100644 --- a/arch/arm/boot/dts/da850.dtsi +++ b/arch/arm/boot/dts/da850.dtsi @@ -358,7 +358,13 @@ status = "disabled"; /* VPIF capture port */ - port { + port@0 { + #address-cells = <1>; + #size-cells = <0>; + }; + + /* VPIF display port */ + port@1 { #address-cells = <1>; #size-cells = <0>; };