From patchwork Sat Jan 21 14:42:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 9530273 X-Patchwork-Delegate: geert@linux-m68k.org 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 CF49E6046A for ; Sat, 21 Jan 2017 14:42:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0CA828459 for ; Sat, 21 Jan 2017 14:42:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF543284D6; Sat, 21 Jan 2017 14:42:51 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 117AC284D6 for ; Sat, 21 Jan 2017 14:42:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751239AbdAUOmi (ORCPT ); Sat, 21 Jan 2017 09:42:38 -0500 Received: from mail-oi0-f66.google.com ([209.85.218.66]:33889 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751222AbdAUOmc (ORCPT ); Sat, 21 Jan 2017 09:42:32 -0500 Received: by mail-oi0-f66.google.com with SMTP id w144so7604195oiw.1; Sat, 21 Jan 2017 06:42:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=EX3vQs/9EXyyFWfk8dDPrt34QIDom1V4o0o3/+X8DhQ=; b=D1R5CIz/Xbh/JeNaq/uZuWZBJ0ExUdUH1G8tK9zbdFT6rwLSfXgRBrxJh/ZbnmSnu5 8u1KNgOwtTSFpM01nvLxhu/sQsCktXh7Avrv3d1EZ0FSOK2jox/ODKn8xnbiBN2KXxEr flDDvbmYGlFfhnn+I8YyuCCproOuWtgBHtqaNt/Wyy9ljcF4poN0ez99WFxp+icp05rg OhFvnWyIYcmY8LB9UdQZuKPjBO2tBFGSJLyBQUjWANq9vYu8dyxvDG4ml8ZnkeX+bOQe pQo21fDFmlQ3oP9RUQlPWKs+t53MxKEHv387WDTlnR1QlDcxQIDPpJxsCTT2aUXTBWSH Nxgw== 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; bh=EX3vQs/9EXyyFWfk8dDPrt34QIDom1V4o0o3/+X8DhQ=; b=UtxpCxlz/3NA+WyBm1nL4ERdVMRrqO20U+akj1EuOzG1cAoSuet8PPwcYwKTWxRT2t btkK5xEs0YU0r0MA1zR4ybUro8wAY6+LoSu2l9zgDj/IV1w4DlEY1oJdY8PTJX9LUoG0 vPQ5R5h2uGBIp4uAadCMfgWoPUSXXj4Mqh/lPO0Lv75Bd0+fsmQKaf4ZZZMNZl+hm8rX f5ZZyby5SfhbPOSwCwAx3SionhQwAllRaKCPheLTBBIkEEKYidXNbP9ZR5scpepk0s4Q CqTZAP/D/ioZcYtyiI9stFeN2bvBozO6k54cQpPCRPapVEmwKqS+9HxugjwXOmMC8UnZ 91QA== X-Gm-Message-State: AIkVDXKd+KQryIvxE3jgY4ar0Ux4ZUBLQafNr5mHspLnhIla+Hi1cW8JNfIbVZf5+YPuHw== X-Received: by 10.202.168.150 with SMTP id r144mr9941256oie.178.1485009746004; Sat, 21 Jan 2017 06:42:26 -0800 (PST) Received: from kurokawa.lan ([195.140.253.167]) by smtp.gmail.com with ESMTPSA id v31sm5558647ota.26.2017.01.21.06.42.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Jan 2017 06:42:25 -0800 (PST) From: Marek Vasut To: linux-iio@vger.kernel.org Cc: Marek Vasut , Geert Uytterhoeven , Simon Horman , Jonathan Cameron , linux-renesas-soc@vger.kernel.org, Wolfram Sang , Rob Herring , devicetree@vger.kernel.org Subject: [PATCH 1/2] iio: adc: Add Renesas GyroADC bindings Date: Sat, 21 Jan 2017 15:42:11 +0100 Message-Id: <20170121144212.8858-1-marek.vasut@gmail.com> X-Mailer: git-send-email 2.11.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add DT bindings for the Renesas RCar GyroADC block. This block is a simple 4/8-channel ADC which samples 12/15/24 bits of data every cycle from all channels. Signed-off-by: Marek Vasut Cc: Geert Uytterhoeven Cc: Simon Horman Cc: Jonathan Cameron Cc: linux-renesas-soc@vger.kernel.org Cc: Wolfram Sang Cc: Rob Herring Cc: devicetree@vger.kernel.org --- .../bindings/iio/adc/renesas,gyroadc.txt | 93 ++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt diff --git a/Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt b/Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt new file mode 100644 index 000000000000..081947367135 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt @@ -0,0 +1,93 @@ +* Renesas RCar GyroADC device driver + +Required properties: +- compatible: Should be "renesas,-gyroadc", "renesas,rcar-gyroadc". + Use "renesas,r8a7792-gyroadc" for a GyroADC with interrupt + block found in R8A7792. +- reg: Address and length of the register set for the device +- clocks: References to all the clocks specified in the clock-names + property as specified in + Documentation/devicetree/bindings/clock/clock-bindings.txt. +- clock-names: Shall contain "fck" and "if". The "fck" is the GyroADC block + clock, the "if" is the interface clock. +- power-domains: Must contain a reference to the PM domain, if available. +- #address-cells: Should be <1> (setting for the subnodes) for all ADCs + except for "fujitsu,mb88101a". Should be <0> (setting for + only subnode) for "fujitsu,mb88101a". +- #size-cells: Should be <0> (setting for the subnodes) + +Sub-nodes: +Optionally you can define subnodes which select the connected ADC type and +reference voltage for the GyroADC channels. + +Required properties for subnodes: +- compatible: Should be either of: + "fujitsu,mb88101a" + - Fujitsu MB88101A compatible mode, + 12bit sampling, up to 4 channels can be sampled in + round-robin fashion. One Fujitsu chip supplies four + GyroADC channels with data as it contains four ADCs + on the chip and thus for 4-channel operation, single + MB88101A is required. The Cx chipselect lines of the + MB88101A connect directly to two CHS lines of the + GyroADC, no demuxer is required. The data out line + of each MB88101A connects to a shared input pin of + the GyroADC. + "ti,adcs7476" or "ti,adc121" or "adi,ad7476" + - TI ADCS7476 / TI ADC121 / ADI AD7476 compatible mode, + 15bit sampling, up to 8 channels can be sampled in + round-robin fashion. One TI/ADI chip supplies single + ADC channel with data, thus for 8-channel operation, + 8 chips are required. A 3:8 chipselect demuxer is + required to connect the nCS line of the TI/ADI chips + to the GyroADC, while MISO line of each TI/ADI ADC + connects to a shared input pin of the GyroADC. + "maxim,max1162" or "maxim,max11100" + - Maxim MAX1162 / Maxim MAX11100 compatible mode, + 16bit sampling, up to 8 channels can be sampled in + round-robin fashion. One Maxim chip supplies single + ADC channel with data, thus for 8-channel operation, + 8 chips are required. A 3:8 chipselect demuxer is + required to connect the nCS line of the MAX chips + to the GyroADC, while MISO line of each Maxim ADC + connects to a shared input pin of the GyroADC. +- reg: Should be the number of the analog input. Should be present + for all ADCs except "fujitsu,mb88101a". +- vref-supply: Reference to the channel reference voltage regulator. + +Example: + vref_max1162: regulator-vref-max1162 { + compatible = "regulator-fixed"; + + regulator-name = "MAX1162 Vref"; + regulator-min-microvolt = <4096000>; + regulator-max-microvolt = <4096000>; + }; + + &adc { + compatible = "renesas,r8a7791-gyroadc", "renesas,rcar-gyroadc"; + reg = <0 0xe6e54000 0 64>; + clocks = <&mstp9_clks R8A7791_CLK_GYROADC>, <&clk_65m>; + clock-names = "fck", "if"; + power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; + + pinctrl-0 = <&adc_pins>; + pinctrl-names = "default"; + + status = "okay"; + + #address-cells = <1>; + #size-cells = <0>; + + adc@0 { + reg = <0>; + compatible = "maxim,max1162"; + vref-supply = <&vref_max1162>; + }; + + adc@1 { + reg = <1>; + compatible = "maxim,max1162"; + vref-supply = <&vref_max1162>; + }; + };