From patchwork Sun Jan 15 22:42:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 9517937 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 B8D6B601B7 for ; Sun, 15 Jan 2017 22:43:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8109E28428 for ; Sun, 15 Jan 2017 22:43:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7562328450; Sun, 15 Jan 2017 22:43:42 +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_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,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 8001528428 for ; Sun, 15 Jan 2017 22:43:41 +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 1cStWW-00067y-B7; Sun, 15 Jan 2017 22:43:40 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cStVt-00053r-0Y; Sun, 15 Jan 2017 22:43:05 +0000 Received: by mail-wm0-x243.google.com with SMTP id r126so26711789wmr.3; Sun, 15 Jan 2017 14:42:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Cuy1dkOUNIc5QESSMaG1UdVPZiik7dohx1QRKm+P/l4=; b=lDbiglnt8+kfl2moixPQprXVW/xcgLY+Rh4sk9+IAM/8DKOzLuNJCXVAOi7p5Moa05 Ik77LJ8veY7MnyIQkGR/H7LplH6JDMZJthqDUxEjuqta+iRvA2ipHWcZOVplazY5TDY5 XVEQab9eb/6SLID4kUZIqmurHWHsmgq7MiRzIBY59bjqj7RVotnc2LPdzwMXURMo6Kmq De1Gn8AjS3aTlPbTRtDFLa9irnc7N8wZBrJNWU5x1frSeEHYDv1cGOyAM3/VL1TCjAh0 En6ribBOCECtg2/NzLV4xEAd3kMTMlE/eA5UNrKHW4ODavPgOGzcqFQhgE5LqGA9hhI9 Imyw== 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:in-reply-to :references; bh=Cuy1dkOUNIc5QESSMaG1UdVPZiik7dohx1QRKm+P/l4=; b=AeDf24icC+sKlPJQLvtdHUl1VFoccRQbt1AmDslazMJBXu7dCLHIp+775jNjghX30o WOsR/TxmY+k8qTAn5xDVIOqOnoI5R3IB+Tzb1B9Svra7nGuylVgZiKxBFBPRMnmcdLsn zm2MtyKba6Iw/3wFCnDLP+iGScFZ/fak7i1oBQrFSvlOtKAmAIhI5zociNKaDFNZPebD UxgOiNe6rpLKua8Fss4BQDQK14n1iG1Qs96tGtOQXAEOGDY4W+q0IaxtlA7lnEDgBm5L ubx83I2T2IHNmKXkIxxP8XqSw2qGziQ66faEGQL9/+Jl8MYZGDVdVvIv/PWgCY09F4k7 RSXg== X-Gm-Message-State: AIkVDXJ0XSmldD24N+YJotuVRZDjGTBRMqCsmMltM9T7qznV+lUaQmJM5GR6N61wKEFjyw== X-Received: by 10.223.148.2 with SMTP id 2mr4765568wrq.75.1484520159579; Sun, 15 Jan 2017 14:42:39 -0800 (PST) Received: from blackbox.darklights.net (p5DE38740.dip0.t-ipconnect.de. [93.227.135.64]) by smtp.googlemail.com with ESMTPSA id y97sm24109827wmh.24.2017.01.15.14.42.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Jan 2017 14:42:38 -0800 (PST) From: Martin Blumenstingl To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, robh+dt@kernel.org, mark.rutland@arm.com, khilman@baylibre.com, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org Subject: [PATCH v2 4/4] ARM64: dts: meson: meson-gx: add the SAR ADC Date: Sun, 15 Jan 2017 23:42:21 +0100 Message-Id: <20170115224221.15510-5-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170115224221.15510-1-martin.blumenstingl@googlemail.com> References: <20170111174334.24343-1-martin.blumenstingl@googlemail.com> <20170115224221.15510-1-martin.blumenstingl@googlemail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170115_144301_546615_45121614 X-CRM114-Status: UNSURE ( 9.13 ) X-CRM114-Notice: Please train this message. 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: narmstrong@baylibre.com, Martin Blumenstingl , catalin.marinas@arm.com, mturquette@baylibre.com, will.deacon@arm.com, carlo@caione.org, sboyd@codeaurora.org, linux-arm-kernel@lists.infradead.org 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 SAR ADC to meson-gxbb.dtsi and meson-gxl.dtsi. GXBB provides a 10-bit ADC while GXL (and GXM, which uses the same ADC as GXL) provides a 12-bit ADC. Some boards use resistor ladder buttons connected through one of the ADC channels. On newer devices (GXL and GXM) some boards use pull-ups/downs to change the resistance (and thus the ADC value) on of the ADC channels to indicate the board revision. Signed-off-by: Martin Blumenstingl --- arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 8 ++++++++ arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 10 ++++++++++ arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 10 ++++++++++ 3 files changed, 28 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi index cddad8c795ec..041e4f0ed7d7 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi @@ -237,6 +237,14 @@ status = "disabled"; }; + saradc: adc@8680 { + compatible = "amlogic,meson-saradc"; + #io-channel-cells = <1>; + status = "disabled"; + reg = <0x0 0x8680 0x0 0x34>; + interrupts = ; + }; + pwm_ef: pwm@86c0 { compatible = "amlogic,meson-gx-pwm", "amlogic,meson-gxbb-pwm"; reg = <0x0 0x086c0 0x0 0x10>; diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi index 5d686334f692..114d7e1c9fc0 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi @@ -429,6 +429,16 @@ clocks = <&clkc CLKID_I2C>; }; +&saradc { + compatible = "amlogic,meson-gxbb-saradc", "amlogic,meson-saradc"; + clocks = <&xtal>, + <&clkc CLKID_SAR_ADC>, + <&clkc CLKID_SANA>, + <&clkc CLKID_SAR_ADC_CLK>, + <&clkc CLKID_SAR_ADC_SEL>; + clock-names = "clkin", "core", "sana", "adc_clk", "adc_sel"; +}; + &sd_emmc_a { clocks = <&clkc CLKID_SD_EMMC_A>, <&xtal>, diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi index bb2842f8a08f..6b63296b6c60 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi @@ -273,6 +273,16 @@ clocks = <&clkc CLKID_I2C>; }; +&saradc { + compatible = "amlogic,meson-gxl-saradc", "amlogic,meson-saradc"; + clocks = <&xtal>, + <&clkc CLKID_SAR_ADC>, + <&clkc CLKID_SANA>, + <&clkc CLKID_SAR_ADC_CLK>, + <&clkc CLKID_SAR_ADC_SEL>; + clock-names = "clkin", "core", "sana", "adc_clk", "adc_sel"; +}; + &sd_emmc_a { clocks = <&clkc CLKID_SD_EMMC_A>, <&xtal>,