From patchwork Sat Oct 31 18:12:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11871543 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9A400921 for ; Sat, 31 Oct 2020 18:14:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E92C206D5 for ; Sat, 31 Oct 2020 18:14:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168098; bh=NMc1PNAZQxUSeAZbY3Gczu/MXpIt6te8IgTivcFzDlc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Y89KZQzqD8mP5my9RjfKJ0iaGMN6QfZ1xHG4Oyp/fhx/TpBQ5IE0ZuIYrBmm5tbGM blfy1BmB7toCntPJY4QJ37brM7dhT1r2OYg78LOWYFqKk+jevVhWRVAfblJWZ56ZI1 TZbZ92tBYB0ZWHQX7JJ3esaG8Qi+gSxBqRePx3kI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728316AbgJaSOy (ORCPT ); Sat, 31 Oct 2020 14:14:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:46106 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728263AbgJaSOy (ORCPT ); Sat, 31 Oct 2020 14:14:54 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BD764206F9; Sat, 31 Oct 2020 18:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168093; bh=NMc1PNAZQxUSeAZbY3Gczu/MXpIt6te8IgTivcFzDlc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fkz5vcgT87Abb7uu9li5CAvBaM6/gaRoIhxKika5fpxmeKgt1Mm9Zine6ygjqNa/Y sQTKUuMv1zh0XjDEluSTGcNCYKS5jrYzUUXk4Zwn9c+/wsiO7risJsJBLqvfP/hnL9 7voKoy/FK1ZeOV1ySNIUdSaf4C6cguibIVj38MxM= From: Jonathan Cameron To: linux-iio@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org Cc: Jonathan Cameron Subject: [PATCH 01/10] dt-bindings:iio:iio-binding.txt Drop file as content now in dt-schema Date: Sat, 31 Oct 2020 18:12:33 +0000 Message-Id: <20201031181242.742301-2-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201031181242.742301-1-jic23@kernel.org> References: <20201031181242.742301-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron File contained generic IIO wide bindings. Now part of the external dt-schema repository. Signed-off-by: Jonathan Cameron --- .../devicetree/bindings/iio/iio-bindings.txt | 102 ------------------ 1 file changed, 102 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/iio-bindings.txt b/Documentation/devicetree/bindings/iio/iio-bindings.txt deleted file mode 100644 index aa63cac7323e..000000000000 --- a/Documentation/devicetree/bindings/iio/iio-bindings.txt +++ /dev/null @@ -1,102 +0,0 @@ -This binding is derived from clock bindings, and based on suggestions -from Lars-Peter Clausen [1]. - -Sources of IIO channels can be represented by any node in the device -tree. Those nodes are designated as IIO providers. IIO consumer -nodes use a phandle and IIO specifier pair to connect IIO provider -outputs to IIO inputs. Similar to the gpio specifiers, an IIO -specifier is an array of one or more cells identifying the IIO -output on a device. The length of an IIO specifier is defined by the -value of a #io-channel-cells property in the IIO provider node. - -[1] https://marc.info/?l=linux-iio&m=135902119507483&w=2 - -==IIO providers== - -Required properties: -#io-channel-cells: Number of cells in an IIO specifier; Typically 0 for nodes - with a single IIO output and 1 for nodes with multiple - IIO outputs. - -Optional properties: -label: A symbolic name for the device. - - -Example for a simple configuration with no trigger: - - adc: voltage-sensor@35 { - compatible = "maxim,max1139"; - reg = <0x35>; - #io-channel-cells = <1>; - label = "voltage_feedback_group1"; - }; - -Example for a configuration with trigger: - - adc@35 { - compatible = "some-vendor,some-adc"; - reg = <0x35>; - - adc1: iio-device@0 { - #io-channel-cells = <1>; - /* other properties */ - }; - adc2: iio-device@1 { - #io-channel-cells = <1>; - /* other properties */ - }; - }; - -==IIO consumers== - -Required properties: -io-channels: List of phandle and IIO specifier pairs, one pair - for each IIO input to the device. Note: if the - IIO provider specifies '0' for #io-channel-cells, - then only the phandle portion of the pair will appear. - -Optional properties: -io-channel-names: - List of IIO input name strings sorted in the same - order as the io-channels property. Consumers drivers - will use io-channel-names to match IIO input names - with IIO specifiers. -io-channel-ranges: - Empty property indicating that child nodes can inherit named - IIO channels from this node. Useful for bus nodes to provide - and IIO channel to their children. - -For example: - - device { - io-channels = <&adc 1>, <&ref 0>; - io-channel-names = "vcc", "vdd"; - }; - -This represents a device with two IIO inputs, named "vcc" and "vdd". -The vcc channel is connected to output 1 of the &adc device, and the -vdd channel is connected to output 0 of the &ref device. - -==Example== - - adc: max1139@35 { - compatible = "maxim,max1139"; - reg = <0x35>; - #io-channel-cells = <1>; - }; - - ... - - iio-hwmon { - compatible = "iio-hwmon"; - io-channels = <&adc 0>, <&adc 1>, <&adc 2>, - <&adc 3>, <&adc 4>, <&adc 5>, - <&adc 6>, <&adc 7>, <&adc 8>, - <&adc 9>; - }; - - some_consumer { - compatible = "some-consumer"; - io-channels = <&adc 10>, <&adc 11>; - io-channel-names = "adc1", "adc2"; - }; From patchwork Sat Oct 31 18:12:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11871541 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8759E921 for ; Sat, 31 Oct 2020 18:14:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6782220723 for ; Sat, 31 Oct 2020 18:14:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168097; bh=r/HMSSHlxN7A44SSKNFurR/Pa6IplZTBID1cSbgL6aM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=fGawVDSCWt5KbBYJGkN3Tj5QTJC4j9GKrlAGR4/Wn9A6UacKd7KAhbt8BvaIZaJ7D vkWSXYCUj7AsbD3OBt/oiicemZNfeLGFVjVjz0xKAgCtd+0CjAOhKXJ9p9OZOALiB8 uJ5LTbmewfcRl6jUGfAaigL3dL3biyFyBvE/T0+o= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728329AbgJaSO4 (ORCPT ); Sat, 31 Oct 2020 14:14:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:46120 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728324AbgJaSOz (ORCPT ); Sat, 31 Oct 2020 14:14:55 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0A69F206DD; Sat, 31 Oct 2020 18:14:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168095; bh=r/HMSSHlxN7A44SSKNFurR/Pa6IplZTBID1cSbgL6aM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a6sjw362l/vZIfp+FC6Ne5HEZHZPwT4MQ8E17CYl6Re4yyQa2jZXHODvVlX1lf41A 8brfG/NUVllV2DOCpxRWOmdSWAGTNirl6pw4zZaspWdsZa+B7qI71qjKgeXcA7IqLD 8UZGruB/pLiZq0LT/a9gATTAOWf6U6txGEYcliPk= From: Jonathan Cameron To: linux-iio@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org Cc: Jonathan Cameron , Peter Rosin Subject: [PATCH 02/10] dt-bindings:iio:dac:dpot-dac: yaml conversion. Date: Sat, 31 Oct 2020 18:12:34 +0000 Message-Id: <20201031181242.742301-3-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201031181242.742301-1-jic23@kernel.org> References: <20201031181242.742301-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron Txt to yaml format conversion. I dropped the example section describing the measurement ADC, as that isn't strictly part of this binding. Uses the new dt-schema/schema/iio/iio-consumer.yaml schema. Signed-off-by: Jonathan Cameron Cc: Peter Rosin --- .../devicetree/bindings/iio/dac/dpot-dac.txt | 41 ------------ .../devicetree/bindings/iio/dac/dpot-dac.yaml | 64 +++++++++++++++++++ 2 files changed, 64 insertions(+), 41 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/dac/dpot-dac.txt b/Documentation/devicetree/bindings/iio/dac/dpot-dac.txt deleted file mode 100644 index fdf47a01bfef..000000000000 --- a/Documentation/devicetree/bindings/iio/dac/dpot-dac.txt +++ /dev/null @@ -1,41 +0,0 @@ -Bindings for DAC emulation using a digital potentiometer - -It is assumed that the dpot is used as a voltage divider between the -current dpot wiper setting and the maximum resistance of the dpot. The -divided voltage is provided by a vref regulator. - - .------. - .-----------. | | - | vref |--' .---. - | regulator |--. | | - '-----------' | | d | - | | p | - | | o | wiper - | | t |<---------+ - | | | - | '---' dac output voltage - | | - '------+------------+ - -Required properties: -- compatible: Should be "dpot-dac" -- vref-supply: The regulator supplying the voltage divider. -- io-channels: Channel node of the dpot to be used for the voltage division. -- io-channel-names: Should be "dpot". - -Example: - - &i2c { - dpot: mcp4651-503@28 { - compatible = "microchip,mcp4651-503"; - reg = <0x28>; - #io-channel-cells = <1>; - }; - }; - - dac { - compatible = "dpot-dac"; - vref-supply = <®_3v3>; - io-channels = <&dpot 0>; - io-channel-names = "dpot"; - }; diff --git a/Documentation/devicetree/bindings/iio/dac/dpot-dac.yaml b/Documentation/devicetree/bindings/iio/dac/dpot-dac.yaml new file mode 100644 index 000000000000..6a7ca8e432d1 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/dac/dpot-dac.yaml @@ -0,0 +1,64 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/dac/dpot-dac.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: DAC emulation using a digital potentiometer + +maintainers: + - Peter Rosin + +description: | + It is assumed that the dpot is used as a voltage divider between the + current dpot wiper setting and the maximum resistance of the dpot. The + divided voltage is provided by a vref regulator. + + .------. + .-----------. | | + | vref |--' .---. + | regulator |--. | | + '-----------' | | d | + | | p | + | | o | wiper + | | t |<---------+ + | | | + | '---' dac output voltage + | | + '------+------------+ + +properties: + compatible: + const: dpot-dac + + vref-supply: + description: Regulator supplying the voltage divider. + + io-channels: + maxItems: 1 + description: | + Channel node of the dpot to be used for the voltage division. + + io-channel-names: + const: dpot + + "#io-channel-cells": + const: 1 + +required: + - compatible + - vref-supply + - io-channels + - io-channel-names + +additionalProperties: false + +examples: + - | + dac { + compatible = "dpot-dac"; + vref-supply = <®_3v3>; + io-channels = <&dpot 0>; + io-channel-names = "dpot"; + }; +... From patchwork Sat Oct 31 18:12:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11871545 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 11EE0921 for ; Sat, 31 Oct 2020 18:15:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E02C4206F9 for ; Sat, 31 Oct 2020 18:14:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168100; bh=bX04u/UP18oPfs0/Vp3t8E9k8/QrJPuuttCk4PPr5J4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=UBauKM3pfOml+BJ6XOe/i/jOuzdZnjt289B+8rdGLjbX5qRi51eVuW4MbfWDyjRu6 M7D3Y60NZqYeeIhFStkluej5M1hrpSPNw7GQULi11+bcf2l19V/eC9pbp7ON5zeqgz u+MRD6nJzfkG40cuONjhoa3H4Tx9F1EkI3WGZJuw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728324AbgJaSO6 (ORCPT ); Sat, 31 Oct 2020 14:14:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:46136 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728322AbgJaSO5 (ORCPT ); Sat, 31 Oct 2020 14:14:57 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7AAF6206E3; Sat, 31 Oct 2020 18:14:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168096; bh=bX04u/UP18oPfs0/Vp3t8E9k8/QrJPuuttCk4PPr5J4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E8vC0Z5neJjY0l4CnOJAp65Ddgj0HD8vZHUqoCsxNEJMK9GlPHLGH49BR+4yraMDU PC47wZAzxCpUV0+DmMxWFFsbjnh+4DWora9j+RfDOAW2ab0JMDIxFrYaluEH0VGgFd LKnoe+tDn7LASUbbPo90/N0Cl93O43MSbdQEo6CU= From: Jonathan Cameron To: linux-iio@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org Cc: Jonathan Cameron , Peter Rosin Subject: [PATCH 03/10] dt-bindings:iio:potentiometer: give microchip,mcp4531 its own binding Date: Sat, 31 Oct 2020 18:12:35 +0000 Message-Id: <20201031181242.742301-4-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201031181242.742301-1-jic23@kernel.org> References: <20201031181242.742301-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron We use this part in an example for the envelope detector. That showed that we need to allow for the #io-channel-cells property which trivial-devices.yaml does not. It doesn't make sense to add that property to trivial-devices as it only applies for those devices that can provide some sort of DAC or ADC service to another device driver. Hence solution will be to pull some IIO devices out to have their own file on a case by case basis. Signed-off-by: Jonathan Cameron Cc: Peter Rosin --- .../iio/potentiometer/microchip,mcp4531.yaml | 116 ++++++++++++++++ .../devicetree/bindings/trivial-devices.yaml | 128 ------------------ 2 files changed, 116 insertions(+), 128 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp4531.yaml b/Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp4531.yaml new file mode 100644 index 000000000000..5c4b9b9181ae --- /dev/null +++ b/Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp4531.yaml @@ -0,0 +1,116 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/potentiometer/microchip,mcp4531.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip mcp4531 and similar potentiometers. + +maintainers: + - Peter Rosin + +description: | + Family of I2C digital potentiometer + Datasheets at: + * volatile https://ww1.microchip.com/downloads/en/DeviceDoc/22096b.pdf + * non-volatile https://ww1.microchip.com/downloads/en/DeviceDoc/22107B.pdf + Part numbers as follows: mcp4ABC-XXX where + A = 5 (1 wiper), 6 (2 wipers) + B = 3 (7-bit, volatile), 4 (7-bit, non-volatile), + 5 (8-bit, volatile), 6 (8-bit, non-volatile), + C: 1 (potentiometer), 2 (rheostat) + XXX = 502 (5 kOhms), 103 (10 kOhms), 503 (50 kOhms), 104 (100 kOhms) + +properties: + compatible: + enum: + # Ordering reflects part number + range, so 502 < 103 etc + - microchip,mcp4531-502 + - microchip,mcp4531-103 + - microchip,mcp4531-503 + - microchip,mcp4531-104 + - microchip,mcp4532-502 + - microchip,mcp4532-103 + - microchip,mcp4532-503 + - microchip,mcp4532-104 + - microchip,mcp4541-502 + - microchip,mcp4541-103 + - microchip,mcp4541-503 + - microchip,mcp4541-104 + - microchip,mcp4542-502 + - microchip,mcp4542-103 + - microchip,mcp4542-503 + - microchip,mcp4542-104 + - microchip,mcp4551-502 + - microchip,mcp4551-103 + - microchip,mcp4551-503 + - microchip,mcp4551-104 + - microchip,mcp4552-502 + - microchip,mcp4552-103 + - microchip,mcp4552-503 + - microchip,mcp4552-104 + - microchip,mcp4561-502 + - microchip,mcp4561-103 + - microchip,mcp4561-503 + - microchip,mcp4561-104 + - microchip,mcp4562-502 + - microchip,mcp4562-103 + - microchip,mcp4562-503 + - microchip,mcp4562-104 + - microchip,mcp4631-502 + - microchip,mcp4631-103 + - microchip,mcp4631-503 + - microchip,mcp4631-104 + - microchip,mcp4632-502 + - microchip,mcp4632-103 + - microchip,mcp4632-503 + - microchip,mcp4632-104 + - microchip,mcp4641-502 + - microchip,mcp4641-103 + - microchip,mcp4641-503 + - microchip,mcp4641-104 + - microchip,mcp4642-502 + - microchip,mcp4642-103 + - microchip,mcp4642-503 + - microchip,mcp4642-104 + - microchip,mcp4651-502 + - microchip,mcp4651-103 + - microchip,mcp4651-503 + - microchip,mcp4651-104 + - microchip,mcp4652-502 + - microchip,mcp4652-103 + - microchip,mcp4652-503 + - microchip,mcp4652-104 + - microchip,mcp4661-502 + - microchip,mcp4661-103 + - microchip,mcp4661-503 + - microchip,mcp4661-104 + - microchip,mcp4662-502 + - microchip,mcp4662-103 + - microchip,mcp4662-503 + - microchip,mcp4662-104 + + reg: + maxItems: 1 + + "#io-channel-cells": + const: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + dpot: dpot@28 { + compatible = "microchip,mcp4651-104"; + reg = <0x28>; + #io-channel-cells = <1>; + }; + }; +... diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml index cb4fd8f29675..d154ea97e30d 100644 --- a/Documentation/devicetree/bindings/trivial-devices.yaml +++ b/Documentation/devicetree/bindings/trivial-devices.yaml @@ -186,134 +186,6 @@ properties: - microchip,mcp4019-503 # Microchip 7-bit Single I2C Digital POT (100k) - microchip,mcp4019-104 - # Microchip 7-bit Single I2C Digital Potentiometer (5k) - - microchip,mcp4531-502 - # Microchip 7-bit Single I2C Digital Potentiometer (10k) - - microchip,mcp4531-103 - # Microchip 7-bit Single I2C Digital Potentiometer (50k) - - microchip,mcp4531-503 - # Microchip 7-bit Single I2C Digital Potentiometer (100k) - - microchip,mcp4531-104 - # Microchip 7-bit Single I2C Digital Potentiometer (5k) - - microchip,mcp4532-502 - # Microchip 7-bit Single I2C Digital Potentiometer (10k) - - microchip,mcp4532-103 - # Microchip 7-bit Single I2C Digital Potentiometer (50k) - - microchip,mcp4532-503 - # Microchip 7-bit Single I2C Digital Potentiometer (100k) - - microchip,mcp4532-104 - # Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (5k) - - microchip,mcp4541-502 - # Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (10k) - - microchip,mcp4541-103 - # Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (50k) - - microchip,mcp4541-503 - # Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (100k) - - microchip,mcp4541-104 - # Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (5k) - - microchip,mcp4542-502 - # Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (10k) - - microchip,mcp4542-103 - # Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (50k) - - microchip,mcp4542-503 - # Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (100k) - - microchip,mcp4542-104 - # Microchip 8-bit Single I2C Digital Potentiometer (5k) - - microchip,mcp4551-502 - # Microchip 8-bit Single I2C Digital Potentiometer (10k) - - microchip,mcp4551-103 - # Microchip 8-bit Single I2C Digital Potentiometer (50k) - - microchip,mcp4551-503 - # Microchip 8-bit Single I2C Digital Potentiometer (100k) - - microchip,mcp4551-104 - # Microchip 8-bit Single I2C Digital Potentiometer (5k) - - microchip,mcp4552-502 - # Microchip 8-bit Single I2C Digital Potentiometer (10k) - - microchip,mcp4552-103 - # Microchip 8-bit Single I2C Digital Potentiometer (50k) - - microchip,mcp4552-503 - # Microchip 8-bit Single I2C Digital Potentiometer (100k) - - microchip,mcp4552-104 - # Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (5k) - - microchip,mcp4561-502 - # Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (10k) - - microchip,mcp4561-103 - # Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (50k) - - microchip,mcp4561-503 - # Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (100k) - - microchip,mcp4561-104 - # Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (5k) - - microchip,mcp4562-502 - # Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (10k) - - microchip,mcp4562-103 - # Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (50k) - - microchip,mcp4562-503 - # Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (100k) - - microchip,mcp4562-104 - # Microchip 7-bit Dual I2C Digital Potentiometer (5k) - - microchip,mcp4631-502 - # Microchip 7-bit Dual I2C Digital Potentiometer (10k) - - microchip,mcp4631-103 - # Microchip 7-bit Dual I2C Digital Potentiometer (50k) - - microchip,mcp4631-503 - # Microchip 7-bit Dual I2C Digital Potentiometer (100k) - - microchip,mcp4631-104 - # Microchip 7-bit Dual I2C Digital Potentiometer (5k) - - microchip,mcp4632-502 - # Microchip 7-bit Dual I2C Digital Potentiometer (10k) - - microchip,mcp4632-103 - # Microchip 7-bit Dual I2C Digital Potentiometer (50k) - - microchip,mcp4632-503 - # Microchip 7-bit Dual I2C Digital Potentiometer (100k) - - microchip,mcp4632-104 - # Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (5k) - - microchip,mcp4641-502 - # Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (10k) - - microchip,mcp4641-103 - # Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (50k) - - microchip,mcp4641-503 - # Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (100k) - - microchip,mcp4641-104 - # Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (5k) - - microchip,mcp4642-502 - # Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (10k) - - microchip,mcp4642-103 - # Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (50k) - - microchip,mcp4642-503 - # Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (100k) - - microchip,mcp4642-104 - # Microchip 8-bit Dual I2C Digital Potentiometer (5k) - - microchip,mcp4651-502 - # Microchip 8-bit Dual I2C Digital Potentiometer (10k) - - microchip,mcp4651-103 - # Microchip 8-bit Dual I2C Digital Potentiometer (50k) - - microchip,mcp4651-503 - # Microchip 8-bit Dual I2C Digital Potentiometer (100k) - - microchip,mcp4651-104 - # Microchip 8-bit Dual I2C Digital Potentiometer (5k) - - microchip,mcp4652-502 - # Microchip 8-bit Dual I2C Digital Potentiometer (10k) - - microchip,mcp4652-103 - # Microchip 8-bit Dual I2C Digital Potentiometer (50k) - - microchip,mcp4652-503 - # Microchip 8-bit Dual I2C Digital Potentiometer (100k) - - microchip,mcp4652-104 - # Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (5k) - - microchip,mcp4661-502 - # Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (10k) - - microchip,mcp4661-103 - # Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (50k) - - microchip,mcp4661-503 - # Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (100k) - - microchip,mcp4661-104 - # Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (5k) - - microchip,mcp4662-502 - # Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (10k) - - microchip,mcp4662-103 - # Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (50k) - - microchip,mcp4662-503 - # Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (100k) - - microchip,mcp4662-104 # PWM Fan Speed Controller With Fan Fault Detection - microchip,tc654 # PWM Fan Speed Controller With Fan Fault Detection From patchwork Sat Oct 31 18:12:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11871555 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F2B0192C for ; Sat, 31 Oct 2020 18:15:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D1A17206E3 for ; Sat, 31 Oct 2020 18:15:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168109; bh=uqY3t5DS/fLrjmuPBA7eur8K8fB96S7fLULj9OOiZw4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Fo6K3vzYRg38B4QQwXh2cLYr4r4g43mTBMdq5hXb/NokrMSNZslxcXvOByaQF4i5G 9Bt01/rfAkge7rsxtkSYCb9N59WlFKnypep1peSWu1Dpjks1cH/rn4dz/b5todo66E SSjw9igriFsSYdvehmoRB9lxjGRn0FdA27wVjfJY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728344AbgJaSPI (ORCPT ); Sat, 31 Oct 2020 14:15:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:46174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728247AbgJaSO6 (ORCPT ); Sat, 31 Oct 2020 14:14:58 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E336F20709; Sat, 31 Oct 2020 18:14:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168098; bh=uqY3t5DS/fLrjmuPBA7eur8K8fB96S7fLULj9OOiZw4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0u5DT0qQ62kOs9tCaPSdEGLe20bgpq5FOJJAoFmQ0QOu3Iby7uEzwXSKqHr8RaVPk DDZKSS6+715OBw++hVenWzw2O8u/YmMKsOOTv4V7cQSqyu98eQd7VH27B3hp/Zr1P4 aWvjTSl87/oddhAa5INe8hoy9Q/xTUEuROmWGX7o= From: Jonathan Cameron To: linux-iio@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org Cc: Jonathan Cameron , Peter Rosin Subject: [PATCH 04/10] dt-bindings:iio:adc:envelope-detector: txt to yaml conversion. Date: Sat, 31 Oct 2020 18:12:36 +0000 Message-Id: <20201031181242.742301-5-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201031181242.742301-1-jic23@kernel.org> References: <20201031181242.742301-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron Straight forward format conversion. The example in here is fun in that it has 2 separate provider / consumer pairs. Signed-off-by: Jonathan Cameron Cc: Peter Rosin --- .../bindings/iio/adc/envelope-detector.txt | 54 ------------ .../bindings/iio/adc/envelope-detector.yaml | 87 +++++++++++++++++++ 2 files changed, 87 insertions(+), 54 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/envelope-detector.txt b/Documentation/devicetree/bindings/iio/adc/envelope-detector.txt deleted file mode 100644 index 27544bdd4478..000000000000 --- a/Documentation/devicetree/bindings/iio/adc/envelope-detector.txt +++ /dev/null @@ -1,54 +0,0 @@ -Bindings for ADC envelope detector using a DAC and a comparator - -The DAC is used to find the peak level of an alternating voltage input -signal by a binary search using the output of a comparator wired to -an interrupt pin. Like so: - _ - | \ - input +------>-------|+ \ - | \ - .-------. | }---. - | | | / | - | dac|-->--|- / | - | | |_/ | - | | | - | | | - | irq|------<-------' - | | - '-------' - -Required properties: -- compatible: Should be "axentia,tse850-envelope-detector" -- io-channels: Channel node of the dac to be used for comparator input. -- io-channel-names: Should be "dac". -- interrupt specification for one client interrupt, - see ../../interrupt-controller/interrupts.txt for details. -- interrupt-names: Should be "comp". - -Example: - - &i2c { - dpot: mcp4651-104@28 { - compatible = "microchip,mcp4651-104"; - reg = <0x28>; - #io-channel-cells = <1>; - }; - }; - - dac: dac { - compatible = "dpot-dac"; - vref-supply = <®_3v3>; - io-channels = <&dpot 0>; - io-channel-names = "dpot"; - #io-channel-cells = <1>; - }; - - envelope-detector { - compatible = "axentia,tse850-envelope-detector"; - io-channels = <&dac 0>; - io-channel-names = "dac"; - - interrupt-parent = <&gpio>; - interrupts = <3 IRQ_TYPE_EDGE_FALLING>; - interrupt-names = "comp"; - }; diff --git a/Documentation/devicetree/bindings/iio/adc/envelope-detector.yaml b/Documentation/devicetree/bindings/iio/adc/envelope-detector.yaml new file mode 100644 index 000000000000..6048be936aba --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/envelope-detector.yaml @@ -0,0 +1,87 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/adc/envelope-detector.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ADC envelope detector using a DAC and a comparator + +maintainers: + - Peter Rosin + +description: | + The DAC is used to find the peak level of an alternating voltage input + signal by a binary search using the output of a comparator wired to + an interrupt pin. Like so: + _ + | \ + input +------>-------|+ \ + | \ + .-------. | }---. + | | | / | + | dac|-->--|- / | + | | |_/ | + | | | + | | | + | irq|------<-------' + | | + '-------' + +properties: + compatible: + const: axentia,tse850-envelope-detector + + io-channels: + maxItems: 1 + description: Channel node of the dac to be used for comparator input. + + io-channel-names: + const: dac + + interrupts: + maxItems: 1 + + interrupt-names: + const: comp + +required: + - compatible + - io-channels + - io-channel-names + - interrupts + - interrupt-names + +additionalProperties: false + +examples: + - | + #include + i2c { + #address-cells = <1>; + #size-cells = <0>; + dpot: dpot@28 { + compatible = "microchip,mcp4651-104"; + reg = <0x28>; + #io-channel-cells = <1>; + }; + }; + + dac: dac { + compatible = "dpot-dac"; + vref-supply = <®_3v3>; + io-channels = <&dpot 0>; + io-channel-names = "dpot"; + #io-channel-cells = <1>; + }; + + envelope-detector { + compatible = "axentia,tse850-envelope-detector"; + io-channels = <&dac 0>; + io-channel-names = "dac"; + + interrupt-parent = <&gpio>; + interrupts = <3 IRQ_TYPE_EDGE_FALLING>; + interrupt-names = "comp"; + }; +... + From patchwork Sat Oct 31 18:12:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11871551 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 56F1F14B2 for ; Sat, 31 Oct 2020 18:15:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 39C0F2071A for ; Sat, 31 Oct 2020 18:15:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168107; bh=b6xwsrTqrL01OYwuXwqonMBb71GmaCiq8RUPWDCO/o8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Yrnnwa762ypQWu9cGtNVmEoYBjKcc3SNc0lxbRpVm8vAVPlaPgJ5ThHpGL8/fu5yI TTRwQfRfrCnsH/KddelSd0kDUNEApw87VqCx6F/KeGCAODEa2Tj0rEA6ZZZJ2NpYHT GwFWDhrc8mm+7JeuylTPQgqz+SPJ1J5gTKkg+Xe8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728345AbgJaSPF (ORCPT ); Sat, 31 Oct 2020 14:15:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:46206 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728322AbgJaSPA (ORCPT ); Sat, 31 Oct 2020 14:15:00 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 581352071A; Sat, 31 Oct 2020 18:14:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168099; bh=b6xwsrTqrL01OYwuXwqonMBb71GmaCiq8RUPWDCO/o8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Li8Jm7v8bURv5b+Dyp28swb0/hNKZM3EzhHsFfIjh416nLhmoiriL4nLpDzKFGuXW h0RSTiNIsN6OkevcDn1QCa0velT23VCw9HXvXLGGVB0O20KoNX98Nw6ZdtPExjEMMd iHeftnTlBpamqopkYxKRONxI1KixscUIL3HRkdyQ= From: Jonathan Cameron To: linux-iio@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org Cc: Jonathan Cameron , Peter Rosin Subject: [PATCH 05/10] dt-bindings:iio:afe:current-sense-amplifier: txt to yaml conversion. Date: Sat, 31 Oct 2020 18:12:37 +0000 Message-Id: <20201031181242.742301-6-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201031181242.742301-1-jic23@kernel.org> References: <20201031181242.742301-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron Note this includes a fix in the example where we had *-mul instead of *-mult. The binding doc and driver agree that it should be *-mult Signed-off-by: Jonathan Cameron Cc: Peter Rosin --- .../iio/afe/current-sense-amplifier.txt | 26 --------- .../iio/afe/current-sense-amplifier.yaml | 55 +++++++++++++++++++ 2 files changed, 55 insertions(+), 26 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/afe/current-sense-amplifier.txt b/Documentation/devicetree/bindings/iio/afe/current-sense-amplifier.txt deleted file mode 100644 index 821b61b8c542..000000000000 --- a/Documentation/devicetree/bindings/iio/afe/current-sense-amplifier.txt +++ /dev/null @@ -1,26 +0,0 @@ -Current Sense Amplifier -======================= - -When an io-channel measures the output voltage from a current sense -amplifier, the interesting measurement is almost always the current -through the sense resistor, not the voltage output. This binding -describes such a current sense circuit. - -Required properties: -- compatible : "current-sense-amplifier" -- io-channels : Channel node of a voltage io-channel. -- sense-resistor-micro-ohms : The sense resistance in microohms. - -Optional properties: -- sense-gain-mult: Amplifier gain multiplier. The default is <1>. -- sense-gain-div: Amplifier gain divider. The default is <1>. - -Example: - -sysi { - compatible = "current-sense-amplifier"; - io-channels = <&tiadc 0>; - - sense-resistor-micro-ohms = <20000>; - sense-gain-mul = <50>; -}; diff --git a/Documentation/devicetree/bindings/iio/afe/current-sense-amplifier.yaml b/Documentation/devicetree/bindings/iio/afe/current-sense-amplifier.yaml new file mode 100644 index 000000000000..920bdd8d12d6 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/afe/current-sense-amplifier.yaml @@ -0,0 +1,55 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/afe/current-sense-amplifier.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Current Sense Amplifier + +maintainers: + - Peter Rosin + +description: | + When an io-channel measures the output voltage from a current sense + amplifier, the interesting measurement is almost always the current + through the sense resistor, not the voltage output. This binding + describes such a current sense circuit. + +properties: + compatible: + const: current-sense-amplifier + + io-channels: + maxItems: 1 + description: | + Channel node of a voltage io-channel. + + sense-resistor-micro-ohms: + $ref: /schemas/types.yaml#/definitions/uint32 + description: The sense resistance. + + sense-gain-mult: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Amplifier gain multiplier. The default is <1>. + + sense-gain-div: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Amplifier gain divider. The default is <1>. + +required: + - compatible + - io-channels + - sense-resistor-micro-ohms + +additionalProperties: false + +examples: + - | + sysi { + compatible = "current-sense-amplifier"; + io-channels = <&tiadc 0>; + + sense-resistor-micro-ohms = <20000>; + sense-gain-mult = <50>; + }; +... From patchwork Sat Oct 31 18:12:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11871549 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B058792C for ; Sat, 31 Oct 2020 18:15:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 94FCA20709 for ; Sat, 31 Oct 2020 18:15:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168106; bh=+KKQvxitikpmSsDORSTRtGhhfcyGmEHjn9x1tgY/194=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=bgnN87CYCk0KPatXD0nYjzDcneZ4iCk1nYCYkKiGPFT5EzdLthpfcUISZS2yP7gIW PtIHMtFxNkqZykfVbcBcLV5aOyvYVeIByRX/MdVKXtICSTL235VIcz0Xk5vg7E4DQk aw82tCYXkeDMov2RUpzF4YkR+4lQmjxhAWiV/8eY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728338AbgJaSPF (ORCPT ); Sat, 31 Oct 2020 14:15:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:46234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728332AbgJaSPB (ORCPT ); Sat, 31 Oct 2020 14:15:01 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C8D7220723; Sat, 31 Oct 2020 18:14:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168100; bh=+KKQvxitikpmSsDORSTRtGhhfcyGmEHjn9x1tgY/194=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bCG51qMXl+kJbXF2yXQLnY1sZ4nSgWFeu6mWrMjldSiRv9oseuXUJKwHRN5rCqRtN fcoZRPTaNL0q41XbNjLEbGCC10CUXbeOt57LEp4dlCpSZz4i213dBgG1o+ZLCddAE4 gZu0ZFPA/hdpUMIkt570oBaA4HBP7X2U5lzvRh/A= From: Jonathan Cameron To: linux-iio@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org Cc: Jonathan Cameron , Peter Rosin Subject: [PATCH 06/10] dt-bindings:iio:afe:current-sense-shunt: txt to yaml conversion. Date: Sat, 31 Oct 2020 18:12:38 +0000 Message-Id: <20201031181242.742301-7-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201031181242.742301-1-jic23@kernel.org> References: <20201031181242.742301-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron Very simple binding. As such straight forward conversion. Signed-off-by: Jonathan Cameron Cc: Peter Rosin --- .../bindings/iio/afe/current-sense-shunt.txt | 41 ------------ .../bindings/iio/afe/current-sense-shunt.yaml | 65 +++++++++++++++++++ 2 files changed, 65 insertions(+), 41 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.txt b/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.txt deleted file mode 100644 index 0f67108a07b6..000000000000 --- a/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.txt +++ /dev/null @@ -1,41 +0,0 @@ -Current Sense Shunt -=================== - -When an io-channel measures the voltage over a current sense shunt, -the interesting measurement is almost always the current through the -shunt, not the voltage over it. This binding describes such a current -sense circuit. - -Required properties: -- compatible : "current-sense-shunt" -- io-channels : Channel node of a voltage io-channel. -- shunt-resistor-micro-ohms : The shunt resistance in microohms. - -Example: -The system current is measured by measuring the voltage over a -3.3 ohms shunt resistor. - -sysi { - compatible = "current-sense-shunt"; - io-channels = <&tiadc 0>; - - /* Divide the voltage by 3300000/1000000 (or 3.3) for the current. */ - shunt-resistor-micro-ohms = <3300000>; -}; - -&i2c { - tiadc: adc@48 { - compatible = "ti,ads1015"; - reg = <0x48>; - #io-channel-cells = <1>; - - #address-cells = <1>; - #size-cells = <0>; - - channel@0 { /* IN0,IN1 differential */ - reg = <0>; - ti,gain = <1>; - ti,datarate = <4>; - }; - }; -}; diff --git a/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml b/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml new file mode 100644 index 000000000000..2f18409c64e3 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml @@ -0,0 +1,65 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/afe/current-sense-shunt.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Current Sense Shunt + +maintainers: + - Peter Rosin + +description: | + When an io-channel measures the voltage over a current sense shunt, + the interesting measurement is almost always the current through the + shunt, not the voltage over it. This binding describes such a current + sense circuit. + +properties: + compatible: + const: current-sense-shunt + + io-channels: + maxItems: 1 + description: | + Channel node of a voltage io-channel. + + shunt-resistor-micro-ohms: + $ref: /schemas/types.yaml#/definitions/uint32 + description: The shunt resistance. + +required: + - compatible + - io-channels + - shunt-resistor-micro-ohms + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + tiadc: adc@48 { + compatible = "ti,ads1015"; + reg = <0x48>; + #io-channel-cells = <1>; + + #address-cells = <1>; + #size-cells = <0>; + + channel@0 { /* IN0,IN1 differential */ + reg = <0>; + ti,gain = <1>; + ti,datarate = <4>; + }; + }; + }; + sysi { + compatible = "current-sense-shunt"; + io-channels = <&tiadc 0>; + + /* Divide the voltage by 3300000/1000000 (or 3.3) for the current. */ + shunt-resistor-micro-ohms = <3300000>; + }; +... From patchwork Sat Oct 31 18:12:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11871547 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 26CD592C for ; Sat, 31 Oct 2020 18:15:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 07C4A20731 for ; Sat, 31 Oct 2020 18:15:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168105; bh=3JNkkk9Dl1YomxLvoKDitnSaJq06f+AYRrZkk3n4+0Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=CaWOtEbe+c9VWG0zz526NwSgrKDiwIknP8YPVsK+1Me/xDRsmD30z/eXm7wK0ASNq btQb0AFODf8hs729Whm0pnf/xVOiNIcnHpwUsc4wOhh1GXUzI6dG5zR1XsJzy16+k2 dlI9y8XDLuIyCs86ETlOzUL+RD3L8N3En+jvecSc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728248AbgJaSPE (ORCPT ); Sat, 31 Oct 2020 14:15:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:46268 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728338AbgJaSPD (ORCPT ); Sat, 31 Oct 2020 14:15:03 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 42C69206D5; Sat, 31 Oct 2020 18:15:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168102; bh=3JNkkk9Dl1YomxLvoKDitnSaJq06f+AYRrZkk3n4+0Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QEjKOf2HcUyA6Aq9I6wetNpIMAYeqi8OoS4eauMsN4+1cxcAEKJ4hwJFM74CCh0/v Xf3DcQTwq3A237CjRgqDiuDWJuqt6vQjg92ZReAx2MqzOp04FH6D2JEbEiav6/7PHu c5cKO0SqHozFMAWLr/+T2Hw6/QNunNua1XNF9Rs8= From: Jonathan Cameron To: linux-iio@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org Cc: Jonathan Cameron , Miquel Raynal , Philippe Reynes Subject: [PATCH 07/10] dt-bindings:iio:adc:maxim,max1027: Pull out to separate binding doc. Date: Sat, 31 Oct 2020 18:12:39 +0000 Message-Id: <20201031181242.742301-8-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201031181242.742301-1-jic23@kernel.org> References: <20201031181242.742301-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron The afe/voltage-divider.yaml example uses this device with 2 properties not provided by trivial-devices.yaml (spi-max-frequency and #io-channel-cells) Solve that by creating a more specific binding doc. Signed-off-by: Jonathan Cameron Cc: Miquel Raynal Cc: Philippe Reynes --- .../bindings/iio/adc/maxim,max1027.yaml | 64 +++++++++++++++++++ .../devicetree/bindings/trivial-devices.yaml | 12 ---- 2 files changed, 64 insertions(+), 12 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/maxim,max1027.yaml b/Documentation/devicetree/bindings/iio/adc/maxim,max1027.yaml new file mode 100644 index 000000000000..09e853c50c76 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/maxim,max1027.yaml @@ -0,0 +1,64 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/adc/maxim,max1027.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Maxim MAX1027 and similar ADCs + +maintainers: + - Miquel Raynal + - Philippe Reynes + +description: | + 300ks/s SPI ADCs with temperature sensors. + +properties: + compatible: + enum: + # 10-bit 8 channels + - maxim,max1027 + # 10-bit 12 channels + - maxim,max1029 + # 10-bit 16 channels + - maxim,max1031 + # 12-bit 8 channels + - maxim,max1227 + # 12-bit 12 channels + - maxim,max1229 + # 12-bit 16 channels + - maxim,max1231 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + spi-max-frequency: true + + "#io-channel-cells": + const: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + #include + spi { + #address-cells = <1>; + #size-cells = <0>; + maxadc: adc@0 { + compatible = "maxim,max1027"; + reg = <0>; + #io-channel-cells = <1>; + interrupt-parent = <&gpio5>; + interrupts = <15 IRQ_TYPE_EDGE_RISING>; + spi-max-frequency = <1000000>; + }; + }; +... diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml index d154ea97e30d..185e09e61e16 100644 --- a/Documentation/devicetree/bindings/trivial-devices.yaml +++ b/Documentation/devicetree/bindings/trivial-devices.yaml @@ -108,18 +108,6 @@ properties: - isil,isl68137 # 5 Bit Programmable, Pulse-Width Modulator - maxim,ds1050 - # 10-bit 8 channels 300ks/s SPI ADC with temperature sensor - - maxim,max1027 - # 10-bit 12 channels 300ks/s SPI ADC with temperature sensor - - maxim,max1029 - # 10-bit 16 channels 300ks/s SPI ADC with temperature sensor - - maxim,max1031 - # 12-bit 8 channels 300ks/s SPI ADC with temperature sensor - - maxim,max1227 - # 12-bit 12 channels 300ks/s SPI ADC with temperature sensor - - maxim,max1229 - # 12-bit 16 channels 300ks/s SPI ADC with temperature sensor - - maxim,max1231 # Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs - maxim,max1237 # PECI-to-I2C translator for PECI-to-SMBus/I2C protocol conversion From patchwork Sat Oct 31 18:12:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11871557 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BCDCE92C for ; Sat, 31 Oct 2020 18:15:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A41E7206E3 for ; Sat, 31 Oct 2020 18:15:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168110; bh=Za5exTD0a3RmhL7Ob2UhOE7IOWXzYlzSvz5GMsTToo8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=E3voC/9wtraVg94uFXNz18/2e568Okz+jqSrsKdserOAR1hJieA/y4TUEj0zi304t Qx2O1QJkLwZNAR84SHSXxkrwj1xVrK05YDfSPTS7Orvlw9lI0aJqKhhsOBoGNkBSf+ nhQYAz9DipCduwl/Hgaj4qjJJalWi62pJ6BBdmwU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728332AbgJaSPH (ORCPT ); Sat, 31 Oct 2020 14:15:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:46274 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728344AbgJaSPE (ORCPT ); Sat, 31 Oct 2020 14:15:04 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DE5AF206E3; Sat, 31 Oct 2020 18:15:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168104; bh=Za5exTD0a3RmhL7Ob2UhOE7IOWXzYlzSvz5GMsTToo8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ePGlAk5Va5+w4pv82PhGHDy2perbG3HYCP1mzkSpZbHcSdP2cjA8LvcuhE54JxOVE kogoU58gdzdLy8Sb6aH0Xt05PNBAqdgCv7S0rnCuFqOWwmHXbifw1JJPbtzKz4wfhS 7XPnL7skU3t152cbcnfHDzDp2XUgYeAKX+ouGd6s= From: Jonathan Cameron To: linux-iio@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org Cc: Jonathan Cameron , Peter Rosin Subject: [PATCH 08/10] dt-bindings:iio:afe:voltage-divider: txt to yaml conversion Date: Sat, 31 Oct 2020 18:12:40 +0000 Message-Id: <20201031181242.742301-9-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201031181242.742301-1-jic23@kernel.org> References: <20201031181242.742301-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron Simple binding so straight forward conversion, though did require adding a separate binding document for the max1027 to reflect its abilities to provide channels to consumers. Signed-off-by: Jonathan Cameron Cc: Peter Rosin --- .../bindings/iio/afe/voltage-divider.txt | 53 ----------- .../bindings/iio/afe/voltage-divider.yaml | 88 +++++++++++++++++++ 2 files changed, 88 insertions(+), 53 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/afe/voltage-divider.txt b/Documentation/devicetree/bindings/iio/afe/voltage-divider.txt deleted file mode 100644 index b452a8406107..000000000000 --- a/Documentation/devicetree/bindings/iio/afe/voltage-divider.txt +++ /dev/null @@ -1,53 +0,0 @@ -Voltage divider -=============== - -When an io-channel measures the midpoint of a voltage divider, the -interesting voltage is often the voltage over the full resistance -of the divider. This binding describes the voltage divider in such -a curcuit. - - Vin ----. - | - .-----. - | R | - '-----' - | - +---- Vout - | - .-----. - | Rout| - '-----' - | - GND - -Required properties: -- compatible : "voltage-divider" -- io-channels : Channel node of a voltage io-channel measuring Vout. -- output-ohms : Resistance Rout over which the output voltage is measured. - See full-ohms. -- full-ohms : Resistance R + Rout for the full divider. The io-channel - is scaled by the Rout / (R + Rout) quotient. - -Example: -The system voltage is circa 12V, but divided down with a 22/222 -voltage divider (R = 200 Ohms, Rout = 22 Ohms) and fed to an ADC. - -sysv { - compatible = "voltage-divider"; - io-channels = <&maxadc 1>; - - /* Scale the system voltage by 22/222 to fit the ADC range. */ - output-ohms = <22>; - full-ohms = <222>; /* 200 + 22 */ -}; - -&spi { - maxadc: adc@0 { - compatible = "maxim,max1027"; - reg = <0>; - #io-channel-cells = <1>; - interrupt-parent = <&gpio5>; - interrupts = <15 IRQ_TYPE_EDGE_RISING>; - spi-max-frequency = <1000000>; - }; -}; diff --git a/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml b/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml new file mode 100644 index 000000000000..fefce8c9f6dc --- /dev/null +++ b/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml @@ -0,0 +1,88 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/afe/voltage-divider.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Voltage divider + +maintainers: + - Peter Rosin + +description: | + When an io-channel measures the midpoint of a voltage divider, the + interesting voltage is often the voltage over the full resistance + of the divider. This binding describes the voltage divider in such + a curcuit. + + Vin ----. + | + .-----. + | R | + '-----' + | + +---- Vout + | + .-----. + | Rout| + '-----' + | + GND + + +properties: + compatible: + const: voltage-divider + + io-channels: + maxItems: 1 + description: | + Channel node of a voltage io-channel. + + output-ohms: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Resistance Rout over which the output voltage is measured. See full-ohms. + + full-ohms: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Resistance R + Rout for the full divider. The io-channel is scaled by + the Rout / (R + Rout) quotient. + +required: + - compatible + - io-channels + - output-ohms + - full-ohms + +additionalProperties: false + +examples: + - | + #include + /* + * The system voltage is circa 12V, but divided down with a 22/222 + * voltage divider (R = 200 Ohms, Rout = 22 Ohms) and fed to an ADC. + */ + spi { + #address-cells = <1>; + #size-cells = <0>; + maxadc: adc@0 { + compatible = "maxim,max1027"; + reg = <0>; + #io-channel-cells = <1>; + interrupt-parent = <&gpio5>; + interrupts = <15 IRQ_TYPE_EDGE_RISING>; + spi-max-frequency = <1000000>; + }; + }; + sysv { + compatible = "voltage-divider"; + io-channels = <&maxadc 1>; + + /* Scale the system voltage by 22/222 to fit the ADC range. */ + output-ohms = <22>; + full-ohms = <222>; /* 200 + 22 */ + }; +... From patchwork Sat Oct 31 18:12:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11871553 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E7F292C for ; Sat, 31 Oct 2020 18:15:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 12D2120709 for ; Sat, 31 Oct 2020 18:15:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168108; bh=Dajqw5nvr2DvYCFQUKa+XCYy8A7wnG/zDAlkydD1B0s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=vHoUhLMU0dJjRKWA8lef9iv2X4QEx+DT+ssezEXUZnsJDOeSztKN8WhgYOzvgG71M Vordi6NdLu1aWKUpZiJuSvyR9Z26rMR3Ga+OuAwj0+Ldmdwfavxe5UA2oG22K5HhlO bI9tKmnog57B5vSJB6JfilfTVPDrDlXVar2nC4Ws= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728355AbgJaSPH (ORCPT ); Sat, 31 Oct 2020 14:15:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:46308 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728332AbgJaSPG (ORCPT ); Sat, 31 Oct 2020 14:15:06 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6564E206DD; Sat, 31 Oct 2020 18:15:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168105; bh=Dajqw5nvr2DvYCFQUKa+XCYy8A7wnG/zDAlkydD1B0s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jklqEaapj5i8oOedy9tPBdkExPWW1Lnvtegbj997i+2TXkrPEekBG0PkeHiCH+Ziq 9iulStcClJzllY4vB3MCMWqueq4+b/pPp/gFROfT7PwPI9do75LzMKgueUMH24/t5D MTzFb/BBvxptx8cr1vX/Dv/hI4w4l9qh0vVLaQw8= From: Jonathan Cameron To: linux-iio@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org Cc: Jonathan Cameron , Linus Walleij Subject: [PATCH 09/10] dt-bindings:iio:light:capella,cm3605: txt to yaml conversion. Date: Sat, 31 Oct 2020 18:12:41 +0000 Message-Id: <20201031181242.742301-10-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201031181242.742301-1-jic23@kernel.org> References: <20201031181242.742301-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron Simple conversion using the new iio-consumers.yaml binding in the dt-schema. Signed-off-by: Jonathan Cameron Cc: Linus Walleij Reviewed-by: Linus Walleij --- .../bindings/iio/light/capella,cm3605.yaml | 78 +++++++++++++++++++ .../devicetree/bindings/iio/light/cm3605.txt | 41 ---------- 2 files changed, 78 insertions(+), 41 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/light/capella,cm3605.yaml b/Documentation/devicetree/bindings/iio/light/capella,cm3605.yaml new file mode 100644 index 000000000000..001c99dbd14e --- /dev/null +++ b/Documentation/devicetree/bindings/iio/light/capella,cm3605.yaml @@ -0,0 +1,78 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/light/capella,cm3605.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: + Capella Microsystems CM3605 Ambient Light and Short Distance Proximity Sensor + +maintainers: + - Linus Walleij + +description: | + The CM3605 is an entirely analog part. However, it requires quite a bit of + software logic to interface a host operating system. + + This ALS and proximity sensor was one of the very first deployed in mobile + handsets, notably it is used in the very first Nexus One Android phone from + 2010. + +properties: + compatible: + const: capella,cm3605 + + aset-gpios: + maxItems: 1 + description: + ASET line (drive low to activate the ALS, should be flagged + GPIO_ACTIVE_LOW) + + interrupts: + maxItems: 1 + description: + Connected to the POUT (proximity sensor out) line. The edge + detection must be set to IRQ_TYPE_EDGE_BOTH so as to detect + movements toward and away from the proximity sensor. + + io-channels: + maxItems: 1 + description: + ADC channel used for converting the voltage from AOUT to a digital + representation. + + io-channel-names: + const: aout + + vdd-supply: true + + capella,aset-resistance-ohms: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [50000, 100000, 300000, 600000] + description: > + Sensitivity calibration resistance. Note that calibration curves + are only provided for specific allowed values. Default: 100 kOhms. + +required: + - compatible + - aset-gpios + - interrupts + - io-channels + - io-channel-names + +additionalProperties: false + +examples: + - | + #include + #include + light-sensor { + compatible = "capella,cm3605"; + vdd-supply = <&foo_reg>; + aset-gpios = <&foo_gpio 1 GPIO_ACTIVE_LOW>; + capella,aset-resistance-ohms = <100000>; + interrupts = <1 IRQ_TYPE_EDGE_BOTH>; + io-channels = <&adc 0x01>; + io-channel-names = "aout"; + }; +... diff --git a/Documentation/devicetree/bindings/iio/light/cm3605.txt b/Documentation/devicetree/bindings/iio/light/cm3605.txt deleted file mode 100644 index 56331a79f9ab..000000000000 --- a/Documentation/devicetree/bindings/iio/light/cm3605.txt +++ /dev/null @@ -1,41 +0,0 @@ -Capella Microsystems CM3605 -Ambient Light and Short Distance Proximity Sensor - -The CM3605 is an entirely analog part which however require quite a bit of -software logic to interface a host operating system. - -This ALS and proximity sensor was one of the very first deployed in mobile -handsets, notably it is used in the very first Nexus One Android phone from -2010. - -Required properties: -- compatible: must be: "capella,cm3605" -- aset-gpios: GPIO line controlling the ASET line (drive low - to activate the ALS, should be flagged GPIO_ACTIVE_LOW) -- interrupts: the IRQ line (such as a GPIO) that is connected to - the POUT (proximity sensor out) line. The edge detection must - be set to IRQ_TYPE_EDGE_BOTH so as to detect movements toward - and away from the proximity sensor. -- io-channels: the ADC channel used for converting the voltage from - AOUT to a digital representation. -- io-channel-names: must be "aout" - -Optional properties: -- vdd-supply: regulator supplying VDD power to the component. -- capella,aset-resistance-ohms: the sensitivity calibration resistance, - in Ohms. Valid values are: 50000, 100000, 300000 and 600000, - as these are the resistance values that we are supplied with - calibration curves for. If not supplied, 100 kOhm will be assumed - but it is strongly recommended to supply this. - -Example: - -cm3605 { - compatible = "capella,cm3605"; - vdd-supply = <&foo_reg>; - aset-gpios = <&foo_gpio 1 GPIO_ACTIVE_LOW>; - capella,aset-resistance-ohms = <100000>; - interrupts = <1 IRQ_TYPE_EDGE_BOTH>; - io-channels = <&adc 0x01>; - io-channel-names = "aout"; -}; From patchwork Sat Oct 31 18:12:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11871559 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9763D1130 for ; Sat, 31 Oct 2020 18:15:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E86320723 for ; Sat, 31 Oct 2020 18:15:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168111; bh=oAO6hYALRFY8QJ0jyjR+2tZNlN8Y0J3uYxsPvH4gG/8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=2C72eCCQyq0j0GnEeeIAo2YQ6l9gR4c+hVAQg0J61h0YeQbRmh9CflWbxoXNYNPJk 3nO9q6sXGbIZYa1wZ5IvjJd+mL+b8OyG+k1O95MD4rACiXfatoaWkYxfVWmzjV4bBj VqFYTo6sVSnCVADY32MwqETaL6PekPyRms2Nen5c= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727967AbgJaSPK (ORCPT ); Sat, 31 Oct 2020 14:15:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:46332 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728352AbgJaSPH (ORCPT ); Sat, 31 Oct 2020 14:15:07 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E0593206A5; Sat, 31 Oct 2020 18:15:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168107; bh=oAO6hYALRFY8QJ0jyjR+2tZNlN8Y0J3uYxsPvH4gG/8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QpArb/nu/ZfUHGMsuaINJ3i1lGH5ktCZWvhxyv+OnwB1fbOW2ZLBqB6wQ4SAjtQ5m YdyHK8szW3uQrIqGGRa8soNNrUSaj8dwo2u07vV4kDWL8tFMMcnWPdUYOGKYL/yp0O TfGn4M2cwmi4iYQE1YZKKI/i2zl+phzvZd73nFz8= From: Jonathan Cameron To: linux-iio@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org Cc: Jonathan Cameron , Matt Ranostay Subject: [PATCH 10/10] dt-bindings:iio:potentiostat:ti,lmp91000: txt to yaml conversion. Date: Sat, 31 Oct 2020 18:12:42 +0000 Message-Id: <20201031181242.742301-11-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201031181242.742301-1-jic23@kernel.org> References: <20201031181242.742301-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron There were a few parts of the example that did not conform to the binding description and would not have worked with the Linux driver as a result. Fixed them whilst doing this conversion. Signed-off-by: Jonathan Cameron Cc: Matt Ranostay Acked-by: Matt Ranostay --- .../bindings/iio/potentiostat/lmp91000.txt | 33 --------- .../iio/potentiostat/ti,lmp91000.yaml | 68 +++++++++++++++++++ 2 files changed, 68 insertions(+), 33 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/potentiostat/lmp91000.txt b/Documentation/devicetree/bindings/iio/potentiostat/lmp91000.txt deleted file mode 100644 index f3ab02b0dd41..000000000000 --- a/Documentation/devicetree/bindings/iio/potentiostat/lmp91000.txt +++ /dev/null @@ -1,33 +0,0 @@ -* Texas Instruments LMP91000 series of potentiostats - -LMP91000: https://www.ti.com/lit/ds/symlink/lmp91000.pdf -LMP91002: https://www.ti.com/lit/ds/symlink/lmp91002.pdf - -Required properties: - - - compatible: should be one of the following: - "ti,lmp91000" - "ti,lmp91002" - - reg: the I2C address of the device - - io-channels: the phandle of the iio provider - - - ti,external-tia-resistor: if the property ti,tia-gain-ohm is not defined this - needs to be set to signal that an external resistor value is being used. - -Optional properties: - - - ti,tia-gain-ohm: ohm value of the internal resistor for the transimpedance - amplifier. Must be 2750, 3500, 7000, 14000, 35000, 120000, or 350000 ohms. - - - ti,rload-ohm: ohm value of the internal resistor load applied to the gas - sensor. Must be 10, 33, 50, or 100 (default) ohms. - -Example: - -lmp91000@48 { - compatible = "ti,lmp91000"; - reg = <0x48>; - ti,tia-gain-ohm = <7500>; - ti,rload = <100>; - io-channels = <&adc>; -}; diff --git a/Documentation/devicetree/bindings/iio/potentiostat/ti,lmp91000.yaml b/Documentation/devicetree/bindings/iio/potentiostat/ti,lmp91000.yaml new file mode 100644 index 000000000000..e4b5d890e8d5 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/potentiostat/ti,lmp91000.yaml @@ -0,0 +1,68 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/potentiostat/ti,lmp91000.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Texas Instruments LMP91000 series of potentiostats with I2C control + +maintainers: + - Matt Ranostay + +description: | + Typically used as a signal conditioner for chemical sensors. + LMP91000: https://www.ti.com/lit/ds/symlink/lmp91000.pdf + LMP91002: https://www.ti.com/lit/ds/symlink/lmp91002.pdf + +properties: + compatible: + enum: + - ti,lmp91000 + - ti,lmp91002 + + reg: + maxItems: 1 + + io-channels: + maxItems: 1 + + ti,external-tia-resistor: + $ref: /schemas/types.yaml#/definitions/flag + description: + If the property ti,tia-gain-ohm is not defined this needs to be set to + signal that an external resistor value is being used. + + ti,tia-gain-ohm: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [2750, 3500, 7000, 14000, 35000, 120000, 350000] + description: + Internal resistor for the transimpedance amplifier. + + ti,rload-ohm: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [10, 33, 50, 100] + description: + Internal resistor load applied to the gas sensor. + Default 100 Ohms. + +required: + - compatible + - reg + - io-channels + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + lmp91000@48 { + compatible = "ti,lmp91000"; + reg = <0x48>; + ti,tia-gain-ohm = <7000>; + ti,rload-ohm = <100>; + io-channels = <&adc>; + }; + }; +...