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: 9517915 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 56E22601B7 for ; Sun, 15 Jan 2017 22:42:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1EE9A28428 for ; Sun, 15 Jan 2017 22:42:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 13C5F28450; Sun, 15 Jan 2017 22:42:44 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A87A328428 for ; Sun, 15 Jan 2017 22:42:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751377AbdAOWmm (ORCPT ); Sun, 15 Jan 2017 17:42:42 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33762 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751068AbdAOWml (ORCPT ); Sun, 15 Jan 2017 17:42:41 -0500 Received: by mail-wm0-f65.google.com with SMTP id r144so26707718wme.0; 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=O1lEvyhApqkm2VNZKCumhOIp3UTX5cb5U7+FHkT/Kd5LAdC6zmN8huK+I+OyPFc1+Y B1TIm4Y8bTF/ZlKIc476p3DWZK2O7MRkntATtuy+AJ8HJamLm1SmhqvK7o/FAxK0Yi2z QzXYUE7HoV/LYlj400KnX3+PZDiJkUwU/zKP//Jz8Fiu8vS2mxuIt0i++T5qZt2aYuTj wKeA4FWydyQs2H+y/qsffSPfKD08clykQ37+2Wr/KpHpvlBd4ouo9ggXZpWNZSNlobi0 AXprbHb+MEvaS/INketoAX37Cg3PAgkYFL3lg6D5QWOyxATZ6NFOxLFNXXxJDMKfgwX4 aRYQ== X-Gm-Message-State: AIkVDXIHzKGGbreR7M7IflpYnBtw0BNuKkpI7XOnfKxRVCxLxVWF/kRiuj2rzLMPiywafg== 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 Cc: carlo@caione.org, catalin.marinas@arm.com, will.deacon@arm.com, mturquette@baylibre.com, sboyd@codeaurora.org, narmstrong@baylibre.com, linux-arm-kernel@lists.infradead.org, Martin Blumenstingl 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> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.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>,