From patchwork Tue Mar 7 10:40:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 9608581 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 3837D6046A for ; Tue, 7 Mar 2017 10:41:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20F10284CC for ; Tue, 7 Mar 2017 10:41:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12F83284D9; Tue, 7 Mar 2017 10:41:22 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8F4AE284CC for ; Tue, 7 Mar 2017 10:41:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=UsMKZS5aTPNRrHu1TOgSpNZdG5k0V0RUtDxkEBudQsk=; b=Dmr 1UPAhcy1g2ENp4ohAO6JfUVnkgWXRv9cwCfl8FodbVsZUFyBs5G2lpl7jy5TBvygw6e+HtniPAzCs w+tVAZ7pNejZkTfogqCX4r5UZ3jFmhXlDsNOaciNdQS3Jcv3uzlakdkXM7AqoR0D+meAmYixBU6p7 cFwSuhYvXiL8KqzOEXXjq7nk5fEow0+aYKMhUPSvWGsSK5a1ARSMLQklEc98GzwW4WWkY4O3EaNGS VG6araBOm6HxgaD28/rGNgV8ivf5B5Fq2tni/71tzHaQHPUWCRBWYXyoa46hl2i4vQKiwt2W8DQ3s pTVBXEUEcdsT6gPJqj0G+tGOAc7sOEA==; 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 1clCYP-0003sy-66; Tue, 07 Mar 2017 10:41:17 +0000 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1clCXz-0003pU-VT for linux-arm-kernel@lists.infradead.org; Tue, 07 Mar 2017 10:40:53 +0000 Received: by mail-wm0-x235.google.com with SMTP id v186so85954623wmd.0 for ; Tue, 07 Mar 2017 02:40:31 -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=F3bbTjXQR9LIla8dY8BPH8Cwp2CWdHDvwU99o7kNxYk=; b=0SVCJlf7Ngs0aBnek/Xx910s0lWKys6sgaGneuDbUc8YXjGIdHRCwwNeMZltz7lYiQ ecZBGEyUZs73vjRKknOXh+81PANIoRT+l2Fg7jkqnTr66yYg1nFKu32/CNFfKXFlO5jA bOtWWeMsWYxFxgxM4X1Ah1Te+8xWMr3Mkd8d80QBvvjm6dcr2WijoRHMZwrflHC+M1uX fFjjQ/Se5KAkM/ytoMjEb7cYORPoz2GUkH185Z30kwClgJ1VCCB37oZy6c3b6mWiYU4p jd4MpFgm68dtiGM1zw8+6fiXeAQTYQJB4d/45HS/z0LN7yiwGLmKJlKNE2zkm1ybZWnq f1tw== 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=F3bbTjXQR9LIla8dY8BPH8Cwp2CWdHDvwU99o7kNxYk=; b=GnOdA9zDvg9OQEarENHF9IjAzSyo/Fw9Wvydt7eMy9b6LHwLXYTa9qsR8L5Vz/hPFg acfC8fZF+khU2jAkOoxgiz3+eIk9Ar5Ly5QZziNlNeZrbV2ak/zRjcpfN37vcHjaK2jK fg33Dnx/qIkRQPOQp3zCOdjjqQ0mY1LrGs2+KiEQ87zGhKaG09e+4c34bg6cwSWnnhLm 5TVLT/W2fiEt+KgQBw+BVD78G7pNT+1fY/Z050IjgaafT/BJ9FXfJpRiDYCMDGHZ6AeQ 95AEicOIanbocJzGl05DnBhTDRdVFcU9U5tJM7Az/YyQnSjuZg1B923cbbz9P7C0DURM cVNg== X-Gm-Message-State: AMke39nUtijzKesz4fSZYmvDWzHry0YHXjysP0w+QxESKM+tBqa66fO8cEk5uXKFGVqtXbRk X-Received: by 10.28.8.213 with SMTP id 204mr148473wmi.100.1488883229272; Tue, 07 Mar 2017 02:40:29 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id g45sm12766607wrd.11.2017.03.07.02.40.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Mar 2017 02:40:28 -0800 (PST) From: Neil Armstrong To: khilman@baylibre.com, carlo@caione.org Subject: [PATCH] ARM64: dts: meson-gx: Add Buttons to Q200 and P230 boards Date: Tue, 7 Mar 2017 11:40:22 +0100 Message-Id: <1488883222-23320-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-20170307_024052_176576_37E99C9C X-CRM114-Status: GOOD ( 10.60 ) 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 This patch adds support for the P230 and Q200 ADC laddered button and GPIO button. Signed-off-by: Neil Armstrong --- .../boot/dts/amlogic/meson-gxl-s905d-p230.dts | 40 ++++++++++++++++++++++ arch/arm64/boot/dts/amlogic/meson-gxm-q200.dts | 40 ++++++++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts index f66939c..a97d17d 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts @@ -43,12 +43,47 @@ /dts-v1/; +#include + #include "meson-gxl-s905d.dtsi" #include "meson-gx-p23x-q20x.dtsi" / { compatible = "amlogic,p230", "amlogic,s905d", "amlogic,meson-gxl"; model = "Amlogic Meson GXL (S905D) P230 Development Board"; + + adc-keys { + compatible = "adc-keys"; + io-channels = <&saradc 0>; + io-channel-names = "buttons"; + keyup-threshold-microvolt = <1710000>; + + button-function { + label = "Update"; + linux,code = ; + press-threshold-microvolt = <10000>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <100>; + + button@0 { + label = "power"; + linux,code = ; + gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>; + }; + }; + + vddio_ao18: regulator-vddio_ao18 { + compatible = "regulator-fixed"; + regulator-name = "VDDIO_AO18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; }; /* P230 has exclusive choice between internal or external PHY */ @@ -75,3 +110,8 @@ max-speed = <1000>; }; }; + +&saradc { + status = "okay"; + vref-supply = <&vddio_ao18>; +}; diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-q200.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-q200.dts index 5dbc660..a2f2908 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxm-q200.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxm-q200.dts @@ -43,12 +43,47 @@ /dts-v1/; +#include + #include "meson-gxm.dtsi" #include "meson-gx-p23x-q20x.dtsi" / { compatible = "amlogic,q200", "amlogic,s912", "amlogic,meson-gxm"; model = "Amlogic Meson GXM (S912) Q200 Development Board"; + + adc-keys { + compatible = "adc-keys"; + io-channels = <&saradc 0>; + io-channel-names = "buttons"; + keyup-threshold-microvolt = <1710000>; + + button-function { + label = "Update"; + linux,code = ; + press-threshold-microvolt = <10000>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <100>; + + button@0 { + label = "power"; + linux,code = ; + gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>; + }; + }; + + vddio_ao18: regulator-vddio_ao18 { + compatible = "regulator-fixed"; + regulator-name = "VDDIO_AO18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; }; /* Q200 has exclusive choice between internal or external PHY */ @@ -75,3 +110,8 @@ max-speed = <1000>; }; }; + +&saradc { + status = "okay"; + vref-supply = <&vddio_ao18>; +};