Skip to contentSkip to conversation

ARM: dts: sun7i: Olimex A20-SOM-EVB: LRADC-keys, MMC3 and typo fix in the sunxi LRADC binding

PATCH In review Karsten Merker 4 participants 10 messages Dec 10, 2015 – Dec 11, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover ARM: dts: sun7i: Olimex A20-SOM-EVB: LRADC-keys, MMC3 and typo fix in the sunxi LRADC binding

Hello,

the Olimex A20-SOM-EVB is an evaluation board for the Olimex A20-SOM system-on-module. This patchset adds/enables some more hardware features in the board dts:

- Patch 1 adds support for the LRADC-keys on the baseboard.

- Patch 2 enables the MMC3 controller to allow use of the full-size SD card socket on the baseboard.

While adding the LRADC-keys support, I have stumbled over a typo in the bindings documentation. Patch 3 fixes that.

Regards,
Karsten

Karsten Merker (3):
ARM: dts: sun7i: Olimex A20-SOM-EVB: Add LRADC keys
ARM: dts: sun7i: Olimex A20-SOM-EVB: Enable mmc3 (baseboard SD socket)
ARM: dts: sunxi: allwinner,sun4i-a10-lradc-keys binding: typo fix

 .../devicetree/bindings/input/sun4i-lradc-keys.txt |  2 +-
 arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts     | 73 ++++++++++++++++++++++
 2 files changed, 74 insertions(+), 1 deletion(-)
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/3 ARM: dts: sun7i: Olimex A20-SOM-EVB: Add LRADC keys

The Olimex A20-SOM-EVB is an evaluation board for the Olimex A20-SOM system-on-module. It provides a set of android-style buttons (labeled "VOL+", "VOL-", "MENU", "SEARCH", "HOME", "ESC" and "ENTER") which are connected to a low-resolution ADC via a resistor network.

This patch adds appropriate button definitions to the board dts. The voltages assigned to the keys are specified in the board schematics published by the manufacturer.

---
 arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts | 56 ++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)
arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts +56 -0
index b7fe102..6562a6bc 100644
@@ -1,5 +1,6 @@
 /*
  * Copyright 2015 - Marcus Cooper <[email protected]>
+ * Copyright 2015 - Karsten Merker <[email protected]>
  *
  * This file is dual-licensed: you can use it either under the terms
  * of the GPL or the X11 license, at your option. Note that this dual
@@ -45,6 +46,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/pinctrl/sun4i-a10.h>
 
@@ -110,6 +112,60 @@
 	};
 };
 
+&lradc {
+	vref-supply = <&reg_vcc3v0>;
+	status = "okay";
+
+	button at 190 {
+		label = "Volume Up";
+		linux,code = <KEY_VOLUMEUP>;
+		channel = <0>;
+		voltage = <190000>;
+	};
+
+	button at 390 {
+		label = "Volume Down";
+		linux,code = <KEY_VOLUMEDOWN>;
+		channel = <0>;
+		voltage = <390000>;
+	};
+
+	button at 600 {
+		label = "Menu";
+		linux,code = <KEY_MENU>;
+		channel = <0>;
+		voltage = <600000>;
+	};
+
+	button at 800 {
+		label = "Search";
+		linux,code = <KEY_SEARCH>;
+		channel = <0>;
+		voltage = <800000>;
+	};
+
+	button at 980 {
+		label = "Home";
+		linux,code = <KEY_HOMEPAGE>;
+		channel = <0>;
+		voltage = <980000>;
+	};
+
+	button at 1180 {
+		label = "Esc";
+		linux,code = <KEY_ESC>;
+		channel = <0>;
+		voltage = <1180000>;
+	};
+
+	button at 1400 {
+		label = "Enter";
+		linux,code = <KEY_ENTER>;
+		channel = <0>;
+		voltage = <1400000>;
+	};
+};
+
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
Signature · 1 line
2.1.4
#4 lore raw

PATCH 2/3 ARM: dts: sun7i: Olimex A20-SOM-EVB: Enable mmc3 (baseboard SD socket)

In reply to Karsten Merker

The Olimex A20-SOM-EVB is an evaluation board for the Olimex A20-SOM system-on-module. The baseboard provides a full-size SD socket (connected to mmc3) in addition to the micro-SD socket on the SOM itself (which is connected to mmc0).

Enable the mmc3 controller in the dts.

---
 arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts +17 -0
index 6562a6bc..6a3d95d 100644
@@ -176,6 +176,16 @@
 	status = "okay";
 };
 
+&mmc3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc3_pins_a>, <&mmc3_cd_pin_olimex_som_evb>;
+	vmmc-supply = <&reg_vcc3v3>;
+	bus-width = <4>;
+	cd-gpios = <&pio 7 0 GPIO_ACTIVE_HIGH>; /* PH0 */
+	cd-inverted;
+	status = "okay";
+};
+
 &ohci0 {
 	status = "okay";
 };
@@ -198,6 +208,13 @@
 		allwinner,drive = <SUN4I_PINCTRL_20_MA>;
 		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 	};
+
+	mmc3_cd_pin_olimex_som_evb: mmc3_cd_pin at 0 {
+		allwinner,pins = "PH0";
+		allwinner,function = "gpio_in";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+	};
 };
 
 &reg_ahci_5v {
Signature · 1 line
2.1.4
#6 lore raw

PATCH 3/3 ARM: dts: sunxi: allwinner,sun4i-a10-lradc-keys binding: typo fix

In reply to Karsten Merker

Trivial typo fix ("mut" -> "must") in the sunxi LRADC-keys binding documentation.

---
 Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt +1 -1
index b9c32f6..4357e49 100644
@@ -12,7 +12,7 @@ Each key is represented as a sub-node of "allwinner,sun4i-a10-lradc-keys":
 Required subnode-properties:
 	- label: Descriptive name of the key.
 	- linux,code: Keycode to emit.
-	- channel: Channel this key is attached to, mut be 0 or 1.
+	- channel: Channel this key is attached to, must be 0 or 1.
 	- voltage: Voltage in ?V at lradc input when this key is pressed.
 
 Example:
Signature · 1 line
2.1.4
maintainer Acked-by on v1 3/3
#7 lore raw

Re: [PATCH 3/3] ARM: dts: sunxi: allwinner,sun4i-a10-lradc-keys binding: typo fix

Quoted 4 lines · Karsten Merker

Trivial typo fix ("mut" -> "must") in the sunxi LRADC-keys binding documentation.

Quoted 20 lines
---
 Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt +1 -1
index b9c32f6..4357e49 100644
@@ -12,7 +12,7 @@ Each key is represented as a sub-node of "allwinner,sun4i-a10-lradc-keys":
 Required subnode-properties:
 	- label: Descriptive name of the key.
 	- linux,code: Keycode to emit.
-	- channel: Channel this key is attached to, mut be 0 or 1.
+	- channel: Channel this key is attached to, must be 0 or 1.
 	- voltage: Voltage in ?V at lradc input when this key is pressed.
 
 Example:
Signature · 1 line
2.1.4
#9 lore raw

Re: [PATCH 3/3] ARM: dts: sunxi: allwinner,sun4i-a10-lradc-keys binding: typo fix

Quoted 10 lines · Chen-Yu Tsai
Quoted 7 lines · Rob Herring
Quoted 4 lines · Karsten Merker

Trivial typo fix ("mut" -> "must") in the sunxi LRADC-keys binding documentation.

You should send this patch to the input subsystem maintainer and input mailing list (with all the acks gathered in this thread).

ChenYu

Acked-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] ARM: dts: sun7i: Olimex A20-SOM-EVB: Add LRADC keys

In reply to Karsten Merker
Quoted 11 lines · Karsten Merker

The Olimex A20-SOM-EVB is an evaluation board for the Olimex A20-SOM system-on-module. It provides a set of android-style buttons (labeled "VOL+", "VOL-", "MENU", "SEARCH", "HOME", "ESC" and "ENTER") which are connected to a low-resolution ADC via a resistor network.

This patch adds appropriate button definitions to the board dts. The voltages assigned to the keys are specified in the board schematics published by the manufacturer.

Acked-by on v1 2/3
#5 lore raw

Re: [PATCH 2/3] ARM: dts: sun7i: Olimex A20-SOM-EVB: Enable mmc3 (baseboard SD socket)

In reply to Karsten Merker
Quoted 8 lines · Karsten Merker

The Olimex A20-SOM-EVB is an evaluation board for the Olimex A20-SOM system-on-module. The baseboard provides a full-size SD socket (connected to mmc3) in addition to the micro-SD socket on the SOM itself (which is connected to mmc0).

Enable the mmc3 controller in the dts.

#3 lore raw

Re: [PATCH 1/3] ARM: dts: sun7i: Olimex A20-SOM-EVB: Add LRADC keys

In reply to Karsten Merker

Hi,

Quoted 11 lines · Karsten Merker

The Olimex A20-SOM-EVB is an evaluation board for the Olimex A20-SOM system-on-module. It provides a set of android-style buttons (labeled "VOL+", "VOL-", "MENU", "SEARCH", "HOME", "ESC" and "ENTER") which are connected to a low-resolution ADC via a resistor network.

This patch adds appropriate button definitions to the board dts. The voltages assigned to the keys are specified in the board schematics published by the manufacturer.

Applied 1 and 2, thanks!
Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151211/2ed9bb8c/attachment-0001.sig>