From patchwork Mon Jan 16 10:22:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 9518451 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 512EF601C3 for ; Mon, 16 Jan 2017 10:23:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DB2A28435 for ; Mon, 16 Jan 2017 10:23:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1217E2844A; Mon, 16 Jan 2017 10:23:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BAB7B28435 for ; Mon, 16 Jan 2017 10:23:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cT4RW-00033V-7W; Mon, 16 Jan 2017 10:23:14 +0000 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cT4RR-00031P-Rm for linux-arm-kernel@lists.infradead.org; Mon, 16 Jan 2017 10:23:12 +0000 Received: by mail-wm0-x234.google.com with SMTP id r144so168075850wme.1 for ; Mon, 16 Jan 2017 02:22:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=RLEvNtiIH+wygkUe98p9IvGOOKs438SzEH3Tic/uIJo=; b=b8rCyXwiz3l3KfUbavxAyOhas66ry4H/Pkib0t/+y7ZkaV+dAUAB6R6wUWH07wkcLU gJ1/fgqf2F6xsohNrh8Uhn+8ZKb1PUnyEhuqRx/7KPWThvy17kGHkf2+ddgEabuy2ypZ 70v/36SPqP5koudltvJBepOIeExoTF/V7IkZMD0iKlOHrCVfHPkAUS71YGTcEMMlkXrH 6umc5Vsvbv7jDeYmW9C88z63rUik40Yw4ijK+zun44OCmq45qm1rzS5zmt17g16Zx2/w zcJKSxY5wlbHJRY/UHVx3xf24Z9AcUeQBQNJC7uw3/ja5L7ge3p8nEBZxew3hXxeCBpT ndOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=RLEvNtiIH+wygkUe98p9IvGOOKs438SzEH3Tic/uIJo=; b=tNy7OD/O8/tFcIMw01A4kTiS/ul1bQJgUw+0bk3F4d8WwHptF/gbgdDawZh0m0KRcW KT76iEGDQ85Sl2UfJkbMEVFcejLiofHJ55ah8dCthJlOTR8s9/VrBRB6u1fynEpvHC36 GePZ2mQZo6KBi8PGdt/rLN5pmZKX1MGIVNwigDEwcYOwRJ2cGeOGDgTG0PgILIGYw3qS As6Z54khbLRZURGHT86ywNf4CDkclI4rVrxkHQdh0Wif5ntHqDWTDO4zOYxBMHbe9lWS KcsNfkOTQB2RGHKgiqDHPnTwtnrduZa1vtkXb5kdK1ilfbevFA4KnaVxx2u7TqM0WOVG oLqQ== X-Gm-Message-State: AIkVDXKyugJtFaTaP3NO2MV+0zhAbuFvqRHE5NbKMYFryscqqgrh5omfl3g1WkW1MsODbiad X-Received: by 10.28.130.212 with SMTP id e203mr10813749wmd.104.1484562168103; Mon, 16 Jan 2017 02:22:48 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id c9sm27449022wmi.16.2017.01.16.02.22.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Jan 2017 02:22:47 -0800 (PST) From: Neil Armstrong To: carlo@caione.org, khilman@baylibre.com Subject: [PATCH] ARM64: meson-gxbb-p200: add ADC laddered keys Date: Mon, 16 Jan 2017 11:22:45 +0100 Message-Id: <1484562165-29449-1-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170116_022310_058409_36290CCD X-CRM114-Status: GOOD ( 10.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Neil Armstrong MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add the 5 buttons connected to a resistor laddered matrix and sampled by the SAR ADC channel 0. Only the p200 board has these buttons, the P201 doesn't. Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts | 50 +++++++++++++++++++++++++ 1 file changed, 50 insertions(+) This patch depends on Martin Blumenstingl's sar adc patchset at [1]. [1] http://lkml.kernel.org/r/20170115224221.15510-1-martin.blumenstingl@googlemail.com diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts index af7b151..3051cc8 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts @@ -45,6 +45,7 @@ /dts-v1/; #include "meson-gxbb-p20x.dtsi" +#include / { compatible = "amlogic,p200", "amlogic,meson-gxbb"; @@ -58,6 +59,50 @@ */ linux,usable-memory = <0x0 0x1000000 0x0 0x3f000000>; }; + + avdd18_usb_adc: regulator-avdd18_usb_adc { + compatible = "regulator-fixed"; + regulator-name = "AVDD18_USB_ADC"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + adc_keys { + compatible = "adc-keys"; + io-channels = <&saradc 0>; + io-channel-names = "buttons"; + keyup-threshold-microvolt = <1800000>; + + button-home { + label = "Home"; + linux,code = ; + press-threshold-microvolt = <900000>; /* 50% */ + }; + + button-esc { + label = "Esc"; + linux,code = ; + press-threshold-microvolt = <684000>; /* 38% */ + }; + + button-up { + label = "Volume Up"; + linux,code = ; + press-threshold-microvolt = <468000>; /* 26% */ + }; + + button-down { + label = "Volume Down"; + linux,code = ; + press-threshold-microvolt = <252000>; /* 14% */ + }; + + button-menu { + label = "Menu"; + linux,code = ; + press-threshold-microvolt = <0>; /* 0% */ + }; + }; }; &i2c_B { @@ -65,3 +110,8 @@ pinctrl-0 = <&i2c_b_pins>; pinctrl-names = "default"; }; + +&saradc { + status = "okay"; + vref-supply = <&avdd18_usb_adc>; +};