From patchwork Wed Jan 11 17:43:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 9510835 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 A80276075C for ; Wed, 11 Jan 2017 17:43:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A59228512 for ; Wed, 11 Jan 2017 17:43:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F33C28619; Wed, 11 Jan 2017 17:43:58 +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 2EEE528512 for ; Wed, 11 Jan 2017 17:43:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030988AbdAKRn4 (ORCPT ); Wed, 11 Jan 2017 12:43:56 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:36265 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030998AbdAKRnz (ORCPT ); Wed, 11 Jan 2017 12:43:55 -0500 Received: by mail-wm0-f67.google.com with SMTP id r126so17807117wmr.3; Wed, 11 Jan 2017 09:43:54 -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=R9pmsrRc7MmIYJxWZFH/18LpyN0/Ry35ACC15zV1w+Q=; b=FBrYMx17uuDYb+cDTjHqInz4WTHG+KdN7C7eK3ROf7tO741cI7pd/X5aQvxGK7m1kj 9usfn990918V9K48yct6lQe5wwOsRfBml35p56I7rWsEHfcAozb/IR5NB+1sJW1N2STX 411ie0cC6O3C/b+s1sRBAOWSF/cbHwOLBy22+EK+Q1NTe6er3NPQmSWrCo1MPcr+8u58 6VmE1EXHgBsSX/06IyRTOXTwJJpxn4EEEo8xSzzwWJcEoOGG2yxfzEbnno14TVDOSVMS mhHh5iONLOH8Wfd+ylKShdSit/iKIVGG504h8QAls7twi8Sv1JzZUt4iRblXTxJqnvZP /1oQ== 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=R9pmsrRc7MmIYJxWZFH/18LpyN0/Ry35ACC15zV1w+Q=; b=PSv4Vkg8coaadHvg0W5yA9yWsnQX/HfkrkZr7QHEvo6Z5uo/Jsd7se6Cydflmp0nlZ qayNgR0fU/A83dULwayl0ZMYVTb8dpUo4TK3G1QOv9GmgaUkEsvLr/gdwCxUlBzp2bFO npCEK8fRcXVJgQXhhJ1vL/gjb+oH2bcUJt0CJ4mDwZhj3fRULU61FSUU5CNvuMRx4LJQ 0woydGG58R+kf6+W1hnH+zpOXvgYQKRrsowcZLIRKe21lIZXw/jOk4S5ueBeqE/dHWtl nFkunUBQ9uka9Qi0ItfJLaCQfF1K5Ah1iFG8/CFwBhtruSfUQutiPDFaM+X0lbhG0tKZ FEfw== X-Gm-Message-State: AIkVDXKqEH41noq7PpSTezh9+XmV1O+eLB7CAvwTBAvdcygG5ttqS+N9cQXJS10zQYGVKg== X-Received: by 10.28.5.2 with SMTP id 2mr5892543wmf.78.1484156633298; Wed, 11 Jan 2017 09:43:53 -0800 (PST) Received: from blackbox.darklights.net (p5DE3863D.dip0.t-ipconnect.de. [93.227.134.61]) by smtp.googlemail.com with ESMTPSA id wp2sm9582307wjc.35.2017.01.11.09.43.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jan 2017 09:43:52 -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 4/4] ARM64: dts: meson: meson-gx: add the SAR ADC Date: Wed, 11 Jan 2017 18:43:34 +0100 Message-Id: <20170111174334.24343-5-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170111174334.24343-1-martin.blumenstingl@googlemail.com> References: <20170111174334.24343-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..ed3bf29eb76a 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>,