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: 9510851 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 B2F9D6075C for ; Wed, 11 Jan 2017 17:44:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A59B1284E6 for ; Wed, 11 Jan 2017 17:44:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A327285BB; Wed, 11 Jan 2017 17:44:52 +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 5CB93284E6 for ; Wed, 11 Jan 2017 17:44:52 +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 1cRMx5-00071Z-LV; Wed, 11 Jan 2017 17:44:47 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cRMwX-0005ww-7x; Wed, 11 Jan 2017 17:44:15 +0000 Received: by mail-wm0-x241.google.com with SMTP id c85so37842427wmi.1; 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=TbjwRCpQj9jlVeCxC/s/31zw+JzCqqy1FAkiJ60mwmz7bllqO30i2PGSsz4l20uKNo 862zheWuwg4y1Z8kkBSMJssF7bjQRGVZEJNSFjJOVV9OYoELp7TmtzK78TQ/CaGvLkng SiwFgLabrClz15cAG+v+0BhUA+beGeLgQqqzIXE5kTS+CeqYD9EnR9ctQLSomu96relg qkgrVFiBl07KzOEoe7OdWR0fJpPMW6oVT+pfRtewanKgIFZKWfv4GRxc2lArfmZLKtgW 3Nsab++x8B0BEYyTXuNIftRw9lg/O1eUHfgJ8ayfdWulmz4UUmeP8PFYQFrlx7qr3Yn4 uTxA== X-Gm-Message-State: AIkVDXIvoJaUTMRJLJisjemMnvVMjz0Sgi88Q1tMaZZge2nlrMfJ2JWAzjBGf7Eq0WfAgg== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170111_094413_493460_E9B43D87 X-CRM114-Status: UNSURE ( 9.24 ) 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..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>,