From patchwork Sun Jan 22 18:17:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 9531341 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 9475F6020B for ; Sun, 22 Jan 2017 18:20:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83DA027FAC for ; Sun, 22 Jan 2017 18:20:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7737D27FB3; Sun, 22 Jan 2017 18:20:32 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=no 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 0F8BA27FB1 for ; Sun, 22 Jan 2017 18:20:32 +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 1cVMkc-00088p-EO; Sun, 22 Jan 2017 18:20:26 +0000 Received: from mail-wm0-f68.google.com ([74.125.82.68]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cVMj3-0006d0-Rb; Sun, 22 Jan 2017 18:18:51 +0000 Received: by mail-wm0-f68.google.com with SMTP id r126so20743344wmr.3; Sun, 22 Jan 2017 10:18:29 -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 :mime-version:content-transfer-encoding; bh=68i1lXCmOLCfcZTIkzaKdZ/KunnTSWBSdKNull9ilz4=; b=tlYJA17WHw4bFhixUX2ULXy/WpDwiH90qkJT4R++5GNEdyx298lDmDT84HsORc/0zU 7q/jhsbnaUaOdfGBYW3103Wel/oGzfNWO19IMqeE0hTbXKhs14AGTUIwtGW698Nbma21 Ek/fj3xzcDXJUz9sFKHRh6A6k70Yf8jlNE7coTgIh69U/A9P2P2orboGd3fLkFciTBA+ pVl9du8yNnAmoHSy0ClMq4A/LsHSg0NPiOqZEtOJnMfHK87CeTbhlvNy8LWa5ZbzWjG3 p/qonWOs0wsCj52awIpoSBR3dajwmjkqb9XR/P1rOT1YL5cxa7Pbl18GJ4Y+D9Q+DhkX Wpug== 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:mime-version:content-transfer-encoding; bh=68i1lXCmOLCfcZTIkzaKdZ/KunnTSWBSdKNull9ilz4=; b=Qa2R4ipbnjxEMchlTWQbWwFg7aKiMVGl9uty1Io4kf3EejMphzaO9nbvnF9eiDnpeX 4LV3R2wuVHyXuf/nlNxu2g+TKYNqKzdjSCE5/0oVxNuuAa950RY7JS8pXCDu4x2N/bYh J3nDAqlAgHWZ3or+hS0ib9rrvgQCIf6q6EReYSDBdBU49XcIh+v6Ke21KyURg30sT5ML hyH699VJiMRQK+1laqMb2BUBe8KLescHBxi6c2OcOddBX9+xa22RcDnmy+/fEhZx+uOD N13D7pHkMz+geXkWQ+Ko+LCTuwW1xC+5Y7SGSGTXzAdDdMxyV7zt247rEVeLfmAjDztH sNkg== X-Gm-Message-State: AIkVDXIAY42P7F5+7Lfws1dqv12BBYMql4BfISaGdCm1VyevRtrFB2LDwtz1e8UOgYWwLQ== X-Received: by 10.28.224.10 with SMTP id x10mr11386390wmg.134.1485109048410; Sun, 22 Jan 2017 10:17:28 -0800 (PST) Received: from blackbox.darklights.net (p200300DCD3E0200408A0F52CBA7B1138.dip0.t-ipconnect.de. [2003:dc:d3e0:2004:8a0:f52c:ba7b:1138]) by smtp.googlemail.com with ESMTPSA id s17sm10639503wrc.6.2017.01.22.10.17.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Jan 2017 10:17:27 -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 Subject: [PATCH v4 3/3] ARM64: dts: meson: meson-gx: add the SAR ADC Date: Sun, 22 Jan 2017 19:17:14 +0100 Message-Id: <20170122181714.6259-4-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170122181714.6259-1-martin.blumenstingl@googlemail.com> References: <20170122181714.6259-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170122_101850_121156_AB6C9D6E X-CRM114-Status: UNSURE ( 8.17 ) 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, will.deacon@arm.com, carlo@caione.org, linux-arm-kernel@lists.infradead.org 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 provide 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 one of the ADC channels to indicate the board revision. Signed-off-by: Martin Blumenstingl Tested-by: Neil Armstrong Reviewed-by: Andreas Färber --- 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 ++++++++++ arch/arm64/boot/dts/amlogic/meson-gxm.dtsi | 4 ++++ 4 files changed, 32 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi index df10d4507ca9..c76a690967f8 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"; + reg = <0x0 0x8680 0x0 0x34>; + #io-channel-cells = <1>; + interrupts = ; + status = "disabled"; + }; + 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 5c22c794ed95..3f70cfcb9682 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi @@ -490,6 +490,16 @@ }; }; +&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 afa74455e1de..b0070489e179 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi @@ -340,6 +340,16 @@ }; }; +&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>, diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxm.dtsi index 78a004d13236..fba3c76c78a6 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxm.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gxm.dtsi @@ -117,6 +117,10 @@ }; }; +&saradc { + compatible = "amlogic,meson-gxm-saradc", "amlogic,meson-saradc"; +}; + &scpi_dvfs { clock-indices = <0 1>; clock-output-names = "vbig", "vlittle";