All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions
@ 2020-10-31 18:48 Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 01/46] dt-bindings:iio:resolver:adi,ad2s90: Conversion of binding to yaml Jonathan Cameron
                   ` (46 more replies)
  0 siblings, 47 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This set is basically all the stuff bindings where I couldn't come up
with a unifying theme to split them out into smaller more palatble sets.

So there is all sorts in here :)  Enjoy.

There are a few more binding files left after these are done.
* io-channel-mux:  Needs conversion of the mux subsystem bindings
* xilinx-xadc: I think Lars is working on this one already.
* lis302: This one got moved to IIO directory, but reflects a bunch of stuff
  that would not have made it into an IIO binding.  The driver is still in
  misc and in theory has been replaced by the st-sensors driver.
  Need to think what to do about this one.
* mount-matrix.txt:  The binding part is under review for inclusion in
  dt-schema rather than kernel tree, but this document has a wealth of
  information we don't want hidden away there.  As such I'm probably
  going to convert it to general kernel documentation.

Final patch in here drops the generic temperatures sensor binding.
Whilst I'm keen on that we only currently have one user.  So I'd
rather we had a second before we went to the effort of defining a
proper yaml binding for that.

Jonathan Cameron (46):
  dt-bindings:iio:resolver:adi,ad2s90: Conversion of binding to yaml.
  dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion
  dt-bindings:iio:potentiometer:microchip,mcp4131 txt to yaml conversion
  dt-bindings:iio:potentiometer:microchip,mcp41010 txt to yaml
    conversion
  dt-bindings:iio:impedance-analyzer:adi,ad5933 yaml conversion.
  dt-bindings:iio:samsung,sensorhub-rinato: yaml conversion
  dt-bindings:iio:health:ti,afe4403: txt to yaml binding
  dt-bindings:iio:health:ti,afe4404: txt to yaml conversion
  dt-bindings:iio:health:maxim,max30100: txt to yaml conversion
  dt-bindings:iio:health:maxim,max30102: txt to yaml conversion
  dt-bindings:iio:imu:adi,adis16480: txt to yaml conversion
  dt-bindings:iio:imu:st,lsm6dsx: txt to yaml conversion
  dt-bindings:iio:light:avago,apds9300: txt to yaml conversion.
  dt-bindings:iio:light:avago,apds9960: txt to yaml conversion
  dt-bindings:iio:light:capella,cm36651: txt to yaml conversion.
  dt-bindings:iio:light:sharp,gp2ap020a00f: txt to yaml conversion.
  dt-bindings:iio:light:maxim,max44009: txt to yaml conversion.
  dt-bindings:iio:light:ti,opt3001: txt to yaml conversion
  dt-bindings:iio:light:upisemi,us51882: txt to yaml conversion.
  dt-bindings:iio:light:st,uvis25: txt to yaml conversion for this UV
    sensor
  dt-bindings:iio:light:vishay,vcnl4035: txt to yaml conversion
  dt-bindings:iio:light:st,vl6180: txt to yaml format conversion.
  dt-bindings:iio:magnetometer:fsl,mag3110: txt to yaml conversion
  dt-bindings:iio:magnetometer:asahi-kasei,ak8974: txt to yaml format
    conversion
  dt-bindings:iio:magnetometer:bosch,bmc150_magn: txt to yaml
    conversion.
  dt-bindings:iio:magnetometer:honeywell,hmc5843: txt to yaml format
    conversion
  dt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion.
  dt-bindings:iio:adc:atmel,sama5d2-adc: txt to yaml conversion
  dt-bindings:iio:adc:atmel,sama9260-adc: conversion to yaml from
    at91_adc.txt
  dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion.
  dt-bindings:iio:adc:x-powers,axp209-adc: txt to yaml conversion
  dt-bindings:iio:adc:brcm,iproc-static-adc: txt to yaml conversion
  dt-bindings:iio:adc:mediatek,mt2701-auxadc: rename and yaml
    conversion.
  dt-bindings:iio:adc:ti,palmas-gpadc: txt to yaml format conversion.
  dt-bindings:iio:adc:qcom,pm8018-adc: yaml conversion and rename.
  dt-bindings:iio:adc:qcom,spmi-iadc: txt to yaml format conversion.
  dt-binding:iio:adc:ti,ads124s08: txt to yaml format conversion.
  dt-bindings:iio:dac:ad5592r: txt to yaml format conversion.
  dt-bindings:iio:dac:ad5755: txt to yaml format conversion.
  dt-bindings:iio:accel:bosch,bma180: txt to yaml format conversion.
  dt-bindings:iio:accel:kionix,kxcjk1013: txt to yaml format conversion.
  dt-bindings:iio:accel:fsl,mma8452: txt to yaml conversion.
  dt-bindings:iio:gyro:bosch,bmg180: txt to yaml format conversion.
  dt-bindings:iio:st,st-sensors: txt to yaml conversion.
  dt-bindings:iio:frequency:adi,adf4350: txt to yaml format conversion.
  dt-bindings:iio:temperature: Drop generic binding file.

 .../devicetree/bindings/iio/accel/bma180.txt  |  35 ---
 .../bindings/iio/accel/bosch,bma180.yaml      |  62 ++++++
 .../bindings/iio/accel/fsl,mma8452.yaml       |  62 ++++++
 .../bindings/iio/accel/kionix,kxcjk1013.txt   |  24 ---
 .../bindings/iio/accel/kionix,kxcjk1013.yaml  |  46 ++++
 .../devicetree/bindings/iio/accel/mma8452.txt |  35 ---
 .../bindings/iio/adc/at91-sama5d2_adc.txt     |  50 -----
 .../devicetree/bindings/iio/adc/at91_adc.txt  |  83 --------
 .../bindings/iio/adc/atmel,sama5d2-adc.yaml   | 104 +++++++++
 .../bindings/iio/adc/atmel,sama9260-adc.yaml  | 178 ++++++++++++++++
 .../bindings/iio/adc/axp20x_adc.txt           |  48 -----
 .../iio/adc/brcm,iproc-static-adc.txt         |  40 ----
 .../iio/adc/brcm,iproc-static-adc.yaml        |  70 ++++++
 .../iio/adc/mediatek,mt2701-auxadc.yaml       |  77 +++++++
 .../bindings/iio/adc/mt6577_auxadc.txt        |  34 ---
 .../bindings/iio/adc/palmas-gpadc.txt         |  48 -----
 .../bindings/iio/adc/qcom,pm8018-adc.yaml     | 166 +++++++++++++++
 .../bindings/iio/adc/qcom,pm8xxx-xoadc.txt    | 157 --------------
 .../bindings/iio/adc/qcom,spmi-iadc.txt       |  46 ----
 .../bindings/iio/adc/qcom,spmi-iadc.yaml      |  62 ++++++
 .../bindings/iio/adc/renesas,gyroadc.txt      |  98 ---------
 .../iio/adc/renesas,rcar-gyroadc.yaml         | 141 ++++++++++++
 .../bindings/iio/adc/ti,ads124s08.yaml        |  52 +++++
 .../bindings/iio/adc/ti,palmas-gpadc.yaml     |  87 ++++++++
 .../bindings/iio/adc/ti-ads124s08.txt         |  25 ---
 .../bindings/iio/adc/x-powers,axp209-adc.yaml |  67 ++++++
 .../devicetree/bindings/iio/dac/ad5592r.txt   | 155 --------------
 .../devicetree/bindings/iio/dac/ad5755.txt    | 124 -----------
 .../bindings/iio/dac/adi,ad5592r.yaml         | 201 ++++++++++++++++++
 .../bindings/iio/dac/adi,ad5755.yaml          | 178 ++++++++++++++++
 .../bindings/iio/frequency/adf4350.txt        |  86 --------
 .../bindings/iio/frequency/adi,adf4350.yaml   | 190 +++++++++++++++++
 .../bindings/iio/gyroscope/bmg160.txt         |  20 --
 .../bindings/iio/gyroscope/bosch,bmg160.yaml  |  46 ++++
 .../bindings/iio/health/afe4403.txt           |  33 ---
 .../bindings/iio/health/afe4404.txt           |  29 ---
 .../bindings/iio/health/max30100.txt          |  28 ---
 .../bindings/iio/health/max30102.txt          |  33 ---
 .../bindings/iio/health/maxim,max30100.yaml   |  52 +++++
 .../bindings/iio/health/maxim,max30102.yaml   |  75 +++++++
 .../bindings/iio/health/ti,afe4403.yaml       |  54 +++++
 .../bindings/iio/health/ti,afe4404.yaml       |  51 +++++
 .../iio/impedance-analyzer/ad5933.txt         |  26 ---
 .../iio/impedance-analyzer/adi,ad5933.yaml    |  59 +++++
 .../bindings/iio/imu/adi,adis16480.txt        |  86 --------
 .../bindings/iio/imu/adi,adis16480.yaml       | 130 +++++++++++
 .../bindings/iio/imu/st,lsm6dsx.yaml          |  86 ++++++++
 .../bindings/iio/imu/st_lsm6dsx.txt           |  49 -----
 .../bindings/iio/light/apds9300.txt           |  21 --
 .../bindings/iio/light/apds9960.txt           |  21 --
 .../bindings/iio/light/avago,apds9300.yaml    |  44 ++++
 .../bindings/iio/light/avago,apds9960.yaml    |  44 ++++
 .../bindings/iio/light/capella,cm36651.yaml   |  48 +++++
 .../devicetree/bindings/iio/light/cm36651.txt |  26 ---
 .../bindings/iio/light/gp2ap020a00f.txt       |  21 --
 .../bindings/iio/light/max44009.txt           |  24 ---
 .../bindings/iio/light/maxim,max44009.yaml    |  45 ++++
 .../devicetree/bindings/iio/light/opt3001.txt |  25 ---
 .../iio/light/sharp,gp2ap020a00f.yaml         |  49 +++++
 .../bindings/iio/light/st,uvis25.yaml         |  42 ++++
 .../bindings/iio/light/st,vl6180.yaml         |  45 ++++
 .../bindings/iio/light/ti,opt3001.yaml        |  47 ++++
 .../bindings/iio/light/upisemi,us5182.yaml    |  75 +++++++
 .../devicetree/bindings/iio/light/us5182d.txt |  45 ----
 .../devicetree/bindings/iio/light/uvis25.txt  |  22 --
 .../bindings/iio/light/vcnl4035.txt           |  18 --
 .../bindings/iio/light/vishay,vcnl4035.yaml   |  45 ++++
 .../devicetree/bindings/iio/light/vl6180.txt  |  15 --
 .../bindings/iio/magnetometer/ak8974.txt      |  31 ---
 .../iio/magnetometer/asahi-kasei,ak8974.yaml  |  57 +++++
 .../bindings/iio/magnetometer/bmc150_magn.txt |  25 ---
 .../iio/magnetometer/bosch,bmc150_magn.yaml   |  55 +++++
 .../iio/magnetometer/fsl,mag3110.yaml         |  48 +++++
 .../bindings/iio/magnetometer/hmc5843.txt     |  21 --
 .../iio/magnetometer/honeywell,hmc5843.yaml   |  43 ++++
 .../bindings/iio/magnetometer/mag3110.txt     |  27 ---
 .../bindings/iio/magnetometer/pni,rm3100.txt  |  20 --
 .../bindings/iio/magnetometer/pni,rm3100.yaml |  42 ++++
 .../bindings/iio/potentiometer/ad5272.txt     |  27 ---
 .../iio/potentiometer/adi,ad5272.yaml         |  50 +++++
 .../bindings/iio/potentiometer/mcp41010.txt   |  28 ---
 .../bindings/iio/potentiometer/mcp4131.txt    |  84 --------
 .../iio/potentiometer/microchip,mcp41010.yaml |  48 +++++
 .../iio/potentiometer/microchip,mcp4131.yaml  | 102 +++++++++
 .../bindings/iio/resolver/ad2s90.txt          |  31 ---
 .../bindings/iio/resolver/adi,ad2s90.yaml     |  60 ++++++
 .../iio/samsung,sensorhub-rinato.yaml         |  72 +++++++
 .../devicetree/bindings/iio/sensorhub.txt     |  24 ---
 .../bindings/iio/st,st-sensors.yaml           | 123 +++++++++++
 .../devicetree/bindings/iio/st-sensors.txt    |  82 -------
 .../iio/temperature/temperature-bindings.txt  |   7 -
 91 files changed, 3480 insertions(+), 2037 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/iio/accel/bma180.txt
 create mode 100644 Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/accel/fsl,mma8452.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.txt
 create mode 100644 Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/accel/mma8452.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/adc/at91-sama5d2_adc.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/adc/at91_adc.txt
 create mode 100644 Documentation/devicetree/bindings/iio/adc/atmel,sama5d2-adc.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/adc/atmel,sama9260-adc.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/adc/brcm,iproc-static-adc.txt
 create mode 100644 Documentation/devicetree/bindings/iio/adc/brcm,iproc-static-adc.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/adc/palmas-gpadc.txt
 create mode 100644 Documentation/devicetree/bindings/iio/adc/qcom,pm8018-adc.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/adc/qcom,pm8xxx-xoadc.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.txt
 create mode 100644 Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt
 create mode 100644 Documentation/devicetree/bindings/iio/adc/renesas,rcar-gyroadc.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,ads124s08.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,palmas-gpadc.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/adc/ti-ads124s08.txt
 create mode 100644 Documentation/devicetree/bindings/iio/adc/x-powers,axp209-adc.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/dac/ad5592r.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/dac/ad5755.txt
 create mode 100644 Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/frequency/adf4350.txt
 create mode 100644 Documentation/devicetree/bindings/iio/frequency/adi,adf4350.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/gyroscope/bmg160.txt
 create mode 100644 Documentation/devicetree/bindings/iio/gyroscope/bosch,bmg160.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/health/afe4403.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/health/afe4404.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/health/max30100.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/health/max30102.txt
 create mode 100644 Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/health/maxim,max30102.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/health/ti,afe4403.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt
 create mode 100644 Documentation/devicetree/bindings/iio/impedance-analyzer/adi,ad5933.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/imu/adi,adis16480.txt
 create mode 100644 Documentation/devicetree/bindings/iio/imu/adi,adis16480.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/light/apds9300.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/light/apds9960.txt
 create mode 100644 Documentation/devicetree/bindings/iio/light/avago,apds9300.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/light/capella,cm36651.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/light/cm36651.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/light/gp2ap020a00f.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/light/max44009.txt
 create mode 100644 Documentation/devicetree/bindings/iio/light/maxim,max44009.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/light/opt3001.txt
 create mode 100644 Documentation/devicetree/bindings/iio/light/sharp,gp2ap020a00f.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/light/st,uvis25.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/light/st,vl6180.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/light/ti,opt3001.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/light/us5182d.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/light/uvis25.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/light/vcnl4035.txt
 create mode 100644 Documentation/devicetree/bindings/iio/light/vishay,vcnl4035.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/light/vl6180.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/magnetometer/ak8974.txt
 create mode 100644 Documentation/devicetree/bindings/iio/magnetometer/asahi-kasei,ak8974.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt
 create mode 100644 Documentation/devicetree/bindings/iio/magnetometer/bosch,bmc150_magn.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/magnetometer/fsl,mag3110.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/magnetometer/hmc5843.txt
 create mode 100644 Documentation/devicetree/bindings/iio/magnetometer/honeywell,hmc5843.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/magnetometer/mag3110.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.txt
 create mode 100644 Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
 create mode 100644 Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/potentiometer/mcp41010.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/potentiometer/mcp4131.txt
 create mode 100644 Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp41010.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp4131.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/resolver/ad2s90.txt
 create mode 100644 Documentation/devicetree/bindings/iio/resolver/adi,ad2s90.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/samsung,sensorhub-rinato.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/sensorhub.txt
 create mode 100644 Documentation/devicetree/bindings/iio/st,st-sensors.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/st-sensors.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/temperature/temperature-bindings.txt

-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 01/46] dt-bindings:iio:resolver:adi,ad2s90: Conversion of binding to yaml.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion Jonathan Cameron
                   ` (45 subsequent siblings)
  46 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree
  Cc: Jonathan Cameron, Matheus Tavares, Alexandru Ardelean

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Simple binding with a good description of why the spi-max-frequency is,
in practice not as high as the datasheet implies.  I've set the
maximum as per the value established in the description.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Matheus Tavares <matheus.bernardino@usp.br>
Cc: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
 .../bindings/iio/resolver/ad2s90.txt          | 31 ----------
 .../bindings/iio/resolver/adi,ad2s90.yaml     | 60 +++++++++++++++++++
 2 files changed, 60 insertions(+), 31 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/resolver/ad2s90.txt b/Documentation/devicetree/bindings/iio/resolver/ad2s90.txt
deleted file mode 100644
index 477d41fa6467..000000000000
--- a/Documentation/devicetree/bindings/iio/resolver/ad2s90.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-Analog Devices AD2S90 Resolver-to-Digital Converter
-
-https://www.analog.com/en/products/ad2s90.html
-
-Required properties:
-  - compatible: should be "adi,ad2s90"
-  - reg: SPI chip select number for the device
-  - spi-max-frequency: set maximum clock frequency, must be 830000
-  - spi-cpol and spi-cpha:
-        Either SPI mode (0,0) or (1,1) must be used, so specify none or both of
-        spi-cpha, spi-cpol.
-
-See for more details:
-    Documentation/devicetree/bindings/spi/spi-bus.txt
-
-Note about max frequency:
-    Chip's max frequency, as specified in its datasheet, is 2Mhz. But a 600ns
-    delay is expected between the application of a logic LO to CS and the
-    application of SCLK, as also specified. And since the delay is not
-    implemented in the spi code, to satisfy it, SCLK's period should be at most
-    2 * 600ns, so the max frequency should be 1 / (2 * 6e-7), which gives
-    roughly 830000Hz.
-
-Example:
-resolver@0 {
-	compatible = "adi,ad2s90";
-	reg = <0>;
-	spi-max-frequency = <830000>;
-	spi-cpol;
-	spi-cpha;
-};
diff --git a/Documentation/devicetree/bindings/iio/resolver/adi,ad2s90.yaml b/Documentation/devicetree/bindings/iio/resolver/adi,ad2s90.yaml
new file mode 100644
index 000000000000..81e4bdfc17c4
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/resolver/adi,ad2s90.yaml
@@ -0,0 +1,60 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/resolver/adi,ad2s90.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD2S90 Resolver-to-Digital Converter
+
+maintainers:
+  - Matheus Tavares <matheus.bernardino@usp.br>
+
+description: |
+  Datasheet: https://www.analog.com/en/products/ad2s90.html
+
+properties:
+  compatible:
+    const: adi,ad2s90
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency:
+    maximum: 830000
+    description: |
+      Chip's max frequency, as specified in its datasheet, is 2Mhz. But a 600ns
+      delay is expected between the application of a logic LO to CS and the
+      application of SCLK, as also specified. And since the delay is not
+      implemented in the spi code, to satisfy it, SCLK's period should be at
+      most 2 * 600ns, so the max frequency should be 1 / (2 * 6e-7), which gives
+      roughly 830000Hz.
+
+  spi-cpol: true
+
+  spi-cpha: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+dependencies:
+  spi-cpol: [ spi-cpha ]
+  spi-cpha: [ spi-cpol ]
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        resolver@0 {
+            compatible = "adi,ad2s90";
+            reg = <0>;
+            spi-max-frequency = <830000>;
+            spi-cpol;
+            spi-cpha;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 01/46] dt-bindings:iio:resolver:adi,ad2s90: Conversion of binding to yaml Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-02  4:48   ` Phil Reid
  2020-11-03 16:10   ` Rob Herring
  2020-10-31 18:48 ` [PATCH 03/46] dt-bindings:iio:potentiometer:microchip,mcp4131 txt to " Jonathan Cameron
                   ` (44 subsequent siblings)
  46 siblings, 2 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Phil Reid

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Simple direct conversion from txt to yaml as part of a general aim of
converting all IIO bindings to this machine readable format.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Phil Reid <preid@electromag.com.au>
---
 .../bindings/iio/potentiometer/ad5272.txt     | 27 ----------
 .../iio/potentiometer/adi,ad5272.yaml         | 50 +++++++++++++++++++
 2 files changed, 50 insertions(+), 27 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt b/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
deleted file mode 100644
index f9b2eef946aa..000000000000
--- a/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-* Analog Devices AD5272 digital potentiometer
-
-The node for this device must be a child node of a I2C controller, hence
-all mandatory properties for your controller must be specified. See directory:
-
-        Documentation/devicetree/bindings/i2c
-
-for more details.
-
-Required properties:
-	- compatible:  	Must be one of the following, depending on the model:
-			adi,ad5272-020
-			adi,ad5272-050
-			adi,ad5272-100
-			adi,ad5274-020
-			adi,ad5274-100
-
-Optional properties:
- - reset-gpios: GPIO specification for the RESET input. This is an
-		active low signal to the AD5272.
-
-Example:
-ad5272: potentiometer@2f {
-	reg = <0x2F>;
-	compatible = "adi,ad5272-020";
-	reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
-};
diff --git a/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml b/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
new file mode 100644
index 000000000000..b9b7d383bff1
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
@@ -0,0 +1,50 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/potentiometer/adi,ad5272.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD5272 digital potentiometer
+
+maintainers:
+  - Phil Reid <preid@electromag.com.au>
+
+description: |
+  Datasheet: https://www.analog.com/en/products/ad5272.html
+
+properties:
+  compatible:
+    enum:
+      - adi,ad5272-020
+      - adi,ad5272-050
+      - adi,ad5272-100
+      - adi,ad5274-020
+      - adi,ad5274-100
+
+  reg:
+    maxItems: 1
+
+  reset-gpios:
+    description:
+      Active low signal to the AD5272 RESET input.
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        potentiometer@2f {
+            compatible = "adi,ad5272-020";
+            reg = <0x2F>;
+            reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 03/46] dt-bindings:iio:potentiometer:microchip,mcp4131 txt to yaml conversion
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 01/46] dt-bindings:iio:resolver:adi,ad2s90: Conversion of binding to yaml Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-02 16:19   ` Slawomir Stepien
  2020-11-03 16:11   ` Rob Herring
  2020-10-31 18:48 ` [PATCH 04/46] dt-bindings:iio:potentiometer:microchip,mcp41010 " Jonathan Cameron
                   ` (43 subsequent siblings)
  46 siblings, 2 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Slawomir Stepien

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This binding is very simple, but I think the very large number of
compatible values make it unsuitable for moving to trivial-devices.yaml.
Main change in the conversion was reordering the compatible list to
numerical order.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Slawomir Stepien <sst@poczta.fm>
---
 .../bindings/iio/potentiometer/mcp4131.txt    |  84 ---------------
 .../iio/potentiometer/microchip,mcp4131.yaml  | 102 ++++++++++++++++++
 2 files changed, 102 insertions(+), 84 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/potentiometer/mcp4131.txt b/Documentation/devicetree/bindings/iio/potentiometer/mcp4131.txt
deleted file mode 100644
index 3ccba16f7035..000000000000
--- a/Documentation/devicetree/bindings/iio/potentiometer/mcp4131.txt
+++ /dev/null
@@ -1,84 +0,0 @@
-* Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X Digital Potentiometer
-  driver
-
-The node for this driver must be a child node of a SPI controller, hence
-all mandatory properties described in
-
-        Documentation/devicetree/bindings/spi/spi-bus.txt
-
-must be specified.
-
-Required properties:
-	- compatible:  	Must be one of the following, depending on the
-			model:
-			"microchip,mcp4131-502"
-			"microchip,mcp4131-103"
-			"microchip,mcp4131-503"
-			"microchip,mcp4131-104"
-			"microchip,mcp4132-502"
-			"microchip,mcp4132-103"
-			"microchip,mcp4132-503"
-			"microchip,mcp4132-104"
-			"microchip,mcp4141-502"
-			"microchip,mcp4141-103"
-			"microchip,mcp4141-503"
-			"microchip,mcp4141-104"
-			"microchip,mcp4142-502"
-			"microchip,mcp4142-103"
-			"microchip,mcp4142-503"
-			"microchip,mcp4142-104"
-			"microchip,mcp4151-502"
-			"microchip,mcp4151-103"
-			"microchip,mcp4151-503"
-			"microchip,mcp4151-104"
-			"microchip,mcp4152-502"
-			"microchip,mcp4152-103"
-			"microchip,mcp4152-503"
-			"microchip,mcp4152-104"
-			"microchip,mcp4161-502"
-			"microchip,mcp4161-103"
-			"microchip,mcp4161-503"
-			"microchip,mcp4161-104"
-			"microchip,mcp4162-502"
-			"microchip,mcp4162-103"
-			"microchip,mcp4162-503"
-			"microchip,mcp4162-104"
-			"microchip,mcp4231-502"
-			"microchip,mcp4231-103"
-			"microchip,mcp4231-503"
-			"microchip,mcp4231-104"
-			"microchip,mcp4232-502"
-			"microchip,mcp4232-103"
-			"microchip,mcp4232-503"
-			"microchip,mcp4232-104"
-			"microchip,mcp4241-502"
-			"microchip,mcp4241-103"
-			"microchip,mcp4241-503"
-			"microchip,mcp4241-104"
-			"microchip,mcp4242-502"
-			"microchip,mcp4242-103"
-			"microchip,mcp4242-503"
-			"microchip,mcp4242-104"
-			"microchip,mcp4251-502"
-			"microchip,mcp4251-103"
-			"microchip,mcp4251-503"
-			"microchip,mcp4251-104"
-			"microchip,mcp4252-502"
-			"microchip,mcp4252-103"
-			"microchip,mcp4252-503"
-			"microchip,mcp4252-104"
-			"microchip,mcp4261-502"
-			"microchip,mcp4261-103"
-			"microchip,mcp4261-503"
-			"microchip,mcp4261-104"
-			"microchip,mcp4262-502"
-			"microchip,mcp4262-103"
-			"microchip,mcp4262-503"
-			"microchip,mcp4262-104"
-
-Example:
-mcp4131: mcp4131@0 {
-	compatible = "mcp4131-502";
-	reg = <0>;
-	spi-max-frequency = <500000>;
-};
diff --git a/Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp4131.yaml b/Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp4131.yaml
new file mode 100644
index 000000000000..834d17ae3730
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp4131.yaml
@@ -0,0 +1,102 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/potentiometer/microchip,mcp4131.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X Digital Potentiometer
+maintainers:
+  - Slawomir Stepien <sst@poczta.fm>
+
+properties:
+  compatible:
+    enum:
+      - microchip,mcp4131-103
+      - microchip,mcp4131-104
+      - microchip,mcp4131-502
+      - microchip,mcp4131-503
+      - microchip,mcp4132-103
+      - microchip,mcp4132-104
+      - microchip,mcp4132-502
+      - microchip,mcp4132-503
+      - microchip,mcp4141-103
+      - microchip,mcp4141-104
+      - microchip,mcp4141-502
+      - microchip,mcp4141-503
+      - microchip,mcp4142-103
+      - microchip,mcp4142-104
+      - microchip,mcp4142-502
+      - microchip,mcp4142-503
+      - microchip,mcp4151-103
+      - microchip,mcp4151-104
+      - microchip,mcp4151-502
+      - microchip,mcp4151-503
+      - microchip,mcp4152-103
+      - microchip,mcp4152-104
+      - microchip,mcp4152-502
+      - microchip,mcp4152-503
+      - microchip,mcp4161-103
+      - microchip,mcp4161-104
+      - microchip,mcp4161-502
+      - microchip,mcp4161-503
+      - microchip,mcp4162-103
+      - microchip,mcp4162-104
+      - microchip,mcp4162-502
+      - microchip,mcp4162-503
+      - microchip,mcp4231-103
+      - microchip,mcp4231-104
+      - microchip,mcp4231-502
+      - microchip,mcp4231-503
+      - microchip,mcp4232-103
+      - microchip,mcp4232-104
+      - microchip,mcp4232-502
+      - microchip,mcp4232-503
+      - microchip,mcp4241-103
+      - microchip,mcp4241-104
+      - microchip,mcp4241-502
+      - microchip,mcp4241-503
+      - microchip,mcp4242-103
+      - microchip,mcp4242-104
+      - microchip,mcp4242-502
+      - microchip,mcp4242-503
+      - microchip,mcp4251-103
+      - microchip,mcp4251-104
+      - microchip,mcp4251-502
+      - microchip,mcp4251-503
+      - microchip,mcp4252-103
+      - microchip,mcp4252-104
+      - microchip,mcp4252-502
+      - microchip,mcp4252-503
+      - microchip,mcp4261-103
+      - microchip,mcp4261-104
+      - microchip,mcp4261-502
+      - microchip,mcp4261-503
+      - microchip,mcp4262-103
+      - microchip,mcp4262-104
+      - microchip,mcp4262-502
+      - microchip,mcp4262-503
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        potentiometer@0 {
+            compatible = "mcp4131-502";
+            reg = <0>;
+            spi-max-frequency = <500000>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 04/46] dt-bindings:iio:potentiometer:microchip,mcp41010 txt to yaml conversion
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (2 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 03/46] dt-bindings:iio:potentiometer:microchip,mcp4131 txt to " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 05/46] dt-bindings:iio:impedance-analyzer:adi,ad5933 " Jonathan Cameron
                   ` (42 subsequent siblings)
  46 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Chris Coffey

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

A simple binding that I almost just move to trivial devices.
The small amount of additional documentation and relatively large number
of compatible entries convinced me to suggest we keep this one separately
documented.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Chris Coffey <cmc@babblebit.net>
---
 .../bindings/iio/potentiometer/mcp41010.txt   | 28 -----------
 .../iio/potentiometer/microchip,mcp41010.yaml | 48 +++++++++++++++++++
 2 files changed, 48 insertions(+), 28 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/potentiometer/mcp41010.txt b/Documentation/devicetree/bindings/iio/potentiometer/mcp41010.txt
deleted file mode 100644
index 4f245e8469fd..000000000000
--- a/Documentation/devicetree/bindings/iio/potentiometer/mcp41010.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-* Microchip MCP41010/41050/41100/42010/42050/42100 Digital Potentiometer
-
-Datasheet publicly available at:
-https://ww1.microchip.com/downloads/en/devicedoc/11195c.pdf
-
-The node for this driver must be a child node of a SPI controller, hence
-all mandatory properties described in
-
-        Documentation/devicetree/bindings/spi/spi-bus.txt
-
-must be specified.
-
-Required properties:
-	- compatible:  	Must be one of the following, depending on the
-			model:
-			"microchip,mcp41010"
-			"microchip,mcp41050"
-			"microchip,mcp41100"
-			"microchip,mcp42010"
-			"microchip,mcp42050"
-			"microchip,mcp42100"
-
-Example:
-potentiometer@0 {
-	compatible = "microchip,mcp41010";
-	reg = <0>;
-	spi-max-frequency = <500000>;
-};
diff --git a/Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp41010.yaml b/Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp41010.yaml
new file mode 100644
index 000000000000..567697d996ec
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp41010.yaml
@@ -0,0 +1,48 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/potentiometer/microchip,mcp41010.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip MCP41010/41050/41100/42010/42050/42100 Digital Potentiometer
+
+maintainers:
+  - Chris Coffey <cmc@babblebit.net>
+
+description: |
+  Datasheet: https://ww1.microchip.com/downloads/en/devicedoc/11195c.pdf
+
+properties:
+  compatible:
+    enum:
+      - microchip,mcp41010
+      - microchip,mcp41050
+      - microchip,mcp41100
+      - microchip,mcp42010
+      - microchip,mcp42050
+      - microchip,mcp42100
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        potentiometer@0 {
+            compatible = "microchip,mcp41010";
+            reg = <0>;
+            spi-max-frequency = <500000>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 05/46] dt-bindings:iio:impedance-analyzer:adi,ad5933 yaml conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (3 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 04/46] dt-bindings:iio:potentiometer:microchip,mcp41010 " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 06/46] dt-bindings:iio:samsung,sensorhub-rinato: " Jonathan Cameron
                   ` (41 subsequent siblings)
  46 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree
  Cc: Jonathan Cameron, Marcelo Schmitt, Gabriel Capella, Alexandru Ardelean

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

The example in this one had a completely wrong compatible so I've
fixed that. Otherwise, a fairly simple conversion.

Note the driver itself is still in staging.  Looking back at the
last discussion around this, I think we were just waiting for some
test results on some refactors.  As such the binding should be stable
even if the driver might need a little more love and attention.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Cc: Gabriel Capella <gabriel@capella.pro>
Cc: Alexandru Ardelean <Alexandru.Ardelean@analog.com>
---
 .../iio/impedance-analyzer/ad5933.txt         | 26 --------
 .../iio/impedance-analyzer/adi,ad5933.yaml    | 59 +++++++++++++++++++
 2 files changed, 59 insertions(+), 26 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt b/Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt
deleted file mode 100644
index 5ff38728ff91..000000000000
--- a/Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-Analog Devices AD5933/AD5934 Impedance Converter, Network Analyzer
-
-https://www.analog.com/media/en/technical-documentation/data-sheets/AD5933.pdf
-https://www.analog.com/media/en/technical-documentation/data-sheets/AD5934.pdf
-
-Required properties:
- - compatible : should be one of
-		"adi,ad5933"
-		"adi,ad5934"
- - reg : the I2C address.
- - vdd-supply : The regulator supply for DVDD, AVDD1 and AVDD2 when they
-   are connected together.
-
-Optional properties:
-- clocks : external clock reference.
-- clock-names : must be "mclk" if clocks is set.
-
-Example for a I2C device node:
-
-	impedance-analyzer@0d {
-		compatible = "adi,adxl345";
-		reg = <0x0d>;
-		vdd-supply = <&vdd_supply>;
-		clocks = <&ref_clk>;
-		clock-names = "mclk";
-	};
diff --git a/Documentation/devicetree/bindings/iio/impedance-analyzer/adi,ad5933.yaml b/Documentation/devicetree/bindings/iio/impedance-analyzer/adi,ad5933.yaml
new file mode 100644
index 000000000000..2ad043554b9c
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/impedance-analyzer/adi,ad5933.yaml
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/impedance-analyzer/adi,ad5933.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD5933/AD5934 Impedance Converter, Network Analyzer
+
+maintainers:
+  - Marcelo Schmitt <marcelo.schmitt1@gmail.com>
+  - Gabriel Capella <gabriel@capella.pro>
+
+description: |
+  https://www.analog.com/media/en/technical-documentation/data-sheets/AD5933.pdf
+  https://www.analog.com/media/en/technical-documentation/data-sheets/AD5934.pdf
+
+properties:
+  compatible:
+    enum:
+      - adi,ad5933
+      - adi,ad5934
+
+  reg:
+    maxItems: 1
+
+  vdd-supply:
+    description: |
+      The regulator supply for DVDD, AVDD1 and AVDD2 when they
+      are connected together.  Used to calculate voltage scaling of measurement
+      channels.
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: mclk
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - vdd-supply
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        impedance-analyzer@d {
+            compatible = "adi,ad5933";
+            reg = <0x0d>;
+            vdd-supply = <&vdd_supply>;
+            clocks = <&ref_clk>;
+            clock-names = "mclk";
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 06/46] dt-bindings:iio:samsung,sensorhub-rinato: yaml conversion
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (4 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 05/46] dt-bindings:iio:impedance-analyzer:adi,ad5933 " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-22 16:43   ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 07/46] dt-bindings:iio:health:ti,afe4403: txt to yaml binding Jonathan Cameron
                   ` (40 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Karol Wrona

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Renamed to be more specific as I would be surprised if this is the only
sensorhub Samsung have ever shipped.
Fixed missing reg property in the example

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Karol Wrona <k.wrona@samsung.com>
---
 .../iio/samsung,sensorhub-rinato.yaml         | 72 +++++++++++++++++++
 .../devicetree/bindings/iio/sensorhub.txt     | 24 -------
 2 files changed, 72 insertions(+), 24 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/samsung,sensorhub-rinato.yaml b/Documentation/devicetree/bindings/iio/samsung,sensorhub-rinato.yaml
new file mode 100644
index 000000000000..62366cbd37e5
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/samsung,sensorhub-rinato.yaml
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/samsung,sensorhub-rinato.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Samsung Sensorhub driver
+
+maintainers:
+  - Karol Wrona <k.wrona@samsung.com>
+
+description: |
+  Sensorhub is a MCU which manages several sensors and also plays the role
+  of a virtual sensor device.
+
+properties:
+  compatible:
+    enum:
+      - samsung,sensorhub-rinato
+      - samsung,sensorhub-thermostat
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  ap-mcu-gpios:
+    maxItems: 1
+    description:
+      Application Processor to sensorhub line - used during communication
+
+  mcu-ap-gpios:
+    maxItems: 1
+    description:
+      Sensorhub to Application Processor - used during communication
+
+  mcu-reset-gpios:
+    maxItems: 1
+    description:
+      Reset the sensorhub.
+
+  spi-max-frequency: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - ap-mcu-gpios
+  - mcu-ap-gpios
+  - mcu-reset-gpios
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        sensorhub@0 {
+            compatible = "samsung,sensorhub-rinato";
+            reg = <0>;
+            spi-max-frequency = <5000000>;
+            interrupt-parent = <&gpx0>;
+            interrupts = <2 0>;
+            ap-mcu-gpios = <&gpx0 0 0>;
+            mcu-ap-gpios = <&gpx0 4 0>;
+            mcu-reset-gpios = <&gpx0 5 0>;
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/iio/sensorhub.txt b/Documentation/devicetree/bindings/iio/sensorhub.txt
deleted file mode 100644
index b6ac0457d4ea..000000000000
--- a/Documentation/devicetree/bindings/iio/sensorhub.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-Samsung Sensorhub driver
-
-Sensorhub is a MCU which manages several sensors and also plays the role
-of a virtual sensor device.
-
-Required properties:
-- compatible: "samsung,sensorhub-rinato" or "samsung,sensorhub-thermostat"
-- spi-max-frequency: max SPI clock frequency
-- interrupts: communication interrupt
-- ap-mcu-gpios: [out] ap to sensorhub line - used during communication
-- mcu-ap-gpios: [in] sensorhub to ap - used during communication
-- mcu-reset-gpios: [out] sensorhub reset
-
-Example:
-
-	shub_spi: shub {
-		compatible = "samsung,sensorhub-rinato";
-		spi-max-frequency = <5000000>;
-		interrupt-parent = <&gpx0>;
-		interrupts = <2 0>;
-		ap-mcu-gpios = <&gpx0 0 0>;
-		mcu-ap-gpios = <&gpx0 4 0>;
-		mcu-reset-gpios = <&gpx0 5 0>;
-	};
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 07/46] dt-bindings:iio:health:ti,afe4403: txt to yaml binding
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (5 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 06/46] dt-bindings:iio:samsung,sensorhub-rinato: " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-22 17:32   ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 08/46] dt-bindings:iio:health:ti,afe4404: txt to yaml conversion Jonathan Cameron
                   ` (39 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Andrew F . Davis

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

A few questions came up whilst converting this one.
1) What is actually required?
  - Checking Linux driver, interrupt is not, and the tx-supply could
    be supplied by a stub regulator as long as it's always on.
    As such I have reduced the required list to just compatible and reg.
2) What is the regulator called?
  - It's tx-supply in the binding doc, but the driver request tx_sup
    I've left this alone for now.  Andrew could you confirm what is
    intended for this?

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Andrew F. Davis <afd@ti.com>
---
 .../bindings/iio/health/afe4403.txt           | 33 ------------
 .../bindings/iio/health/ti,afe4403.yaml       | 54 +++++++++++++++++++
 2 files changed, 54 insertions(+), 33 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/health/afe4403.txt b/Documentation/devicetree/bindings/iio/health/afe4403.txt
deleted file mode 100644
index 8e412054d6d5..000000000000
--- a/Documentation/devicetree/bindings/iio/health/afe4403.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-Texas Instruments AFE4403 Heart rate and Pulse Oximeter
-
-Required properties:
- - compatible		: Should be "ti,afe4403".
- - reg			: SPI chip select address of device.
- - tx-supply		: Regulator supply to transmitting LEDs.
- - interrupts		: The interrupt line the device ADC_RDY pin is
-			  connected to. For details refer to,
-			  ../../interrupt-controller/interrupts.txt.
-
-Optional properties:
- - reset-gpios		: GPIO used to reset the device.
-			  For details refer to, ../../gpio/gpio.txt.
-
-For other required and optional properties of SPI slave nodes
-please refer to ../../spi/spi-bus.txt.
-
-Example:
-
-&spi0 {
-	heart_mon@0 {
-		compatible = "ti,afe4403";
-		reg = <0>;
-		spi-max-frequency = <10000000>;
-
-		tx-supply = <&vbat>;
-
-		interrupt-parent = <&gpio1>;
-		interrupts = <28 IRQ_TYPE_EDGE_RISING>;
-
-		reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
-	};
-};
diff --git a/Documentation/devicetree/bindings/iio/health/ti,afe4403.yaml b/Documentation/devicetree/bindings/iio/health/ti,afe4403.yaml
new file mode 100644
index 000000000000..5c86db65c033
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/health/ti,afe4403.yaml
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/health/ti,afe4403.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments AFE4403 Heart rate and Pulse Oximeter
+
+maintainers:
+  - Andrew F. Davis <afd@ti.com>
+
+properties:
+  compatible:
+    const: ti,afe4403
+
+  reg:
+    maxItems: 1
+
+  tx-supply:
+    description: Supply to transmitting LEDs.
+
+  interrupts:
+    maxItems: 1
+    description: Connected to ADC_RDY pin.
+
+  reset-gpios: true
+
+  spi-max-frequency: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        heart_mon@0 {
+            compatible = "ti,afe4403";
+            reg = <0>;
+            spi-max-frequency = <10000000>;
+            tx-supply = <&vbat>;
+            interrupt-parent = <&gpio1>;
+            interrupts = <28 IRQ_TYPE_EDGE_RISING>;
+            reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 08/46] dt-bindings:iio:health:ti,afe4404: txt to yaml conversion
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (6 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 07/46] dt-bindings:iio:health:ti,afe4403: txt to yaml binding Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-28 16:24   ` Jonathan Cameron
  2020-12-18 19:42   ` Rob Herring
  2020-10-31 18:48 ` [PATCH 09/46] dt-bindings:iio:health:maxim,max30100: " Jonathan Cameron
                   ` (38 subsequent siblings)
  46 siblings, 2 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Andrew F . Davis

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This basically has same questions as for the afe4403.  We could combine
the two bindings, but as the drivers are separate and it would be a little
fiddly due to different buses let's keep the separating.
To repeat questions from the ti,afe4403 binding.

A few questions came up whilst converting this one.
1) What is actually required?
   - Checking Linux driver, interrupt is not, and the tx-supply could
     be supplied by a stub regulator as long as it's always on.
     As such I have reduced the required list to just compatible and reg.
2) What is the regulator called?
   - It's tx-supply in the binding doc, but the driver request tx_sup
     I've left this alone for now.  Andrew could you confirm what is
     intended for this?

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Andrew F. Davis <afd@ti.com>
---
 .../bindings/iio/health/afe4404.txt           | 29 -----------
 .../bindings/iio/health/ti,afe4404.yaml       | 51 +++++++++++++++++++
 2 files changed, 51 insertions(+), 29 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/health/afe4404.txt b/Documentation/devicetree/bindings/iio/health/afe4404.txt
deleted file mode 100644
index 0b52830a0d9c..000000000000
--- a/Documentation/devicetree/bindings/iio/health/afe4404.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-Texas Instruments AFE4404 Heart rate and Pulse Oximeter
-
-Required properties:
- - compatible		: Should be "ti,afe4404".
- - reg			: I2C address of the device.
- - tx-supply		: Regulator supply to transmitting LEDs.
- - interrupts		: The interrupt line the device ADC_RDY pin is
-			  connected to. For details refer to,
-			  ../interrupt-controller/interrupts.txt.
-
-Optional properties:
- - reset-gpios		: GPIO used to reset the device.
-			  For details refer to, ../gpio/gpio.txt.
-
-Example:
-
-&i2c2 {
-	heart_mon@58 {
-		compatible = "ti,afe4404";
-		reg = <0x58>;
-
-		tx-supply = <&vbat>;
-
-		interrupt-parent = <&gpio1>;
-		interrupts = <28 IRQ_TYPE_EDGE_RISING>;
-
-		reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
-	};
-};
diff --git a/Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml b/Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml
new file mode 100644
index 000000000000..187b99b22312
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml
@@ -0,0 +1,51 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/health/ti,afe4404.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments AFE4404 Heart rate and Pulse Oximeter
+
+maintainers:
+  - Andrew F. Davis <afd@ti.com>
+
+properties:
+  compatible:
+    const: ti,afe4403
+
+  reg:
+    maxItems: 1
+
+  tx-supply:
+    description: Supply to transmitting LEDs.
+
+  interrupts:
+    maxItems: 1
+    description: Connected to ADC_RDY pin.
+
+  reset-gpios: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        heart_mon@58 {
+            compatible = "ti,afe4404";
+            reg = <0x58>;
+            tx-supply = <&vbat>;
+            interrupt-parent = <&gpio1>;
+            interrupts = <28 IRQ_TYPE_EDGE_RISING>;
+            reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 09/46] dt-bindings:iio:health:maxim,max30100: txt to yaml conversion
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (7 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 08/46] dt-bindings:iio:health:ti,afe4404: txt to yaml conversion Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 21:41   ` Matt Ranostay
  2020-10-31 18:48 ` [PATCH 10/46] dt-bindings:iio:health:maxim,max30102: " Jonathan Cameron
                   ` (37 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Straight forward conversion. As with other bindings I've dropped
any standrd description, but kept the unusual bits, in thisscase
the maxim,led-current-microamp and it's description.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 .../bindings/iio/health/max30100.txt          | 28 ----------
 .../bindings/iio/health/maxim,max30100.yaml   | 52 +++++++++++++++++++
 2 files changed, 52 insertions(+), 28 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/health/max30100.txt b/Documentation/devicetree/bindings/iio/health/max30100.txt
deleted file mode 100644
index 0054908a6e74..000000000000
--- a/Documentation/devicetree/bindings/iio/health/max30100.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-Maxim MAX30100 heart rate and pulse oximeter sensor
-
-* https://datasheets.maximintegrated.com/en/ds/MAX30100.pdf
-
-Required properties:
-  - compatible: must be "maxim,max30100"
-  - reg: the I2C address of the sensor
-  - interrupts: the sole interrupt generated by the device
-
-  Refer to interrupt-controller/interrupts.txt for generic
-  interrupt client node bindings.
-
-Optional properties:
-  - maxim,led-current-microamp: configuration for LED current in microamperes
-    while the engine is running. First indexed value is the configuration for
-    the RED LED, and second value is for the IR LED.
-
-    Refer to the datasheet for the allowed current values.
-
-Example:
-
-max30100@57 {
-	compatible = "maxim,max30100";
-	reg = <0x57>;
-	maxim,led-current-microamp = <24000 50000>;
-	interrupt-parent = <&gpio1>;
-	interrupts = <16 2>;
-};
diff --git a/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml b/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml
new file mode 100644
index 000000000000..5684f2f61bcc
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml
@@ -0,0 +1,52 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/health/maxim,max30100.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Maxim MAX30100 heart rate and pulse oximeter sensor
+
+maintainers:
+  - Matt Ranostay <mranostay@gmail.com>
+
+properties:
+  compatible:
+    const: maxim,max30100
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+    description: Connected to ADC_RDY pin.
+
+  maxim,led-current-microamp:
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    minItems: 2
+    maxItems: 2
+    description: |
+      LED current whilst the engine is running. First indexed value is
+      the configuration for the RED LED, and second value is for the IR LED.
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        heart-rate@57 {
+            compatible = "maxim,max30100";
+            reg = <0x57>;
+            maxim,led-current-microamp = <24000 50000>;
+            interrupt-parent = <&gpio1>;
+            interrupts = <16 2>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 10/46] dt-bindings:iio:health:maxim,max30102: txt to yaml conversion
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (8 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 09/46] dt-bindings:iio:health:maxim,max30100: " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 21:38   ` Matt Ranostay
  2020-10-31 18:48 ` [PATCH 11/46] dt-bindings:iio:imu:adi,adis16480: " Jonathan Cameron
                   ` (36 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Matt Ranostay

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Straight forward binding.  Title was a bit of a challenge to keep short
as this binding covers sensors for two entirely different purposes.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Matt Ranostay <mranostay@gmail.com>
---
 .../bindings/iio/health/max30102.txt          | 33 --------
 .../bindings/iio/health/maxim,max30102.yaml   | 75 +++++++++++++++++++
 2 files changed, 75 insertions(+), 33 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/health/max30102.txt b/Documentation/devicetree/bindings/iio/health/max30102.txt
deleted file mode 100644
index 7ef7ae40ae4f..000000000000
--- a/Documentation/devicetree/bindings/iio/health/max30102.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-Maxim MAX30102 heart rate and pulse oximeter sensor
-Maxim MAX30105 optical particle-sensing module
-
-* https://datasheets.maximintegrated.com/en/ds/MAX30102.pdf
-* https://datasheets.maximintegrated.com/en/ds/MAX30105.pdf
-
-Required properties:
-  - compatible: must be "maxim,max30102" or "maxim,max30105"
-  - reg: the I2C address of the sensor
-  - interrupts: the sole interrupt generated by the device
-
-  Refer to interrupt-controller/interrupts.txt for generic
-  interrupt client node bindings.
-
-Optional properties:
-  - maxim,red-led-current-microamp: configuration for red LED current
-  - maxim,ir-led-current-microamp: configuration for IR LED current
-  - maxim,green-led-current-microamp: configuration for green LED current
-    (max30105 only)
-
-    Note that each step is approximately 200 microamps, ranging from 0 uA to
-    50800 uA.
-
-Example:
-
-max30102@57 {
-	compatible = "maxim,max30102";
-	reg = <0x57>;
-	maxim,red-led-current-microamp = <7000>;
-	maxim,ir-led-current-microamp = <7000>;
-	interrupt-parent = <&gpio1>;
-	interrupts = <16 2>;
-};
diff --git a/Documentation/devicetree/bindings/iio/health/maxim,max30102.yaml b/Documentation/devicetree/bindings/iio/health/maxim,max30102.yaml
new file mode 100644
index 000000000000..67d40f4a91a7
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/health/maxim,max30102.yaml
@@ -0,0 +1,75 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/health/maxim,max30102.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Maxim MAX30102 heart rate and pulse oximeter and MAX30105 particle-sensor
+
+maintainers:
+  - Matt Ranostay <mranostay@gmail.com>
+
+properties:
+  compatible:
+    enum:
+      - maxim,max30102
+      - maxim,max30105
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+    description: Connected to ADC_RDY pin.
+
+  maxim,red-led-current-microamp:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: RED LED current. Each step is approximately 200 microamps.
+    minimum: 0
+    maximum: 50800
+
+  maxim,ir-led-current-microamp:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: IR LED current. Each step is approximately 200 microamps.
+    minimum: 0
+    maximum: 50800
+
+  maxim,green-led-current-microamp:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Green LED current. Each step is approximately 200 microamps.
+    minimum: 0
+    maximum: 50800
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: maxim,max30100
+    then:
+      properties:
+        maxim,green-led-current-microamp: false
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        heart-rate@57 {
+            compatible = "maxim,max30102";
+            reg = <0x57>;
+            maxim,red-led-current-microamp = <7000>;
+            maxim,ir-led-current-microamp = <7000>;
+            interrupt-parent = <&gpio1>;
+            interrupts = <16 2>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 11/46] dt-bindings:iio:imu:adi,adis16480: txt to yaml conversion
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (9 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 10/46] dt-bindings:iio:health:maxim,max30102: " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 12/46] dt-bindings:iio:imu:st,lsm6dsx: " Jonathan Cameron
                   ` (35 subsequent siblings)
  46 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Alexandru Ardelean

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Alexandru is currently listed as maintainer on basis of last person
to touch the binding.

Whilst the driver only uses one interrupt, the hardware can route events
to one and dataready signal to the other so we should allow for either
1 or 2 interrupts.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
 .../bindings/iio/imu/adi,adis16480.txt        |  86 ------------
 .../bindings/iio/imu/adi,adis16480.yaml       | 130 ++++++++++++++++++
 2 files changed, 130 insertions(+), 86 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/imu/adi,adis16480.txt b/Documentation/devicetree/bindings/iio/imu/adi,adis16480.txt
deleted file mode 100644
index cd903a1d880d..000000000000
--- a/Documentation/devicetree/bindings/iio/imu/adi,adis16480.txt
+++ /dev/null
@@ -1,86 +0,0 @@
-
-Analog Devices ADIS16480 and similar IMUs
-
-Required properties for the ADIS16480:
-
-- compatible: Must be one of
-	* "adi,adis16375"
-	* "adi,adis16480"
-	* "adi,adis16485"
-	* "adi,adis16488"
-	* "adi,adis16490"
-	* "adi,adis16495-1"
-	* "adi,adis16495-2"
-	* "adi,adis16495-3"
-	* "adi,adis16497-1"
-	* "adi,adis16497-2"
-	* "adi,adis16497-3"
-- reg: SPI chip select number for the device
-- spi-max-frequency: Max SPI frequency to use
-	see: Documentation/devicetree/bindings/spi/spi-bus.txt
-- spi-cpha: See Documentation/devicetree/bindings/spi/spi-bus.txt
-- spi-cpol: See Documentation/devicetree/bindings/spi/spi-bus.txt
-- interrupts: interrupt mapping for IRQ, accepted values are:
-	* IRQF_TRIGGER_RISING
-	* IRQF_TRIGGER_FALLING
-
-Optional properties:
-
-- interrupt-names: Data ready line selection. Valid values are:
-	* DIO1
-	* DIO2
-	* DIO3
-	* DIO4
-	If this field is left empty, DIO1 is assigned as default data ready
-	signal.
-- reset-gpios: must be the device tree identifier of the RESET pin. As the line
-	is active low, it should be marked GPIO_ACTIVE_LOW.
-- clocks: phandle to the external clock. Should be set according to
-	"clock-names".
-	If this field is left empty together with the "clock-names" field, then
-	the internal clock is used.
-- clock-names: The name of the external clock to be used. Valid values are:
-	* sync: In sync mode, the internal clock is disabled and the frequency
-		of the external clock signal establishes therate of data
-		collection and processing. See Fig 14 and 15 in the datasheet.
-		The clock-frequency must be:
-		* 3000 to 4500 Hz for adis1649x devices.
-		* 700 to 2400 Hz for adis1648x devices.
-	* pps: In Pulse Per Second (PPS) Mode, the rate of data collection and
-	       production is equal to the product of the external clock
-	       frequency and the scale factor in the SYNC_SCALE register, see
-	       Table 154 in the datasheet.
-	       The clock-frequency must be:
-	       * 1 to 128 Hz for adis1649x devices.
-	       * This mode is not supported by adis1648x devices.
-	If this field is left empty together with the "clocks" field, then the
-	internal clock is used.
-- adi,ext-clk-pin: The DIOx line to be used as an external clock input.
-	Valid values are:
-	* DIO1
-	* DIO2
-	* DIO3
-	* DIO4
-	Each DIOx pin supports only one function at a time (data ready line
-	selection or external clock input). When a single pin has two
-	two assignments, the enable bit for the lower priority function
-	automatically resets to zero (disabling the lower priority function).
-	Data ready has highest priority.
-	If this field is left empty, DIO2 is assigned as default external clock
-	input pin.
-
-Example:
-
-	imu@0 {
-		compatible = "adi,adis16495-1";
-		reg = <0>;
-		spi-max-frequency = <3200000>;
-		spi-cpol;
-		spi-cpha;
-		interrupts = <25 IRQF_TRIGGER_FALLING>;
-		interrupt-parent = <&gpio>;
-		interrupt-names = "DIO2";
-		clocks = <&adis16495_sync>;
-		clock-names = "sync";
-		adi,ext-clk-pin = "DIO1";
-	};
diff --git a/Documentation/devicetree/bindings/iio/imu/adi,adis16480.yaml b/Documentation/devicetree/bindings/iio/imu/adi,adis16480.yaml
new file mode 100644
index 000000000000..5dbe24be9925
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/imu/adi,adis16480.yaml
@@ -0,0 +1,130 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/imu/adi,adis16480.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices ADIS16480 and similar IMUs
+
+maintainers:
+  - Alexandru Ardelean <alexandru.ardelean@analog.com>
+
+properties:
+  compatible:
+    enum:
+      - adi,adis16375
+      - adi,adis16480
+      - adi,adis16485
+      - adi,adis16488
+      - adi,adis16490
+      - adi,adis16495-1
+      - adi,adis16495-2
+      - adi,adis16495-3
+      - adi,adis16497-1
+      - adi,adis16497-2
+      - adi,adis16497-3
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    minItems: 1
+    maxItems: 2
+    description: |
+      Accepted interrupt types are:
+      * IRQ_TYPE_EDGE_RISING
+      * IRQ_TYPE_EDGE_FALLING
+
+  interrupt-names:
+    minItems: 1
+    maxItems: 2
+    description:
+      Default if not supplied is DIO1.
+    items:
+      enum:
+        - DIO1
+        - DIO2
+        - DIO3
+        - DIO4
+
+  spi-max-frequency: true
+
+  spi-cpha: true
+  spi-cpol: true
+
+  reset-gpios:
+    maxItems: 1
+    description: Connected to RESET pin which is active low.
+
+  clocks:
+    maxItems: 1
+    description: If not provided, then the internal clock is used.
+
+  clock-names:
+    description: |
+      sync: In sync mode, the internal clock is disabled and the frequency
+            of the external clock signal establishes therate of data
+            collection and processing. See Fig 14 and 15 in the datasheet.
+            The clock-frequency must be:
+            * 3000 to 4500 Hz for adis1649x devices.
+            * 700 to 2400 Hz for adis1648x devices.
+      pps:  In Pulse Per Second (PPS) Mode, the rate of data collection and
+            production is equal to the product of the external clock
+            frequency and the scale factor in the SYNC_SCALE register, see
+            Table 154 in the datasheet.
+            The clock-frequency must be:
+            * 1 to 128 Hz for adis1649x devices.
+            * This mode is not supported by adis1648x devices.
+    enum:
+      - sync
+      - pps
+
+  adi,ext-clk-pin:
+    $ref: /schemas/types.yaml#/definitions/string
+    description: |
+      The DIOx line to be used as an external clock input.
+      Each DIOx pin supports only one function at a time (data ready line
+      selection or external clock input). When a single pin has two
+      two assignments, the enable bit for the lower priority function
+      automatically resets to zero (disabling the lower priority function).
+      Data ready has highest priority.
+      If not provided then DIO2 is assigned as default external clock
+      input pin.
+    enum:
+      - DIO1
+      - DIO2
+      - DIO3
+      - DIO4
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - spi-cpha
+  - spi-cpol
+  - spi-max-frequency
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        imu@0 {
+            compatible = "adi,adis16495-1";
+            reg = <0>;
+            spi-max-frequency = <3200000>;
+            spi-cpol;
+            spi-cpha;
+            interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
+            interrupt-parent = <&gpio>;
+            interrupt-names = "DIO2";
+            clocks = <&adis16495_sync>;
+            clock-names = "sync";
+            adi,ext-clk-pin = "DIO1";
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 12/46] dt-bindings:iio:imu:st,lsm6dsx: txt to yaml conversion
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (10 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 11/46] dt-bindings:iio:imu:adi,adis16480: " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 13/46] dt-bindings:iio:light:avago,apds9300: " Jonathan Cameron
                   ` (34 subsequent siblings)
  46 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Lorenzo Bianconi

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Straight forward conversion, but there are a few generic properties
in here like wakeup-source which should probably have schema in a
more generic location.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Lorenzo Bianconi <lorenzo@kernel.org>
---
 .../bindings/iio/imu/st,lsm6dsx.yaml          | 86 +++++++++++++++++++
 .../bindings/iio/imu/st_lsm6dsx.txt           | 49 -----------
 2 files changed, 86 insertions(+), 49 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
new file mode 100644
index 000000000000..49d0687e0c06
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
@@ -0,0 +1,86 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/imu/st,lsm6dsx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: STM 6-axis (acc + gyro) IMU Mems sensors
+
+maintainers:
+  - Lorenzo Bianconi <lorenzo@kernel.org>
+
+description:
+  Devices have both I2C and SPI interfaces.
+
+properties:
+  compatible:
+    enum:
+      - st,lsm6ds3
+      - st,lsm6ds3h
+      - st,lsm6dsl
+      - st,lsm6dsm
+      - st,ism330dlc
+      - st,lsm6dso
+      - st,asm330lhh
+      - st,lsm6dsox
+      - st,lsm6dsr
+      - st,lsm6ds3tr-c
+      - st,ism330dhcx
+      - st,lsm9ds1-imu
+      - st,lsm6ds0
+      - st,lsm6dsrx
+      - st,lsm6dst
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    minItems: 1
+    maxItems: 2
+    description:
+      Supports up to 2 interrupt lines via the INT1 and INT2 pins.
+
+  spi-max-frequency: true
+
+  st,drdy-int-pin:
+    $ref: '/schemas/types.yaml#/definitions/uint32'
+    description: |
+      The pin on the package that will be used to signal data ready
+    enum:
+      - 1
+      - 2
+
+  st,pullups:
+    type: boolean
+    description: enable/disable internal i2c controller pullup resistors.
+
+  drive-open-drain:
+    type: boolean
+    description:
+      The interrupt/data ready line will be configured as open drain, which
+      is useful if several sensors share the same interrupt line.
+
+  wakeup-source:
+    $ref: /schemas/types.yaml#/definitions/flag
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        imu@6b {
+            compatible = "st,lsm6dsm";
+            reg = <0x6b>;
+            interrupt-parent = <&gpio0>;
+            interrupts = <0 IRQ_TYPE_EDGE_RISING>;
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt b/Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt
deleted file mode 100644
index 7c6742d3e992..000000000000
--- a/Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-* ST_LSM6DSx driver for STM 6-axis (acc + gyro) imu Mems sensors
-
-Required properties:
-- compatible: must be one of:
-  "st,lsm6ds3"
-  "st,lsm6ds3h"
-  "st,lsm6dsl"
-  "st,lsm6dsm"
-  "st,ism330dlc"
-  "st,lsm6dso"
-  "st,asm330lhh"
-  "st,lsm6dsox"
-  "st,lsm6dsr"
-  "st,lsm6ds3tr-c"
-  "st,ism330dhcx"
-  "st,lsm9ds1-imu"
-  "st,lsm6ds0"
-  "st,lsm6dsrx"
-  "st,lsm6dst"
-- reg: i2c address of the sensor / spi cs line
-
-Optional properties:
-- st,drdy-int-pin: the pin on the package that will be used to signal
-  "data ready" (valid values: 1 or 2).
-- st,pullups : enable/disable internal i2c controller pullup resistors.
-- drive-open-drain: the interrupt/data ready line will be configured
-  as open drain, which is useful if several sensors share the same
-  interrupt line. This is a boolean property.
-  (This binding is taken from pinctrl/pinctrl-bindings.txt)
-  If the requested interrupt is configured as IRQ_TYPE_LEVEL_HIGH or
-  IRQ_TYPE_EDGE_RISING a pull-down resistor is needed to drive the line
-  when it is not active, whereas a pull-up one is needed when interrupt
-  line is configured as IRQ_TYPE_LEVEL_LOW or IRQ_TYPE_EDGE_FALLING.
-- interrupts: interrupt mapping for IRQ. It should be configured with
-  flags IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_EDGE_RISING, IRQ_TYPE_LEVEL_LOW or
-  IRQ_TYPE_EDGE_FALLING.
-- wakeup-source: Enables wake up of host system on event.
-
-  Refer to interrupt-controller/interrupts.txt for generic interrupt
-  client node bindings.
-
-Example:
-
-lsm6dsm@6b {
-	compatible = "st,lsm6dsm";
-	reg = <0x6b>;
-	interrupt-parent = <&gpio0>;
-	interrupts = <0 IRQ_TYPE_EDGE_RISING>;
-};
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 13/46] dt-bindings:iio:light:avago,apds9300: txt to yaml conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (11 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 12/46] dt-bindings:iio:imu:st,lsm6dsx: " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 14/46] dt-bindings:iio:light:avago,apds9960: " Jonathan Cameron
                   ` (33 subsequent siblings)
  46 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Oleksandr Kravchenko

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This could have gone in trivial-devices.yaml, but there was a datasheet
link so I've given it a minimal file of it's own.
Very simple binding and so a very simple conversion.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
---
 .../bindings/iio/light/apds9300.txt           | 21 ---------
 .../bindings/iio/light/avago,apds9300.yaml    | 44 +++++++++++++++++++
 2 files changed, 44 insertions(+), 21 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/light/apds9300.txt b/Documentation/devicetree/bindings/iio/light/apds9300.txt
deleted file mode 100644
index 3aa6db3ee99d..000000000000
--- a/Documentation/devicetree/bindings/iio/light/apds9300.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-* Avago APDS9300 ambient light sensor
-
-https://www.avagotech.com/docs/AV02-1077EN
-
-Required properties:
-
-  - compatible : should be "avago,apds9300"
-  - reg : the I2C address of the sensor
-
-Optional properties:
-
-  - interrupts : interrupt mapping for GPIO IRQ
-
-Example:
-
-apds9300@39 {
-	compatible = "avago,apds9300";
-	reg = <0x39>;
-	interrupt-parent = <&gpio2>;
-	interrupts = <29 8>;
-};
diff --git a/Documentation/devicetree/bindings/iio/light/avago,apds9300.yaml b/Documentation/devicetree/bindings/iio/light/avago,apds9300.yaml
new file mode 100644
index 000000000000..1cc026b9a62b
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/light/avago,apds9300.yaml
@@ -0,0 +1,44 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/light/avago,apds9300.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Avago APDS9300 ambient light sensor
+
+maintainers:
+  - Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
+
+description: |
+  Datasheet at https://www.avagotech.com/docs/AV02-1077EN
+
+properties:
+  compatible:
+    const: avago,apds9300
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        light-sensor@39 {
+            compatible = "avago,apds9300";
+            reg = <0x39>;
+            interrupt-parent = <&gpio2>;
+            interrupts = <29 8>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 14/46] dt-bindings:iio:light:avago,apds9960: txt to yaml conversion
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (12 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 13/46] dt-bindings:iio:light:avago,apds9300: " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 21:33   ` Matt Ranostay
  2020-10-31 18:48 ` [PATCH 15/46] dt-bindings:iio:light:capella,cm36651: " Jonathan Cameron
                   ` (32 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Matt Ranostay

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Very simple binding that we could move into trivial-devices.yaml
with a small loss of documentation.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Matt Ranostay <mranostay@gmail.com>
---
 .../bindings/iio/light/apds9960.txt           | 21 ---------
 .../bindings/iio/light/avago,apds9960.yaml    | 44 +++++++++++++++++++
 2 files changed, 44 insertions(+), 21 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/light/apds9960.txt b/Documentation/devicetree/bindings/iio/light/apds9960.txt
deleted file mode 100644
index c53ddb81c4aa..000000000000
--- a/Documentation/devicetree/bindings/iio/light/apds9960.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-* Avago APDS9960 gesture/RGB/ALS/proximity sensor
-
-https://www.avagotech.com/docs/AV02-4191EN
-
-Required properties:
-
-  - compatible: must be "avago,apds9960"
-  - reg: the I2c address of the sensor
-  - interrupts : the sole interrupt generated by the device
-
-  Refer to interrupt-controller/interrupts.txt for generic interrupt client
-  node bindings.
-
-Example:
-
-apds9960@39 {
-	compatible = "avago,apds9960";
-	reg = <0x39>;
-	interrupt-parent = <&gpio1>;
-	interrupts = <16 1>;
-};
diff --git a/Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml b/Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml
new file mode 100644
index 000000000000..eae8c7327c0f
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml
@@ -0,0 +1,44 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/light/avago,apds9960.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Avago APDS9960 gesture/RGB/ALS/proximity sensor
+
+maintainers:
+  - Matt Ranostay <mranostay@gmail.com>
+
+description: |
+  Datasheet at https://www.avagotech.com/docs/AV02-4191EN
+
+properties:
+  compatible:
+    const: avago,apds9960
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        light-sensor@39 {
+            compatible = "avago,apds9960";
+            reg = <0x39>;
+            interrupt-parent = <&gpio1>;
+            interrupts = <16 1>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 15/46] dt-bindings:iio:light:capella,cm36651: txt to yaml conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (13 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 14/46] dt-bindings:iio:light:avago,apds9960: " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 16/46] dt-bindings:iio:light:sharp,gp2ap020a00f: " Jonathan Cameron
                   ` (31 subsequent siblings)
  46 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Beomho Seo

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Straight forward conversion with no changes beyond the node
name in the example

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Beomho Seo <beomho.seo@samsung.com>
---
 .../bindings/iio/light/capella,cm36651.yaml   | 48 +++++++++++++++++++
 .../devicetree/bindings/iio/light/cm36651.txt | 26 ----------
 2 files changed, 48 insertions(+), 26 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/light/capella,cm36651.yaml b/Documentation/devicetree/bindings/iio/light/capella,cm36651.yaml
new file mode 100644
index 000000000000..446d94f3a89f
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/light/capella,cm36651.yaml
@@ -0,0 +1,48 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/light/capella,cm36651.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Capella CM36651 I2C Proximity and Color Light sensor
+
+maintainers:
+  - Beomho Seo <beomho.seo@samsung.com>
+
+properties:
+  compatible:
+    const: capella,cm36651
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  vled-supply:
+    description: |
+      Supply for the IR_LED which is part of the cm36651 for proximity detection.
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - vled-supply
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        light-sensor@18 {
+            compatible = "capella,cm36651";
+            reg = <0x18>;
+            interrupt-parent = <&gpx0>;
+            interrupts = <2 0>;
+            vled-supply = <&ps_als_reg>;
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/iio/light/cm36651.txt b/Documentation/devicetree/bindings/iio/light/cm36651.txt
deleted file mode 100644
index c03e19db4550..000000000000
--- a/Documentation/devicetree/bindings/iio/light/cm36651.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-* Capella CM36651 I2C Proximity and Color Light sensor
-
-Required properties:
-- compatible: must be "capella,cm36651"
-- reg: the I2C address of the device
-- interrupts: interrupt-specifier for the sole interrupt
-	      generated by the device
-- vled-supply: regulator for the IR LED. IR_LED is a part
-	      of the cm36651 for proximity detection.
-	      As covered in ../../regulator/regulator.txt
-
-Example:
-
-	i2c_cm36651: i2c-gpio {
-		/* ... */
-
-		cm36651@18 {
-			compatible = "capella,cm36651";
-			reg = <0x18>;
-			interrupt-parent = <&gpx0>;
-			interrupts = <2 0>;
-			vled-supply = <&ps_als_reg>;
-		};
-
-		/* ... */
-	};
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 16/46] dt-bindings:iio:light:sharp,gp2ap020a00f: txt to yaml conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (14 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 15/46] dt-bindings:iio:light:capella,cm36651: " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-22 17:42   ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 17/46] dt-bindings:iio:light:maxim,max44009: " Jonathan Cameron
                   ` (30 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree
  Cc: Jonathan Cameron, Jacek Anaszewski, Kyungmin Park

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Simple conversion.  Maintainers as per original binding file authors,
but that was a long time back so as with others, if email addresses bounce
I'll switch this to me.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Jacek Anaszewski <j.anaszewski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
---
 .../bindings/iio/light/gp2ap020a00f.txt       | 21 --------
 .../iio/light/sharp,gp2ap020a00f.yaml         | 49 +++++++++++++++++++
 2 files changed, 49 insertions(+), 21 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/light/gp2ap020a00f.txt b/Documentation/devicetree/bindings/iio/light/gp2ap020a00f.txt
deleted file mode 100644
index 9231c82317ad..000000000000
--- a/Documentation/devicetree/bindings/iio/light/gp2ap020a00f.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-* Sharp GP2AP020A00F I2C Proximity/ALS sensor
-
-The proximity detector sensor requires power supply
-for its built-in led. It is also defined by this binding.
-
-Required properties:
-
-  - compatible : should be "sharp,gp2ap020a00f"
-  - reg : the I2C slave address of the light sensor
-  - interrupts : interrupt specifier for the sole interrupt generated
-		 by the device
-  - vled-supply : VLED power supply, as covered in ../regulator/regulator.txt
-
-Example:
-
-gp2ap020a00f@39 {
-	compatible = "sharp,gp2ap020a00f";
-	reg = <0x39>;
-	interrupts = <2 0>;
-	vled-supply = <...>;
-};
diff --git a/Documentation/devicetree/bindings/iio/light/sharp,gp2ap020a00f.yaml b/Documentation/devicetree/bindings/iio/light/sharp,gp2ap020a00f.yaml
new file mode 100644
index 000000000000..d6a4b47467f2
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/light/sharp,gp2ap020a00f.yaml
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/light/sharp,gp2ap020a00f.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Sharp GP2AP020A00F I2C Proximity/ALS sensor
+
+maintainers:
+  - Jacek Anaszewski <j.anaszewski@samsung.com>
+  - Kyungmin Park <kyungmin.park@samsung.com>
+
+description: |
+  The proximity detector sensor requires power supply for its built-in led.
+
+properties:
+  compatible:
+    const: sharp,gp2ap020a00f
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  vled-supply: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - vled-supply
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        light-sensor@39 {
+            compatible = "sharp,gp2ap020a00f";
+            reg = <0x39>;
+            interrupts = <2 0>;
+            vled-supply = <&als_reg>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 17/46] dt-bindings:iio:light:maxim,max44009: txt to yaml conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (15 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 16/46] dt-bindings:iio:light:sharp,gp2ap020a00f: " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 18/46] dt-bindings:iio:light:ti,opt3001: " Jonathan Cameron
                   ` (29 subsequent siblings)
  46 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Robert Eshleman

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Straight forward format conversion.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Robert Eshleman <bobbyeshleman@gmail.com>
---
 .../bindings/iio/light/max44009.txt           | 24 ----------
 .../bindings/iio/light/maxim,max44009.yaml    | 45 +++++++++++++++++++
 2 files changed, 45 insertions(+), 24 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/light/max44009.txt b/Documentation/devicetree/bindings/iio/light/max44009.txt
deleted file mode 100644
index 4a98848e35c0..000000000000
--- a/Documentation/devicetree/bindings/iio/light/max44009.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-* MAX44009 Ambient Light Sensor
-
-Required properties:
-
-- compatible: should be "maxim,max44009"
-- reg: the I2C address of the device (default is <0x4a>)
-
-Optional properties:
-
-- interrupts: interrupt mapping for GPIO IRQ. Should be configured with
-  IRQ_TYPE_EDGE_FALLING.
-
-Refer to interrupt-controller/interrupts.txt for generic interrupt client
-node bindings.
-
-Example:
-
-light-sensor@4a {
-	compatible = "maxim,max44009";
-	reg = <0x4a>;
-
-	interrupt-parent = <&gpio1>;
-	interrupts = <17 IRQ_TYPE_EDGE_FALLING>;
-};
diff --git a/Documentation/devicetree/bindings/iio/light/maxim,max44009.yaml b/Documentation/devicetree/bindings/iio/light/maxim,max44009.yaml
new file mode 100644
index 000000000000..5911bd93bcb1
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/light/maxim,max44009.yaml
@@ -0,0 +1,45 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/light/maxim,max44009.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MAX44009 Ambient Light Sensor
+
+maintainers:
+  - Robert Eshleman <bobbyeshleman@gmail.com>
+
+properties:
+  compatible:
+    const: maxim,max44009
+
+  reg:
+    maxItems: 1
+    description: Default address is 0x4a
+
+  interrupts:
+    maxItems: 1
+    description: Should be configured with type IRQ_TYPE_EDGE_FALLING
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        light-sensor@4a {
+            compatible = "maxim,max44009";
+            reg = <0x4a>;
+
+            interrupt-parent = <&gpio1>;
+            interrupts = <17 IRQ_TYPE_EDGE_FALLING>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 18/46] dt-bindings:iio:light:ti,opt3001: txt to yaml conversion
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (16 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 17/46] dt-bindings:iio:light:maxim,max44009: " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 19/46] dt-bindings:iio:light:upisemi,us51882: " Jonathan Cameron
                   ` (28 subsequent siblings)
  46 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Andreas Dannenberg

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Straight forward format conversion of this simple binding.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Andreas Dannenberg <dannenberg@ti.com>
---
 .../devicetree/bindings/iio/light/opt3001.txt | 25 ----------
 .../bindings/iio/light/ti,opt3001.yaml        | 47 +++++++++++++++++++
 2 files changed, 47 insertions(+), 25 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/light/opt3001.txt b/Documentation/devicetree/bindings/iio/light/opt3001.txt
deleted file mode 100644
index 9e6f2998e751..000000000000
--- a/Documentation/devicetree/bindings/iio/light/opt3001.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-* Texas Instruments OPT3001 Ambient Light Sensor
-
-The driver supports interrupt-driven and interrupt-less operation, depending
-on whether an interrupt property has been populated into the DT. Note that
-the optional generation of IIO events on rising/falling light threshold changes
-requires the use of interrupts. Without interrupts, only the simple reading
-of the current light value is supported through the IIO API.
-
-https://www.ti.com/product/opt3001
-
-Required properties:
-  - compatible: should be "ti,opt3001"
-  - reg: the I2C address of the sensor
-
-Optional properties:
-  - interrupts: interrupt mapping for GPIO IRQ (configure for falling edge)
-
-Example:
-
-opt3001@44 {
-	compatible = "ti,opt3001";
-	reg = <0x44>;
-	interrupt-parent = <&gpio1>;
-	interrupts = <28 IRQ_TYPE_EDGE_FALLING>;
-};
diff --git a/Documentation/devicetree/bindings/iio/light/ti,opt3001.yaml b/Documentation/devicetree/bindings/iio/light/ti,opt3001.yaml
new file mode 100644
index 000000000000..441e9343fc97
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/light/ti,opt3001.yaml
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/light/ti,opt3001.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments OPT3001 Ambient Light Sensor
+
+maintainers:
+  - Andreas Dannenberg <dannenberg@ti.com>
+
+description: |
+  The device supports interrupt-driven and interrupt-less operation, depending
+  on whether an interrupt property has been populated into the DT.
+
+properties:
+  compatible:
+    const: ti,opt3001
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+    description: Should be configured with type IRQ_TYPE_EDGE_FALLING
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        light-sensor@44 {
+            compatible = "ti,opt3001";
+            reg = <0x44>;
+            interrupt-parent = <&gpio1>;
+            interrupts = <28 IRQ_TYPE_EDGE_FALLING>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 19/46] dt-bindings:iio:light:upisemi,us51882: txt to yaml conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (17 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 18/46] dt-bindings:iio:light:ti,opt3001: " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-03 16:18   ` Rob Herring
  2020-10-31 18:48 ` [PATCH 20/46] dt-bindings:iio:light:st,uvis25: txt to yaml conversion for this UV sensor Jonathan Cameron
                   ` (27 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

I don't have an up to date address for Adriana Reus so I've put myself
as the binding maintainer for this one.  I'm happy to hand over to Adriana
or anyone else who wants take it on!

This has a lot of optional tuning parameters. The docs are modified to try
and put the default values in the description of each one rather than a
forwards reference to the example.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 .../bindings/iio/light/upisemi,us5182.yaml    | 75 +++++++++++++++++++
 .../devicetree/bindings/iio/light/us5182d.txt | 45 -----------
 2 files changed, 75 insertions(+), 45 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml b/Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml
new file mode 100644
index 000000000000..b9dc8ae25bf0
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml
@@ -0,0 +1,75 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/light/upisemi,us5182.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: UPISEMI us5182d I2C ALS and Proximity sensor
+
+maintainers:
+  - Jonathan Cameron <jic23@kernel.org>
+
+properties:
+  compatible:
+    const: upisemi,asd5182
+
+  reg:
+    maxItems: 1
+
+  upsemi,glass-coef:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      glass attenuation factor - compensation factor of resolution 1000
+      for material transmittance.  Default: 1000
+
+  upisemi,dark-ths:
+    $ref: /schemas/types.yaml#/definitions/uint16-array
+    minItems: 8
+    maxItems: 8
+    description:
+      16-bit thresholds (adc counts) corresponding to every scale.
+
+  upisemi,upper-dark-gain:
+    $ref: /schemas/types.yaml#/definitions/uint8
+    description: |
+      8-bit dark gain compensation factor(4 int and 4 fractional bits - Q4.4)
+      applied when light > threshold. Default: 0.
+
+  upisemi,lower-dark-gain:
+    $ref: /schemas/types.yaml#/definitions/uint8
+    description: |
+      8-bit dark gain compensation factor(4 int and 4 fractional bits - Q4.4)
+      applied when light < threshold. Default: 0x16
+
+  upisemi,continuous:
+    $ref: /schemas/types.yaml#definitions/flag
+    description: |
+      This chip has two power modes: one-shot (chip takes one measurement and
+      then shuts itself down) and continuous (chip takes continuous
+      measurements). The one-shot mode is more power-friendly but the
+      continuous mode may be more reliable. If this property is specified
+      the continuous mode will be used instead of the default one-shot one for
+      raw reads.
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        light-sensor@39 {
+            compatible = "upisemi,usd5182";
+            reg = <0x39>;
+            upisemi,glass-coef = < 1000 >;
+            upisemi,dark-ths = /bits/ 16 <170 200 512 512 800 2000 4000 8000>;
+            upisemi,upper-dark-gain = /bits/ 8 <0x00>;
+            upisemi,lower-dark-gain = /bits/ 8 <0x16>;
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/iio/light/us5182d.txt b/Documentation/devicetree/bindings/iio/light/us5182d.txt
deleted file mode 100644
index a61979997f37..000000000000
--- a/Documentation/devicetree/bindings/iio/light/us5182d.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-* UPISEMI us5182d I2C ALS and Proximity sensor
-
-Required properties:
-- compatible: must be "upisemi,usd5182"
-- reg: the I2C address of the device
-
-Optional properties:
-- upisemi,glass-coef: glass attenuation factor - compensation factor of
-                      resolution 1000 for material transmittance.
-
-- upisemi,dark-ths: array of 8 elements containing 16-bit thresholds (adc
-                    counts) corresponding to every scale.
-
-- upisemi,upper-dark-gain: 8-bit dark gain compensation factor(4 int and 4
-                           fractional bits - Q4.4) applied when light > threshold
-
-- upisemi,lower-dark-gain: 8-bit dark gain compensation factor(4 int and 4
-                           fractional bits - Q4.4) applied when light < threshold
-
-- upisemi,continuous: This chip has two power modes: one-shot (chip takes one
-                      measurement and then shuts itself down) and continuous (
-                      chip takes continuous measurements). The one-shot mode is
-                      more power-friendly but the continuous mode may be more
-                      reliable. If this property is specified the continuous
-                      mode will be used instead of the default one-shot one for
-                      raw reads.
-
-If the optional properties are not specified these factors will default to the
-values in the below example.
-The glass-coef defaults to no compensation for the covering material.
-The threshold array defaults to experimental values that work with US5182D
-sensor on evaluation board - roughly between 12-32 lux.
-There will be no dark-gain compensation by default when ALS > thresh
-(0 * dark-gain), and a 1.35 compensation factor when ALS < thresh.
-
-Example:
-
-    usd5182@39 {
-                compatible = "upisemi,usd5182";
-                reg = <0x39>;
-                upisemi,glass-coef = < 1000 >;
-                upisemi,dark-ths = /bits/ 16 <170 200 512 512 800 2000 4000 8000>;
-                upisemi,upper-dark-gain = /bits/ 8 <0x00>;
-                upisemi,lower-dark-gain = /bits/ 8 <0x16>;
-    };
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 20/46] dt-bindings:iio:light:st,uvis25: txt to yaml conversion for this UV sensor
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (18 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 19/46] dt-bindings:iio:light:upisemi,us51882: " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 21/46] dt-bindings:iio:light:vishay,vcnl4035: txt to yaml conversion Jonathan Cameron
                   ` (26 subsequent siblings)
  46 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Lorenzo Bianconi

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

For the example, node name is uv-sensor because the standard option
of light-sensor seemed a little too generic for this.

This one could have just been moved to trivial-devices.yaml but for now
I have kept it as a separate doc.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
---
 .../bindings/iio/light/st,uvis25.yaml         | 42 +++++++++++++++++++
 .../devicetree/bindings/iio/light/uvis25.txt  | 22 ----------
 2 files changed, 42 insertions(+), 22 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/light/st,uvis25.yaml b/Documentation/devicetree/bindings/iio/light/st,uvis25.yaml
new file mode 100644
index 000000000000..c86e5e1d135e
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/light/st,uvis25.yaml
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/light/st,uvis25.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ST UVIS25 uv sensor
+
+maintainers:
+  - Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
+
+properties:
+  compatible:
+    const: st,uvis25
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        uv-sensor@47 {
+            compatible = "st,uvis25";
+            reg = <0x47>;
+            interrupt-parent = <&gpio0>;
+            interrupts = <0 IRQ_TYPE_EDGE_RISING>;
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/iio/light/uvis25.txt b/Documentation/devicetree/bindings/iio/light/uvis25.txt
deleted file mode 100644
index 043c139d91e6..000000000000
--- a/Documentation/devicetree/bindings/iio/light/uvis25.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-* ST UVIS25 uv sensor
-
-Required properties:
-- compatible: should be "st,uvis25"
-- reg: i2c address of the sensor / spi cs line
-
-Optional properties:
-- interrupts: interrupt mapping for IRQ. It should be configured with
-  flags IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_EDGE_RISING, IRQ_TYPE_LEVEL_LOW or
-  IRQ_TYPE_EDGE_FALLING.
-
-  Refer to interrupt-controller/interrupts.txt for generic interrupt
-  client node bindings.
-
-Example:
-
-uvis25@47 {
-	compatible = "st,uvis25";
-	reg = <0x47>;
-	interrupt-parent = <&gpio0>;
-	interrupts = <0 IRQ_TYPE_EDGE_RISING>;
-};
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 21/46] dt-bindings:iio:light:vishay,vcnl4035: txt to yaml conversion
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (19 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 20/46] dt-bindings:iio:light:st,uvis25: txt to yaml conversion for this UV sensor Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-22 17:52   ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 22/46] dt-bindings:iio:light:st,vl6180: txt to yaml format conversion Jonathan Cameron
                   ` (25 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree
  Cc: Jonathan Cameron, Parthiban Nallathambi

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Only significant change in here was dropping the statement that the
i2c address should be 60.  The datasheet suggests there are variants
available with several different addresses.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Parthiban Nallathambi <pn@denx.de>
---
 .../bindings/iio/light/vcnl4035.txt           | 18 --------
 .../bindings/iio/light/vishay,vcnl4035.yaml   | 45 +++++++++++++++++++
 2 files changed, 45 insertions(+), 18 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/light/vcnl4035.txt b/Documentation/devicetree/bindings/iio/light/vcnl4035.txt
deleted file mode 100644
index c07c7f052556..000000000000
--- a/Documentation/devicetree/bindings/iio/light/vcnl4035.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-VISHAY VCNL4035 -  Ambient Light and proximity sensor
-
-Link to datasheet: https://www.vishay.com/docs/84251/vcnl4035x01.pdf
-
-Required properties:
-
-	-compatible: should be "vishay,vcnl4035"
-	-reg: I2C address of the sensor, should be 0x60
-	-interrupts: interrupt mapping for GPIO IRQ (level active low)
-
-Example:
-
-light-sensor@60 {
-	compatible = "vishay,vcnl4035";
-	reg = <0x60>;
-	interrupt-parent = <&gpio4>;
-	interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
-};
diff --git a/Documentation/devicetree/bindings/iio/light/vishay,vcnl4035.yaml b/Documentation/devicetree/bindings/iio/light/vishay,vcnl4035.yaml
new file mode 100644
index 000000000000..e41c25817dd8
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/light/vishay,vcnl4035.yaml
@@ -0,0 +1,45 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/light/vishay,vcnl4035.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: VISHAY VCNL4035 ambient Light and proximity sensor
+
+maintainers:
+  - Parthiban Nallathambi <pn@denx.de>
+
+description: |
+  Datasheet at https://www.vishay.com/docs/84251/vcnl4035x01.pdf
+
+properties:
+  compatible:
+    const: vishay,vcnl4035
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        light-sensor@60 {
+            compatible = "vishay,vcnl4035";
+            reg = <0x60>;
+            interrupt-parent = <&gpio4>;
+            interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 22/46] dt-bindings:iio:light:st,vl6180: txt to yaml format conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (20 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 21/46] dt-bindings:iio:light:vishay,vcnl4035: txt to yaml conversion Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-01 15:26   ` Manivannan Sadhasivam
  2020-10-31 18:48 ` [PATCH 23/46] dt-bindings:iio:magnetometer:fsl,mag3110: txt to yaml conversion Jonathan Cameron
                   ` (24 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree
  Cc: Jonathan Cameron, Manivannan Sadhasivam, Peter Meerwald-Stadler

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

I'm not sure anyone would use this part primarily as an ALS,
given the time of flight laser also present, but I'll stick with the
original decision on where to put the binding.

Added interrupts property as the device has a GPIO interrupt even
if the driver is not currently using it.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Manivannan Sadhasivam <manivannanece23@gmail.com>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
---
 .../bindings/iio/light/st,vl6180.yaml         | 45 +++++++++++++++++++
 .../devicetree/bindings/iio/light/vl6180.txt  | 15 -------
 2 files changed, 45 insertions(+), 15 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/light/st,vl6180.yaml b/Documentation/devicetree/bindings/iio/light/st,vl6180.yaml
new file mode 100644
index 000000000000..27c36ab7990d
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/light/st,vl6180.yaml
@@ -0,0 +1,45 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/light/st,vl6180.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: STMicro VL6180 ALS, range and proximity sensor
+
+maintainers:
+  - Manivannan Sadhasivam <manivannanece23@gmail.com>
+  - Peter Meerwald-Stadler <pmeerw@pmeerw.net>
+
+description: |
+  Proximity sensing module incorporating time of flight sensor
+  Datasheet at https://www.st.com/resource/en/datasheet/vl6180x.pdf
+
+properties:
+  compatible:
+    const: st,vl6180
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        proximity@29 {
+            compatible = "st,vl6180";
+            reg = <0x29>;
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/iio/light/vl6180.txt b/Documentation/devicetree/bindings/iio/light/vl6180.txt
deleted file mode 100644
index fb9137d85df9..000000000000
--- a/Documentation/devicetree/bindings/iio/light/vl6180.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-STMicro VL6180 -  ALS, range and proximity sensor
-
-Link to datasheet: https://www.st.com/resource/en/datasheet/vl6180x.pdf
-
-Required properties:
-
-	-compatible: should be "st,vl6180"
-	-reg: the I2C address of the sensor
-
-Example:
-
-vl6180@29 {
-	compatible = "st,vl6180";
-	reg = <0x29>;
-};
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 23/46] dt-bindings:iio:magnetometer:fsl,mag3110: txt to yaml conversion
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (21 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 22/46] dt-bindings:iio:light:st,vl6180: txt to yaml format conversion Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 24/46] dt-bindings:iio:magnetometer:asahi-kasei,ak8974: txt to yaml format conversion Jonathan Cameron
                   ` (23 subsequent siblings)
  46 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Anson Huang

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Dropped a few bits of help text in here that didn't seem to add anything
that wasn't fairly obvious.  Otherwise simple format conversion

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Anson Huang <Anson.Huang@nxp.com>
---
 .../iio/magnetometer/fsl,mag3110.yaml         | 48 +++++++++++++++++++
 .../bindings/iio/magnetometer/mag3110.txt     | 27 -----------
 2 files changed, 48 insertions(+), 27 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/magnetometer/fsl,mag3110.yaml b/Documentation/devicetree/bindings/iio/magnetometer/fsl,mag3110.yaml
new file mode 100644
index 000000000000..6b54d32323fc
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/magnetometer/fsl,mag3110.yaml
@@ -0,0 +1,48 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/magnetometer/fsl,mag3110.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale MAG3110 magnetometer sensor
+
+maintainers:
+  - Anson Huang <Anson.Huang@nxp.com>
+
+properties:
+  compatible:
+    const: fsl,mag3110
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  vdd-supply: true
+
+  vddio-supply: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        magnetometer@e {
+            compatible = "fsl,mag3110";
+            reg = <0x0e>;
+            pinctrl-names = "default";
+            pinctrl-0 = <&pinctrl_i2c3_mag3110_int>;
+            interrupt-parent = <&gpio3>;
+            interrupts = <16 IRQ_TYPE_EDGE_RISING>;
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/iio/magnetometer/mag3110.txt b/Documentation/devicetree/bindings/iio/magnetometer/mag3110.txt
deleted file mode 100644
index bdd40bcaaa1f..000000000000
--- a/Documentation/devicetree/bindings/iio/magnetometer/mag3110.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-* FREESCALE MAG3110 magnetometer sensor
-
-Required properties:
-
-  - compatible : should be "fsl,mag3110"
-  - reg : the I2C address of the magnetometer
-
-Optional properties:
-
-  - interrupts: the sole interrupt generated by the device
-
-  Refer to interrupt-controller/interrupts.txt for generic interrupt client
-  node bindings.
-
-  - vdd-supply: phandle to the regulator that provides power to the sensor.
-  - vddio-supply: phandle to the regulator that provides power to the sensor's IO.
-
-Example:
-
-magnetometer@e {
-	compatible = "fsl,mag3110";
-	reg = <0x0e>;
-	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_i2c3_mag3110_int>;
-	interrupt-parent = <&gpio3>;
-	interrupts = <16 IRQ_TYPE_EDGE_RISING>;
-};
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 24/46] dt-bindings:iio:magnetometer:asahi-kasei,ak8974: txt to yaml format conversion
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (22 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 23/46] dt-bindings:iio:magnetometer:fsl,mag3110: txt to yaml conversion Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-04 14:47   ` Linus Walleij
  2020-10-31 18:48 ` [PATCH 25/46] dt-bindings:iio:magnetometer:bosch,bmc150_magn: txt to yaml conversion Jonathan Cameron
                   ` (22 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Linus Walleij

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Simple conversion.  I have pruned descriptions that did not add much useful
detail.  Note that the mount-matrix description will form part of a generic
IIO binding.  No need to repeat that in every driver that uses it.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
---
 .../bindings/iio/magnetometer/ak8974.txt      | 31 ----------
 .../iio/magnetometer/asahi-kasei,ak8974.yaml  | 57 +++++++++++++++++++
 2 files changed, 57 insertions(+), 31 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/magnetometer/ak8974.txt b/Documentation/devicetree/bindings/iio/magnetometer/ak8974.txt
deleted file mode 100644
index 7f06eff3b504..000000000000
--- a/Documentation/devicetree/bindings/iio/magnetometer/ak8974.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-* Asahi Kasei AK8974 magnetometer sensor
-
-Required properties:
-
-- compatible:
-    * "asahi-kasei,ak8974"
-    * "alps,hscdtd008a"
-- reg : the I2C address of the magnetometer
-
-Optional properties:
-
-- avdd-supply: regulator supply for the analog voltage
-  (see regulator/regulator.txt)
-- dvdd-supply: regulator supply for the digital voltage
-  (see regulator/regulator.txt)
-- interrupts: data ready (DRDY) and interrupt (INT1) lines
-  from the chip, the DRDY interrupt must be placed first.
-  The interrupts can be triggered on rising or falling
-  edges alike.
-- mount-matrix: an optional 3x3 mounting rotation matrix
-
-Example:
-
-ak8974@f {
-	compatible = "asahi-kasei,ak8974";
-	reg = <0x0f>;
-	avdd-supply = <&foo_reg>;
-	dvdd-supply = <&bar_reg>;
-	interrupts = <0 IRQ_TYPE_EDGE_RISING>,
-		     <1 IRQ_TYPE_EDGE_RISING>;
-};
diff --git a/Documentation/devicetree/bindings/iio/magnetometer/asahi-kasei,ak8974.yaml b/Documentation/devicetree/bindings/iio/magnetometer/asahi-kasei,ak8974.yaml
new file mode 100644
index 000000000000..cefb70def188
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/magnetometer/asahi-kasei,ak8974.yaml
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/magnetometer/asahi-kasei,ak8974.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Asahi Kasei AK8974 magnetometer sensor
+
+maintainers:
+  - Linus Walleij <linus.walleij@linaro.org>
+
+properties:
+  compatible:
+    enum:
+      - alps,hscdtd008a
+      - asahi-kasei,ak8974
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    minItems: 1
+    maxItems: 2
+    description: |
+      Data ready (DRDY) and interrupt (INT1) lines from the chip. The DRDY
+      interrupt must be placed first. The interrupts can be triggered on
+      rising or falling edges.
+
+  avdd-supply: true
+
+  dvdd-supply: true
+
+  mount-matrix: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        magnetometer@f {
+            compatible = "asahi-kasei,ak8974";
+            reg = <0x0f>;
+            avdd-supply = <&foo_reg>;
+            dvdd-supply = <&bar_reg>;
+            interrupts = <0 IRQ_TYPE_EDGE_RISING>,
+                         <1 IRQ_TYPE_EDGE_RISING>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 25/46] dt-bindings:iio:magnetometer:bosch,bmc150_magn: txt to yaml conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (23 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 24/46] dt-bindings:iio:magnetometer:asahi-kasei,ak8974: txt to yaml format conversion Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 26/46] dt-bindings:iio:magnetometer:honeywell,hmc5843: txt to yaml format conversion Jonathan Cameron
                   ` (21 subsequent siblings)
  46 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This describes the bindings for both stand along magnetometers and ones
which form part of a multi chip package.
Given original author hasn't been active remotely recently I've
put myself as maintainer for this one.  I would of course like to
hand this over to someone more appropriate so shout out if this is you!

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 .../bindings/iio/magnetometer/bmc150_magn.txt | 25 ---------
 .../iio/magnetometer/bosch,bmc150_magn.yaml   | 55 +++++++++++++++++++
 2 files changed, 55 insertions(+), 25 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt b/Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt
deleted file mode 100644
index 22912e43b60c..000000000000
--- a/Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-* Bosch BMC150 magnetometer sensor
-
-http://ae-bst.resource.bosch.com/media/products/dokumente/bmc150/BST-BMC150-DS000-04.pdf
-
-Required properties:
-
-  - compatible : should be one of:
-                 "bosch,bmc150_magn"
-                 "bosch,bmc156_magn"
-                 "bosch,bmm150"
-                 "bosch,bmm150_magn" (DEPRECATED, use bosch,bmm150)
-  - reg : the I2C address of the magnetometer
-
-Optional properties:
-
-  - interrupts : interrupt mapping for GPIO IRQ
-
-Example:
-
-bmc150_magn@12 {
-        compatible = "bosch,bmc150_magn";
-        reg = <0x12>;
-        interrupt-parent = <&gpio1>;
-        interrupts = <0 1>;
-};
diff --git a/Documentation/devicetree/bindings/iio/magnetometer/bosch,bmc150_magn.yaml b/Documentation/devicetree/bindings/iio/magnetometer/bosch,bmc150_magn.yaml
new file mode 100644
index 000000000000..cdef7aeba708
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/magnetometer/bosch,bmc150_magn.yaml
@@ -0,0 +1,55 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/magnetometer/bosch,bmc150_magn.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Bosch BMC150 magnetometer sensor
+
+maintainers:
+  - Jonathan Cameron <jic23@kernel.org>
+
+description: |
+  Supports a range of parts, some of which form part of a multi die
+  package that also contains other sensors.  The interface is independent
+  however, so a separate driver is used to support the magnetometer part.
+  Datasheet at:
+  http://ae-bst.resource.bosch.com/media/products/dokumente/bmc150/BST-BMC150-DS000-04.pdf
+
+properties:
+  compatible:
+    description:
+      Note the bmm150_magn is a deprecated compatible as this part contains only
+      a magnetometer.
+    enum:
+      - bosch,bmc150_magn
+      - bosch,bmc156_magn
+      - bosch,bmm150
+      - bosch,bmm150_magn
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        magnetometer@12 {
+            compatible = "bosch,bmc150_magn";
+            reg = <0x12>;
+            interrupt-parent = <&gpio1>;
+            interrupts = <0 1>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 26/46] dt-bindings:iio:magnetometer:honeywell,hmc5843: txt to yaml format conversion
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (24 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 25/46] dt-bindings:iio:magnetometer:bosch,bmc150_magn: txt to yaml conversion Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 27/46] dt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion Jonathan Cameron
                   ` (20 subsequent siblings)
  46 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Neil Brown

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Mostly a straight conversion, but the txt file had an oddity.
It documented a gpios property for what appeared to be in interrupt line.
There are mainline dts that have this as interrupts, so I've converted
it to that.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Neil Brown <neilb@suse.de>
---
 .../bindings/iio/magnetometer/hmc5843.txt     | 21 ---------
 .../iio/magnetometer/honeywell,hmc5843.yaml   | 43 +++++++++++++++++++
 2 files changed, 43 insertions(+), 21 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/magnetometer/hmc5843.txt b/Documentation/devicetree/bindings/iio/magnetometer/hmc5843.txt
deleted file mode 100644
index 8e191eef014e..000000000000
--- a/Documentation/devicetree/bindings/iio/magnetometer/hmc5843.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-* Honeywell HMC5843 magnetometer sensor
-
-Required properties:
-
-  - compatible : should be "honeywell,hmc5843"
-  Other models which are supported with driver are:
-	"honeywell,hmc5883"
-	"honeywell,hmc5883l"
-	"honeywell,hmc5983"
-  - reg : the I2C address of the magnetometer - typically 0x1e
-
-Optional properties:
-
-  - gpios : should be device tree identifier of the magnetometer DRDY pin
-
-Example:
-
-hmc5843@1e {
-        compatible = "honeywell,hmc5843"
-        reg = <0x1e>;
-};
diff --git a/Documentation/devicetree/bindings/iio/magnetometer/honeywell,hmc5843.yaml b/Documentation/devicetree/bindings/iio/magnetometer/honeywell,hmc5843.yaml
new file mode 100644
index 000000000000..5e778c98584e
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/magnetometer/honeywell,hmc5843.yaml
@@ -0,0 +1,43 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/magnetometer/honeywell,hmc5843.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Honeywell HMC5843 magnetometer sensor
+
+maintainers:
+  - Neil Brown <neilb@suse.de>
+
+properties:
+  compatible:
+    enum:
+      - honeywell,hmc5843
+      - honeywell,hmc5883
+      - honeywell,hmc5883l
+      - honeywell,hmc5983
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        magnetometer@1e {
+            compatible = "honeywell,hmc5843";
+            reg = <0x1e>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 27/46] dt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (25 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 26/46] dt-bindings:iio:magnetometer:honeywell,hmc5843: txt to yaml format conversion Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 28/46] dt-bindings:iio:adc:atmel,sama5d2-adc: " Jonathan Cameron
                   ` (19 subsequent siblings)
  46 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Song Qiang

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Simple binding format conversion.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Song Qiang <songqiang1304521@gmail.com>
---
 .../bindings/iio/magnetometer/pni,rm3100.txt  | 20 ---------
 .../bindings/iio/magnetometer/pni,rm3100.yaml | 42 +++++++++++++++++++
 2 files changed, 42 insertions(+), 20 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.txt b/Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.txt
deleted file mode 100644
index 497c932e9e39..000000000000
--- a/Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-* PNI RM3100 3-axis magnetometer sensor
-
-Required properties:
-
-- compatible : should be "pni,rm3100"
-- reg : the I2C address or SPI chip select number of the sensor.
-
-Optional properties:
-
-- interrupts: data ready (DRDY) from the chip.
-  The interrupts can be triggered on level high.
-
-Example:
-
-rm3100: rm3100@20 {
-	compatible = "pni,rm3100";
-	reg = <0x20>;
-	interrupt-parent = <&gpio0>;
-	interrupts = <4 IRQ_TYPE_LEVEL_HIGH>;
-};
diff --git a/Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.yaml b/Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.yaml
new file mode 100644
index 000000000000..a845cdd23e7b
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.yaml
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/magnetometer/pni,rm3100.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: PNI RM3100 3-axis magnetometer sensor
+
+maintainers:
+  - Song Qiang <songqiang1304521@gmail.com>
+
+properties:
+  compatible:
+    const: pni,rm3100
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        magnetometer@20 {
+            compatible = "pni,rm3100";
+            reg = <0x20>;
+            interrupt-parent = <&gpio0>;
+            interrupts = <4 IRQ_TYPE_LEVEL_HIGH>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 28/46] dt-bindings:iio:adc:atmel,sama5d2-adc: txt to yaml conversion
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (26 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 27/46] dt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-22 18:07   ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 29/46] dt-bindings:iio:adc:atmel,sama9260-adc: conversion to yaml from at91_adc.txt Jonathan Cameron
                   ` (18 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree
  Cc: Jonathan Cameron, Ludovic Desroches, Eugen Hristev

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Whilst this binding has a lot of elements they are all fairly standard.
Hence pretty much direct txt to yaml line by line conversion.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Ludovic Desroches <ludovic.desroches@atmel.com>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
---
 .../bindings/iio/adc/at91-sama5d2_adc.txt     |  50 ---------
 .../bindings/iio/adc/atmel,sama5d2-adc.yaml   | 104 ++++++++++++++++++
 2 files changed, 104 insertions(+), 50 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/at91-sama5d2_adc.txt b/Documentation/devicetree/bindings/iio/adc/at91-sama5d2_adc.txt
deleted file mode 100644
index 07c59f301b31..000000000000
--- a/Documentation/devicetree/bindings/iio/adc/at91-sama5d2_adc.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-* AT91 SAMA5D2 Analog to Digital Converter (ADC)
-
-Required properties:
-  - compatible: Should be "atmel,sama5d2-adc" or "microchip,sam9x60-adc".
-  - reg: Should contain ADC registers location and length.
-  - interrupts: Should contain the IRQ line for the ADC.
-  - clocks: phandle to device clock.
-  - clock-names: Must be "adc_clk".
-  - vref-supply: Supply used as reference for conversions.
-  - vddana-supply: Supply for the adc device.
-  - atmel,min-sample-rate-hz: Minimum sampling rate, it depends on SoC.
-  - atmel,max-sample-rate-hz: Maximum sampling rate, it depends on SoC.
-  - atmel,startup-time-ms: Startup time expressed in ms, it depends on SoC.
-  - atmel,trigger-edge-type: One of possible edge types for the ADTRG hardware
-  trigger pin. When the specific edge type is detected, the conversion will
-  start. Possible values are rising, falling, or both.
-  This property uses the IRQ edge types values: IRQ_TYPE_EDGE_RISING ,
-  IRQ_TYPE_EDGE_FALLING or IRQ_TYPE_EDGE_BOTH
-
-Optional properties:
-  - dmas: Phandle to dma channel for the ADC.
-  - dma-names: Must be "rx" when dmas property is being used.
-  See ../../dma/dma.txt for details.
-  - #io-channel-cells: in case consumer drivers are attached, this must be 1.
-  See <Documentation/devicetree/bindings/iio/iio-bindings.txt> for details.
-
-Properties for consumer drivers:
-  - Consumer drivers can be connected to this producer device, as specified
-  in <Documentation/devicetree/bindings/iio/iio-bindings.txt>
-  - Channels exposed are specified in:
-  <dt-bindings/iio/adc/at91-sama5d2_adc.txt>
-
-Example:
-
-adc: adc@fc030000 {
-	compatible = "atmel,sama5d2-adc";
-	reg = <0xfc030000 0x100>;
-	interrupts = <40 IRQ_TYPE_LEVEL_HIGH 7>;
-	clocks = <&adc_clk>;
-	clock-names = "adc_clk";
-	atmel,min-sample-rate-hz = <200000>;
-	atmel,max-sample-rate-hz = <20000000>;
-	atmel,startup-time-ms = <4>;
-	vddana-supply = <&vdd_3v3_lp_reg>;
-	vref-supply = <&vdd_3v3_lp_reg>;
-	atmel,trigger-edge-type = <IRQ_TYPE_EDGE_BOTH>;
-	dmas = <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) | AT91_XDMAC_DT_PERID(25))>;
-	dma-names = "rx";
-	#io-channel-cells = <1>;
-}
diff --git a/Documentation/devicetree/bindings/iio/adc/atmel,sama5d2-adc.yaml b/Documentation/devicetree/bindings/iio/adc/atmel,sama5d2-adc.yaml
new file mode 100644
index 000000000000..9b282c3ee8fb
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/atmel,sama5d2-adc.yaml
@@ -0,0 +1,104 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/atmel,sama5d2-adc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: AT91 SAMA5D2 Analog to Digital Converter (ADC)
+
+maintainers:
+  - Ludovic Desroches <ludovic.desroches@atmel.com>
+  - Eugen Hristev <eugen.hristev@microchip.com>
+
+properties:
+  compatible:
+    enum:
+      - atmel,sama5d2-adc
+      - microchip,sam9x60-adc
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: adc_clk
+
+  vref-supply: true
+  vddana-supply: true
+
+  atmel,min-sample-rate-hz:
+    $ref: '/schemas/types.yaml#/definitions/uint32'
+    description: Minimum sampling rate, it depends on SoC.
+
+  atmel,max-sample-rate-hz:
+    $ref: '/schemas/types.yaml#/definitions/uint32'
+    description: Maximum sampling rate, it depends on SoC.
+
+  atmel,startup-time-ms:
+    $ref: '/schemas/types.yaml#/definitions/uint32'
+    description: Startup time expressed in ms, it depends on SoC.
+
+  atmel,trigger-edge-type:
+    $ref: '/schemas/types.yaml#/definitions/uint32'
+    description:
+      One of possible edge types for the ADTRG hardware trigger pin.
+      When the specific edge type is detected, the conversion will
+      start. Should be one of IRQ_TYPE_EDGE_RISING, IRQ_TYPE_EDGE_FALLING
+      or IRQ_TYPE_EDGE_BOTH.
+    enum: [1, 2, 3]
+
+  dmas:
+    maxItems: 1
+
+  dma-names:
+    const: rx
+
+  "#io-channel-cells":
+    const: 1
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - vref-supply
+  - vddana-supply
+  - atmel,min-sample-rate-hz
+  - atmel,max-sample-rate-hz
+  - atmel,startup-time-ms
+  - atmel,trigger-edge-type
+
+examples:
+  - |
+    #include <dt-bindings/dma/at91.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    soc {
+        #address-cells = <1>;
+        #size-cells = <1>;
+
+        adc@fc030000 {
+            compatible = "atmel,sama5d2-adc";
+            reg = <0xfc030000 0x100>;
+            interrupts = <40 IRQ_TYPE_LEVEL_HIGH 7>;
+            clocks = <&adc_clk>;
+            clock-names = "adc_clk";
+            atmel,min-sample-rate-hz = <200000>;
+            atmel,max-sample-rate-hz = <20000000>;
+            atmel,startup-time-ms = <4>;
+            vddana-supply = <&vdd_3v3_lp_reg>;
+            vref-supply = <&vdd_3v3_lp_reg>;
+            atmel,trigger-edge-type = <IRQ_TYPE_EDGE_BOTH>;
+            dmas = <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) | AT91_XDMAC_DT_PERID(25))>;
+            dma-names = "rx";
+            #io-channel-cells = <1>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 29/46] dt-bindings:iio:adc:atmel,sama9260-adc: conversion to yaml from at91_adc.txt
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (27 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 28/46] dt-bindings:iio:adc:atmel,sama5d2-adc: " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-13  9:22   ` Alexandre Belloni
  2020-10-31 18:48 ` [PATCH 30/46] dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion Jonathan Cameron
                   ` (17 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree
  Cc: Jonathan Cameron, Alexandre Belloni, Nicolas Ferre, Ludovic Desroches

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This binding raises a few questions.
1) Do we need #address-cells and #size-cells as the child nodes don't have
   a reg property?  A few dtsi files include these so if we drop the
   requirement we will need to clean those up as well.
2) Renamed to a specific part.  Given we have another at91 ADC binding
   it is clear now this won't cover all at91 parts so lets name it
   after a specific part.
3) For atmel,adc-res-names the description is a big vague.  Are other
   resolution names allowed? We don't seem to have any currently.

There are a few things we would do differently in an ADC binding if we
were starting from scratch but we are stuck with what we have (which
made sense back when this was written!)

We may be able to tighten up some elements of this binding in the future
by careful checking of what values properties can actually take.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
---
 .../devicetree/bindings/iio/adc/at91_adc.txt  |  83 --------
 .../bindings/iio/adc/atmel,sama9260-adc.yaml  | 178 ++++++++++++++++++
 2 files changed, 178 insertions(+), 83 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/at91_adc.txt b/Documentation/devicetree/bindings/iio/adc/at91_adc.txt
deleted file mode 100644
index f65b04fb7962..000000000000
--- a/Documentation/devicetree/bindings/iio/adc/at91_adc.txt
+++ /dev/null
@@ -1,83 +0,0 @@
-* AT91's Analog to Digital Converter (ADC)
-
-Required properties:
-  - compatible: Should be "atmel,<chip>-adc"
-    <chip> can be "at91sam9260", "at91sam9g45" or "at91sam9x5"
-  - reg: Should contain ADC registers location and length
-  - interrupts: Should contain the IRQ line for the ADC
-  - clock-names: tuple listing input clock names.
-	Required elements: "adc_clk", "adc_op_clk".
-  - clocks: phandles to input clocks.
-  - atmel,adc-channels-used: Bitmask of the channels muxed and enabled for this
-    device
-  - atmel,adc-startup-time: Startup Time of the ADC in microseconds as
-    defined in the datasheet
-  - atmel,adc-vref: Reference voltage in millivolts for the conversions
-  - atmel,adc-res: List of resolutions in bits supported by the ADC. List size
-		   must be two at least.
-  - atmel,adc-res-names: Contains one identifier string for each resolution
-			 in atmel,adc-res property. "lowres" and "highres"
-			 identifiers are required.
-
-Optional properties:
-  - atmel,adc-use-external-triggers: Boolean to enable the external triggers
-  - atmel,adc-use-res: String corresponding to an identifier from
-		       atmel,adc-res-names property. If not specified, the highest
-		       resolution will be used.
-  - atmel,adc-sleep-mode: Boolean to enable sleep mode when no conversion
-  - atmel,adc-sample-hold-time: Sample and Hold Time in microseconds
-  - atmel,adc-ts-wires: Number of touchscreen wires. Should be 4 or 5. If this
-                        value is set, then the adc driver will enable touchscreen
-                        support.
-    NOTE: when adc touchscreen is enabled, the adc hardware trigger will be
-          disabled. Since touchscreen will occupy the trigger register.
-  - atmel,adc-ts-pressure-threshold: a pressure threshold for touchscreen. It
-                                     makes touch detection more precise.
-
-Optional trigger Nodes:
-  - Required properties:
-    * trigger-name: Name of the trigger exposed to the user
-    * trigger-value: Value to put in the Trigger register
-      to activate this trigger
-  - Optional properties:
-    * trigger-external: Is the trigger an external trigger?
-
-Examples:
-adc0: adc@fffb0000 {
-	#address-cells = <1>;
-	#size-cells = <0>;
-	compatible = "atmel,at91sam9260-adc";
-	reg = <0xfffb0000 0x100>;
-	interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>;
-	clocks = <&adc_clk>, <&adc_op_clk>;
-	clock-names = "adc_clk", "adc_op_clk";
-	atmel,adc-channels-used = <0xff>;
-	atmel,adc-startup-time = <40>;
-	atmel,adc-use-external-triggers;
-	atmel,adc-vref = <3300>;
-	atmel,adc-res = <8 10>;
-	atmel,adc-res-names = "lowres", "highres";
-	atmel,adc-use-res = "lowres";
-
-	trigger0 {
-		trigger-name = "external-rising";
-		trigger-value = <0x1>;
-		trigger-external;
-	};
-	trigger1 {
-		trigger-name = "external-falling";
-		trigger-value = <0x2>;
-		trigger-external;
-	};
-
-	trigger2 {
-		trigger-name = "external-any";
-		trigger-value = <0x3>;
-		trigger-external;
-	};
-
-	trigger3 {
-		trigger-name = "continuous";
-		trigger-value = <0x6>;
-	};
-};
diff --git a/Documentation/devicetree/bindings/iio/adc/atmel,sama9260-adc.yaml b/Documentation/devicetree/bindings/iio/adc/atmel,sama9260-adc.yaml
new file mode 100644
index 000000000000..c480e835e5a8
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/atmel,sama9260-adc.yaml
@@ -0,0 +1,178 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/atmel,sama9260-adc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: AT91 sama9260 and similar Analog to Digital Converter (ADC)
+
+maintainers:
+  - Alexandre Belloni <alexandre.belloni@bootlin.com>
+
+properties:
+  compatible:
+    enum:
+      - atmel,at91sam9260-adc
+      - atmel,at91sam9rl-adc
+      - atmel,at91sam9g45-adc
+      - atmel,at91sam9x5-adc
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    minItems: 2
+    maxItems: 2
+
+  clock-names:
+    items:
+      - const: adc_clk
+      - const: adc_op_clk
+
+  atmel,adc-channels-used:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Bitmask of the channels muxed and enabled for this device
+
+  atmel,adc-startup-time:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Startup Time of the ADC in microseconds as defined in the datasheet
+
+  atmel,adc-vref:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Reference voltage in millivolts for the conversions
+
+  atmel,adc-res:
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    description: List of resolutions in bits supported by the ADC.
+    minItems: 2
+
+  atmel,adc-res-names:
+    $ref: /schemas/types.yaml#/definitions/string-array
+    description: |
+      Contains one identifier string for each resolution in atmel,adc-res
+      property. lowres and highres identifiers are required.
+
+  atmel,adc-use-external-triggers:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enable the external triggers
+
+  atmel,adc-use-res:
+    $ref: /schemas/types.yaml#/definitions/string
+    description:
+      String corresponding to an identifier from atmel,adc-res-names property.
+      If not specified, the highest resolution will be used.
+
+  atmel,adc-sleep-mode:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enable sleep mode when no conversion
+
+  atmel,adc-sample-hold-time:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Sample and Hold Time in microseconds
+
+  atmel,adc-ts-wires:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Number of touchscreen wires. Must be set to enable touchscreen.
+      NOTE: when adc touchscreen is enabled, the adc hardware trigger will be
+      disabled. Since touchscreen will occupy the trigger register.
+    enum:
+      - 4
+      - 5
+
+  atmel,adc-ts-pressure-threshold:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Pressure threshold for touchscreen.
+
+  "#io-channel-cells":
+    const: 1
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - atmel,adc-channels-used
+  - atmel,adc-startup-time
+  - atmel,adc-vref
+  - atmel,adc-res
+  - atmel,adc-res-names
+
+patternProperties:
+  "^(trigger)[0-9]$":
+    type: object
+    description: Child node to describe a trigger exposed to the user.
+    properties:
+      trigger-name:
+        $ref: /schemas/types.yaml#/definitions/string
+        description: Identifying name.
+
+      trigger-value:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description:
+          Value to put in the Trigger register to activate this trigger
+
+      trigger-external:
+        $ref: /schemas/types.yaml#/definitions/flag
+        description: This trigger is provided from an external pin.
+
+    additionalProperties: false
+    required:
+      - trigger-name
+      - trigger-value
+
+examples:
+  - |
+    #include <dt-bindings/dma/at91.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    soc {
+        #address-cells = <1>;
+        #size-cells = <1>;
+
+        adc@fffb0000 {
+            compatible = "atmel,at91sam9260-adc";
+            reg = <0xfffb0000 0x100>;
+            interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>;
+            clocks = <&adc_clk>, <&adc_op_clk>;
+            clock-names = "adc_clk", "adc_op_clk";
+            atmel,adc-channels-used = <0xff>;
+            atmel,adc-startup-time = <40>;
+            atmel,adc-use-external-triggers;
+            atmel,adc-vref = <3300>;
+            atmel,adc-res = <8 10>;
+            atmel,adc-res-names = "lowres", "highres";
+            atmel,adc-use-res = "lowres";
+
+            trigger0 {
+                trigger-name = "external-rising";
+                trigger-value = <0x1>;
+                trigger-external;
+            };
+
+            trigger1 {
+                trigger-name = "external-falling";
+                trigger-value = <0x2>;
+                trigger-external;
+            };
+
+            trigger2 {
+                trigger-name = "external-any";
+                trigger-value = <0x3>;
+                trigger-external;
+            };
+
+            trigger3 {
+                trigger-name = "continuous";
+                trigger-value = <0x6>;
+            };
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 30/46] dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (28 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 29/46] dt-bindings:iio:adc:atmel,sama9260-adc: conversion to yaml from at91_adc.txt Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-03 16:26   ` Rob Herring
  2020-11-27  8:14   ` Geert Uytterhoeven
  2020-10-31 18:48 ` [PATCH 31/46] dt-bindings:iio:adc:x-powers,axp209-adc: " Jonathan Cameron
                   ` (16 subsequent siblings)
  46 siblings, 2 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Marek Vasut

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This is a somewhat unusual device, in that it effectively does
spi offload.   That means that it doesn't act as a full SPI
master, but supports some functionality.  As such it supports
a subset of specific SPI ADCs.  There is potential for a future
clash in bindings, but as these are simple devices hopefully that
will not occur.

One addition to this from testing it against existing dts files
was to add a resets property.
This is specified in arch/arm/boot/dts/r8a7791.dtsi
If it's the dtsi that is wrong and not the binding doc, then
we can fix that instead.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Marek Vasut <marek.vasut+renesas@gmail.com>
---
 .../bindings/iio/adc/renesas,gyroadc.txt      |  98 ------------
 .../iio/adc/renesas,rcar-gyroadc.yaml         | 141 ++++++++++++++++++
 2 files changed, 141 insertions(+), 98 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt b/Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt
deleted file mode 100644
index df5b9f2ad8d8..000000000000
--- a/Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt
+++ /dev/null
@@ -1,98 +0,0 @@
-* Renesas R-Car GyroADC device driver
-
-The GyroADC block is a reduced SPI block with up to 8 chipselect lines,
-which supports the SPI protocol of a selected few SPI ADCs. The SPI ADCs
-are sampled by the GyroADC block in a round-robin fashion and the result
-presented in the GyroADC registers.
-
-Required properties:
-- compatible:	Should be "<soc-specific>", "renesas,rcar-gyroadc".
-                The <soc-specific> should be one of:
-		renesas,r8a7791-gyroadc - for the GyroADC block present
-					  in r8a7791 SoC
-		renesas,r8a7792-gyroadc - for the GyroADC with interrupt
-					  block present in r8a7792 SoC
-- 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". The "fck" is the GyroADC block 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:
-You must define subnode(s) 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@e6e54000 {
-		compatible = "renesas,r8a7791-gyroadc", "renesas,rcar-gyroadc";
-		reg = <0 0xe6e54000 0 64>;
-		clocks = <&mstp9_clks R8A7791_CLK_GYROADC>;
-		clock-names = "fck";
-		power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
-
-		pinctrl-0 = <&adc_pins>;
-		pinctrl-names = "default";
-
-		#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>;
-		};
-	};
diff --git a/Documentation/devicetree/bindings/iio/adc/renesas,rcar-gyroadc.yaml b/Documentation/devicetree/bindings/iio/adc/renesas,rcar-gyroadc.yaml
new file mode 100644
index 000000000000..aeaa9d372450
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/renesas,rcar-gyroadc.yaml
@@ -0,0 +1,141 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/renesas,rcar-gyroadc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas R-Car GyroADC
+
+maintainers:
+  - Marek Vasut <marek.vasut+renesas@gmail.com>
+
+description: |
+  The GyroADC block is a reduced SPI block with up to 8 chipselect lines,
+  which supports the SPI protocol of a selected few SPI ADCs. The SPI ADCs
+  are sampled by the GyroADC block in a round-robin fashion and the result
+  presented in the GyroADC registers.
+  The ADC bindings should match with that of the devices connected to a
+  full featured SPI bus.
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - renesas,r8a7791-gyroadc
+          - renesas,r8a7792-gyroadc
+      - const: renesas,rcar-gyroadc
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: fck
+
+  power-domains: true
+
+  resets: true
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - "#address-cells"
+  - "#size-cells"
+
+patternProperties:
+  "^[a-zA-Z][a-zA-Z0-9,+\\-._]{0,63}@[0-9a-fA-F]+$":
+    type: object
+    properties:
+      compatible:
+        description: |
+          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.
+        enum:
+          - adi,7476
+          - fujitsu,mb88101a
+          - maxim,max1162
+          - maxim,max11100
+          - ti,adcs7476
+          - ti,adc121
+
+      reg: true
+
+      vref-supply: true
+
+    additionalProperties: false
+
+    required:
+      - compatible
+      - reg
+      - vref-supply
+
+examples:
+  - |
+    #include <dt-bindings/clock/r8a7791-clock.h>
+    #include <dt-bindings/power/r8a7791-sysc.h>
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        adc@e6e54000 {
+            compatible = "renesas,r8a7791-gyroadc", "renesas,rcar-gyroadc";
+            reg = <0 0xe6e54000 0 64>;
+            clocks = <&mstp9_clks R8A7791_CLK_GYROADC>;
+            clock-names = "fck";
+            power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
+
+            pinctrl-0 = <&adc_pins>;
+            pinctrl-names = "default";
+
+            #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>;
+            };
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 31/46] dt-bindings:iio:adc:x-powers,axp209-adc: txt to yaml conversion
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (29 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 30/46] dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-22 18:15   ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 32/46] dt-bindings:iio:adc:brcm,iproc-static-adc: " Jonathan Cameron
                   ` (15 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Quentin Schulz

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This is a very small binding.  It might make sense at some stage
to just roll it into the parent mfd.  For now, converted as is.
The main advantage of this document is the identification of the
channel index values when this is used as a provider of ADC channels
to consumers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Quentin Schulz <quentin.schulz@bootlin.com>
---
 .../bindings/iio/adc/axp20x_adc.txt           | 48 -------------
 .../bindings/iio/adc/x-powers,axp209-adc.yaml | 67 +++++++++++++++++++
 2 files changed, 67 insertions(+), 48 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt b/Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt
deleted file mode 100644
index 7a6313913923..000000000000
--- a/Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-* X-Powers AXP ADC bindings
-
-Required properties:
-  - compatible: should be one of:
-    - "x-powers,axp209-adc",
-    - "x-powers,axp221-adc",
-    - "x-powers,axp813-adc",
-  - #io-channel-cells: should be 1,
-
-Example:
-
-&axp22x {
-	adc {
-		compatible = "x-powers,axp221-adc";
-		#io-channel-cells = <1>;
-	};
-};
-
-ADC channels and their indexes per variant:
-
-AXP209
-------
- 0 | acin_v
- 1 | acin_i
- 2 | vbus_v
- 3 | vbus_i
- 4 | pmic_temp
- 5 | gpio0_v
- 6 | gpio1_v
- 7 | ipsout_v
- 8 | batt_v
- 9 | batt_chrg_i
-10 | batt_dischrg_i
-
-AXP22x
-------
- 0 | pmic_temp
- 1 | batt_v
- 2 | batt_chrg_i
- 3 | batt_dischrg_i
-
-AXP813
-------
- 0 | pmic_temp
- 1 | gpio0_v
- 2 | batt_v
- 3 | batt_chrg_i
- 4 | batt_dischrg_i
diff --git a/Documentation/devicetree/bindings/iio/adc/x-powers,axp209-adc.yaml b/Documentation/devicetree/bindings/iio/adc/x-powers,axp209-adc.yaml
new file mode 100644
index 000000000000..288a5ac31a16
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/x-powers,axp209-adc.yaml
@@ -0,0 +1,67 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/x-powers,axp209-adc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: X-Powers AXP ADC bindings
+
+maintainers:
+  - Quentin Schulz <quentin.schulz@bootlin.com>
+
+description: |
+  ADC is frequently used as a provider to consumers of the ADC channels.
+  Device is a child of an axp209 multifunction device
+  ADC channels and their indexes per variant:
+
+  AXP209
+  ------
+   0 | acin_v
+   1 | acin_i
+   2 | vbus_v
+   3 | vbus_i
+   4 | pmic_temp
+   5 | gpio0_v
+   6 | gpio1_v
+   7 | ipsout_v
+   8 | batt_v
+   9 | batt_chrg_i
+  10 | batt_dischrg_i
+
+  AXP22x
+  ------
+   0 | pmic_temp
+   1 | batt_v
+   2 | batt_chrg_i
+   3 | batt_dischrg_i
+
+  AXP813
+  ------
+   0 | pmic_temp
+   1 | gpio0_v
+   2 | batt_v
+   3 | batt_chrg_i
+   4 | batt_dischrg_i
+
+
+properties:
+  compatible:
+    enum:
+      - x-powers,axp209-adc
+      - x-powers,axp221-adc
+      - x-powers,axp813-adc
+
+  "#io-channel-cells":
+    const: 1
+
+additionalProperties: false
+
+examples:
+  - |
+    axp221 {
+        adc {
+            compatible = "x-powers,axp221-adc";
+            #io-channel-cells = <1>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 32/46] dt-bindings:iio:adc:brcm,iproc-static-adc: txt to yaml conversion
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (30 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 31/46] dt-bindings:iio:adc:x-powers,axp209-adc: " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 33/46] dt-bindings:iio:adc:mediatek,mt2701-auxadc: rename and " Jonathan Cameron
                   ` (14 subsequent siblings)
  46 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Raveendra Padasalagi

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

A few questions came up in this one.
1) Why does the txt file document io-channel-ranges as a required property.
   That property is for iio-channel consumers, and this is a provider.
   I have dropped it.
2) The example had an @180a6000 for the ADC but given it uses syscon for
   all access, it doesn't have its own reg etc.  I've dropped that from
   the binding example.

Note this example was lifted directly from bcm-cygnus.dtsi so both
issues are present there as well.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
---
 .../iio/adc/brcm,iproc-static-adc.txt         | 40 -----------
 .../iio/adc/brcm,iproc-static-adc.yaml        | 70 +++++++++++++++++++
 2 files changed, 70 insertions(+), 40 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/brcm,iproc-static-adc.txt b/Documentation/devicetree/bindings/iio/adc/brcm,iproc-static-adc.txt
deleted file mode 100644
index 7b1b1e4086d4..000000000000
--- a/Documentation/devicetree/bindings/iio/adc/brcm,iproc-static-adc.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-* Broadcom's IPROC Static ADC controller
-
-Broadcom iProc ADC controller has 8 channels 10bit ADC.
-Allows user to convert analog input voltage values to digital.
-
-Required properties:
-
-- compatible: Must be "brcm,iproc-static-adc"
-
-- adc-syscon: Handler of syscon node defining physical base address of the
-  controller and length of memory mapped region.
-
-- #io-channel-cells = <1>; As ADC has multiple outputs
-  refer to Documentation/devicetree/bindings/iio/iio-bindings.txt for details.
-
-- io-channel-ranges:
-  refer to Documentation/devicetree/bindings/iio/iio-bindings.txt for details.
-
-- clocks: Clock used for this block.
-
-- clock-names: Clock name should be given as tsc_clk.
-
-- interrupts: interrupt line number.
-
-For example:
-
-	ts_adc_syscon: ts_adc_syscon@180a6000 {
-		compatible = "brcm,iproc-ts-adc-syscon","syscon";
-		reg = <0x180a6000 0xc30>;
-	};
-
-	adc: adc@180a6000 {
-		compatible = "brcm,iproc-static-adc";
-		adc-syscon = <&ts_adc_syscon>;
-		#io-channel-cells = <1>;
-		io-channel-ranges;
-		clocks = <&asiu_clks BCM_CYGNUS_ASIU_ADC_CLK>;
-		clock-names = "tsc_clk";
-		interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
-	};
diff --git a/Documentation/devicetree/bindings/iio/adc/brcm,iproc-static-adc.yaml b/Documentation/devicetree/bindings/iio/adc/brcm,iproc-static-adc.yaml
new file mode 100644
index 000000000000..c562d25bee3b
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/brcm,iproc-static-adc.yaml
@@ -0,0 +1,70 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/brcm,iproc-static-adc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Broadcom's IPROC Static ADC controller
+
+maintainers:
+  - Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
+
+description: |
+  Broadcom iProc ADC controller has 8 10bit channels
+
+properties:
+  compatible:
+    const: brcm,iproc-static-adc
+
+  adc-syscon:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      syscon node defining physical base address of the controller and length
+      of memory mapped region.
+
+  "#io-channel-cells":
+    const: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: tsc_clk
+
+  interrupts:
+    maxItems: 1
+
+additionalProperties: false
+
+required:
+  - compatible
+  - adc-syscon
+  - "#io-channel-cells"
+  - clocks
+  - clock-names
+  - interrupts
+
+examples:
+  - |
+    #include <dt-bindings/clock/bcm-cygnus.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    soc {
+        #address-cells = <1>;
+        #size-cells = <1>;
+
+        ts_adc_syscon: ts_adc_syscon@180a6000 {
+            compatible = "brcm,iproc-ts-adc-syscon","syscon";
+            reg = <0x180a6000 0xc30>;
+        };
+
+        adc {
+            compatible = "brcm,iproc-static-adc";
+            adc-syscon = <&ts_adc_syscon>;
+            #io-channel-cells = <1>;
+            clocks = <&asiu_clks BCM_CYGNUS_ASIU_ADC_CLK>;
+            clock-names = "tsc_clk";
+            interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 33/46] dt-bindings:iio:adc:mediatek,mt2701-auxadc: rename and yaml conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (31 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 32/46] dt-bindings:iio:adc:brcm,iproc-static-adc: " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 34/46] dt-bindings:iio:adc:ti,palmas-gpadc: txt to yaml format conversion Jonathan Cameron
                   ` (13 subsequent siblings)
  46 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree
  Cc: Jonathan Cameron, Zhiyong Tao, Matthias Brugger

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

The current driver and indeed binding are named after a part that they
do not list in the compatible.  Hence renamed the binding to reflect
one that does.

From the driver it looks like there is a lot more backwards compatibility
than the binding currently reflects. We could consider expressing that
more explicitly in the yaml for the compatible property. I have
added one explicit pair that was present in the upstream dtsi files.

I added Matthias alongside Zhiyong Tao because I don't think
Zhiyong Tao has reviewed recent patches.  Please let me know if this
isn't the right thing to do.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Zhiyong Tao <zhiyong.tao@mediatek.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
---
 .../iio/adc/mediatek,mt2701-auxadc.yaml       | 77 +++++++++++++++++++
 .../bindings/iio/adc/mt6577_auxadc.txt        | 34 --------
 2 files changed, 77 insertions(+), 34 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml b/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml
new file mode 100644
index 000000000000..5b21a9fba5dd
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/mediatek,mt2701-auxadc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mediatek AUXADC - ADC on Mediatek mobile SoC (mt65xx/mt81xx/mt27xx)
+
+maintainers:
+  - Zhiyong Tao <zhiyong.tao@mediatek.com>
+  - Matthias Brugger <matthias.bgg@gmail.com>
+
+description: |
+  The Auxiliary Analog/Digital Converter (AUXADC) is an ADC found
+  in some Mediatek SoCs which among other things measures the temperatures
+  in the SoC. It can be used directly with register accesses, but it is also
+  used by thermal controller which reads the temperatures from the AUXADC
+  directly via its own bus interface. See mediatek-thermal bindings
+  for the Thermal Controller which holds a phandle to the AUXADC.
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - mediatek,mt2701-auxadc
+          - mediatek,mt2712-auxadc
+          - mediatek,mt6765-auxadc
+          - mediatek,mt7622-auxadc
+          - mediatek,mt8173-auxadc
+      - items:
+          - enum:
+              - mediatek,mt7623-auxadc
+          - const: mediatek,mt2701-auxadc
+      - items:
+          - enum:
+              - mediatek,mt8183-auxadc
+              - mediatek,mt8516-auxadc
+          - const: mediatek,mt8173-auxadc
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: main
+
+  "#io-channel-cells":
+    const: 1
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - "#io-channel-cells"
+
+examples:
+  - |
+    #include <dt-bindings/clock/mt8183-clk.h>
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        adc@11001000 {
+            compatible = "mediatek,mt8183-auxadc",
+                         "mediatek,mt8173-auxadc";
+            reg = <0 0x11001000 0 0x1000>;
+            clocks = <&infracfg CLK_INFRA_AUXADC>;
+            clock-names = "main";
+            #io-channel-cells = <1>;
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt b/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
deleted file mode 100644
index 1b7ff9e5615a..000000000000
--- a/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-* Mediatek AUXADC - Analog to Digital Converter on Mediatek mobile soc (mt65xx/mt81xx/mt27xx)
-===============
-
-The Auxiliary Analog/Digital Converter (AUXADC) is an ADC found
-in some Mediatek SoCs which among other things measures the temperatures
-in the SoC. It can be used directly with register accesses, but it is also
-used by thermal controller which reads the temperatures from the AUXADC
-directly via its own bus interface. See
-Documentation/devicetree/bindings/thermal/mediatek-thermal.txt
-for the Thermal Controller which holds a phandle to the AUXADC.
-
-Required properties:
-  - compatible: Should be one of:
-    - "mediatek,mt2701-auxadc": For MT2701 family of SoCs
-    - "mediatek,mt2712-auxadc": For MT2712 family of SoCs
-    - "mediatek,mt6765-auxadc": For MT6765 family of SoCs
-    - "mediatek,mt7622-auxadc": For MT7622 family of SoCs
-    - "mediatek,mt8173-auxadc": For MT8173 family of SoCs
-    - "mediatek,mt8183-auxadc", "mediatek,mt8173-auxadc": For MT8183 family of SoCs
-    - "mediatek,mt8516-auxadc", "mediatek,mt8173-auxadc": For MT8516 family of SoCs
-  - reg: Address range of the AUXADC unit.
-  - clocks: Should contain a clock specifier for each entry in clock-names
-  - clock-names: Should contain "main".
-  - #io-channel-cells: Should be 1, see ../iio-bindings.txt
-
-Example:
-
-auxadc: adc@11001000 {
-	compatible = "mediatek,mt2701-auxadc";
-	reg = <0 0x11001000 0 0x1000>;
-	clocks = <&pericfg CLK_PERI_AUXADC>;
-	clock-names = "main";
-	#io-channel-cells = <1>;
-};
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 34/46] dt-bindings:iio:adc:ti,palmas-gpadc: txt to yaml format conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (32 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 33/46] dt-bindings:iio:adc:mediatek,mt2701-auxadc: rename and " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-22 18:20   ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 35/46] dt-bindings:iio:adc:qcom,pm8018-adc: yaml conversion and rename Jonathan Cameron
                   ` (12 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Tony Lindgren

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Simple conversion of the binding doc for this subnode of the palmas
PMIC.
Given age of driver and lack interaction with original authors,
I've guessed at Tony for a maintainer on this one.  Tony, if you
are happy with that great, otherwise I can default back to myself.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Tony Lindgren <tony@atomide.com>
---
 .../bindings/iio/adc/palmas-gpadc.txt         | 48 ----------
 .../bindings/iio/adc/ti,palmas-gpadc.yaml     | 87 +++++++++++++++++++
 2 files changed, 87 insertions(+), 48 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/palmas-gpadc.txt b/Documentation/devicetree/bindings/iio/adc/palmas-gpadc.txt
deleted file mode 100644
index 4bb9a86065d1..000000000000
--- a/Documentation/devicetree/bindings/iio/adc/palmas-gpadc.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-* Palmas general purpose ADC IP block devicetree bindings
-
-Channels list:
-	0 battery type
-	1 battery temp NTC (optional current source)
-	2 GP
-	3 temp (with ext. diode, optional current source)
-	4 GP
-	5 GP
-	6 VBAT_SENSE
-	7 VCC_SENSE
-	8 Backup Battery voltage
-	9 external charger (VCHG)
-	10 VBUS
-	11 DC-DC current probe (how does this work?)
-	12 internal die temp
-	13 internal die temp
-	14 USB ID pin voltage
-	15 test network
-
-Required properties:
-- compatible : Must be "ti,palmas-gpadc".
-- #io-channel-cells: Should be set to <1>.
-
-Optional sub-nodes:
-ti,channel0-current-microamp: Channel 0 current in uA.
-	Values are rounded to derive 0uA, 5uA, 15uA, 20uA.
-ti,channel3-current-microamp: Channel 3 current in uA.
-	Values are rounded to derive 0uA, 10uA, 400uA, 800uA.
-ti,enable-extended-delay: Enable extended delay.
-
-Example:
-
-pmic {
-	compatible = "ti,twl6035-pmic", "ti,palmas-pmic";
-	...
-	gpadc {
-		compatible = "ti,palmas-gpadc";
-		interrupts = <18 0
-			      16 0
-			      17 0>;
-		#io-channel-cells = <1>;
-		ti,channel0-current-microamp = <5>;
-		ti,channel3-current-microamp = <10>;
-		};
-	};
-	...
-};
diff --git a/Documentation/devicetree/bindings/iio/adc/ti,palmas-gpadc.yaml b/Documentation/devicetree/bindings/iio/adc/ti,palmas-gpadc.yaml
new file mode 100644
index 000000000000..692dacd0fee5
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/ti,palmas-gpadc.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/ti,palmas-gpadc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Palmas general purpose ADC IP block devicetree bindings
+
+maintainers:
+  - Tony Lindgren <tony@atomide.com>
+
+description: |
+  This ADC is often used to provide channels via the io-channels
+  consumer framework.
+  Channels list:
+    0 battery type
+    1 battery temp NTC (optional current source)
+    2 GP
+    3 temp (with ext. diode, optional current source)
+    4 GP
+    5 GP
+    6 VBAT_SENSE
+    7 VCC_SENSE
+    8 Backup Battery voltage
+    9 external charger (VCHG)
+    10 VBUS
+    11 DC-DC current probe (how does this work?)
+    12 internal die temp
+    13 internal die temp
+    14 USB ID pin voltage
+    15 test network
+
+properties:
+  compatible:
+    const: ti,palmas-gpadc
+
+  interrupts:
+    minItems: 1
+    maxItems: 3
+
+  "#io-channel-cells":
+    const: 1
+
+  ti,channel0-current-microamp:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Channel 0 current in uA.
+    enum:
+      - 0
+      - 5
+      - 15
+      - 20
+
+  ti,channel3-current-microamp:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Channel 3 current in uA.
+    enum:
+      - 0
+      - 10
+      - 400
+      - 800
+
+  ti,enable-extended-delay:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enable extended delay.
+
+additionalProperties: false
+
+required:
+  - compatible
+  - "#io-channel-cells"
+
+examples:
+  - |
+    #include <dt-bindings/clock/mt8183-clk.h>
+    pmic {
+        compatible = "ti,twl6035-pmic", "ti,palmas-pmic";
+        adc {
+            compatible = "ti,palmas-gpadc";
+            interrupts = <18 0
+                          16 0
+                          17 0>;
+            #io-channel-cells = <1>;
+            ti,channel0-current-microamp = <5>;
+            ti,channel3-current-microamp = <10>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 35/46] dt-bindings:iio:adc:qcom,pm8018-adc: yaml conversion and rename.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (33 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 34/46] dt-bindings:iio:adc:ti,palmas-gpadc: txt to yaml format conversion Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-04 14:51   ` Linus Walleij
  2020-10-31 18:48 ` [PATCH 36/46] dt-bindings:iio:adc:qcom,spmi-iadc: txt to yaml format conversion Jonathan Cameron
                   ` (11 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Linus Walleij

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Renamed to match a listed compatible rather than relying on wildcards
with all their usual problems.

Dropped the reference supply as a requirement as at least one dtsi doesn't
include it and the example never did.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
---
 .../bindings/iio/adc/qcom,pm8018-adc.yaml     | 166 ++++++++++++++++++
 .../bindings/iio/adc/qcom,pm8xxx-xoadc.txt    | 157 -----------------
 2 files changed, 166 insertions(+), 157 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/qcom,pm8018-adc.yaml b/Documentation/devicetree/bindings/iio/adc/qcom,pm8018-adc.yaml
new file mode 100644
index 000000000000..d186b713d6a7
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/qcom,pm8018-adc.yaml
@@ -0,0 +1,166 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/qcom,pm8018-adc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm's PM8xxx voltage XOADC
+
+maintainers:
+  - Linus Walleij <linus.walleij@linaro.org>
+
+description: |
+  The Qualcomm PM8xxx PMICs contain a HK/XO ADC (Housekeeping/Crystal
+  oscillator ADC) encompassing PM8018, PM8038, PM8058 and PM8921.
+
+properties:
+  compatible:
+    enum:
+      - qcom,pm8018-adc
+      - qcom,pm8038-adc
+      - qcom,pm8058-adc
+      - qcom,pm8921-adc
+
+  reg:
+    maxItems: 1
+    description:
+      ADC base address in the PMIC, typically 0x197.
+
+  xoadc-ref-supply:
+    description:
+      The reference voltage may vary with PMIC variant but is typically
+      something like 2.2 or 1.8V.
+
+  interrupts:
+    maxItems: 1
+
+  "#address-cells":
+    const: 2
+    description:
+      The first cell is the prescaler (on PM8058) or premux (on PM8921)
+      with two valid bits  so legal values are 0x00, 0x01 or 0x02.
+      The second cell is the main analog mux setting (0x00..0x0f).
+      The combination of prescaler/premux and analog mux uniquely addresses
+      a hardware channel on all systems.
+
+  "#size-cells":
+    const: 0
+
+  "#io-channel-cells":
+    const: 2
+    description:
+      The cells are precaler or premux followed by the analog muxing line.
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - "#io-channel-cells"
+  - "#address-cells"
+  - "#size-cells"
+  - adc-channel@c
+  - adc-channel@d
+  - adc-channel@f
+
+patternProperties:
+  "^(adc-channel@)[0-9a-f]$":
+    type: object
+    description: |
+      ADC channel specific configuration.
+      Note that channels c, d and f must be present for calibration.
+      These three nodes are used for absolute and ratiometric calibration
+      and only need to have these reg values: they are by hardware definition
+      1:1 ratio converters that sample 625, 1250 and 0 milliV and create
+      an interpolation calibration for all other ADCs.
+
+    properties:
+      reg:
+        maxItems: 1
+
+      qcom,decimation:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: |
+          This parameter is used to decrease the ADC sampling rate.
+          Quicker measurements can be made by reducing the decimation ratio.
+          Valid values are 512, 1024, 2048, 4096.
+          If the property is not found, a default value of 512 will be used.
+
+      qcom,ratiometric:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: |
+          Channel calibration type. If this property is specified
+          VADC will use a special voltage references for channel
+          calibration. The available references are specified in the
+          as a u32 value setting (see below) and it is compulsory
+          to also specify this reference if ratiometric calibration
+          is selected.
+
+          If the property is not found, the channel will be
+          calibrated with the 0.625V and 1.25V reference channels, also
+          known as an absolute calibration.
+
+          The reference voltage pairs when using ratiometric calibration:
+          0 = XO_IN/XOADC_GND
+          1 = PMIC_IN/XOADC_GND
+          2 = PMIC_IN/BMS_CSP
+          3 (invalid)
+          4 = XOADC_GND/XOADC_GND
+          5 = XOADC_VREF/XOADC_GND
+
+    additionalProperties: false
+
+    required:
+      - reg
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    pmic {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        adc@197 {
+            compatible = "qcom,pm8058-adc";
+            reg = <0x197>;
+            interrupts-extended = <&pm8058 76 IRQ_TYPE_EDGE_RISING>;
+            #address-cells = <2>;
+            #size-cells = <0>;
+            #io-channel-cells = <2>;
+
+            vcoin: adc-channel@0 {
+                reg = <0x00 0x00>;
+            };
+            vbat: adc-channel@1 {
+                reg = <0x00 0x01>;
+            };
+            dcin: adc-channel@2 {
+                reg = <0x00 0x02>;
+            };
+            ichg: adc-channel@3 {
+                reg = <0x00 0x03>;
+            };
+            vph_pwr: adc-channel@4 {
+                reg = <0x00 0x04>;
+            };
+            usb_vbus: adc-channel@a {
+                reg = <0x00 0x0a>;
+            };
+            die_temp: adc-channel@b {
+                reg = <0x00 0x0b>;
+            };
+            ref_625mv: adc-channel@c {
+                reg = <0x00 0x0c>;
+            };
+            ref_1250mv: adc-channel@d {
+                reg = <0x00 0x0d>;
+            };
+            ref_325mv: adc-channel@e {
+                reg = <0x00 0x0e>;
+            };
+            ref_muxoff: adc-channel@f {
+                reg = <0x00 0x0f>;
+           };
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/iio/adc/qcom,pm8xxx-xoadc.txt b/Documentation/devicetree/bindings/iio/adc/qcom,pm8xxx-xoadc.txt
deleted file mode 100644
index 3ae06127789e..000000000000
--- a/Documentation/devicetree/bindings/iio/adc/qcom,pm8xxx-xoadc.txt
+++ /dev/null
@@ -1,157 +0,0 @@
-Qualcomm's PM8xxx voltage XOADC
-
-The Qualcomm PM8xxx PMICs contain a HK/XO ADC (Housekeeping/Crystal
-oscillator ADC) encompassing PM8018, PM8038, PM8058 and PM8921.
-
-Required properties:
-
-- compatible: should be one of:
-  "qcom,pm8018-adc"
-  "qcom,pm8038-adc"
-  "qcom,pm8058-adc"
-  "qcom,pm8921-adc"
-
-- reg: should contain the ADC base address in the PMIC, typically
-  0x197.
-
-- xoadc-ref-supply: should reference a regulator that can supply
-  a reference voltage on demand. The reference voltage may vary
-  with PMIC variant but is typically something like 2.2 or 1.8V.
-
-The following required properties are standard for IO channels, see
-iio-bindings.txt for more details, but notice that this particular
-ADC has a special addressing scheme that require two cells for
-identifying each ADC channel:
-
-- #address-cells: should be set to <2>, the first cell is the
-  prescaler (on PM8058) or premux (on PM8921) with two valid bits
-  so legal values are 0x00, 0x01 or 0x02. The second cell
-  is the main analog mux setting (0x00..0x0f). The combination
-  of prescaler/premux and analog mux uniquely addresses a hardware
-  channel on all systems.
-
-- #size-cells: should be set to <0>
-
-- #io-channel-cells: should be set to <2>, again the cells are
-  precaler or premux followed by the analog muxing line.
-
-- interrupts: should refer to the parent PMIC interrupt controller
-  and reference the proper ADC interrupt.
-
-Required subnodes:
-
-The ADC channels are configured as subnodes of the ADC.
-
-Since some of them are used for calibrating the ADC, these nodes are
-compulsory:
-
-adc-channel@c {
-	reg = <0x00 0x0c>;
-};
-
-adc-channel@d {
-	reg = <0x00 0x0d>;
-};
-
-adc-channel@f {
-	reg = <0x00 0x0f>;
-};
-
-These three nodes are used for absolute and ratiometric calibration
-and only need to have these reg values: they are by hardware definition
-1:1 ratio converters that sample 625, 1250 and 0 milliV and create
-an interpolation calibration for all other ADCs.
-
-Optional subnodes: any channels other than channels [0x00 0x0c],
-[0x00 0x0d] and [0x00 0x0f] are optional.
-
-Required channel node properties:
-
-- reg: should contain the hardware channel number in the range
-  0 .. 0xff (8 bits).
-
-Optional channel node properties:
-
-- qcom,decimation:
-  Value type: <u32>
-  Definition: This parameter is used to decrease the ADC sampling rate.
-          Quicker measurements can be made by reducing the decimation ratio.
-          Valid values are 512, 1024, 2048, 4096.
-          If the property is not found, a default value of 512 will be used.
-
-- qcom,ratiometric:
-  Value type: <u32>
-  Definition: Channel calibration type. If this property is specified
-          VADC will use a special voltage references for channel
-          calibration. The available references are specified in the
-	  as a u32 value setting (see below) and it is compulsory
-	  to also specify this reference if ratiometric calibration
-	  is selected.
-
-	  If the property is not found, the channel will be
-          calibrated with the 0.625V and 1.25V reference channels, also
-          known as an absolute calibration.
-  The reference voltage pairs when using ratiometric calibration:
-	  0 = XO_IN/XOADC_GND
-	  1 = PMIC_IN/XOADC_GND
-	  2 = PMIC_IN/BMS_CSP
-	  3 (invalid)
-	  4 = XOADC_GND/XOADC_GND
-	  5 = XOADC_VREF/XOADC_GND
-
-Example:
-
-xoadc: xoadc@197 {
-	compatible = "qcom,pm8058-adc";
-	reg = <0x197>;
-	interrupts-extended = <&pm8058 76 IRQ_TYPE_EDGE_RISING>;
-	#address-cells = <2>;
-	#size-cells = <0>;
-	#io-channel-cells = <2>;
-
-	vcoin: adc-channel@0 {
-		reg = <0x00 0x00>;
-	};
-	vbat: adc-channel@1 {
-		reg = <0x00 0x01>;
-	};
-	dcin: adc-channel@2 {
-		reg = <0x00 0x02>;
-	};
-	ichg: adc-channel@3 {
-		reg = <0x00 0x03>;
-	};
-	vph_pwr: adc-channel@4 {
-		reg = <0x00 0x04>;
-	};
-	usb_vbus: adc-channel@a {
-		reg = <0x00 0x0a>;
-	};
-	die_temp: adc-channel@b {
-		reg = <0x00 0x0b>;
-	};
-	ref_625mv: adc-channel@c {
-		reg = <0x00 0x0c>;
-	};
-	ref_1250mv: adc-channel@d {
-		reg = <0x00 0x0d>;
-	};
-	ref_325mv: adc-channel@e {
-		reg = <0x00 0x0e>;
-	};
-	ref_muxoff: adc-channel@f {
-		reg = <0x00 0x0f>;
-	};
-};
-
-/* IIO client node */
-iio-hwmon {
-	compatible = "iio-hwmon";
-	io-channels = <&xoadc 0x00 0x01>, /* Battery */
-		    <&xoadc 0x00 0x02>, /* DC in (charger) */
-		    <&xoadc 0x00 0x04>, /* VPH the main system voltage */
-		    <&xoadc 0x00 0x0b>, /* Die temperature */
-		    <&xoadc 0x00 0x0c>, /* Reference voltage 1.25V */
-		    <&xoadc 0x00 0x0d>, /* Reference voltage 0.625V */
-		    <&xoadc 0x00 0x0e>; /* Reference voltage 0.325V */
-};
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 36/46] dt-bindings:iio:adc:qcom,spmi-iadc: txt to yaml format conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (34 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 35/46] dt-bindings:iio:adc:qcom,pm8018-adc: yaml conversion and rename Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-22 18:25   ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 37/46] dt-binding:iio:adc:ti,ads124s08: " Jonathan Cameron
                   ` (10 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Ivan T . Ivanov

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Straight forward conversion.  Not heard from Ivan in a while so if the
email bounces, I'll change the maintainer to myself for this binding unless
anyone else comes forwards.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Ivan T. Ivanov <iivanov@mm-sol.com>
---
 .../bindings/iio/adc/qcom,spmi-iadc.txt       | 46 --------------
 .../bindings/iio/adc/qcom,spmi-iadc.yaml      | 62 +++++++++++++++++++
 2 files changed, 62 insertions(+), 46 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.txt b/Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.txt
deleted file mode 100644
index 4e36d6e2f7b6..000000000000
--- a/Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-Qualcomm's SPMI PMIC current ADC
-
-QPNP PMIC current ADC (IADC) provides interface to clients to read current.
-A 16 bit ADC is used for current measurements. IADC can measure the current
-through an external resistor (channel 1) or internal (built-in) resistor
-(channel 0). When using an external resistor it is to be described by
-qcom,external-resistor-micro-ohms property.
-
-IADC node:
-
-- compatible:
-    Usage: required
-    Value type: <string>
-    Definition: Should contain "qcom,spmi-iadc".
-
-- reg:
-    Usage: required
-    Value type: <prop-encoded-array>
-    Definition: IADC base address and length in the SPMI PMIC register map
-
-- interrupts:
-    Usage: optional
-    Value type: <prop-encoded-array>
-    Definition: End of ADC conversion.
-
-- qcom,external-resistor-micro-ohms:
-    Usage: optional
-    Value type: <u32>
-    Definition: Sense resister value in micro Ohm.
-                If not defined value of 10000 micro Ohms will be used.
-
-Example:
-	/* IADC node */
-	pmic_iadc: iadc@3600 {
-		compatible = "qcom,spmi-iadc";
-		reg = <0x3600 0x100>;
-		interrupts = <0x0 0x36 0x0 IRQ_TYPE_EDGE_RISING>;
-		qcom,external-resistor-micro-ohms = <10000>;
-		#io-channel-cells  = <1>;
-	};
-
-	/* IIO client node */
-	bat {
-		io-channels = <&pmic_iadc  0>;
-		io-channel-names = "iadc";
-	};
diff --git a/Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.yaml b/Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.yaml
new file mode 100644
index 000000000000..359e1ede0ae2
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.yaml
@@ -0,0 +1,62 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/qcom,spmi-iadc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm's SPMI PMIC current ADC
+
+maintainers:
+  - Ivan T. Ivanov <iivanov@mm-sol.com>
+
+description: |
+  QPNP PMIC current ADC (IADC) provides interface to clients to read current.
+  A 16 bit ADC is used for current measurements. IADC can measure the current
+  through an external resistor (channel 1) or internal (built-in) resistor
+  (channel 0). When using an external resistor it is to be described by
+  qcom,external-resistor-micro-ohms property.
+
+properties:
+  compatible:
+    const: qcom,spmi-iadc
+
+  reg:
+    description: IADC base address and length in the SPMI PMIC register map
+    maxItems: 1
+
+  qcom,external-resistor-micro-ohms:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Sensor resistor value. If not defined value of 10000 micro Ohms
+      will be used.
+
+  interrupts:
+    maxItems: 1
+    description:
+      End of conversion interrupt.
+
+  "#io-channel-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    spmi_bus {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        pmic_iadc: adc@3600 {
+            compatible = "qcom,spmi-iadc";
+            reg = <0x3600 0x100>;
+            interrupts = <0x0 0x36 0x0 IRQ_TYPE_EDGE_RISING>;
+            qcom,external-resistor-micro-ohms = <10000>;
+            #io-channel-cells  = <1>;
+        };
+    };
+...
+
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 37/46] dt-binding:iio:adc:ti,ads124s08: txt to yaml format conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (35 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 36/46] dt-bindings:iio:adc:qcom,spmi-iadc: txt to yaml format conversion Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-02 12:49   ` Dan Murphy
  2020-10-31 18:48 ` [PATCH 38/46] dt-bindings:iio:dac:ad5592r: " Jonathan Cameron
                   ` (9 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Dan Murphy

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Simple binding so straight forward format conversion.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Dan Murphy <dmurphy@ti.com>
---
 .../bindings/iio/adc/ti,ads124s08.yaml        | 52 +++++++++++++++++++
 .../bindings/iio/adc/ti-ads124s08.txt         | 25 ---------
 2 files changed, 52 insertions(+), 25 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/ti,ads124s08.yaml b/Documentation/devicetree/bindings/iio/adc/ti,ads124s08.yaml
new file mode 100644
index 000000000000..5912a52953fa
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/ti,ads124s08.yaml
@@ -0,0 +1,52 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/ti,ads124s08.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments' ads124s08 and ads124s06 ADC chip
+
+maintainers:
+  - Dan Murphy <dmurphy@ti.com>
+
+properties:
+  compatible:
+    enum:
+      - ti,ads124s06
+      - ti,ads124s08
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency: true
+
+  spi-cpha: true
+
+  reset-gpios:
+    maxItems: 1
+
+  "#io-channel-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        adc@0 {
+            compatible = "ti,ads124s08";
+            reg = <0>;
+            spi-max-frequency = <1000000>;
+            spi-cpha;
+            reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/iio/adc/ti-ads124s08.txt b/Documentation/devicetree/bindings/iio/adc/ti-ads124s08.txt
deleted file mode 100644
index ecf807bb32f7..000000000000
--- a/Documentation/devicetree/bindings/iio/adc/ti-ads124s08.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-* Texas Instruments' ads124s08 and ads124s06 ADC chip
-
-Required properties:
- - compatible :
-	"ti,ads124s08"
-	"ti,ads124s06"
- - reg : spi chip select number for the device
-
-Recommended properties:
- - spi-max-frequency : Definition as per
-		Documentation/devicetree/bindings/spi/spi-bus.txt
- - spi-cpha : Definition as per
-		Documentation/devicetree/bindings/spi/spi-bus.txt
-
-Optional properties:
- - reset-gpios : GPIO pin used to reset the device.
-
-Example:
-adc@0 {
-	compatible = "ti,ads124s08";
-	reg = <0>;
-	spi-max-frequency = <1000000>;
-	spi-cpha;
-	reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
-};
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 38/46] dt-bindings:iio:dac:ad5592r: txt to yaml format conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (36 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 37/46] dt-binding:iio:adc:ti,ads124s08: " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-03 16:31   ` Rob Herring
  2020-10-31 18:48 ` [PATCH 39/46] dt-bindings:iio:dac:ad5755: " Jonathan Cameron
                   ` (8 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Michael Hennerich

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This is a more complex binding. Whilst conversion is straight forward
I am unsure if the full nature of required properties has been captured.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
---
 .../devicetree/bindings/iio/dac/ad5592r.txt   | 155 --------------
 .../bindings/iio/dac/adi,ad5592r.yaml         | 201 ++++++++++++++++++
 2 files changed, 201 insertions(+), 155 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/dac/ad5592r.txt b/Documentation/devicetree/bindings/iio/dac/ad5592r.txt
deleted file mode 100644
index 989f96f31c66..000000000000
--- a/Documentation/devicetree/bindings/iio/dac/ad5592r.txt
+++ /dev/null
@@ -1,155 +0,0 @@
-Analog Devices AD5592R/AD5593R DAC/ADC device driver
-
-Required properties for the AD5592R:
-	- compatible: Must be "adi,ad5592r"
-	- reg: SPI chip select number for the device
-	- spi-max-frequency: Max SPI frequency to use (< 30000000)
-	- spi-cpol: The AD5592R requires inverse clock polarity (CPOL) mode
-
-Required properties for the AD5593R:
-	- compatible: Must be "adi,ad5593r"
-	- reg: I2C address of the device
-
-Required properties for all supported chips:
-	- #address-cells: Should be 1.
-	- #size-cells: Should be 0.
-	- channel nodes:
-	  Each child node represents one channel and has the following
-	  Required properties:
-		* reg: Pin on which this channel is connected to.
-		* adi,mode: Mode or function of this channel.
-			    Macros specifying the valid values
-			    can be found in <dt-bindings/iio/adi,ad5592r.h>.
-
-			    The following values are currently supported:
-				* CH_MODE_UNUSED (the pin is unused)
-				* CH_MODE_ADC (the pin is ADC input)
-				* CH_MODE_DAC (the pin is DAC output)
-				* CH_MODE_DAC_AND_ADC (the pin is DAC output
-					but can be monitored by an ADC, since
-					there is no disadvantage this
-					this should be considered as the
-					preferred DAC mode)
-				* CH_MODE_GPIO (the pin is registered
-					with GPIOLIB)
-	 Optional properties:
-		* adi,off-state: State of this channel when unused or the
-				 device gets removed. Macros specifying the
-				 valid values can be found in
-				 <dt-bindings/iio/adi,ad5592r.h>.
-
-				* CH_OFFSTATE_PULLDOWN (the pin is pulled down)
-				* CH_OFFSTATE_OUT_LOW  (the pin is output low)
-				* CH_OFFSTATE_OUT_HIGH (the pin is output high)
-				* CH_OFFSTATE_OUT_TRISTATE (the pin is
-					tristated output)
-
-
-Optional properties:
-	- vref-supply: Phandle to the external reference voltage supply. This should
-	  only be set if there is an external reference voltage connected to the VREF
-	  pin. If the property is not set the internal 2.5V reference is used.
-	- reset-gpios : GPIO spec for the RESET pin. If specified, it will be
-	  asserted during driver probe.
-	- gpio-controller: Marks the device node as a GPIO controller.
-	- #gpio-cells: Should be 2. The first cell is the GPIO number and the second
-	  cell specifies GPIO flags, as defined in <dt-bindings/gpio/gpio.h>.
-
-AD5592R Example:
-
-	#include <dt-bindings/iio/adi,ad5592r.h>
-
-	vref: regulator-vref {
-		compatible = "regulator-fixed";
-		regulator-name = "vref-ad559x";
-		regulator-min-microvolt = <3300000>;
-		regulator-max-microvolt = <3300000>;
-		regulator-always-on;
-	};
-
-	ad5592r@0 {
-		#size-cells = <0>;
-		#address-cells = <1>;
-		#gpio-cells = <2>;
-		compatible = "adi,ad5592r";
-		reg = <0>;
-
-		spi-max-frequency = <1000000>;
-		spi-cpol;
-
-		vref-supply = <&vref>; /* optional */
-		reset-gpios = <&gpio0 86 0>;  /* optional */
-		gpio-controller;
-
-		channel@0 {
-			reg = <0>;
-			adi,mode = <CH_MODE_DAC>;
-		};
-		channel@1 {
-			reg = <1>;
-			adi,mode = <CH_MODE_ADC>;
-		};
-		channel@2 {
-			reg = <2>;
-			adi,mode = <CH_MODE_DAC_AND_ADC>;
-		};
-		channel@3 {
-			reg = <3>;
-			adi,mode = <CH_MODE_DAC_AND_ADC>;
-			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
-		};
-		channel@4 {
-			reg = <4>;
-			adi,mode = <CH_MODE_UNUSED>;
-			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
-		};
-		channel@5 {
-			reg = <5>;
-			adi,mode = <CH_MODE_GPIO>;
-			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
-		};
-		channel@6 {
-			reg = <6>;
-			adi,mode = <CH_MODE_GPIO>;
-			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
-		};
-		channel@7 {
-			reg = <7>;
-			adi,mode = <CH_MODE_GPIO>;
-			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
-		};
-	};
-
-AD5593R Example:
-
-	#include <dt-bindings/iio/adi,ad5592r.h>
-
-	ad5593r@10 {
-		#size-cells = <0>;
-		#address-cells = <1>;
-		#gpio-cells = <2>;
-		compatible = "adi,ad5593r";
-		reg = <0x10>;
-		gpio-controller;
-
-		channel@0 {
-			reg = <0>;
-			adi,mode = <CH_MODE_DAC>;
-			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
-		};
-		channel@1 {
-			reg = <1>;
-			adi,mode = <CH_MODE_ADC>;
-			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
-		};
-		channel@2 {
-			reg = <2>;
-			adi,mode = <CH_MODE_DAC_AND_ADC>;
-			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
-		};
-		channel@6 {
-			reg = <6>;
-			adi,mode = <CH_MODE_GPIO>;
-			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
-		};
-	};
diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml
new file mode 100644
index 000000000000..c49646825c37
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml
@@ -0,0 +1,201 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/adi,ad5592r.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD5592R/AD5593R DAC/ADC
+
+maintainers:
+  - Michael Hennerich <michael.hennerich@analog.com>
+
+properties:
+  compatible:
+    enum:
+      - adi,ad5592r
+      - adi,ad5593r
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency:
+    maximum: 30000000
+
+  spi-cpol: true
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+  "#io-channel-cells":
+    const: 1
+
+  vref-supply:
+    description: If not set internal 2.5V reference used.
+
+  reset-gpios:
+    maxItems: 1
+
+  gpio-controller:
+    description: Marks the device node as a GPIO controller.
+
+  "#gpio-cells":
+    const: 2
+    description:
+      The first cell is the GPIO number and the second cell specifies
+      GPIO flags, as defined in <dt-bindings/gpio/gpio.h>.
+
+required:
+  - compatible
+  - reg
+  - "#address-cells"
+  - "#size-cells"
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: adi,ad5592r
+    then:
+      required:
+        - spi-cpol
+    else:
+      properties:
+        spi-cpol: false
+
+additionalProperties: false
+
+patternProperties:
+  "^(channel@)[0-7]$":
+    type: object
+    description: Child node to describe a channel
+    properties:
+      reg:
+        maxItems: 1
+
+      adi,mode:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: |
+          Mode or function of this channel.
+          Macros specifying the valid values can be found in
+          <dt-bindings/iio/adi,ad5592r.h>.
+
+          The following values are currently supported:
+          * CH_MODE_UNUSED (the pin is unused)
+          * CH_MODE_ADC (the pin is ADC input)
+          * CH_MODE_DAC (the pin is DAC output)
+          * CH_MODE_DAC_AND_ADC (the pin is DAC output but can be monitored
+            by an ADC, since there is no disadvantage this should be
+            considered as the preferred DAC mode)
+          * CH_MODE_GPIO (the pin is registered with GPIOLIB)
+
+      adi,off-state:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: |
+          State of this channel when unused or the device gets removed.
+          Macros specifying the  valid values can be found in
+          <dt-bindings/iio/adi,ad5592r.h>.
+          * CH_OFFSTATE_PULLDOWN (the pin is pulled down)
+          * CH_OFFSTATE_OUT_LOW  (the pin is output low)
+          * CH_OFFSTATE_OUT_HIGH (the pin is output high)
+          * CH_OFFSTATE_OUT_TRISTATE (the pin is tristated output)
+
+    required:
+      - reg
+      - adi,mode
+
+    additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/iio/adi,ad5592r.h>
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        addac@0 {
+            compatible = "adi,ad5592r";
+            #size-cells = <0>;
+            #address-cells = <1>;
+            #gpio-cells = <2>;
+            reg = <0>;
+
+            spi-max-frequency = <1000000>;
+            spi-cpol;
+
+            vref-supply = <&vref>;
+            reset-gpios = <&gpio0 86 0>;
+            gpio-controller;
+
+            channel@0 {
+                reg = <0>;
+                adi,mode = <CH_MODE_DAC>;
+            };
+            channel@1 {
+                reg = <1>;
+                adi,mode = <CH_MODE_ADC>;
+            };
+            channel@2 {
+                reg = <2>;
+                adi,mode = <CH_MODE_DAC_AND_ADC>;
+            };
+            channel@3 {
+                reg = <3>;
+                adi,mode = <CH_MODE_DAC_AND_ADC>;
+                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
+            };
+            channel@4 {
+                reg = <4>;
+                adi,mode = <CH_MODE_UNUSED>;
+                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
+            };
+            channel@5 {
+                reg = <5>;
+                adi,mode = <CH_MODE_GPIO>;
+                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
+            };
+            channel@6 {
+                reg = <6>;
+                adi,mode = <CH_MODE_GPIO>;
+                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
+            };
+            channel@7 {
+                reg = <7>;
+                adi,mode = <CH_MODE_GPIO>;
+                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
+            };
+        };
+        ad5593r@10 {
+            compatible = "adi,ad5593r";
+            #size-cells = <0>;
+            #address-cells = <1>;
+            #gpio-cells = <2>;
+            reg = <0x10>;
+            gpio-controller;
+
+            channel@0 {
+                reg = <0>;
+                adi,mode = <CH_MODE_DAC>;
+                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
+            };
+            channel@1 {
+                reg = <1>;
+                adi,mode = <CH_MODE_ADC>;
+                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
+            };
+            channel@2 {
+                reg = <2>;
+                adi,mode = <CH_MODE_DAC_AND_ADC>;
+                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
+            };
+            channel@6 {
+                reg = <6>;
+                adi,mode = <CH_MODE_GPIO>;
+                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
+            };
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 39/46] dt-bindings:iio:dac:ad5755: txt to yaml format conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (37 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 38/46] dt-bindings:iio:dac:ad5592r: " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-03 16:32   ` Rob Herring
  2020-10-31 18:48 ` [PATCH 40/46] dt-bindings:iio:accel:bosch,bma180: " Jonathan Cameron
                   ` (7 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Sean Nyekjaer

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Straight forward conversion.  Only fiddly bit is the XOR of
spi-cpol and spi-cpha.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
---
 .../devicetree/bindings/iio/dac/ad5755.txt    | 124 ------------
 .../bindings/iio/dac/adi,ad5755.yaml          | 178 ++++++++++++++++++
 2 files changed, 178 insertions(+), 124 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/dac/ad5755.txt b/Documentation/devicetree/bindings/iio/dac/ad5755.txt
deleted file mode 100644
index 502e1e55adbd..000000000000
--- a/Documentation/devicetree/bindings/iio/dac/ad5755.txt
+++ /dev/null
@@ -1,124 +0,0 @@
-* Analog Devices AD5755 IIO Multi-Channel DAC Linux Driver
-
-Required properties:
- - compatible: Has to contain one of the following:
-	adi,ad5755
-	adi,ad5755-1
-	adi,ad5757
-	adi,ad5735
-	adi,ad5737
-
- - reg: spi chip select number for the device
- - spi-cpha or spi-cpol: is the only modes that is supported
-
-Recommended properties:
- - spi-max-frequency: Definition as per
-		Documentation/devicetree/bindings/spi/spi-bus.txt
-
-Optional properties:
-See include/dt-bindings/iio/ad5755.h
- - adi,ext-dc-dc-compenstation-resistor: boolean set if the hardware have an
-					 external resistor and thereby bypasses
-					 the internal compensation resistor.
- - adi,dc-dc-phase:
-	Valid values for DC DC Phase control is:
-	0: All dc-to-dc converters clock on the same edge.
-	1: Channel A and Channel B clock on the same edge,
-	   Channel C and Channel D clock on opposite edges.
-	2: Channel A and Channel C clock on the same edge,
-	   Channel B and Channel D clock on opposite edges.
-	3: Channel A, Channel B, Channel C, and Channel D
-	   clock 90 degrees out of phase from each other.
- - adi,dc-dc-freq-hz:
-	Valid values for DC DC frequency is [Hz]:
-	250000
-	410000
-	650000
- - adi,dc-dc-max-microvolt:
-	Valid values for the maximum allowed Vboost voltage supplied by
-	the dc-to-dc converter is:
-	23000000
-	24500000
-	27000000
-	29500000
-
-Optional for every channel:
- - adi,mode:
-	Valid values for DAC modes is:
-	0: 0 V to 5 V voltage range.
-	1: 0 V to 10 V voltage range.
-	2: Plus minus 5 V voltage range.
-	3: Plus minus 10 V voltage range.
-	4: 4 mA to 20 mA current range.
-	5: 0 mA to 20 mA current range.
-	6: 0 mA to 24 mA current range.
- - adi,ext-current-sense-resistor: boolean set if the hardware a external
-				   current sense resistor.
- - adi,enable-voltage-overrange: boolean enable voltage overrange
- - adi,slew: Array of slewrate settings should contain 3 fields:
-	1: Should be either 0 or 1 in order to enable or disable slewrate.
-	2: Slew rate settings:
-		Valid values for the slew rate update frequency:
-		64000
-		32000
-		16000
-		8000
-		4000
-		2000
-		1000
-		500
-		250
-		125
-		64
-		32
-		16
-		8
-		4
-		0
-	3: Slew step size:
-		Valid values for the step size LSBs:
-		1
-		2
-		4
-		16
-		32
-		64
-		128
-		256
-
-Example:
-dac@0 {
-	#address-cells = <1>;
-	#size-cells = <0>;
-	compatible = "adi,ad5755";
-	reg = <0>;
-	spi-max-frequency = <1000000>;
-	spi-cpha;
-	adi,dc-dc-phase = <0>;
-	adi,dc-dc-freq-hz = <410000>;
-	adi,dc-dc-max-microvolt = <23000000>;
-	channel@0 {
-		reg = <0>;
-		adi,mode = <4>;
-		adi,ext-current-sense-resistor;
-		adi,slew = <0 64000 1>;
-	};
-	channel@1 {
-		reg = <1>;
-		adi,mode = <4>;
-		adi,ext-current-sense-resistor;
-		adi,slew = <0 64000 1>;
-	};
-	channel@2 {
-		reg = <2>;
-		adi,mode = <4>;
-		adi,ext-current-sense-resistor;
-		adi,slew = <0 64000 1>;
-	};
-	channel@3 {
-		reg = <3>;
-		adi,mode = <4>;
-		adi,ext-current-sense-resistor;
-		adi,slew = <0 64000 1>;
-	};
-};
diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml
new file mode 100644
index 000000000000..74edff3e8408
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml
@@ -0,0 +1,178 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/adi,ad5755.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD5755 Multi-Channel DAC
+
+maintainers:
+  - Sean Nyekjaer <sean.nyekjaer@prevas.dk>
+
+properties:
+  compatible:
+    enum:
+      - adi,ad5755
+      - adi,ad5755-1
+      - adi,ad5757
+      - adi,ad5735
+      - adi,ad5737
+
+  reg:
+    maxItems: 1
+
+  spi-cpha:
+    description: Either this or spi-cpol but not both.
+  spi-cpol: true
+
+  spi-max-frequency: true
+
+  adi,ext-dc-dc-compenstation-resistor:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      Set if the hardware have an external resistor and thereby bypasses
+      the internal compensation resistor.
+
+  adi,dc-dc-phase:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1, 2, 3]
+    description: |
+      Valid values for DC DC Phase control is:
+      0: All dc-to-dc converters clock on the same edge.
+      1: Channel A and Channel B clock on the same edge,
+         Channel C and Channel D clock on opposite edges.
+      2: Channel A and Channel C clock on the same edge,
+         Channel B and Channel D clock on opposite edges.
+      3: Channel A, Channel B, Channel C, and Channel D
+         clock 90 degrees out of phase from each other.
+
+  adi,dc-dc-freq-hz:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [250000, 410000, 650000]
+
+  adi,dc-dc-max-microvolt:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Maximum allowed Vboost voltage supplied by the dc-to-dc converter.
+    enum: [23000000, 24500000, 27000000, 29500000]
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+  "#io-channel-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+patternProperties:
+  "^(channel@)[0-7]$":
+    type: object
+    description: Child node to describe a channel
+    properties:
+      reg:
+        maxItems: 1
+
+      adi,mode:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 6
+        description: |
+          Valid values for DAC modes is:
+          0: 0 V to 5 V voltage range.
+          1: 0 V to 10 V voltage range.
+          2: Plus minus 5 V voltage range.
+          3: Plus minus 10 V voltage range.
+          4: 4 mA to 20 mA current range.
+          5: 0 mA to 20 mA current range.
+          6: 0 mA to 24 mA current range.
+
+      adi,ext-current-sense-resistor:
+        $ref: /schemas/types.yaml#/definitions/flag
+        description:
+          Set if the hardware has an external current sense resistor
+
+      adi,enable-voltage-overrange:
+        $ref: /schemas/types.yaml#/definitions/flag
+        description: Enable voltage overrange
+
+      adi,slew:
+        $ref: /schemas/types.yaml#/definitions/uint32-array
+        description: |
+          Array of slewrate settings should contain 3 fields:
+          1: Should be either 0 or 1 in order to enable or disable slewrate.
+          2: Slew rate update frequency
+          3: Slew step size
+        items:
+          - enum: [0, 1]
+          - enum: [64000, 32000, 16000, 8000, 4000, 2000, 1000, 500, 250, 125, 64, 32, 16, 8, 4, 0]
+          - enum: [1, 2, 4, 16, 32, 64, 128, 256]
+
+    required:
+      - reg
+
+    additionalProperties: false
+
+allOf:
+  - $ref: '#/definitions/cpolXORcpha'
+
+definitions:
+  cpolXORcpha:
+    not:
+      required: [spi-cpha, spi-cpol]
+    oneOf:
+      - required:
+          - spi-cpha
+      - required:
+          - spi-cpol
+
+examples:
+  - |
+    #include <dt-bindings/iio/adi,ad5592r.h>
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        dac@0 {
+            #address-cells = <1>;
+            #size-cells = <0>;
+            compatible = "adi,ad5755";
+            reg = <0>;
+            spi-max-frequency = <1000000>;
+            spi-cpha;
+            adi,dc-dc-phase = <0>;
+            adi,dc-dc-freq-hz = <410000>;
+            adi,dc-dc-max-microvolt = <23000000>;
+            channel@0 {
+                reg = <0>;
+                adi,mode = <4>;
+                adi,ext-current-sense-resistor;
+                adi,slew = <0 64000 1>;
+            };
+            channel@1 {
+                reg = <1>;
+                adi,mode = <4>;
+                adi,ext-current-sense-resistor;
+                adi,slew = <0 64000 1>;
+            };
+            channel@2 {
+                reg = <2>;
+                adi,mode = <4>;
+                adi,ext-current-sense-resistor;
+                adi,slew = <0 64000 1>;
+            };
+            channel@3 {
+                reg = <3>;
+                adi,mode = <4>;
+                adi,ext-current-sense-resistor;
+                adi,slew = <0 64000 1>;
+            };
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 40/46] dt-bindings:iio:accel:bosch,bma180: txt to yaml format conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (38 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 39/46] dt-bindings:iio:dac:ad5755: " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-22 18:44   ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 41/46] dt-bindings:iio:accel:kionix,kxcjk1013: " Jonathan Cameron
                   ` (6 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Oleksandr Kravchenko

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

One question in here is whether we want to constrain the number of
interrupts.  Some parts definitely only have 1 such pin, and others
2 pins but I can not find information on the bma254.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
---
 .../devicetree/bindings/iio/accel/bma180.txt  | 35 -----------
 .../bindings/iio/accel/bosch,bma180.yaml      | 62 +++++++++++++++++++
 2 files changed, 62 insertions(+), 35 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/accel/bma180.txt b/Documentation/devicetree/bindings/iio/accel/bma180.txt
deleted file mode 100644
index 33da4a6fdb39..000000000000
--- a/Documentation/devicetree/bindings/iio/accel/bma180.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-* Bosch BMA023 / BMA150/ BMA180 / BMA25x / SMB380 triaxial acceleration sensor
-
-https://media.digikey.com/pdf/Data%20Sheets/Bosch/BMA150.pdf
-http://omapworld.com/BMA180_111_1002839.pdf
-http://ae-bst.resource.bosch.com/media/products/dokumente/bma250/bst-bma250-ds002-05.pdf
-
-Required properties:
-
-  - compatible : should be one of:
-    "bosch,bma023"
-    "bosch,bma150"
-    "bosch,bma180"
-    "bosch,bma250"
-    "bosch,bma254"
-    "bosch,smb380"
-  - reg : the I2C address of the sensor
-  - vdd-supply : regulator phandle connected to the VDD pin
-  - vddio-supply : regulator phandle connected to the VDDIO pin
-
-Optional properties:
-
-  - interrupts : interrupt mapping for GPIO IRQ, it should by configured with
-		flags IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING
-		For the bma250 the first interrupt listed must be the one
-		connected to the INT1 pin, the second (optional) interrupt
-		listed must be the one connected to the INT2 pin.
-
-Example:
-
-bma180@40 {
-	compatible = "bosch,bma180";
-	reg = <0x40>;
-	interrupt-parent = <&gpio6>;
-	interrupts = <18 (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING)>;
-};
diff --git a/Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml b/Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml
new file mode 100644
index 000000000000..14e48290ffe3
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml
@@ -0,0 +1,62 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/accel/bosch,bma180.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Bosch BMA023 / BMA150/ BMA180 / BMA25x / SMB380 triaxial accelerometers
+
+maintainers:
+  - Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
+
+description: |
+  https://media.digikey.com/pdf/Data%20Sheets/Bosch/BMA150.pdf
+  http://omapworld.com/BMA180_111_1002839.pdf
+  http://ae-bst.resource.bosch.com/media/products/dokumente/bma250/bst-bma250-ds002-05.pdf
+
+properties:
+  compatible:
+    enum:
+      - bosch,bma023
+      - bosch,bma150
+      - bosch,bma180
+      - bosch,bma250
+      - bosch,bma254
+      - bosch,smb380
+
+  reg:
+    maxItems: 1
+
+  vdd-supply: true
+
+  vddio-supply: true
+
+  interrupts:
+    minItems: 1
+    maxItems: 2
+    description: |
+      Type should be either IRQ_TYPE_LEVEL_HIGH or IRQ_TYPE_EDGE_RISING.
+      For the bma250 the first interrupt listed must be the one
+      connected to the INT1 pin, the second (optional) interrupt
+      listed must be the one connected to the INT2 pin.
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        accel@40 {
+            compatible = "bosch,bma180";
+            reg = <0x40>;
+            interrupt-parent = <&gpio6>;
+            interrupts = <18 (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING)>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 41/46] dt-bindings:iio:accel:kionix,kxcjk1013: txt to yaml format conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (39 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 40/46] dt-bindings:iio:accel:bosch,bma180: " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 42/46] dt-bindings:iio:accel:fsl,mma8452: txt to yaml conversion Jonathan Cameron
                   ` (5 subsequent siblings)
  46 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree
  Cc: Jonathan Cameron, Dmitry Osipenko, Robert Yang

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Very simple binding hence a straight forward conversion.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Dmitry Osipenko <digetx@gmail.com>
Cc: Robert Yang <decatf@gmail.com>
---
 .../bindings/iio/accel/kionix,kxcjk1013.txt   | 24 ----------
 .../bindings/iio/accel/kionix,kxcjk1013.yaml  | 46 +++++++++++++++++++
 2 files changed, 46 insertions(+), 24 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.txt b/Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.txt
deleted file mode 100644
index ce950e162d5d..000000000000
--- a/Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-Kionix KXCJK-1013 Accelerometer device tree bindings
-
-Required properties:
-
-- compatible: Must be one of:
-    "kionix,kxcjk1013"
-    "kionix,kxcj91008"
-    "kionix,kxtj21009"
-    "kionix,kxtf9"
- - reg: i2c slave address
-
-Optional properties:
-
-  - mount-matrix: an optional 3x3 mounting rotation matrix
-
-Example:
-
-kxtf9@f {
-	compatible = "kionix,kxtf9";
-	reg = <0x0F>;
-	mount-matrix =	"0", "1", "0",
-			"1", "0", "0",
-			"0", "0", "1";
-};
diff --git a/Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.yaml b/Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.yaml
new file mode 100644
index 000000000000..5667d09dfe6a
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.yaml
@@ -0,0 +1,46 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/accel/kionix,kxcjk1013.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Kionix KXCJK-1013 Accelerometer
+
+maintainers:
+  - Robert Yang <decatf@gmail.com>
+
+properties:
+  compatible:
+    enum:
+      - kionix,kxcjk1013
+      - kionix,kxcj91008
+      - kionix,kxtj21009
+      - kionix,kxtf9
+
+  reg:
+    maxItems: 1
+
+  mount-matrix:
+    description: an optional 3x3 mounting rotation matrix.
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        accel@f {
+            compatible = "kionix,kxtf9";
+            reg = <0x0F>;
+            mount-matrix = "0", "1", "0",
+                           "1", "0", "0",
+                           "0", "0", "1";
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 42/46] dt-bindings:iio:accel:fsl,mma8452: txt to yaml conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (40 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 41/46] dt-bindings:iio:accel:kionix,kxcjk1013: " Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-03 16:34   ` Rob Herring
  2020-10-31 18:48 ` [PATCH 43/46] dt-bindings:iio:gyro:bosch,bmg180: txt to yaml format conversion Jonathan Cameron
                   ` (4 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Martin Kepplinger

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Simple binding so mostly straight forward to convert.
Original binding was unclear on how many interrupts there are.
The device has two such lines, whilst I believe the driver currently
only uses one at a time.  The binding should allow both to be specified.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Martin Kepplinger <martin.kepplinger@theobroma-systems.com>
---
 .../bindings/iio/accel/fsl,mma8452.yaml       | 62 +++++++++++++++++++
 .../devicetree/bindings/iio/accel/mma8452.txt | 35 -----------
 2 files changed, 62 insertions(+), 35 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/accel/fsl,mma8452.yaml b/Documentation/devicetree/bindings/iio/accel/fsl,mma8452.yaml
new file mode 100644
index 000000000000..3b8e5ebdf90c
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/accel/fsl,mma8452.yaml
@@ -0,0 +1,62 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/accel/fsl,mma8452.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title:
+  Freescale MMA8451Q, MMA8452Q, MMA8453Q, MMA8652FC, MMA8653FC or FXLS8471Q
+  triaxial accelerometer
+
+maintainers:
+  - Martin Kepplinger <martin.kepplinger@theobroma-systems.com>
+
+properties:
+  compatible:
+    enum:
+      - fsl,mma8451
+      - fsl,mma8452
+      - fsl,mma8453
+      - fsl,mma8652
+      - fsl,mma8653
+      - fsl,fxls8471
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    description:
+      2 highly configurable interrupt lines exist.
+    minItems: 1
+    maxItems: 2
+
+  interrupt-names:
+    description: Specify which interrupt line is in use.
+    enum:
+      - INT1
+      - INT2
+
+  vdd-supply: true
+  vddio-supply: true
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        accel@1d {
+            compatible = "fsl,mma8453";
+            reg = <0x1d>;
+            interrupt-parent = <&gpio1>;
+            interrupts = <5 0>;
+            interrupt-names = "INT2";
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/iio/accel/mma8452.txt b/Documentation/devicetree/bindings/iio/accel/mma8452.txt
deleted file mode 100644
index e132394375a1..000000000000
--- a/Documentation/devicetree/bindings/iio/accel/mma8452.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-Freescale MMA8451Q, MMA8452Q, MMA8453Q, MMA8652FC, MMA8653FC or FXLS8471Q
-triaxial accelerometer
-
-Required properties:
-
-  - compatible: should contain one of
-    * "fsl,mma8451"
-    * "fsl,mma8452"
-    * "fsl,mma8453"
-    * "fsl,mma8652"
-    * "fsl,mma8653"
-    * "fsl,fxls8471"
-
-  - reg: the I2C address of the chip
-
-Optional properties:
-
-  - interrupts: interrupt mapping for GPIO IRQ
-
-  - interrupt-names: should contain "INT1" and/or "INT2", the accelerometer's
-		     interrupt line in use.
-
-  - vdd-supply: phandle to the regulator that provides vdd power to the accelerometer.
-
-  - vddio-supply: phandle to the regulator that provides vddio power to the accelerometer.
-
-Example:
-
-	mma8453fc@1d {
-		compatible = "fsl,mma8453";
-		reg = <0x1d>;
-		interrupt-parent = <&gpio1>;
-		interrupts = <5 0>;
-		interrupt-names = "INT2";
-	};
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 43/46] dt-bindings:iio:gyro:bosch,bmg180: txt to yaml format conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (41 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 42/46] dt-bindings:iio:accel:fsl,mma8452: txt to yaml conversion Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 44/46] dt-bindings:iio:st,st-sensors: txt to yaml conversion Jonathan Cameron
                   ` (3 subsequent siblings)
  46 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree
  Cc: Jonathan Cameron, H . Nikolaus Schaller

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Very simple direct conversion of existing txt file.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: H. Nikolaus Schaller <hns@goldelico.com>
---
 .../bindings/iio/gyroscope/bmg160.txt         | 20 --------
 .../bindings/iio/gyroscope/bosch,bmg160.yaml  | 46 +++++++++++++++++++
 2 files changed, 46 insertions(+), 20 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/gyroscope/bmg160.txt b/Documentation/devicetree/bindings/iio/gyroscope/bmg160.txt
deleted file mode 100644
index bb43d1ad9c9f..000000000000
--- a/Documentation/devicetree/bindings/iio/gyroscope/bmg160.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-* Bosch BMG160 triaxial rotation sensor (gyroscope)
-
-Required properties:
-
-  - compatible : should be "bosch,bmg160", "bosch,bmi055_gyro" or "bosch,bmi088_gyro"
-  - reg : the I2C address of the sensor (0x69)
-
-Optional properties:
-
-  - interrupts : interrupt mapping for GPIO IRQ, it should by configured with
-		flags IRQ_TYPE_EDGE_RISING
-
-Example:
-
-bmg160@69 {
-	compatible = "bosch,bmg160";
-	reg = <0x69>;
-	interrupt-parent = <&gpio6>;
-	interrupts = <18 (IRQ_TYPE_EDGE_RISING)>;
-};
diff --git a/Documentation/devicetree/bindings/iio/gyroscope/bosch,bmg160.yaml b/Documentation/devicetree/bindings/iio/gyroscope/bosch,bmg160.yaml
new file mode 100644
index 000000000000..0466483be6bb
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/gyroscope/bosch,bmg160.yaml
@@ -0,0 +1,46 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/gyroscope/bosch,bmg160.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Bosch BMG160 triaxial rotation sensor (gyroscope)
+
+maintainers:
+  - H. Nikolaus Schaller <hns@goldelico.com>
+
+properties:
+  compatible:
+    enum:
+      - bosch,bmg160
+      - bosch,bmi055_gyro
+      - bosch,bmi088_gyro
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    minItems: 1
+    description:
+      Should be configured with type IRQ_TYPE_EDGE_RISING.
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        gyroscope@69 {
+            compatible = "bosch,bmg160";
+            reg = <0x69>;
+            interrupt-parent = <&gpio6>;
+            interrupts = <18 IRQ_TYPE_EDGE_RISING>;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 44/46] dt-bindings:iio:st,st-sensors: txt to yaml conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (42 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 43/46] dt-bindings:iio:gyro:bosch,bmg180: txt to yaml format conversion Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-02 16:16   ` Denis CIOCCA
  2020-10-31 18:48 ` [PATCH 45/46] dt-bindings:iio:frequency:adi,adf4350: txt to yaml format conversion Jonathan Cameron
                   ` (2 subsequent siblings)
  46 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Denis Ciocca

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This binding document covers a very large number of different sensors.
As such the existing documentation is less specific than it could
be (such as which devices have 2 interrupt pin options).
That can be improved later.

Denis, are you happy to be listed as maintainer for this one?
If not feel free to suggestion someone else.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Denis Ciocca <denis.ciocca@st.com>
---
 .../bindings/iio/st,st-sensors.yaml           | 123 ++++++++++++++++++
 .../devicetree/bindings/iio/st-sensors.txt    |  82 ------------
 2 files changed, 123 insertions(+), 82 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
new file mode 100644
index 000000000000..db291a9390b7
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
@@ -0,0 +1,123 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/st,st-sensors.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: STMicroelectronics MEMS sensors
+
+description: |
+  Note that whilst this covers many STMicro MEMs sensors, some more complex
+  IMUs need their own bindings.
+  The STMicroelectronics sensor devices are pretty straight-forward I2C or
+  SPI devices, all sharing the same device tree descriptions no matter what
+  type of sensor it is.
+
+maintainers:
+  - Denis Ciocca <denis.ciocca@st.com>
+
+properties:
+  compatible:
+    description: |
+      Some values are deprecated.
+      st,lis3lv02d (deprecated, use st,lis3lv02dl-accel)
+      st,lis302dl-spi (deprecated, use st,lis3lv02dl-accel)
+    enum:
+        # Accelerometers
+      - st,lis3lv02d
+      - st,lis302dl-spi
+      - st,lis3lv02dl-accel
+      - st,lsm303dlh-accel
+      - st,lsm303dlhc-accel
+      - st,lis3dh-accel
+      - st,lsm330d-accel
+      - st,lsm330dl-accel
+      - st,lsm330dlc-accel
+      - st,lis331dl-accel
+      - st,lis331dlh-accel
+      - st,lsm303dl-accel
+      - st,lsm303dlm-accel
+      - st,lsm330-accel
+      - st,lsm303agr-accel
+      - st,lis2dh12-accel
+      - st,h3lis331dl-accel
+      - st,lng2dm-accel
+      - st,lis3l02dq
+      - st,lis2dw12
+      - st,lis3dhh
+      - st,lis3de
+      - st,lis2de12
+      - st,lis2hh12
+        # Gyroscopes
+      - st,l3g4200d-gyro
+      - st,lsm330d-gyro
+      - st,lsm330dl-gyro
+      - st,lsm330dlc-gyro
+      - st,l3gd20-gyro
+      - st,l3gd20h-gyro
+      - st,l3g4is-gyro
+      - st,lsm330-gyro
+      - st,lsm9ds0-gyro
+        # Magnetometers
+      - st,lsm303agr-magn
+      - st,lsm303dlh-magn
+      - st,lsm303dlhc-magn
+      - st,lsm303dlm-magn
+      - st,lis3mdl-magn
+      - st,lis2mdl
+      - st,lsm9ds1-magn
+        # Pressure sensors
+      - st,lps001wp-press
+      - st,lps25h-press
+      - st,lps331ap-press
+      - st,lps22hb-press
+      - st,lps33hw
+      - st,lps35hw
+      - st,lps22hh
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    minItems: 1
+
+  vdd-supply: true
+  vddio-supply: true
+
+  st,drdy-int-pin:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Some sensors have multiple possible pins via which they can provide
+      a data ready interrupt.  This selects which one.
+    enum:
+      - 1
+      - 2
+
+  drive-open-drain:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: |
+      The interrupt/data ready line will be configured as open drain, which
+      is useful if several sensors share the same interrupt line.
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        accelerometer@1d {
+            compatible = "st,lis3lv02dl-accel";
+            reg = <0x1d>;
+            interrupt-parent = <&gpio2>;
+            interrupts = <18 IRQ_TYPE_EDGE_RISING>;
+            pinctrl-0 = <&lis3lv02dl_nhk_mode>;
+            pinctrl-names = "default";
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/iio/st-sensors.txt b/Documentation/devicetree/bindings/iio/st-sensors.txt
deleted file mode 100644
index 3213599c5071..000000000000
--- a/Documentation/devicetree/bindings/iio/st-sensors.txt
+++ /dev/null
@@ -1,82 +0,0 @@
-STMicroelectronics MEMS sensors
-
-The STMicroelectronics sensor devices are pretty straight-forward I2C or
-SPI devices, all sharing the same device tree descriptions no matter what
-type of sensor it is.
-
-Required properties:
-- compatible: see the list of valid compatible strings below
-- reg: the I2C or SPI address the device will respond to
-
-Optional properties:
-- vdd-supply: an optional regulator that needs to be on to provide VDD
-  power to the sensor.
-- vddio-supply: an optional regulator that needs to be on to provide the
-  VDD IO power to the sensor.
-- st,drdy-int-pin: the pin on the package that will be used to signal
-  "data ready" (valid values: 1 or 2). This property is not configurable
-  on all sensors.
-- drive-open-drain: the interrupt/data ready line will be configured
-  as open drain, which is useful if several sensors share the same
-  interrupt line. (This binding is taken from pinctrl/pinctrl-bindings.txt)
-  This is a boolean property.
-
-Sensors may also have applicable pin control settings, those use the
-standard bindings from pinctrl/pinctrl-bindings.txt.
-
-Valid compatible strings:
-
-Accelerometers:
-- st,lis3lv02d (deprecated, use st,lis3lv02dl-accel)
-- st,lis302dl-spi (deprecated, use st,lis3lv02dl-accel)
-- st,lis3lv02dl-accel
-- st,lsm303dlh-accel
-- st,lsm303dlhc-accel
-- st,lis3dh-accel
-- st,lsm330d-accel
-- st,lsm330dl-accel
-- st,lsm330dlc-accel
-- st,lis331dl-accel
-- st,lis331dlh-accel
-- st,lsm303dl-accel
-- st,lsm303dlm-accel
-- st,lsm330-accel
-- st,lsm303agr-accel
-- st,lis2dh12-accel
-- st,h3lis331dl-accel
-- st,lng2dm-accel
-- st,lis3l02dq
-- st,lis2dw12
-- st,lis3dhh
-- st,lis3de
-- st,lis2de12
-- st,lis2hh12
-
-Gyroscopes:
-- st,l3g4200d-gyro
-- st,lsm330d-gyro
-- st,lsm330dl-gyro
-- st,lsm330dlc-gyro
-- st,l3gd20-gyro
-- st,l3gd20h-gyro
-- st,l3g4is-gyro
-- st,lsm330-gyro
-- st,lsm9ds0-gyro
-
-Magnetometers:
-- st,lsm303agr-magn
-- st,lsm303dlh-magn
-- st,lsm303dlhc-magn
-- st,lsm303dlm-magn
-- st,lis3mdl-magn
-- st,lis2mdl
-- st,lsm9ds1-magn
-
-Pressure sensors:
-- st,lps001wp-press
-- st,lps25h-press
-- st,lps331ap-press
-- st,lps22hb-press
-- st,lps33hw
-- st,lps35hw
-- st,lps22hh
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 45/46] dt-bindings:iio:frequency:adi,adf4350: txt to yaml format conversion.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (43 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 44/46] dt-bindings:iio:st,st-sensors: txt to yaml conversion Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-10-31 18:48 ` [PATCH 46/46] dt-bindings:iio:temperature: Drop generic binding file Jonathan Cameron
  2020-11-03 16:38 ` [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Rob Herring
  46 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Michael Hennerich

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This is a large but fairly simple binding.
It may well be possible to constrain some of the properties more than
currently done, but that would involve diving into datasheets for the
supported parts.  Hence for this initial conversion just use the
information that was in the txt file.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
---
 .../bindings/iio/frequency/adf4350.txt        |  86 --------
 .../bindings/iio/frequency/adi,adf4350.yaml   | 190 ++++++++++++++++++
 2 files changed, 190 insertions(+), 86 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/frequency/adf4350.txt b/Documentation/devicetree/bindings/iio/frequency/adf4350.txt
deleted file mode 100644
index f8c181d81d2d..000000000000
--- a/Documentation/devicetree/bindings/iio/frequency/adf4350.txt
+++ /dev/null
@@ -1,86 +0,0 @@
-Analog Devices ADF4350/ADF4351 device driver
-
-Required properties:
-	- compatible: Should be one of
-		* "adi,adf4350": When using the ADF4350 device
-		* "adi,adf4351": When using the ADF4351 device
-	- reg: SPI chip select numbert for the device
-	- spi-max-frequency: Max SPI frequency to use (< 20000000)
-	- clocks: From common clock binding. Clock is phandle to clock for
-		ADF435x Reference Clock (CLKIN).
-
-Optional properties:
-	- gpios:	 GPIO Lock detect - If set with a valid phandle and GPIO number,
-			pll lock state is tested upon read.
-	- adi,channel-spacing: Channel spacing in Hz (influences MODULUS).
-	- adi,power-up-frequency:	If set in Hz the PLL tunes to
-			the desired frequency on probe.
-	- adi,reference-div-factor: If set the driver skips dynamic calculation
-			and uses this default value instead.
-	- adi,reference-doubler-enable: Enables reference doubler.
-	- adi,reference-div2-enable: Enables reference divider.
-	- adi,phase-detector-polarity-positive-enable: Enables positive phase
-			detector polarity. Default = negative.
-	- adi,lock-detect-precision-6ns-enable: Enables 6ns lock detect precision.
-			Default = 10ns.
-	- adi,lock-detect-function-integer-n-enable: Enables lock detect
-			for integer-N mode. Default = factional-N mode.
-	- adi,charge-pump-current: Charge pump current in mA.
-			Default = 2500mA.
-	- adi,muxout-select: On chip multiplexer output selection.
-			Valid values for the multiplexer output are:
-			0: Three-State Output (default)
-			1: DVDD
-			2: DGND
-			3: R-Counter output
-			4: N-Divider output
-			5: Analog lock detect
-			6: Digital lock detect
-	- adi,low-spur-mode-enable: Enables low spur mode.
-			Default = Low noise mode.
-	- adi,cycle-slip-reduction-enable: Enables cycle slip reduction.
-	- adi,charge-cancellation-enable: Enabled charge pump
-			charge cancellation for integer-N modes.
-	- adi,anti-backlash-3ns-enable: Enables 3ns antibacklash pulse width
-			 for integer-N modes.
-	- adi,band-select-clock-mode-high-enable: Enables faster band
-			selection logic.
-	- adi,12bit-clk-divider: Clock divider value used when
-			adi,12bit-clkdiv-mode != 0
-	- adi,clk-divider-mode:
-			Valid values for the clkdiv mode are:
-			0: Clock divider off (default)
-			1: Fast lock enable
-			2: Phase resync enable
-	- adi,aux-output-enable: Enables auxiliary RF output.
-	- adi,aux-output-fundamental-enable: Selects fundamental VCO output on
-			the auxiliary RF output. Default = Output of RF dividers.
-	- adi,mute-till-lock-enable: Enables Mute-Till-Lock-Detect function.
-	- adi,output-power: Output power selection.
-			Valid values for the power mode are:
-			0: -4dBm (default)
-			1: -1dBm
-			2: +2dBm
-			3: +5dBm
-	- adi,aux-output-power: Auxiliary output power selection.
-			Valid values for the power mode are:
-			0: -4dBm (default)
-			1: -1dBm
-			2: +2dBm
-			3: +5dBm
-
-
-Example:
-		lo_pll0_rx_adf4351: adf4351-rx-lpc@4 {
-			compatible = "adi,adf4351";
-			reg = <4>;
-			spi-max-frequency = <10000000>;
-			clocks = <&clk0_ad9523 9>;
-			clock-names = "clkin";
-			adi,channel-spacing = <10000>;
-			adi,power-up-frequency = <2400000000>;
-			adi,phase-detector-polarity-positive-enable;
-			adi,charge-pump-current = <2500>;
-			adi,output-power = <3>;
-			adi,mute-till-lock-enable;
-		};
diff --git a/Documentation/devicetree/bindings/iio/frequency/adi,adf4350.yaml b/Documentation/devicetree/bindings/iio/frequency/adi,adf4350.yaml
new file mode 100644
index 000000000000..d7f20b8518e0
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/frequency/adi,adf4350.yaml
@@ -0,0 +1,190 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/frequency/adi,adf4350.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices ADF4350/ADF4351 wideband synthesizer
+
+maintainers:
+  - Michael Hennerich <michael.hennerich@analog.com>
+
+properties:
+  compatible:
+    enum:
+      - adi,adf4350
+      - adi,adf4351
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency:
+    maximum: 20000000
+
+  clocks:
+    maxItems: 1
+    description: Clock to provide CLKIN reference clock signal.
+
+  clock-names:
+    const: clkin
+
+  gpios:
+    maxItems: 1
+    description: Lock detect GPIO.
+
+  adi,channel-spacing:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Channel spacing in Hz (influences MODULUS).
+
+  adi,power-up-frequency:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      If set the PLL tunes to this frequency (in Hz) on driver probe.
+
+  adi,reference-div-factor:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      If set the driver skips dynamic calculation and uses this default
+      value instead.
+
+  adi,reference-doubler-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enables reference doubler.
+
+  adi,reference-div2-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enables reference divider.
+
+  adi,phase-detector-polarity-positive-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enables positive phase detector polarity. Default negative.
+
+  adi,lock-detect-precision-6ns-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enables 6ns lock detect precision. Default = 10ns.
+
+  adi,lock-detect-function-integer-n-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      Enables lock detect for integer-N mode. Default = factional-N mode.
+
+  adi,charge-pump-current:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Charge pump current in mA. Default = 2500mA.
+
+  adi,muxout-select:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 0
+    maximum: 6
+    description: |
+      On chip multiplexer output selection.
+      Valid values for the multiplexer output are:
+      0: Three-State Output (default)
+      1: DVDD
+      2: DGND
+      3: R-Counter output
+      4: N-Divider output
+      5: Analog lock detect
+      6: Digital lock detect
+
+  adi,low-spur-mode-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enables low spur mode. Default = Low noise mode.
+
+  adi,cycle-slip-reduction-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enables cycle slip reduction.
+
+  adi,charge-cancellation-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      Enabled charge pump charge cancellation for integer-N modes.
+
+  adi,anti-backlash-3ns-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      Enables 3ns antibacklash pulse width for integer-N modes.
+
+  adi,band-select-clock-mode-high-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enables faster band selection logic.
+
+  adi,12bit-clk-divider:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Clock divider value used when adi,12bit-clkdiv-mode != 0
+
+  adi,clk-divider-mode:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1, 2]
+    description: |
+      Valid values for the clkdiv mode are:
+      0: Clock divider off (default)
+      1: Fast lock enable
+      2: Phase resync enable
+
+  adi,aux-output-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enables auxiliary RF output.
+
+  adi,aux-output-fundamental-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: |
+      Selects fundamental VCO output on the auxiliary RF output.
+      Default = Output of RF dividers.
+
+  adi,mute-till-lock-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enables Mute-Till-Lock-Detect function.
+
+  adi,output-power:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1, 2, 3]
+    description: |
+      Output power selection.
+      Valid values for the power mode are:
+      0: -4dBm (default)
+      1: -1dBm
+      2: +2dBm
+      3: +5dBm
+
+  adi,aux-output-power:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1, 2, 3]
+    description: |
+      Auxiliary output power selection.
+      Valid values for the power mode are:
+      0: -4dBm (default)
+      1: -1dBm
+      2: +2dBm
+      3: +5dBm
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - clocks
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        pll@4 {
+            compatible = "adi,adf4351";
+            reg = <4>;
+            spi-max-frequency = <10000000>;
+            clocks = <&clk0_ad9523 9>;
+            clock-names = "clkin";
+            adi,channel-spacing = <10000>;
+            adi,power-up-frequency = <2400000000>;
+            adi,phase-detector-polarity-positive-enable;
+            adi,charge-pump-current = <2500>;
+            adi,output-power = <3>;
+            adi,mute-till-lock-enable;
+        };
+    };
+...
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 46/46] dt-bindings:iio:temperature: Drop generic binding file.
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (44 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 45/46] dt-bindings:iio:frequency:adi,adf4350: txt to yaml format conversion Jonathan Cameron
@ 2020-10-31 18:48 ` Jonathan Cameron
  2020-11-03 16:38 ` [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Rob Herring
  46 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-10-31 18:48 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Patrick Havelange

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

So far, the thermocouple-type property described in here is only
used in a single driver.  Whilst I would like it to be more generally
used that hasn't happened yet and I don't see a reason to maintain
this small file in the hope that it happens.

I pushed for this generic binding in the first place.  Hopefully
we can bring it back at somepoint.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Patrick Havelange <patrick.havelange@essensium.com>
---
 .../bindings/iio/temperature/temperature-bindings.txt      | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/temperature/temperature-bindings.txt b/Documentation/devicetree/bindings/iio/temperature/temperature-bindings.txt
deleted file mode 100644
index 8f339cab74ae..000000000000
--- a/Documentation/devicetree/bindings/iio/temperature/temperature-bindings.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-If the temperature sensor device can be configured to use some specific
-thermocouple type, you can use the defined types provided in the file
-"include/dt-bindings/iio/temperature/thermocouple.h".
-
-Property:
-thermocouple-type:	A single cell representing the type of the thermocouple
-			used by the device.
-- 
2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 14/46] dt-bindings:iio:light:avago,apds9960: txt to yaml conversion
  2020-10-31 18:48 ` [PATCH 14/46] dt-bindings:iio:light:avago,apds9960: " Jonathan Cameron
@ 2020-10-31 21:33   ` Matt Ranostay
  2020-10-31 21:35     ` Matt Ranostay
  0 siblings, 1 reply; 104+ messages in thread
From: Matt Ranostay @ 2020-10-31 21:33 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, Rob Herring, devicetree,
	Jonathan Cameron, Matt Ranostay

On Sat, Oct 31, 2020 at 11:51 AM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> Very simple binding that we could move into trivial-devices.yaml
> with a small loss of documentation.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Matt Ranostay <mranostay@gmail.com>

Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>

> ---
>  .../bindings/iio/light/apds9960.txt           | 21 ---------
>  .../bindings/iio/light/avago,apds9960.yaml    | 44 +++++++++++++++++++
>  2 files changed, 44 insertions(+), 21 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/iio/light/apds9960.txt b/Documentation/devicetree/bindings/iio/light/apds9960.txt
> deleted file mode 100644
> index c53ddb81c4aa..000000000000
> --- a/Documentation/devicetree/bindings/iio/light/apds9960.txt
> +++ /dev/null
> @@ -1,21 +0,0 @@
> -* Avago APDS9960 gesture/RGB/ALS/proximity sensor
> -
> -https://www.avagotech.com/docs/AV02-4191EN
> -
> -Required properties:
> -
> -  - compatible: must be "avago,apds9960"
> -  - reg: the I2c address of the sensor
> -  - interrupts : the sole interrupt generated by the device
> -
> -  Refer to interrupt-controller/interrupts.txt for generic interrupt client
> -  node bindings.
> -
> -Example:
> -
> -apds9960@39 {
> -       compatible = "avago,apds9960";
> -       reg = <0x39>;
> -       interrupt-parent = <&gpio1>;
> -       interrupts = <16 1>;
> -};
> diff --git a/Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml b/Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml
> new file mode 100644
> index 000000000000..eae8c7327c0f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml
> @@ -0,0 +1,44 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/light/avago,apds9960.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Avago APDS9960 gesture/RGB/ALS/proximity sensor
> +
> +maintainers:
> +  - Matt Ranostay <mranostay@gmail.com>
> +
> +description: |
> +  Datasheet at https://www.avagotech.com/docs/AV02-4191EN
> +
> +properties:
> +  compatible:
> +    const: avago,apds9960
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +
> +examples:
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        light-sensor@39 {
> +            compatible = "avago,apds9960";
> +            reg = <0x39>;
> +            interrupt-parent = <&gpio1>;
> +            interrupts = <16 1>;
> +        };
> +    };
> +...
> --
> 2.28.0
>

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 14/46] dt-bindings:iio:light:avago,apds9960: txt to yaml conversion
  2020-10-31 21:33   ` Matt Ranostay
@ 2020-10-31 21:35     ` Matt Ranostay
  2020-11-01 14:57       ` Jonathan Cameron
  0 siblings, 1 reply; 104+ messages in thread
From: Matt Ranostay @ 2020-10-31 21:35 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, Rob Herring, devicetree,
	Jonathan Cameron, Matt Ranostay

On Sat, Oct 31, 2020 at 2:33 PM Matt Ranostay
<matt.ranostay@konsulko.com> wrote:
>
> On Sat, Oct 31, 2020 at 11:51 AM Jonathan Cameron <jic23@kernel.org> wrote:
> >
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > Very simple binding that we could move into trivial-devices.yaml
> > with a small loss of documentation.
> >
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Cc: Matt Ranostay <mranostay@gmail.com>
>
> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>

Actually still Acked-by but could you change my email below to my Konsulko one?

Thanks,

Matt

> > ---
> >  .../bindings/iio/light/apds9960.txt           | 21 ---------
> >  .../bindings/iio/light/avago,apds9960.yaml    | 44 +++++++++++++++++++
> >  2 files changed, 44 insertions(+), 21 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/iio/light/apds9960.txt b/Documentation/devicetree/bindings/iio/light/apds9960.txt
> > deleted file mode 100644
> > index c53ddb81c4aa..000000000000
> > --- a/Documentation/devicetree/bindings/iio/light/apds9960.txt
> > +++ /dev/null
> > @@ -1,21 +0,0 @@
> > -* Avago APDS9960 gesture/RGB/ALS/proximity sensor
> > -
> > -https://www.avagotech.com/docs/AV02-4191EN
> > -
> > -Required properties:
> > -
> > -  - compatible: must be "avago,apds9960"
> > -  - reg: the I2c address of the sensor
> > -  - interrupts : the sole interrupt generated by the device
> > -
> > -  Refer to interrupt-controller/interrupts.txt for generic interrupt client
> > -  node bindings.
> > -
> > -Example:
> > -
> > -apds9960@39 {
> > -       compatible = "avago,apds9960";
> > -       reg = <0x39>;
> > -       interrupt-parent = <&gpio1>;
> > -       interrupts = <16 1>;
> > -};
> > diff --git a/Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml b/Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml
> > new file mode 100644
> > index 000000000000..eae8c7327c0f
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml
> > @@ -0,0 +1,44 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/iio/light/avago,apds9960.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Avago APDS9960 gesture/RGB/ALS/proximity sensor
> > +
> > +maintainers:
> > +  - Matt Ranostay <mranostay@gmail.com>
> > +
> > +description: |
> > +  Datasheet at https://www.avagotech.com/docs/AV02-4191EN
> > +
> > +properties:
> > +  compatible:
> > +    const: avago,apds9960
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +
> > +additionalProperties: false
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +
> > +examples:
> > +  - |
> > +    i2c {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        light-sensor@39 {
> > +            compatible = "avago,apds9960";
> > +            reg = <0x39>;
> > +            interrupt-parent = <&gpio1>;
> > +            interrupts = <16 1>;
> > +        };
> > +    };
> > +...
> > --
> > 2.28.0
> >

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 10/46] dt-bindings:iio:health:maxim,max30102: txt to yaml conversion
  2020-10-31 18:48 ` [PATCH 10/46] dt-bindings:iio:health:maxim,max30102: " Jonathan Cameron
@ 2020-10-31 21:38   ` Matt Ranostay
  2020-11-22 17:29     ` Jonathan Cameron
  0 siblings, 1 reply; 104+ messages in thread
From: Matt Ranostay @ 2020-10-31 21:38 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, Rob Herring, devicetree,
	Jonathan Cameron, Matt Ranostay

On Sat, Oct 31, 2020 at 11:51 AM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> Straight forward binding.  Title was a bit of a challenge to keep short
> as this binding covers sensors for two entirely different purposes.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Matt Ranostay <mranostay@gmail.com>
> ---
>  .../bindings/iio/health/max30102.txt          | 33 --------
>  .../bindings/iio/health/maxim,max30102.yaml   | 75 +++++++++++++++++++
>  2 files changed, 75 insertions(+), 33 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/iio/health/max30102.txt b/Documentation/devicetree/bindings/iio/health/max30102.txt
> deleted file mode 100644
> index 7ef7ae40ae4f..000000000000
> --- a/Documentation/devicetree/bindings/iio/health/max30102.txt
> +++ /dev/null
> @@ -1,33 +0,0 @@
> -Maxim MAX30102 heart rate and pulse oximeter sensor
> -Maxim MAX30105 optical particle-sensing module
> -
> -* https://datasheets.maximintegrated.com/en/ds/MAX30102.pdf
> -* https://datasheets.maximintegrated.com/en/ds/MAX30105.pdf
> -
> -Required properties:
> -  - compatible: must be "maxim,max30102" or "maxim,max30105"
> -  - reg: the I2C address of the sensor
> -  - interrupts: the sole interrupt generated by the device
> -
> -  Refer to interrupt-controller/interrupts.txt for generic
> -  interrupt client node bindings.
> -
> -Optional properties:
> -  - maxim,red-led-current-microamp: configuration for red LED current
> -  - maxim,ir-led-current-microamp: configuration for IR LED current
> -  - maxim,green-led-current-microamp: configuration for green LED current
> -    (max30105 only)
> -
> -    Note that each step is approximately 200 microamps, ranging from 0 uA to
> -    50800 uA.
> -
> -Example:
> -
> -max30102@57 {
> -       compatible = "maxim,max30102";
> -       reg = <0x57>;
> -       maxim,red-led-current-microamp = <7000>;
> -       maxim,ir-led-current-microamp = <7000>;
> -       interrupt-parent = <&gpio1>;
> -       interrupts = <16 2>;
> -};
> diff --git a/Documentation/devicetree/bindings/iio/health/maxim,max30102.yaml b/Documentation/devicetree/bindings/iio/health/maxim,max30102.yaml
> new file mode 100644
> index 000000000000..67d40f4a91a7
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/health/maxim,max30102.yaml
> @@ -0,0 +1,75 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/health/maxim,max30102.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Maxim MAX30102 heart rate and pulse oximeter and MAX30105 particle-sensor
> +
> +maintainers:
> +  - Matt Ranostay <mranostay@gmail.com>

Change to my Konsulko email please, otherwise LGTM

Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>

> +
> +properties:
> +  compatible:
> +    enum:
> +      - maxim,max30102
> +      - maxim,max30105
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +    description: Connected to ADC_RDY pin.
> +
> +  maxim,red-led-current-microamp:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: RED LED current. Each step is approximately 200 microamps.
> +    minimum: 0
> +    maximum: 50800
> +
> +  maxim,ir-led-current-microamp:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: IR LED current. Each step is approximately 200 microamps.
> +    minimum: 0
> +    maximum: 50800
> +
> +  maxim,green-led-current-microamp:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: Green LED current. Each step is approximately 200 microamps.
> +    minimum: 0
> +    maximum: 50800
> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: maxim,max30100
> +    then:
> +      properties:
> +        maxim,green-led-current-microamp: false
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +
> +examples:
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        heart-rate@57 {
> +            compatible = "maxim,max30102";
> +            reg = <0x57>;
> +            maxim,red-led-current-microamp = <7000>;
> +            maxim,ir-led-current-microamp = <7000>;
> +            interrupt-parent = <&gpio1>;
> +            interrupts = <16 2>;
> +        };
> +    };
> +...
> --
> 2.28.0
>

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 09/46] dt-bindings:iio:health:maxim,max30100: txt to yaml conversion
  2020-10-31 18:48 ` [PATCH 09/46] dt-bindings:iio:health:maxim,max30100: " Jonathan Cameron
@ 2020-10-31 21:41   ` Matt Ranostay
  2020-11-22 16:58     ` Jonathan Cameron
  0 siblings, 1 reply; 104+ messages in thread
From: Matt Ranostay @ 2020-10-31 21:41 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, Rob Herring, devicetree,
	Jonathan Cameron

On Sat, Oct 31, 2020 at 11:51 AM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> Straight forward conversion. As with other bindings I've dropped
> any standrd description, but kept the unusual bits, in thisscase
> the maxim,led-current-microamp and it's description.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
>  .../bindings/iio/health/max30100.txt          | 28 ----------
>  .../bindings/iio/health/maxim,max30100.yaml   | 52 +++++++++++++++++++
>  2 files changed, 52 insertions(+), 28 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/iio/health/max30100.txt b/Documentation/devicetree/bindings/iio/health/max30100.txt
> deleted file mode 100644
> index 0054908a6e74..000000000000
> --- a/Documentation/devicetree/bindings/iio/health/max30100.txt
> +++ /dev/null
> @@ -1,28 +0,0 @@
> -Maxim MAX30100 heart rate and pulse oximeter sensor
> -
> -* https://datasheets.maximintegrated.com/en/ds/MAX30100.pdf
> -
> -Required properties:
> -  - compatible: must be "maxim,max30100"
> -  - reg: the I2C address of the sensor
> -  - interrupts: the sole interrupt generated by the device
> -
> -  Refer to interrupt-controller/interrupts.txt for generic
> -  interrupt client node bindings.
> -
> -Optional properties:
> -  - maxim,led-current-microamp: configuration for LED current in microamperes
> -    while the engine is running. First indexed value is the configuration for
> -    the RED LED, and second value is for the IR LED.
> -
> -    Refer to the datasheet for the allowed current values.
> -
> -Example:
> -
> -max30100@57 {
> -       compatible = "maxim,max30100";
> -       reg = <0x57>;
> -       maxim,led-current-microamp = <24000 50000>;
> -       interrupt-parent = <&gpio1>;
> -       interrupts = <16 2>;
> -};
> diff --git a/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml b/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml
> new file mode 100644
> index 000000000000..5684f2f61bcc
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml
> @@ -0,0 +1,52 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/health/maxim,max30100.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Maxim MAX30100 heart rate and pulse oximeter sensor
> +
> +maintainers:
> +  - Matt Ranostay <mranostay@gmail.com>

Please change to my Konsulko email, but otherwise LGTM

Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>

> +
> +properties:
> +  compatible:
> +    const: maxim,max30100
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +    description: Connected to ADC_RDY pin.
> +
> +  maxim,led-current-microamp:
> +    $ref: /schemas/types.yaml#/definitions/uint32-array
> +    minItems: 2
> +    maxItems: 2
> +    description: |
> +      LED current whilst the engine is running. First indexed value is
> +      the configuration for the RED LED, and second value is for the IR LED.
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +
> +examples:
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        heart-rate@57 {
> +            compatible = "maxim,max30100";
> +            reg = <0x57>;
> +            maxim,led-current-microamp = <24000 50000>;
> +            interrupt-parent = <&gpio1>;
> +            interrupts = <16 2>;
> +        };
> +    };
> +...
> --
> 2.28.0
>

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 14/46] dt-bindings:iio:light:avago,apds9960: txt to yaml conversion
  2020-10-31 21:35     ` Matt Ranostay
@ 2020-11-01 14:57       ` Jonathan Cameron
  0 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-01 14:57 UTC (permalink / raw)
  To: Matt Ranostay
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, Rob Herring, devicetree,
	Jonathan Cameron, Matt Ranostay

On Sat, 31 Oct 2020 14:35:56 -0700
Matt Ranostay <matt.ranostay@konsulko.com> wrote:

> On Sat, Oct 31, 2020 at 2:33 PM Matt Ranostay
> <matt.ranostay@konsulko.com> wrote:
> >
> > On Sat, Oct 31, 2020 at 11:51 AM Jonathan Cameron <jic23@kernel.org> wrote:  
> > >
> > > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > >
> > > Very simple binding that we could move into trivial-devices.yaml
> > > with a small loss of documentation.
> > >
> > > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > > Cc: Matt Ranostay <mranostay@gmail.com>  
> >
> > Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>  
> 
> Actually still Acked-by but could you change my email below to my Konsulko one?
Will do.

> 
> Thanks,
> 
> Matt
> 
> > > ---
> > >  .../bindings/iio/light/apds9960.txt           | 21 ---------
> > >  .../bindings/iio/light/avago,apds9960.yaml    | 44 +++++++++++++++++++
> > >  2 files changed, 44 insertions(+), 21 deletions(-)
> > >
> > > diff --git a/Documentation/devicetree/bindings/iio/light/apds9960.txt b/Documentation/devicetree/bindings/iio/light/apds9960.txt
> > > deleted file mode 100644
> > > index c53ddb81c4aa..000000000000
> > > --- a/Documentation/devicetree/bindings/iio/light/apds9960.txt
> > > +++ /dev/null
> > > @@ -1,21 +0,0 @@
> > > -* Avago APDS9960 gesture/RGB/ALS/proximity sensor
> > > -
> > > -https://www.avagotech.com/docs/AV02-4191EN
> > > -
> > > -Required properties:
> > > -
> > > -  - compatible: must be "avago,apds9960"
> > > -  - reg: the I2c address of the sensor
> > > -  - interrupts : the sole interrupt generated by the device
> > > -
> > > -  Refer to interrupt-controller/interrupts.txt for generic interrupt client
> > > -  node bindings.
> > > -
> > > -Example:
> > > -
> > > -apds9960@39 {
> > > -       compatible = "avago,apds9960";
> > > -       reg = <0x39>;
> > > -       interrupt-parent = <&gpio1>;
> > > -       interrupts = <16 1>;
> > > -};
> > > diff --git a/Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml b/Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml
> > > new file mode 100644
> > > index 000000000000..eae8c7327c0f
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml
> > > @@ -0,0 +1,44 @@
> > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/iio/light/avago,apds9960.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: Avago APDS9960 gesture/RGB/ALS/proximity sensor
> > > +
> > > +maintainers:
> > > +  - Matt Ranostay <mranostay@gmail.com>
> > > +
> > > +description: |
> > > +  Datasheet at https://www.avagotech.com/docs/AV02-4191EN
> > > +
> > > +properties:
> > > +  compatible:
> > > +    const: avago,apds9960
> > > +
> > > +  reg:
> > > +    maxItems: 1
> > > +
> > > +  interrupts:
> > > +    maxItems: 1
> > > +
> > > +additionalProperties: false
> > > +
> > > +required:
> > > +  - compatible
> > > +  - reg
> > > +
> > > +examples:
> > > +  - |
> > > +    i2c {
> > > +        #address-cells = <1>;
> > > +        #size-cells = <0>;
> > > +
> > > +        light-sensor@39 {
> > > +            compatible = "avago,apds9960";
> > > +            reg = <0x39>;
> > > +            interrupt-parent = <&gpio1>;
> > > +            interrupts = <16 1>;
> > > +        };
> > > +    };
> > > +...
> > > --
> > > 2.28.0
> > >  


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 22/46] dt-bindings:iio:light:st,vl6180: txt to yaml format conversion.
  2020-10-31 18:48 ` [PATCH 22/46] dt-bindings:iio:light:st,vl6180: txt to yaml format conversion Jonathan Cameron
@ 2020-11-01 15:26   ` Manivannan Sadhasivam
  0 siblings, 0 replies; 104+ messages in thread
From: Manivannan Sadhasivam @ 2020-11-01 15:26 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio, Rob Herring, devicetree, Jonathan Cameron,
	Peter Meerwald-Stadler

On Sat, Oct 31, 2020 at 06:48:30PM +0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> I'm not sure anyone would use this part primarily as an ALS,
> given the time of flight laser also present, but I'll stick with the
> original decision on where to put the binding.
> 
> Added interrupts property as the device has a GPIO interrupt even
> if the driver is not currently using it.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Acked-by: Manivannan Sadhasivam <manivannanece23@gmail.com>

Thanks,
Mani

> Cc: Manivannan Sadhasivam <manivannanece23@gmail.com>
> Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
> ---
>  .../bindings/iio/light/st,vl6180.yaml         | 45 +++++++++++++++++++
>  .../devicetree/bindings/iio/light/vl6180.txt  | 15 -------
>  2 files changed, 45 insertions(+), 15 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/light/st,vl6180.yaml b/Documentation/devicetree/bindings/iio/light/st,vl6180.yaml
> new file mode 100644
> index 000000000000..27c36ab7990d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/light/st,vl6180.yaml
> @@ -0,0 +1,45 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/light/st,vl6180.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: STMicro VL6180 ALS, range and proximity sensor
> +
> +maintainers:
> +  - Manivannan Sadhasivam <manivannanece23@gmail.com>
> +  - Peter Meerwald-Stadler <pmeerw@pmeerw.net>
> +
> +description: |
> +  Proximity sensing module incorporating time of flight sensor
> +  Datasheet at https://www.st.com/resource/en/datasheet/vl6180x.pdf
> +
> +properties:
> +  compatible:
> +    const: st,vl6180
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        proximity@29 {
> +            compatible = "st,vl6180";
> +            reg = <0x29>;
> +        };
> +    };
> +...
> diff --git a/Documentation/devicetree/bindings/iio/light/vl6180.txt b/Documentation/devicetree/bindings/iio/light/vl6180.txt
> deleted file mode 100644
> index fb9137d85df9..000000000000
> --- a/Documentation/devicetree/bindings/iio/light/vl6180.txt
> +++ /dev/null
> @@ -1,15 +0,0 @@
> -STMicro VL6180 -  ALS, range and proximity sensor
> -
> -Link to datasheet: https://www.st.com/resource/en/datasheet/vl6180x.pdf
> -
> -Required properties:
> -
> -	-compatible: should be "st,vl6180"
> -	-reg: the I2C address of the sensor
> -
> -Example:
> -
> -vl6180@29 {
> -	compatible = "st,vl6180";
> -	reg = <0x29>;
> -};
> -- 
> 2.28.0
> 

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion
  2020-10-31 18:48 ` [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion Jonathan Cameron
@ 2020-11-02  4:48   ` Phil Reid
  2020-11-03 16:10   ` Rob Herring
  1 sibling, 0 replies; 104+ messages in thread
From: Phil Reid @ 2020-11-02  4:48 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron

On 1/11/2020 02:48, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Simple direct conversion from txt to yaml as part of a general aim of
> converting all IIO bindings to this machine readable format.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Phil Reid <preid@electromag.com.au>
Reviewed-by: Phil Reid <preid@electromag.com.au>

> ---
>   .../bindings/iio/potentiometer/ad5272.txt     | 27 ----------
>   .../iio/potentiometer/adi,ad5272.yaml         | 50 +++++++++++++++++++
>   2 files changed, 50 insertions(+), 27 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt b/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
> deleted file mode 100644
> index f9b2eef946aa..000000000000
> --- a/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
> +++ /dev/null
> @@ -1,27 +0,0 @@
> -* Analog Devices AD5272 digital potentiometer
> -
> -The node for this device must be a child node of a I2C controller, hence
> -all mandatory properties for your controller must be specified. See directory:
> -
> -        Documentation/devicetree/bindings/i2c
> -
> -for more details.
> -
> -Required properties:
> -	- compatible:  	Must be one of the following, depending on the model:
> -			adi,ad5272-020
> -			adi,ad5272-050
> -			adi,ad5272-100
> -			adi,ad5274-020
> -			adi,ad5274-100
> -
> -Optional properties:
> - - reset-gpios: GPIO specification for the RESET input. This is an
> -		active low signal to the AD5272.
> -
> -Example:
> -ad5272: potentiometer@2f {
> -	reg = <0x2F>;
> -	compatible = "adi,ad5272-020";
> -	reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
> -};
> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml b/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
> new file mode 100644
> index 000000000000..b9b7d383bff1
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
> @@ -0,0 +1,50 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/potentiometer/adi,ad5272.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices AD5272 digital potentiometer
> +
> +maintainers:
> +  - Phil Reid <preid@electromag.com.au>
> +
> +description: |
> +  Datasheet: https://www.analog.com/en/products/ad5272.html
> +
> +properties:
> +  compatible:
> +    enum:
> +      - adi,ad5272-020
> +      - adi,ad5272-050
> +      - adi,ad5272-100
> +      - adi,ad5274-020
> +      - adi,ad5274-100
> +
> +  reg:
> +    maxItems: 1
> +
> +  reset-gpios:
> +    description:
> +      Active low signal to the AD5272 RESET input.
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        potentiometer@2f {
> +            compatible = "adi,ad5272-020";
> +            reg = <0x2F>;
> +            reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
> +        };
> +    };
> +...
> 


-- 
Regards
Phil Reid

ElectroMagnetic Imaging Technology Pty Ltd
Development of Geophysical Instrumentation & Software
www.electromag.com.au

23 Junction Parade, Midland WA 6056, AUSTRALIA
Ph: +61 8 9250 8100
Fax: +61 8 9250 7100
Email: preid@electromag.com.au

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 37/46] dt-binding:iio:adc:ti,ads124s08: txt to yaml format conversion.
  2020-10-31 18:48 ` [PATCH 37/46] dt-binding:iio:adc:ti,ads124s08: " Jonathan Cameron
@ 2020-11-02 12:49   ` Dan Murphy
  2020-11-08 16:59     ` Jonathan Cameron
  0 siblings, 1 reply; 104+ messages in thread
From: Dan Murphy @ 2020-11-02 12:49 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron

Jonathan

On 10/31/20 1:48 PM, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> Simple binding so straight forward format conversion.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Dan Murphy <dmurphy@ti.com>
> ---
>   .../bindings/iio/adc/ti,ads124s08.yaml        | 52 +++++++++++++++++++
>   .../bindings/iio/adc/ti-ads124s08.txt         | 25 ---------
>   2 files changed, 52 insertions(+), 25 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/iio/adc/ti,ads124s08.yaml b/Documentation/devicetree/bindings/iio/adc/ti,ads124s08.yaml
> new file mode 100644
> index 000000000000..5912a52953fa
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/ti,ads124s08.yaml
> @@ -0,0 +1,52 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
GPL-2.0-only  OR BSD-2-Clause

Otherwise

Reviewed-by: Dan Murphy <dmurphy@ti.com>


^ permalink raw reply	[flat|nested] 104+ messages in thread

* RE: [PATCH 44/46] dt-bindings:iio:st,st-sensors: txt to yaml conversion.
  2020-10-31 18:48 ` [PATCH 44/46] dt-bindings:iio:st,st-sensors: txt to yaml conversion Jonathan Cameron
@ 2020-11-02 16:16   ` Denis CIOCCA
  0 siblings, 0 replies; 104+ messages in thread
From: Denis CIOCCA @ 2020-11-02 16:16 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron

Hello Jonathan,

Yes it is good to me. Thanks for doing this, much appreciated.

Acked-by: Denis Ciocca <denis.ciocca@st.com>

Thanks,
Denis

> -----Original Message-----
> From: Jonathan Cameron <jic23@kernel.org>
> Sent: Saturday, October 31, 2020 11:49 AM
> To: linux-iio@vger.kernel.org; Rob Herring <robh+dt@kernel.org>;
> devicetree@vger.kernel.org
> Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>; Denis CIOCCA
> <denis.ciocca@st.com>
> Subject: [PATCH 44/46] dt-bindings:iio:st,st-sensors: txt to yaml conversion.
> 
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> This binding document covers a very large number of different sensors.
> As such the existing documentation is less specific than it could be (such as
> which devices have 2 interrupt pin options).
> That can be improved later.
> 
> Denis, are you happy to be listed as maintainer for this one?
> If not feel free to suggestion someone else.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Denis Ciocca <denis.ciocca@st.com>
> ---
>  .../bindings/iio/st,st-sensors.yaml           | 123 ++++++++++++++++++
>  .../devicetree/bindings/iio/st-sensors.txt    |  82 ------------
>  2 files changed, 123 insertions(+), 82 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
> b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
> new file mode 100644
> index 000000000000..db291a9390b7
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
> @@ -0,0 +1,123 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/st,st-sensors.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: STMicroelectronics MEMS sensors
> +
> +description: |
> +  Note that whilst this covers many STMicro MEMs sensors, some more
> +complex
> +  IMUs need their own bindings.
> +  The STMicroelectronics sensor devices are pretty straight-forward I2C
> +or
> +  SPI devices, all sharing the same device tree descriptions no matter
> +what
> +  type of sensor it is.
> +
> +maintainers:
> +  - Denis Ciocca <denis.ciocca@st.com>
> +
> +properties:
> +  compatible:
> +    description: |
> +      Some values are deprecated.
> +      st,lis3lv02d (deprecated, use st,lis3lv02dl-accel)
> +      st,lis302dl-spi (deprecated, use st,lis3lv02dl-accel)
> +    enum:
> +        # Accelerometers
> +      - st,lis3lv02d
> +      - st,lis302dl-spi
> +      - st,lis3lv02dl-accel
> +      - st,lsm303dlh-accel
> +      - st,lsm303dlhc-accel
> +      - st,lis3dh-accel
> +      - st,lsm330d-accel
> +      - st,lsm330dl-accel
> +      - st,lsm330dlc-accel
> +      - st,lis331dl-accel
> +      - st,lis331dlh-accel
> +      - st,lsm303dl-accel
> +      - st,lsm303dlm-accel
> +      - st,lsm330-accel
> +      - st,lsm303agr-accel
> +      - st,lis2dh12-accel
> +      - st,h3lis331dl-accel
> +      - st,lng2dm-accel
> +      - st,lis3l02dq
> +      - st,lis2dw12
> +      - st,lis3dhh
> +      - st,lis3de
> +      - st,lis2de12
> +      - st,lis2hh12
> +        # Gyroscopes
> +      - st,l3g4200d-gyro
> +      - st,lsm330d-gyro
> +      - st,lsm330dl-gyro
> +      - st,lsm330dlc-gyro
> +      - st,l3gd20-gyro
> +      - st,l3gd20h-gyro
> +      - st,l3g4is-gyro
> +      - st,lsm330-gyro
> +      - st,lsm9ds0-gyro
> +        # Magnetometers
> +      - st,lsm303agr-magn
> +      - st,lsm303dlh-magn
> +      - st,lsm303dlhc-magn
> +      - st,lsm303dlm-magn
> +      - st,lis3mdl-magn
> +      - st,lis2mdl
> +      - st,lsm9ds1-magn
> +        # Pressure sensors
> +      - st,lps001wp-press
> +      - st,lps25h-press
> +      - st,lps331ap-press
> +      - st,lps22hb-press
> +      - st,lps33hw
> +      - st,lps35hw
> +      - st,lps22hh
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    minItems: 1
> +
> +  vdd-supply: true
> +  vddio-supply: true
> +
> +  st,drdy-int-pin:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      Some sensors have multiple possible pins via which they can provide
> +      a data ready interrupt.  This selects which one.
> +    enum:
> +      - 1
> +      - 2
> +
> +  drive-open-drain:
> +    $ref: /schemas/types.yaml#/definitions/flag
> +    description: |
> +      The interrupt/data ready line will be configured as open drain, which
> +      is useful if several sensors share the same interrupt line.
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        accelerometer@1d {
> +            compatible = "st,lis3lv02dl-accel";
> +            reg = <0x1d>;
> +            interrupt-parent = <&gpio2>;
> +            interrupts = <18 IRQ_TYPE_EDGE_RISING>;
> +            pinctrl-0 = <&lis3lv02dl_nhk_mode>;
> +            pinctrl-names = "default";
> +        };
> +    };
> +...
> diff --git a/Documentation/devicetree/bindings/iio/st-sensors.txt
> b/Documentation/devicetree/bindings/iio/st-sensors.txt
> deleted file mode 100644
> index 3213599c5071..000000000000
> --- a/Documentation/devicetree/bindings/iio/st-sensors.txt
> +++ /dev/null
> @@ -1,82 +0,0 @@
> -STMicroelectronics MEMS sensors
> -
> -The STMicroelectronics sensor devices are pretty straight-forward I2C or -
> SPI devices, all sharing the same device tree descriptions no matter what -
> type of sensor it is.
> -
> -Required properties:
> -- compatible: see the list of valid compatible strings below
> -- reg: the I2C or SPI address the device will respond to
> -
> -Optional properties:
> -- vdd-supply: an optional regulator that needs to be on to provide VDD
> -  power to the sensor.
> -- vddio-supply: an optional regulator that needs to be on to provide the
> -  VDD IO power to the sensor.
> -- st,drdy-int-pin: the pin on the package that will be used to signal
> -  "data ready" (valid values: 1 or 2). This property is not configurable
> -  on all sensors.
> -- drive-open-drain: the interrupt/data ready line will be configured
> -  as open drain, which is useful if several sensors share the same
> -  interrupt line. (This binding is taken from pinctrl/pinctrl-bindings.txt)
> -  This is a boolean property.
> -
> -Sensors may also have applicable pin control settings, those use the -
> standard bindings from pinctrl/pinctrl-bindings.txt.
> -
> -Valid compatible strings:
> -
> -Accelerometers:
> -- st,lis3lv02d (deprecated, use st,lis3lv02dl-accel)
> -- st,lis302dl-spi (deprecated, use st,lis3lv02dl-accel)
> -- st,lis3lv02dl-accel
> -- st,lsm303dlh-accel
> -- st,lsm303dlhc-accel
> -- st,lis3dh-accel
> -- st,lsm330d-accel
> -- st,lsm330dl-accel
> -- st,lsm330dlc-accel
> -- st,lis331dl-accel
> -- st,lis331dlh-accel
> -- st,lsm303dl-accel
> -- st,lsm303dlm-accel
> -- st,lsm330-accel
> -- st,lsm303agr-accel
> -- st,lis2dh12-accel
> -- st,h3lis331dl-accel
> -- st,lng2dm-accel
> -- st,lis3l02dq
> -- st,lis2dw12
> -- st,lis3dhh
> -- st,lis3de
> -- st,lis2de12
> -- st,lis2hh12
> -
> -Gyroscopes:
> -- st,l3g4200d-gyro
> -- st,lsm330d-gyro
> -- st,lsm330dl-gyro
> -- st,lsm330dlc-gyro
> -- st,l3gd20-gyro
> -- st,l3gd20h-gyro
> -- st,l3g4is-gyro
> -- st,lsm330-gyro
> -- st,lsm9ds0-gyro
> -
> -Magnetometers:
> -- st,lsm303agr-magn
> -- st,lsm303dlh-magn
> -- st,lsm303dlhc-magn
> -- st,lsm303dlm-magn
> -- st,lis3mdl-magn
> -- st,lis2mdl
> -- st,lsm9ds1-magn
> -
> -Pressure sensors:
> -- st,lps001wp-press
> -- st,lps25h-press
> -- st,lps331ap-press
> -- st,lps22hb-press
> -- st,lps33hw
> -- st,lps35hw
> -- st,lps22hh
> --
> 2.28.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 03/46] dt-bindings:iio:potentiometer:microchip,mcp4131 txt to yaml conversion
  2020-10-31 18:48 ` [PATCH 03/46] dt-bindings:iio:potentiometer:microchip,mcp4131 txt to " Jonathan Cameron
@ 2020-11-02 16:19   ` Slawomir Stepien
  2020-11-03 16:11   ` Rob Herring
  1 sibling, 0 replies; 104+ messages in thread
From: Slawomir Stepien @ 2020-11-02 16:19 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, Rob Herring, devicetree, Jonathan Cameron

On paź 31, 2020 18:48, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> This binding is very simple, but I think the very large number of
> compatible values make it unsuitable for moving to trivial-devices.yaml.
> Main change in the conversion was reordering the compatible list to
> numerical order.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Slawomir Stepien <sst@poczta.fm>

Reviewed-by: Slawomir Stepien <sst@poczta.fm>

> ---
>  .../bindings/iio/potentiometer/mcp4131.txt    |  84 ---------------
>  .../iio/potentiometer/microchip,mcp4131.yaml  | 102 ++++++++++++++++++
>  2 files changed, 102 insertions(+), 84 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/mcp4131.txt b/Documentation/devicetree/bindings/iio/potentiometer/mcp4131.txt
> deleted file mode 100644
> index 3ccba16f7035..000000000000
> --- a/Documentation/devicetree/bindings/iio/potentiometer/mcp4131.txt
> +++ /dev/null
> @@ -1,84 +0,0 @@
> -* Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X Digital Potentiometer
> -  driver
> -
> -The node for this driver must be a child node of a SPI controller, hence
> -all mandatory properties described in
> -
> -        Documentation/devicetree/bindings/spi/spi-bus.txt
> -
> -must be specified.
> -
> -Required properties:
> -	- compatible:  	Must be one of the following, depending on the
> -			model:
> -			"microchip,mcp4131-502"
> -			"microchip,mcp4131-103"
> -			"microchip,mcp4131-503"
> -			"microchip,mcp4131-104"
> -			"microchip,mcp4132-502"
> -			"microchip,mcp4132-103"
> -			"microchip,mcp4132-503"
> -			"microchip,mcp4132-104"
> -			"microchip,mcp4141-502"
> -			"microchip,mcp4141-103"
> -			"microchip,mcp4141-503"
> -			"microchip,mcp4141-104"
> -			"microchip,mcp4142-502"
> -			"microchip,mcp4142-103"
> -			"microchip,mcp4142-503"
> -			"microchip,mcp4142-104"
> -			"microchip,mcp4151-502"
> -			"microchip,mcp4151-103"
> -			"microchip,mcp4151-503"
> -			"microchip,mcp4151-104"
> -			"microchip,mcp4152-502"
> -			"microchip,mcp4152-103"
> -			"microchip,mcp4152-503"
> -			"microchip,mcp4152-104"
> -			"microchip,mcp4161-502"
> -			"microchip,mcp4161-103"
> -			"microchip,mcp4161-503"
> -			"microchip,mcp4161-104"
> -			"microchip,mcp4162-502"
> -			"microchip,mcp4162-103"
> -			"microchip,mcp4162-503"
> -			"microchip,mcp4162-104"
> -			"microchip,mcp4231-502"
> -			"microchip,mcp4231-103"
> -			"microchip,mcp4231-503"
> -			"microchip,mcp4231-104"
> -			"microchip,mcp4232-502"
> -			"microchip,mcp4232-103"
> -			"microchip,mcp4232-503"
> -			"microchip,mcp4232-104"
> -			"microchip,mcp4241-502"
> -			"microchip,mcp4241-103"
> -			"microchip,mcp4241-503"
> -			"microchip,mcp4241-104"
> -			"microchip,mcp4242-502"
> -			"microchip,mcp4242-103"
> -			"microchip,mcp4242-503"
> -			"microchip,mcp4242-104"
> -			"microchip,mcp4251-502"
> -			"microchip,mcp4251-103"
> -			"microchip,mcp4251-503"
> -			"microchip,mcp4251-104"
> -			"microchip,mcp4252-502"
> -			"microchip,mcp4252-103"
> -			"microchip,mcp4252-503"
> -			"microchip,mcp4252-104"
> -			"microchip,mcp4261-502"
> -			"microchip,mcp4261-103"
> -			"microchip,mcp4261-503"
> -			"microchip,mcp4261-104"
> -			"microchip,mcp4262-502"
> -			"microchip,mcp4262-103"
> -			"microchip,mcp4262-503"
> -			"microchip,mcp4262-104"
> -
> -Example:
> -mcp4131: mcp4131@0 {
> -	compatible = "mcp4131-502";
> -	reg = <0>;
> -	spi-max-frequency = <500000>;
> -};
> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp4131.yaml b/Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp4131.yaml
> new file mode 100644
> index 000000000000..834d17ae3730
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp4131.yaml
> @@ -0,0 +1,102 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/potentiometer/microchip,mcp4131.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X Digital Potentiometer
> +maintainers:
> +  - Slawomir Stepien <sst@poczta.fm>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - microchip,mcp4131-103
> +      - microchip,mcp4131-104
> +      - microchip,mcp4131-502
> +      - microchip,mcp4131-503
> +      - microchip,mcp4132-103
> +      - microchip,mcp4132-104
> +      - microchip,mcp4132-502
> +      - microchip,mcp4132-503
> +      - microchip,mcp4141-103
> +      - microchip,mcp4141-104
> +      - microchip,mcp4141-502
> +      - microchip,mcp4141-503
> +      - microchip,mcp4142-103
> +      - microchip,mcp4142-104
> +      - microchip,mcp4142-502
> +      - microchip,mcp4142-503
> +      - microchip,mcp4151-103
> +      - microchip,mcp4151-104
> +      - microchip,mcp4151-502
> +      - microchip,mcp4151-503
> +      - microchip,mcp4152-103
> +      - microchip,mcp4152-104
> +      - microchip,mcp4152-502
> +      - microchip,mcp4152-503
> +      - microchip,mcp4161-103
> +      - microchip,mcp4161-104
> +      - microchip,mcp4161-502
> +      - microchip,mcp4161-503
> +      - microchip,mcp4162-103
> +      - microchip,mcp4162-104
> +      - microchip,mcp4162-502
> +      - microchip,mcp4162-503
> +      - microchip,mcp4231-103
> +      - microchip,mcp4231-104
> +      - microchip,mcp4231-502
> +      - microchip,mcp4231-503
> +      - microchip,mcp4232-103
> +      - microchip,mcp4232-104
> +      - microchip,mcp4232-502
> +      - microchip,mcp4232-503
> +      - microchip,mcp4241-103
> +      - microchip,mcp4241-104
> +      - microchip,mcp4241-502
> +      - microchip,mcp4241-503
> +      - microchip,mcp4242-103
> +      - microchip,mcp4242-104
> +      - microchip,mcp4242-502
> +      - microchip,mcp4242-503
> +      - microchip,mcp4251-103
> +      - microchip,mcp4251-104
> +      - microchip,mcp4251-502
> +      - microchip,mcp4251-503
> +      - microchip,mcp4252-103
> +      - microchip,mcp4252-104
> +      - microchip,mcp4252-502
> +      - microchip,mcp4252-503
> +      - microchip,mcp4261-103
> +      - microchip,mcp4261-104
> +      - microchip,mcp4261-502
> +      - microchip,mcp4261-503
> +      - microchip,mcp4262-103
> +      - microchip,mcp4262-104
> +      - microchip,mcp4262-502
> +      - microchip,mcp4262-503
> +
> +  reg:
> +    maxItems: 1
> +
> +  spi-max-frequency: true
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +
> +examples:
> +  - |
> +    spi {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        potentiometer@0 {
> +            compatible = "mcp4131-502";
> +            reg = <0>;
> +            spi-max-frequency = <500000>;
> +        };
> +    };
> +...

-- 
Slawomir Stepien

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion
  2020-10-31 18:48 ` [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion Jonathan Cameron
  2020-11-02  4:48   ` Phil Reid
@ 2020-11-03 16:10   ` Rob Herring
  2020-11-03 17:28     ` Jonathan Cameron
  1 sibling, 1 reply; 104+ messages in thread
From: Rob Herring @ 2020-11-03 16:10 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, devicetree, Jonathan Cameron, Phil Reid

On Sat, Oct 31, 2020 at 06:48:10PM +0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Simple direct conversion from txt to yaml as part of a general aim of
> converting all IIO bindings to this machine readable format.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Phil Reid <preid@electromag.com.au>
> ---
>  .../bindings/iio/potentiometer/ad5272.txt     | 27 ----------
>  .../iio/potentiometer/adi,ad5272.yaml         | 50 +++++++++++++++++++
>  2 files changed, 50 insertions(+), 27 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt b/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
> deleted file mode 100644
> index f9b2eef946aa..000000000000
> --- a/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
> +++ /dev/null
> @@ -1,27 +0,0 @@
> -* Analog Devices AD5272 digital potentiometer
> -
> -The node for this device must be a child node of a I2C controller, hence
> -all mandatory properties for your controller must be specified. See directory:
> -
> -        Documentation/devicetree/bindings/i2c
> -
> -for more details.
> -
> -Required properties:
> -	- compatible:  	Must be one of the following, depending on the model:
> -			adi,ad5272-020
> -			adi,ad5272-050
> -			adi,ad5272-100
> -			adi,ad5274-020
> -			adi,ad5274-100
> -
> -Optional properties:
> - - reset-gpios: GPIO specification for the RESET input. This is an
> -		active low signal to the AD5272.
> -
> -Example:
> -ad5272: potentiometer@2f {
> -	reg = <0x2F>;
> -	compatible = "adi,ad5272-020";
> -	reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
> -};
> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml b/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
> new file mode 100644
> index 000000000000..b9b7d383bff1
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
> @@ -0,0 +1,50 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/potentiometer/adi,ad5272.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices AD5272 digital potentiometer
> +
> +maintainers:
> +  - Phil Reid <preid@electromag.com.au>
> +
> +description: |
> +  Datasheet: https://www.analog.com/en/products/ad5272.html
> +
> +properties:
> +  compatible:
> +    enum:
> +      - adi,ad5272-020
> +      - adi,ad5272-050
> +      - adi,ad5272-100
> +      - adi,ad5274-020
> +      - adi,ad5274-100
> +
> +  reg:
> +    maxItems: 1
> +
> +  reset-gpios:
> +    description:
> +      Active low signal to the AD5272 RESET input.

Not a new problem, but active low or...

> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        potentiometer@2f {
> +            compatible = "adi,ad5272-020";
> +            reg = <0x2F>;
> +            reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;

active high?

> +        };
> +    };
> +...
> -- 
> 2.28.0
> 

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 03/46] dt-bindings:iio:potentiometer:microchip,mcp4131 txt to yaml conversion
  2020-10-31 18:48 ` [PATCH 03/46] dt-bindings:iio:potentiometer:microchip,mcp4131 txt to " Jonathan Cameron
  2020-11-02 16:19   ` Slawomir Stepien
@ 2020-11-03 16:11   ` Rob Herring
  1 sibling, 0 replies; 104+ messages in thread
From: Rob Herring @ 2020-11-03 16:11 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio, devicetree, Jonathan Cameron, Slawomir Stepien

On Sat, Oct 31, 2020 at 06:48:11PM +0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> This binding is very simple, but I think the very large number of
> compatible values make it unsuitable for moving to trivial-devices.yaml.
> Main change in the conversion was reordering the compatible list to
> numerical order.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Slawomir Stepien <sst@poczta.fm>
> ---
>  .../bindings/iio/potentiometer/mcp4131.txt    |  84 ---------------
>  .../iio/potentiometer/microchip,mcp4131.yaml  | 102 ++++++++++++++++++
>  2 files changed, 102 insertions(+), 84 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/mcp4131.txt b/Documentation/devicetree/bindings/iio/potentiometer/mcp4131.txt
> deleted file mode 100644
> index 3ccba16f7035..000000000000
> --- a/Documentation/devicetree/bindings/iio/potentiometer/mcp4131.txt
> +++ /dev/null
> @@ -1,84 +0,0 @@
> -* Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X Digital Potentiometer
> -  driver
> -
> -The node for this driver must be a child node of a SPI controller, hence
> -all mandatory properties described in
> -
> -        Documentation/devicetree/bindings/spi/spi-bus.txt
> -
> -must be specified.
> -
> -Required properties:
> -	- compatible:  	Must be one of the following, depending on the
> -			model:
> -			"microchip,mcp4131-502"
> -			"microchip,mcp4131-103"
> -			"microchip,mcp4131-503"
> -			"microchip,mcp4131-104"
> -			"microchip,mcp4132-502"
> -			"microchip,mcp4132-103"
> -			"microchip,mcp4132-503"
> -			"microchip,mcp4132-104"
> -			"microchip,mcp4141-502"
> -			"microchip,mcp4141-103"
> -			"microchip,mcp4141-503"
> -			"microchip,mcp4141-104"
> -			"microchip,mcp4142-502"
> -			"microchip,mcp4142-103"
> -			"microchip,mcp4142-503"
> -			"microchip,mcp4142-104"
> -			"microchip,mcp4151-502"
> -			"microchip,mcp4151-103"
> -			"microchip,mcp4151-503"
> -			"microchip,mcp4151-104"
> -			"microchip,mcp4152-502"
> -			"microchip,mcp4152-103"
> -			"microchip,mcp4152-503"
> -			"microchip,mcp4152-104"
> -			"microchip,mcp4161-502"
> -			"microchip,mcp4161-103"
> -			"microchip,mcp4161-503"
> -			"microchip,mcp4161-104"
> -			"microchip,mcp4162-502"
> -			"microchip,mcp4162-103"
> -			"microchip,mcp4162-503"
> -			"microchip,mcp4162-104"
> -			"microchip,mcp4231-502"
> -			"microchip,mcp4231-103"
> -			"microchip,mcp4231-503"
> -			"microchip,mcp4231-104"
> -			"microchip,mcp4232-502"
> -			"microchip,mcp4232-103"
> -			"microchip,mcp4232-503"
> -			"microchip,mcp4232-104"
> -			"microchip,mcp4241-502"
> -			"microchip,mcp4241-103"
> -			"microchip,mcp4241-503"
> -			"microchip,mcp4241-104"
> -			"microchip,mcp4242-502"
> -			"microchip,mcp4242-103"
> -			"microchip,mcp4242-503"
> -			"microchip,mcp4242-104"
> -			"microchip,mcp4251-502"
> -			"microchip,mcp4251-103"
> -			"microchip,mcp4251-503"
> -			"microchip,mcp4251-104"
> -			"microchip,mcp4252-502"
> -			"microchip,mcp4252-103"
> -			"microchip,mcp4252-503"
> -			"microchip,mcp4252-104"
> -			"microchip,mcp4261-502"
> -			"microchip,mcp4261-103"
> -			"microchip,mcp4261-503"
> -			"microchip,mcp4261-104"
> -			"microchip,mcp4262-502"
> -			"microchip,mcp4262-103"
> -			"microchip,mcp4262-503"
> -			"microchip,mcp4262-104"
> -
> -Example:
> -mcp4131: mcp4131@0 {
> -	compatible = "mcp4131-502";
> -	reg = <0>;
> -	spi-max-frequency = <500000>;
> -};
> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp4131.yaml b/Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp4131.yaml
> new file mode 100644
> index 000000000000..834d17ae3730
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp4131.yaml
> @@ -0,0 +1,102 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/potentiometer/microchip,mcp4131.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X Digital Potentiometer

Blank line here.

> +maintainers:
> +  - Slawomir Stepien <sst@poczta.fm>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - microchip,mcp4131-103
> +      - microchip,mcp4131-104
> +      - microchip,mcp4131-502
> +      - microchip,mcp4131-503
> +      - microchip,mcp4132-103
> +      - microchip,mcp4132-104
> +      - microchip,mcp4132-502
> +      - microchip,mcp4132-503
> +      - microchip,mcp4141-103
> +      - microchip,mcp4141-104
> +      - microchip,mcp4141-502
> +      - microchip,mcp4141-503
> +      - microchip,mcp4142-103
> +      - microchip,mcp4142-104
> +      - microchip,mcp4142-502
> +      - microchip,mcp4142-503
> +      - microchip,mcp4151-103
> +      - microchip,mcp4151-104
> +      - microchip,mcp4151-502
> +      - microchip,mcp4151-503
> +      - microchip,mcp4152-103
> +      - microchip,mcp4152-104
> +      - microchip,mcp4152-502
> +      - microchip,mcp4152-503
> +      - microchip,mcp4161-103
> +      - microchip,mcp4161-104
> +      - microchip,mcp4161-502
> +      - microchip,mcp4161-503
> +      - microchip,mcp4162-103
> +      - microchip,mcp4162-104
> +      - microchip,mcp4162-502
> +      - microchip,mcp4162-503
> +      - microchip,mcp4231-103
> +      - microchip,mcp4231-104
> +      - microchip,mcp4231-502
> +      - microchip,mcp4231-503
> +      - microchip,mcp4232-103
> +      - microchip,mcp4232-104
> +      - microchip,mcp4232-502
> +      - microchip,mcp4232-503
> +      - microchip,mcp4241-103
> +      - microchip,mcp4241-104
> +      - microchip,mcp4241-502
> +      - microchip,mcp4241-503
> +      - microchip,mcp4242-103
> +      - microchip,mcp4242-104
> +      - microchip,mcp4242-502
> +      - microchip,mcp4242-503
> +      - microchip,mcp4251-103
> +      - microchip,mcp4251-104
> +      - microchip,mcp4251-502
> +      - microchip,mcp4251-503
> +      - microchip,mcp4252-103
> +      - microchip,mcp4252-104
> +      - microchip,mcp4252-502
> +      - microchip,mcp4252-503
> +      - microchip,mcp4261-103
> +      - microchip,mcp4261-104
> +      - microchip,mcp4261-502
> +      - microchip,mcp4261-503
> +      - microchip,mcp4262-103
> +      - microchip,mcp4262-104
> +      - microchip,mcp4262-502
> +      - microchip,mcp4262-503
> +
> +  reg:
> +    maxItems: 1
> +
> +  spi-max-frequency: true
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +
> +examples:
> +  - |
> +    spi {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        potentiometer@0 {
> +            compatible = "mcp4131-502";
> +            reg = <0>;
> +            spi-max-frequency = <500000>;
> +        };
> +    };
> +...
> -- 
> 2.28.0
> 

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 19/46] dt-bindings:iio:light:upisemi,us51882: txt to yaml conversion.
  2020-10-31 18:48 ` [PATCH 19/46] dt-bindings:iio:light:upisemi,us51882: " Jonathan Cameron
@ 2020-11-03 16:18   ` Rob Herring
  0 siblings, 0 replies; 104+ messages in thread
From: Rob Herring @ 2020-11-03 16:18 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, devicetree, Jonathan Cameron

On Sat, Oct 31, 2020 at 06:48:27PM +0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> I don't have an up to date address for Adriana Reus so I've put myself
> as the binding maintainer for this one.  I'm happy to hand over to Adriana
> or anyone else who wants take it on!
> 
> This has a lot of optional tuning parameters. The docs are modified to try
> and put the default values in the description of each one rather than a
> forwards reference to the example.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
>  .../bindings/iio/light/upisemi,us5182.yaml    | 75 +++++++++++++++++++
>  .../devicetree/bindings/iio/light/us5182d.txt | 45 -----------
>  2 files changed, 75 insertions(+), 45 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml b/Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml
> new file mode 100644
> index 000000000000..b9dc8ae25bf0
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml
> @@ -0,0 +1,75 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/light/upisemi,us5182.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: UPISEMI us5182d I2C ALS and Proximity sensor
> +
> +maintainers:
> +  - Jonathan Cameron <jic23@kernel.org>
> +
> +properties:
> +  compatible:
> +    const: upisemi,asd5182
> +
> +  reg:
> +    maxItems: 1
> +
> +  upsemi,glass-coef:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: |
> +      glass attenuation factor - compensation factor of resolution 1000
> +      for material transmittance.  Default: 1000

       default: 1000

> +
> +  upisemi,dark-ths:
> +    $ref: /schemas/types.yaml#/definitions/uint16-array
> +    minItems: 8
> +    maxItems: 8
> +    description:
> +      16-bit thresholds (adc counts) corresponding to every scale.
> +
> +  upisemi,upper-dark-gain:
> +    $ref: /schemas/types.yaml#/definitions/uint8
> +    description: |
> +      8-bit dark gain compensation factor(4 int and 4 fractional bits - Q4.4)
> +      applied when light > threshold. Default: 0.

       default: 0

> +
> +  upisemi,lower-dark-gain:
> +    $ref: /schemas/types.yaml#/definitions/uint8
> +    description: |
> +      8-bit dark gain compensation factor(4 int and 4 fractional bits - Q4.4)
> +      applied when light < threshold. Default: 0x16

     default: 0x16

> +
> +  upisemi,continuous:
> +    $ref: /schemas/types.yaml#definitions/flag
> +    description: |
> +      This chip has two power modes: one-shot (chip takes one measurement and
> +      then shuts itself down) and continuous (chip takes continuous
> +      measurements). The one-shot mode is more power-friendly but the
> +      continuous mode may be more reliable. If this property is specified
> +      the continuous mode will be used instead of the default one-shot one for
> +      raw reads.
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +
> +examples:
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        light-sensor@39 {
> +            compatible = "upisemi,usd5182";
> +            reg = <0x39>;
> +            upisemi,glass-coef = < 1000 >;
> +            upisemi,dark-ths = /bits/ 16 <170 200 512 512 800 2000 4000 8000>;
> +            upisemi,upper-dark-gain = /bits/ 8 <0x00>;
> +            upisemi,lower-dark-gain = /bits/ 8 <0x16>;
> +        };
> +    };
> +...
> diff --git a/Documentation/devicetree/bindings/iio/light/us5182d.txt b/Documentation/devicetree/bindings/iio/light/us5182d.txt
> deleted file mode 100644
> index a61979997f37..000000000000
> --- a/Documentation/devicetree/bindings/iio/light/us5182d.txt
> +++ /dev/null
> @@ -1,45 +0,0 @@
> -* UPISEMI us5182d I2C ALS and Proximity sensor
> -
> -Required properties:
> -- compatible: must be "upisemi,usd5182"
> -- reg: the I2C address of the device
> -
> -Optional properties:
> -- upisemi,glass-coef: glass attenuation factor - compensation factor of
> -                      resolution 1000 for material transmittance.
> -
> -- upisemi,dark-ths: array of 8 elements containing 16-bit thresholds (adc
> -                    counts) corresponding to every scale.
> -
> -- upisemi,upper-dark-gain: 8-bit dark gain compensation factor(4 int and 4
> -                           fractional bits - Q4.4) applied when light > threshold
> -
> -- upisemi,lower-dark-gain: 8-bit dark gain compensation factor(4 int and 4
> -                           fractional bits - Q4.4) applied when light < threshold
> -
> -- upisemi,continuous: This chip has two power modes: one-shot (chip takes one
> -                      measurement and then shuts itself down) and continuous (
> -                      chip takes continuous measurements). The one-shot mode is
> -                      more power-friendly but the continuous mode may be more
> -                      reliable. If this property is specified the continuous
> -                      mode will be used instead of the default one-shot one for
> -                      raw reads.
> -
> -If the optional properties are not specified these factors will default to the
> -values in the below example.
> -The glass-coef defaults to no compensation for the covering material.
> -The threshold array defaults to experimental values that work with US5182D
> -sensor on evaluation board - roughly between 12-32 lux.
> -There will be no dark-gain compensation by default when ALS > thresh
> -(0 * dark-gain), and a 1.35 compensation factor when ALS < thresh.
> -
> -Example:
> -
> -    usd5182@39 {
> -                compatible = "upisemi,usd5182";
> -                reg = <0x39>;
> -                upisemi,glass-coef = < 1000 >;
> -                upisemi,dark-ths = /bits/ 16 <170 200 512 512 800 2000 4000 8000>;
> -                upisemi,upper-dark-gain = /bits/ 8 <0x00>;
> -                upisemi,lower-dark-gain = /bits/ 8 <0x16>;
> -    };
> -- 
> 2.28.0
> 

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 30/46] dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion.
  2020-10-31 18:48 ` [PATCH 30/46] dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion Jonathan Cameron
@ 2020-11-03 16:26   ` Rob Herring
  2020-11-27  8:14   ` Geert Uytterhoeven
  1 sibling, 0 replies; 104+ messages in thread
From: Rob Herring @ 2020-11-03 16:26 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, devicetree, Jonathan Cameron, Marek Vasut

On Sat, Oct 31, 2020 at 06:48:38PM +0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> This is a somewhat unusual device, in that it effectively does
> spi offload.   That means that it doesn't act as a full SPI
> master, but supports some functionality.  As such it supports
> a subset of specific SPI ADCs.  There is potential for a future
> clash in bindings, but as these are simple devices hopefully that
> will not occur.
> 
> One addition to this from testing it against existing dts files
> was to add a resets property.
> This is specified in arch/arm/boot/dts/r8a7791.dtsi
> If it's the dtsi that is wrong and not the binding doc, then
> we can fix that instead.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Marek Vasut <marek.vasut+renesas@gmail.com>
> ---
>  .../bindings/iio/adc/renesas,gyroadc.txt      |  98 ------------
>  .../iio/adc/renesas,rcar-gyroadc.yaml         | 141 ++++++++++++++++++
>  2 files changed, 141 insertions(+), 98 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt b/Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt
> deleted file mode 100644
> index df5b9f2ad8d8..000000000000
> --- a/Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt
> +++ /dev/null
> @@ -1,98 +0,0 @@
> -* Renesas R-Car GyroADC device driver
> -
> -The GyroADC block is a reduced SPI block with up to 8 chipselect lines,
> -which supports the SPI protocol of a selected few SPI ADCs. The SPI ADCs
> -are sampled by the GyroADC block in a round-robin fashion and the result
> -presented in the GyroADC registers.
> -
> -Required properties:
> -- compatible:	Should be "<soc-specific>", "renesas,rcar-gyroadc".
> -                The <soc-specific> should be one of:
> -		renesas,r8a7791-gyroadc - for the GyroADC block present
> -					  in r8a7791 SoC
> -		renesas,r8a7792-gyroadc - for the GyroADC with interrupt
> -					  block present in r8a7792 SoC
> -- 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". The "fck" is the GyroADC block 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:
> -You must define subnode(s) 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@e6e54000 {
> -		compatible = "renesas,r8a7791-gyroadc", "renesas,rcar-gyroadc";
> -		reg = <0 0xe6e54000 0 64>;
> -		clocks = <&mstp9_clks R8A7791_CLK_GYROADC>;
> -		clock-names = "fck";
> -		power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
> -
> -		pinctrl-0 = <&adc_pins>;
> -		pinctrl-names = "default";
> -
> -		#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>;
> -		};
> -	};
> diff --git a/Documentation/devicetree/bindings/iio/adc/renesas,rcar-gyroadc.yaml b/Documentation/devicetree/bindings/iio/adc/renesas,rcar-gyroadc.yaml
> new file mode 100644
> index 000000000000..aeaa9d372450
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/renesas,rcar-gyroadc.yaml
> @@ -0,0 +1,141 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/adc/renesas,rcar-gyroadc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas R-Car GyroADC
> +
> +maintainers:
> +  - Marek Vasut <marek.vasut+renesas@gmail.com>
> +
> +description: |
> +  The GyroADC block is a reduced SPI block with up to 8 chipselect lines,
> +  which supports the SPI protocol of a selected few SPI ADCs. The SPI ADCs
> +  are sampled by the GyroADC block in a round-robin fashion and the result
> +  presented in the GyroADC registers.
> +  The ADC bindings should match with that of the devices connected to a
> +  full featured SPI bus.
> +
> +properties:
> +  compatible:
> +    items:
> +      - enum:
> +          - renesas,r8a7791-gyroadc
> +          - renesas,r8a7792-gyroadc
> +      - const: renesas,rcar-gyroadc
> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +
> +  clock-names:
> +    const: fck
> +
> +  power-domains: true
> +
> +  resets: true
> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 0
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +  - clock-names
> +  - "#address-cells"
> +  - "#size-cells"
> +
> +patternProperties:
> +  "^[a-zA-Z][a-zA-Z0-9,+\\-._]{0,63}@[0-9a-fA-F]+$":

No reason to repeat this regex as all node names get checked. Just need 
to restrict the unit-address:

"@[0-7]$"

> +    type: object
> +    properties:
> +      compatible:
> +        description: |
> +          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.
> +        enum:
> +          - adi,7476
> +          - fujitsu,mb88101a
> +          - maxim,max1162
> +          - maxim,max11100
> +          - ti,adcs7476
> +          - ti,adc121
> +
> +      reg: true

minimum: 0
maximum: 7

> +
> +      vref-supply: true
> +
> +    additionalProperties: false
> +
> +    required:
> +      - compatible
> +      - reg
> +      - vref-supply
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/r8a7791-clock.h>
> +    #include <dt-bindings/power/r8a7791-sysc.h>
> +    soc {
> +        #address-cells = <2>;
> +        #size-cells = <2>;
> +
> +        adc@e6e54000 {
> +            compatible = "renesas,r8a7791-gyroadc", "renesas,rcar-gyroadc";
> +            reg = <0 0xe6e54000 0 64>;
> +            clocks = <&mstp9_clks R8A7791_CLK_GYROADC>;
> +            clock-names = "fck";
> +            power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
> +
> +            pinctrl-0 = <&adc_pins>;
> +            pinctrl-names = "default";
> +
> +            #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>;
> +            };
> +        };
> +    };
> +...
> -- 
> 2.28.0
> 

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 38/46] dt-bindings:iio:dac:ad5592r: txt to yaml format conversion.
  2020-10-31 18:48 ` [PATCH 38/46] dt-bindings:iio:dac:ad5592r: " Jonathan Cameron
@ 2020-11-03 16:31   ` Rob Herring
  2020-11-22 18:38     ` Jonathan Cameron
  0 siblings, 1 reply; 104+ messages in thread
From: Rob Herring @ 2020-11-03 16:31 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio, devicetree, Jonathan Cameron, Michael Hennerich

On Sat, Oct 31, 2020 at 06:48:46PM +0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> This is a more complex binding. Whilst conversion is straight forward
> I am unsure if the full nature of required properties has been captured.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Michael Hennerich <michael.hennerich@analog.com>
> ---
>  .../devicetree/bindings/iio/dac/ad5592r.txt   | 155 --------------
>  .../bindings/iio/dac/adi,ad5592r.yaml         | 201 ++++++++++++++++++
>  2 files changed, 201 insertions(+), 155 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/dac/ad5592r.txt b/Documentation/devicetree/bindings/iio/dac/ad5592r.txt
> deleted file mode 100644
> index 989f96f31c66..000000000000
> --- a/Documentation/devicetree/bindings/iio/dac/ad5592r.txt
> +++ /dev/null
> @@ -1,155 +0,0 @@
> -Analog Devices AD5592R/AD5593R DAC/ADC device driver
> -
> -Required properties for the AD5592R:
> -	- compatible: Must be "adi,ad5592r"
> -	- reg: SPI chip select number for the device
> -	- spi-max-frequency: Max SPI frequency to use (< 30000000)
> -	- spi-cpol: The AD5592R requires inverse clock polarity (CPOL) mode
> -
> -Required properties for the AD5593R:
> -	- compatible: Must be "adi,ad5593r"
> -	- reg: I2C address of the device
> -
> -Required properties for all supported chips:
> -	- #address-cells: Should be 1.
> -	- #size-cells: Should be 0.
> -	- channel nodes:
> -	  Each child node represents one channel and has the following
> -	  Required properties:
> -		* reg: Pin on which this channel is connected to.
> -		* adi,mode: Mode or function of this channel.
> -			    Macros specifying the valid values
> -			    can be found in <dt-bindings/iio/adi,ad5592r.h>.
> -
> -			    The following values are currently supported:
> -				* CH_MODE_UNUSED (the pin is unused)
> -				* CH_MODE_ADC (the pin is ADC input)
> -				* CH_MODE_DAC (the pin is DAC output)
> -				* CH_MODE_DAC_AND_ADC (the pin is DAC output
> -					but can be monitored by an ADC, since
> -					there is no disadvantage this
> -					this should be considered as the
> -					preferred DAC mode)
> -				* CH_MODE_GPIO (the pin is registered
> -					with GPIOLIB)
> -	 Optional properties:
> -		* adi,off-state: State of this channel when unused or the
> -				 device gets removed. Macros specifying the
> -				 valid values can be found in
> -				 <dt-bindings/iio/adi,ad5592r.h>.
> -
> -				* CH_OFFSTATE_PULLDOWN (the pin is pulled down)
> -				* CH_OFFSTATE_OUT_LOW  (the pin is output low)
> -				* CH_OFFSTATE_OUT_HIGH (the pin is output high)
> -				* CH_OFFSTATE_OUT_TRISTATE (the pin is
> -					tristated output)
> -
> -
> -Optional properties:
> -	- vref-supply: Phandle to the external reference voltage supply. This should
> -	  only be set if there is an external reference voltage connected to the VREF
> -	  pin. If the property is not set the internal 2.5V reference is used.
> -	- reset-gpios : GPIO spec for the RESET pin. If specified, it will be
> -	  asserted during driver probe.
> -	- gpio-controller: Marks the device node as a GPIO controller.
> -	- #gpio-cells: Should be 2. The first cell is the GPIO number and the second
> -	  cell specifies GPIO flags, as defined in <dt-bindings/gpio/gpio.h>.
> -
> -AD5592R Example:
> -
> -	#include <dt-bindings/iio/adi,ad5592r.h>
> -
> -	vref: regulator-vref {
> -		compatible = "regulator-fixed";
> -		regulator-name = "vref-ad559x";
> -		regulator-min-microvolt = <3300000>;
> -		regulator-max-microvolt = <3300000>;
> -		regulator-always-on;
> -	};
> -
> -	ad5592r@0 {
> -		#size-cells = <0>;
> -		#address-cells = <1>;
> -		#gpio-cells = <2>;
> -		compatible = "adi,ad5592r";
> -		reg = <0>;
> -
> -		spi-max-frequency = <1000000>;
> -		spi-cpol;
> -
> -		vref-supply = <&vref>; /* optional */
> -		reset-gpios = <&gpio0 86 0>;  /* optional */
> -		gpio-controller;
> -
> -		channel@0 {
> -			reg = <0>;
> -			adi,mode = <CH_MODE_DAC>;
> -		};
> -		channel@1 {
> -			reg = <1>;
> -			adi,mode = <CH_MODE_ADC>;
> -		};
> -		channel@2 {
> -			reg = <2>;
> -			adi,mode = <CH_MODE_DAC_AND_ADC>;
> -		};
> -		channel@3 {
> -			reg = <3>;
> -			adi,mode = <CH_MODE_DAC_AND_ADC>;
> -			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> -		};
> -		channel@4 {
> -			reg = <4>;
> -			adi,mode = <CH_MODE_UNUSED>;
> -			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> -		};
> -		channel@5 {
> -			reg = <5>;
> -			adi,mode = <CH_MODE_GPIO>;
> -			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> -		};
> -		channel@6 {
> -			reg = <6>;
> -			adi,mode = <CH_MODE_GPIO>;
> -			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> -		};
> -		channel@7 {
> -			reg = <7>;
> -			adi,mode = <CH_MODE_GPIO>;
> -			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> -		};
> -	};
> -
> -AD5593R Example:
> -
> -	#include <dt-bindings/iio/adi,ad5592r.h>
> -
> -	ad5593r@10 {
> -		#size-cells = <0>;
> -		#address-cells = <1>;
> -		#gpio-cells = <2>;
> -		compatible = "adi,ad5593r";
> -		reg = <0x10>;
> -		gpio-controller;
> -
> -		channel@0 {
> -			reg = <0>;
> -			adi,mode = <CH_MODE_DAC>;
> -			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> -		};
> -		channel@1 {
> -			reg = <1>;
> -			adi,mode = <CH_MODE_ADC>;
> -			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> -		};
> -		channel@2 {
> -			reg = <2>;
> -			adi,mode = <CH_MODE_DAC_AND_ADC>;
> -			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> -		};
> -		channel@6 {
> -			reg = <6>;
> -			adi,mode = <CH_MODE_GPIO>;
> -			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> -		};
> -	};
> diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml
> new file mode 100644
> index 000000000000..c49646825c37
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml
> @@ -0,0 +1,201 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/dac/adi,ad5592r.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices AD5592R/AD5593R DAC/ADC
> +
> +maintainers:
> +  - Michael Hennerich <michael.hennerich@analog.com>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - adi,ad5592r
> +      - adi,ad5593r
> +
> +  reg:
> +    maxItems: 1
> +
> +  spi-max-frequency:
> +    maximum: 30000000
> +
> +  spi-cpol: true
> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 0
> +
> +  "#io-channel-cells":
> +    const: 1
> +
> +  vref-supply:
> +    description: If not set internal 2.5V reference used.
> +
> +  reset-gpios:
> +    maxItems: 1
> +
> +  gpio-controller:
> +    description: Marks the device node as a GPIO controller.
> +
> +  "#gpio-cells":
> +    const: 2
> +    description:
> +      The first cell is the GPIO number and the second cell specifies
> +      GPIO flags, as defined in <dt-bindings/gpio/gpio.h>.
> +
> +required:
> +  - compatible
> +  - reg
> +  - "#address-cells"
> +  - "#size-cells"
> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: adi,ad5592r
> +    then:
> +      required:
> +        - spi-cpol
> +    else:
> +      properties:
> +        spi-cpol: false
> +
> +additionalProperties: false
> +
> +patternProperties:
> +  "^(channel@)[0-7]$":
> +    type: object
> +    description: Child node to describe a channel
> +    properties:
> +      reg:
> +        maxItems: 1

minimum: 0
maximum: 7

> +
> +      adi,mode:
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +        description: |
> +          Mode or function of this channel.
> +          Macros specifying the valid values can be found in
> +          <dt-bindings/iio/adi,ad5592r.h>.
> +
> +          The following values are currently supported:
> +          * CH_MODE_UNUSED (the pin is unused)
> +          * CH_MODE_ADC (the pin is ADC input)
> +          * CH_MODE_DAC (the pin is DAC output)
> +          * CH_MODE_DAC_AND_ADC (the pin is DAC output but can be monitored
> +            by an ADC, since there is no disadvantage this should be
> +            considered as the preferred DAC mode)
> +          * CH_MODE_GPIO (the pin is registered with GPIOLIB)

Sounds like constraints.

> +
> +      adi,off-state:
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +        description: |
> +          State of this channel when unused or the device gets removed.
> +          Macros specifying the  valid values can be found in
> +          <dt-bindings/iio/adi,ad5592r.h>.
> +          * CH_OFFSTATE_PULLDOWN (the pin is pulled down)
> +          * CH_OFFSTATE_OUT_LOW  (the pin is output low)
> +          * CH_OFFSTATE_OUT_HIGH (the pin is output high)
> +          * CH_OFFSTATE_OUT_TRISTATE (the pin is tristated output)

Here too.

> +
> +    required:
> +      - reg
> +      - adi,mode
> +
> +    additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/iio/adi,ad5592r.h>
> +    spi {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        addac@0 {
> +            compatible = "adi,ad5592r";
> +            #size-cells = <0>;
> +            #address-cells = <1>;
> +            #gpio-cells = <2>;
> +            reg = <0>;
> +
> +            spi-max-frequency = <1000000>;
> +            spi-cpol;
> +
> +            vref-supply = <&vref>;
> +            reset-gpios = <&gpio0 86 0>;
> +            gpio-controller;
> +
> +            channel@0 {
> +                reg = <0>;
> +                adi,mode = <CH_MODE_DAC>;
> +            };
> +            channel@1 {
> +                reg = <1>;
> +                adi,mode = <CH_MODE_ADC>;
> +            };
> +            channel@2 {
> +                reg = <2>;
> +                adi,mode = <CH_MODE_DAC_AND_ADC>;
> +            };
> +            channel@3 {
> +                reg = <3>;
> +                adi,mode = <CH_MODE_DAC_AND_ADC>;
> +                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> +            };
> +            channel@4 {
> +                reg = <4>;
> +                adi,mode = <CH_MODE_UNUSED>;
> +                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> +            };
> +            channel@5 {
> +                reg = <5>;
> +                adi,mode = <CH_MODE_GPIO>;
> +                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> +            };
> +            channel@6 {
> +                reg = <6>;
> +                adi,mode = <CH_MODE_GPIO>;
> +                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> +            };
> +            channel@7 {
> +                reg = <7>;
> +                adi,mode = <CH_MODE_GPIO>;
> +                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> +            };
> +        };
> +        ad5593r@10 {
> +            compatible = "adi,ad5593r";
> +            #size-cells = <0>;
> +            #address-cells = <1>;
> +            #gpio-cells = <2>;
> +            reg = <0x10>;
> +            gpio-controller;
> +
> +            channel@0 {
> +                reg = <0>;
> +                adi,mode = <CH_MODE_DAC>;
> +                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> +            };
> +            channel@1 {
> +                reg = <1>;
> +                adi,mode = <CH_MODE_ADC>;
> +                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> +            };
> +            channel@2 {
> +                reg = <2>;
> +                adi,mode = <CH_MODE_DAC_AND_ADC>;
> +                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> +            };
> +            channel@6 {
> +                reg = <6>;
> +                adi,mode = <CH_MODE_GPIO>;
> +                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> +            };
> +        };
> +    };
> +...
> -- 
> 2.28.0
> 

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 39/46] dt-bindings:iio:dac:ad5755: txt to yaml format conversion.
  2020-10-31 18:48 ` [PATCH 39/46] dt-bindings:iio:dac:ad5755: " Jonathan Cameron
@ 2020-11-03 16:32   ` Rob Herring
  2020-11-22 18:40     ` Jonathan Cameron
  0 siblings, 1 reply; 104+ messages in thread
From: Rob Herring @ 2020-11-03 16:32 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, devicetree, Jonathan Cameron, Sean Nyekjaer

On Sat, Oct 31, 2020 at 06:48:47PM +0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Straight forward conversion.  Only fiddly bit is the XOR of
> spi-cpol and spi-cpha.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
> ---
>  .../devicetree/bindings/iio/dac/ad5755.txt    | 124 ------------
>  .../bindings/iio/dac/adi,ad5755.yaml          | 178 ++++++++++++++++++
>  2 files changed, 178 insertions(+), 124 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/dac/ad5755.txt b/Documentation/devicetree/bindings/iio/dac/ad5755.txt
> deleted file mode 100644
> index 502e1e55adbd..000000000000
> --- a/Documentation/devicetree/bindings/iio/dac/ad5755.txt
> +++ /dev/null
> @@ -1,124 +0,0 @@
> -* Analog Devices AD5755 IIO Multi-Channel DAC Linux Driver
> -
> -Required properties:
> - - compatible: Has to contain one of the following:
> -	adi,ad5755
> -	adi,ad5755-1
> -	adi,ad5757
> -	adi,ad5735
> -	adi,ad5737
> -
> - - reg: spi chip select number for the device
> - - spi-cpha or spi-cpol: is the only modes that is supported
> -
> -Recommended properties:
> - - spi-max-frequency: Definition as per
> -		Documentation/devicetree/bindings/spi/spi-bus.txt
> -
> -Optional properties:
> -See include/dt-bindings/iio/ad5755.h
> - - adi,ext-dc-dc-compenstation-resistor: boolean set if the hardware have an
> -					 external resistor and thereby bypasses
> -					 the internal compensation resistor.
> - - adi,dc-dc-phase:
> -	Valid values for DC DC Phase control is:
> -	0: All dc-to-dc converters clock on the same edge.
> -	1: Channel A and Channel B clock on the same edge,
> -	   Channel C and Channel D clock on opposite edges.
> -	2: Channel A and Channel C clock on the same edge,
> -	   Channel B and Channel D clock on opposite edges.
> -	3: Channel A, Channel B, Channel C, and Channel D
> -	   clock 90 degrees out of phase from each other.
> - - adi,dc-dc-freq-hz:
> -	Valid values for DC DC frequency is [Hz]:
> -	250000
> -	410000
> -	650000
> - - adi,dc-dc-max-microvolt:
> -	Valid values for the maximum allowed Vboost voltage supplied by
> -	the dc-to-dc converter is:
> -	23000000
> -	24500000
> -	27000000
> -	29500000
> -
> -Optional for every channel:
> - - adi,mode:
> -	Valid values for DAC modes is:
> -	0: 0 V to 5 V voltage range.
> -	1: 0 V to 10 V voltage range.
> -	2: Plus minus 5 V voltage range.
> -	3: Plus minus 10 V voltage range.
> -	4: 4 mA to 20 mA current range.
> -	5: 0 mA to 20 mA current range.
> -	6: 0 mA to 24 mA current range.
> - - adi,ext-current-sense-resistor: boolean set if the hardware a external
> -				   current sense resistor.
> - - adi,enable-voltage-overrange: boolean enable voltage overrange
> - - adi,slew: Array of slewrate settings should contain 3 fields:
> -	1: Should be either 0 or 1 in order to enable or disable slewrate.
> -	2: Slew rate settings:
> -		Valid values for the slew rate update frequency:
> -		64000
> -		32000
> -		16000
> -		8000
> -		4000
> -		2000
> -		1000
> -		500
> -		250
> -		125
> -		64
> -		32
> -		16
> -		8
> -		4
> -		0
> -	3: Slew step size:
> -		Valid values for the step size LSBs:
> -		1
> -		2
> -		4
> -		16
> -		32
> -		64
> -		128
> -		256
> -
> -Example:
> -dac@0 {
> -	#address-cells = <1>;
> -	#size-cells = <0>;
> -	compatible = "adi,ad5755";
> -	reg = <0>;
> -	spi-max-frequency = <1000000>;
> -	spi-cpha;
> -	adi,dc-dc-phase = <0>;
> -	adi,dc-dc-freq-hz = <410000>;
> -	adi,dc-dc-max-microvolt = <23000000>;
> -	channel@0 {
> -		reg = <0>;
> -		adi,mode = <4>;
> -		adi,ext-current-sense-resistor;
> -		adi,slew = <0 64000 1>;
> -	};
> -	channel@1 {
> -		reg = <1>;
> -		adi,mode = <4>;
> -		adi,ext-current-sense-resistor;
> -		adi,slew = <0 64000 1>;
> -	};
> -	channel@2 {
> -		reg = <2>;
> -		adi,mode = <4>;
> -		adi,ext-current-sense-resistor;
> -		adi,slew = <0 64000 1>;
> -	};
> -	channel@3 {
> -		reg = <3>;
> -		adi,mode = <4>;
> -		adi,ext-current-sense-resistor;
> -		adi,slew = <0 64000 1>;
> -	};
> -};
> diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml
> new file mode 100644
> index 000000000000..74edff3e8408
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml
> @@ -0,0 +1,178 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/dac/adi,ad5755.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices AD5755 Multi-Channel DAC
> +
> +maintainers:
> +  - Sean Nyekjaer <sean.nyekjaer@prevas.dk>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - adi,ad5755
> +      - adi,ad5755-1
> +      - adi,ad5757
> +      - adi,ad5735
> +      - adi,ad5737
> +
> +  reg:
> +    maxItems: 1
> +
> +  spi-cpha:
> +    description: Either this or spi-cpol but not both.
> +  spi-cpol: true
> +
> +  spi-max-frequency: true
> +
> +  adi,ext-dc-dc-compenstation-resistor:
> +    $ref: /schemas/types.yaml#/definitions/flag
> +    description:
> +      Set if the hardware have an external resistor and thereby bypasses
> +      the internal compensation resistor.
> +
> +  adi,dc-dc-phase:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    enum: [0, 1, 2, 3]
> +    description: |
> +      Valid values for DC DC Phase control is:
> +      0: All dc-to-dc converters clock on the same edge.
> +      1: Channel A and Channel B clock on the same edge,
> +         Channel C and Channel D clock on opposite edges.
> +      2: Channel A and Channel C clock on the same edge,
> +         Channel B and Channel D clock on opposite edges.
> +      3: Channel A, Channel B, Channel C, and Channel D
> +         clock 90 degrees out of phase from each other.
> +
> +  adi,dc-dc-freq-hz:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    enum: [250000, 410000, 650000]
> +
> +  adi,dc-dc-max-microvolt:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      Maximum allowed Vboost voltage supplied by the dc-to-dc converter.
> +    enum: [23000000, 24500000, 27000000, 29500000]
> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 0
> +
> +  "#io-channel-cells":
> +    const: 1
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +patternProperties:
> +  "^(channel@)[0-7]$":
> +    type: object
> +    description: Child node to describe a channel
> +    properties:
> +      reg:
> +        maxItems: 1
> +
> +      adi,mode:
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +        minimum: 0
> +        maximum: 6
> +        description: |
> +          Valid values for DAC modes is:
> +          0: 0 V to 5 V voltage range.
> +          1: 0 V to 10 V voltage range.
> +          2: Plus minus 5 V voltage range.
> +          3: Plus minus 10 V voltage range.
> +          4: 4 mA to 20 mA current range.
> +          5: 0 mA to 20 mA current range.
> +          6: 0 mA to 24 mA current range.
> +
> +      adi,ext-current-sense-resistor:
> +        $ref: /schemas/types.yaml#/definitions/flag
> +        description:
> +          Set if the hardware has an external current sense resistor
> +
> +      adi,enable-voltage-overrange:
> +        $ref: /schemas/types.yaml#/definitions/flag
> +        description: Enable voltage overrange
> +
> +      adi,slew:
> +        $ref: /schemas/types.yaml#/definitions/uint32-array
> +        description: |
> +          Array of slewrate settings should contain 3 fields:
> +          1: Should be either 0 or 1 in order to enable or disable slewrate.
> +          2: Slew rate update frequency
> +          3: Slew step size
> +        items:
> +          - enum: [0, 1]
> +          - enum: [64000, 32000, 16000, 8000, 4000, 2000, 1000, 500, 250, 125, 64, 32, 16, 8, 4, 0]
> +          - enum: [1, 2, 4, 16, 32, 64, 128, 256]
> +
> +    required:
> +      - reg
> +
> +    additionalProperties: false
> +
> +allOf:
> +  - $ref: '#/definitions/cpolXORcpha'
> +
> +definitions:
> +  cpolXORcpha:

Like the other one, you can drop 'definitions'.

> +    not:
> +      required: [spi-cpha, spi-cpol]
> +    oneOf:
> +      - required:
> +          - spi-cpha
> +      - required:
> +          - spi-cpol
> +
> +examples:
> +  - |
> +    #include <dt-bindings/iio/adi,ad5592r.h>
> +    spi {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        dac@0 {
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +            compatible = "adi,ad5755";
> +            reg = <0>;
> +            spi-max-frequency = <1000000>;
> +            spi-cpha;
> +            adi,dc-dc-phase = <0>;
> +            adi,dc-dc-freq-hz = <410000>;
> +            adi,dc-dc-max-microvolt = <23000000>;
> +            channel@0 {
> +                reg = <0>;
> +                adi,mode = <4>;
> +                adi,ext-current-sense-resistor;
> +                adi,slew = <0 64000 1>;
> +            };
> +            channel@1 {
> +                reg = <1>;
> +                adi,mode = <4>;
> +                adi,ext-current-sense-resistor;
> +                adi,slew = <0 64000 1>;
> +            };
> +            channel@2 {
> +                reg = <2>;
> +                adi,mode = <4>;
> +                adi,ext-current-sense-resistor;
> +                adi,slew = <0 64000 1>;
> +            };
> +            channel@3 {
> +                reg = <3>;
> +                adi,mode = <4>;
> +                adi,ext-current-sense-resistor;
> +                adi,slew = <0 64000 1>;
> +            };
> +        };
> +    };
> +...
> -- 
> 2.28.0
> 

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 42/46] dt-bindings:iio:accel:fsl,mma8452: txt to yaml conversion.
  2020-10-31 18:48 ` [PATCH 42/46] dt-bindings:iio:accel:fsl,mma8452: txt to yaml conversion Jonathan Cameron
@ 2020-11-03 16:34   ` Rob Herring
  2020-11-22 18:50     ` Jonathan Cameron
  0 siblings, 1 reply; 104+ messages in thread
From: Rob Herring @ 2020-11-03 16:34 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio, devicetree, Jonathan Cameron, Martin Kepplinger

On Sat, Oct 31, 2020 at 06:48:50PM +0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Simple binding so mostly straight forward to convert.
> Original binding was unclear on how many interrupts there are.
> The device has two such lines, whilst I believe the driver currently
> only uses one at a time.  The binding should allow both to be specified.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Martin Kepplinger <martin.kepplinger@theobroma-systems.com>
> ---
>  .../bindings/iio/accel/fsl,mma8452.yaml       | 62 +++++++++++++++++++
>  .../devicetree/bindings/iio/accel/mma8452.txt | 35 -----------
>  2 files changed, 62 insertions(+), 35 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/accel/fsl,mma8452.yaml b/Documentation/devicetree/bindings/iio/accel/fsl,mma8452.yaml
> new file mode 100644
> index 000000000000..3b8e5ebdf90c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/accel/fsl,mma8452.yaml
> @@ -0,0 +1,62 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/accel/fsl,mma8452.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title:
> +  Freescale MMA8451Q, MMA8452Q, MMA8453Q, MMA8652FC, MMA8653FC or FXLS8471Q
> +  triaxial accelerometer
> +
> +maintainers:
> +  - Martin Kepplinger <martin.kepplinger@theobroma-systems.com>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - fsl,mma8451
> +      - fsl,mma8452
> +      - fsl,mma8453
> +      - fsl,mma8652
> +      - fsl,mma8653
> +      - fsl,fxls8471
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    description:
> +      2 highly configurable interrupt lines exist.
> +    minItems: 1
> +    maxItems: 2
> +
> +  interrupt-names:
> +    description: Specify which interrupt line is in use.
> +    enum:
> +      - INT1
> +      - INT2

This will default to only 1 item allowed. You need minItems/maxItems.

> +
> +  vdd-supply: true
> +  vddio-supply: true
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        accel@1d {
> +            compatible = "fsl,mma8453";
> +            reg = <0x1d>;
> +            interrupt-parent = <&gpio1>;
> +            interrupts = <5 0>;
> +            interrupt-names = "INT2";
> +        };
> +    };
> +...
> diff --git a/Documentation/devicetree/bindings/iio/accel/mma8452.txt b/Documentation/devicetree/bindings/iio/accel/mma8452.txt
> deleted file mode 100644
> index e132394375a1..000000000000
> --- a/Documentation/devicetree/bindings/iio/accel/mma8452.txt
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -Freescale MMA8451Q, MMA8452Q, MMA8453Q, MMA8652FC, MMA8653FC or FXLS8471Q
> -triaxial accelerometer
> -
> -Required properties:
> -
> -  - compatible: should contain one of
> -    * "fsl,mma8451"
> -    * "fsl,mma8452"
> -    * "fsl,mma8453"
> -    * "fsl,mma8652"
> -    * "fsl,mma8653"
> -    * "fsl,fxls8471"
> -
> -  - reg: the I2C address of the chip
> -
> -Optional properties:
> -
> -  - interrupts: interrupt mapping for GPIO IRQ
> -
> -  - interrupt-names: should contain "INT1" and/or "INT2", the accelerometer's
> -		     interrupt line in use.
> -
> -  - vdd-supply: phandle to the regulator that provides vdd power to the accelerometer.
> -
> -  - vddio-supply: phandle to the regulator that provides vddio power to the accelerometer.
> -
> -Example:
> -
> -	mma8453fc@1d {
> -		compatible = "fsl,mma8453";
> -		reg = <0x1d>;
> -		interrupt-parent = <&gpio1>;
> -		interrupts = <5 0>;
> -		interrupt-names = "INT2";
> -	};
> -- 
> 2.28.0
> 

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions
  2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
                   ` (45 preceding siblings ...)
  2020-10-31 18:48 ` [PATCH 46/46] dt-bindings:iio:temperature: Drop generic binding file Jonathan Cameron
@ 2020-11-03 16:38 ` Rob Herring
  2020-11-03 17:24   ` Jonathan Cameron
  46 siblings, 1 reply; 104+ messages in thread
From: Rob Herring @ 2020-11-03 16:38 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, devicetree, Jonathan Cameron

On Sat, Oct 31, 2020 at 06:48:08PM +0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> This set is basically all the stuff bindings where I couldn't come up
> with a unifying theme to split them out into smaller more palatble sets.
> 
> So there is all sorts in here :)  Enjoy.

Thanks for filling my inbox... :)

> There are a few more binding files left after these are done.
> * io-channel-mux:  Needs conversion of the mux subsystem bindings
> * xilinx-xadc: I think Lars is working on this one already.
> * lis302: This one got moved to IIO directory, but reflects a bunch of stuff
>   that would not have made it into an IIO binding.  The driver is still in
>   misc and in theory has been replaced by the st-sensors driver.
>   Need to think what to do about this one.
> * mount-matrix.txt:  The binding part is under review for inclusion in
>   dt-schema rather than kernel tree, but this document has a wealth of
>   information we don't want hidden away there.  As such I'm probably
>   going to convert it to general kernel documentation.
> 
> Final patch in here drops the generic temperatures sensor binding.
> Whilst I'm keen on that we only currently have one user.  So I'd
> rather we had a second before we went to the effort of defining a
> proper yaml binding for that.
> 
> Jonathan Cameron (46):
>   dt-bindings:iio:resolver:adi,ad2s90: Conversion of binding to yaml.
>   dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion
>   dt-bindings:iio:potentiometer:microchip,mcp4131 txt to yaml conversion
>   dt-bindings:iio:potentiometer:microchip,mcp41010 txt to yaml
>     conversion
>   dt-bindings:iio:impedance-analyzer:adi,ad5933 yaml conversion.
>   dt-bindings:iio:samsung,sensorhub-rinato: yaml conversion
>   dt-bindings:iio:health:ti,afe4403: txt to yaml binding
>   dt-bindings:iio:health:ti,afe4404: txt to yaml conversion
>   dt-bindings:iio:health:maxim,max30100: txt to yaml conversion
>   dt-bindings:iio:health:maxim,max30102: txt to yaml conversion
>   dt-bindings:iio:imu:adi,adis16480: txt to yaml conversion
>   dt-bindings:iio:imu:st,lsm6dsx: txt to yaml conversion
>   dt-bindings:iio:light:avago,apds9300: txt to yaml conversion.
>   dt-bindings:iio:light:avago,apds9960: txt to yaml conversion
>   dt-bindings:iio:light:capella,cm36651: txt to yaml conversion.
>   dt-bindings:iio:light:sharp,gp2ap020a00f: txt to yaml conversion.
>   dt-bindings:iio:light:maxim,max44009: txt to yaml conversion.
>   dt-bindings:iio:light:ti,opt3001: txt to yaml conversion
>   dt-bindings:iio:light:upisemi,us51882: txt to yaml conversion.
>   dt-bindings:iio:light:st,uvis25: txt to yaml conversion for this UV
>     sensor
>   dt-bindings:iio:light:vishay,vcnl4035: txt to yaml conversion
>   dt-bindings:iio:light:st,vl6180: txt to yaml format conversion.
>   dt-bindings:iio:magnetometer:fsl,mag3110: txt to yaml conversion
>   dt-bindings:iio:magnetometer:asahi-kasei,ak8974: txt to yaml format
>     conversion
>   dt-bindings:iio:magnetometer:bosch,bmc150_magn: txt to yaml
>     conversion.
>   dt-bindings:iio:magnetometer:honeywell,hmc5843: txt to yaml format
>     conversion
>   dt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion.
>   dt-bindings:iio:adc:atmel,sama5d2-adc: txt to yaml conversion
>   dt-bindings:iio:adc:atmel,sama9260-adc: conversion to yaml from
>     at91_adc.txt
>   dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion.
>   dt-bindings:iio:adc:x-powers,axp209-adc: txt to yaml conversion
>   dt-bindings:iio:adc:brcm,iproc-static-adc: txt to yaml conversion
>   dt-bindings:iio:adc:mediatek,mt2701-auxadc: rename and yaml
>     conversion.
>   dt-bindings:iio:adc:ti,palmas-gpadc: txt to yaml format conversion.
>   dt-bindings:iio:adc:qcom,pm8018-adc: yaml conversion and rename.
>   dt-bindings:iio:adc:qcom,spmi-iadc: txt to yaml format conversion.
>   dt-binding:iio:adc:ti,ads124s08: txt to yaml format conversion.
>   dt-bindings:iio:dac:ad5592r: txt to yaml format conversion.
>   dt-bindings:iio:dac:ad5755: txt to yaml format conversion.
>   dt-bindings:iio:accel:bosch,bma180: txt to yaml format conversion.
>   dt-bindings:iio:accel:kionix,kxcjk1013: txt to yaml format conversion.
>   dt-bindings:iio:accel:fsl,mma8452: txt to yaml conversion.
>   dt-bindings:iio:gyro:bosch,bmg180: txt to yaml format conversion.
>   dt-bindings:iio:st,st-sensors: txt to yaml conversion.
>   dt-bindings:iio:frequency:adi,adf4350: txt to yaml format conversion.
>   dt-bindings:iio:temperature: Drop generic binding file.

There's more standard unit properties you can drop the type $ref on and 
a the couple of nits I raised. With those fixed,

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions
  2020-11-03 16:38 ` [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Rob Herring
@ 2020-11-03 17:24   ` Jonathan Cameron
  2020-11-22 18:59     ` Jonathan Cameron
  0 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-03 17:24 UTC (permalink / raw)
  To: Rob Herring; +Cc: Jonathan Cameron, linux-iio, devicetree

On Tue, 3 Nov 2020 10:38:00 -0600
Rob Herring <robh@kernel.org> wrote:

> On Sat, Oct 31, 2020 at 06:48:08PM +0000, Jonathan Cameron wrote:
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > 
> > This set is basically all the stuff bindings where I couldn't come up
> > with a unifying theme to split them out into smaller more palatble sets.
> > 
> > So there is all sorts in here :)  Enjoy.  
> 
> Thanks for filling my inbox... :)
Always happy to do that :)

I definitely recall you saying you liked to review them lots at a time.
*evil laugh*

Thanks for ploughing through them so quickly.

Jonathan


> 
> > There are a few more binding files left after these are done.
> > * io-channel-mux:  Needs conversion of the mux subsystem bindings
> > * xilinx-xadc: I think Lars is working on this one already.
> > * lis302: This one got moved to IIO directory, but reflects a bunch of stuff
> >   that would not have made it into an IIO binding.  The driver is still in
> >   misc and in theory has been replaced by the st-sensors driver.
> >   Need to think what to do about this one.
> > * mount-matrix.txt:  The binding part is under review for inclusion in
> >   dt-schema rather than kernel tree, but this document has a wealth of
> >   information we don't want hidden away there.  As such I'm probably
> >   going to convert it to general kernel documentation.
> > 
> > Final patch in here drops the generic temperatures sensor binding.
> > Whilst I'm keen on that we only currently have one user.  So I'd
> > rather we had a second before we went to the effort of defining a
> > proper yaml binding for that.
> > 
> > Jonathan Cameron (46):
> >   dt-bindings:iio:resolver:adi,ad2s90: Conversion of binding to yaml.
> >   dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion
> >   dt-bindings:iio:potentiometer:microchip,mcp4131 txt to yaml conversion
> >   dt-bindings:iio:potentiometer:microchip,mcp41010 txt to yaml
> >     conversion
> >   dt-bindings:iio:impedance-analyzer:adi,ad5933 yaml conversion.
> >   dt-bindings:iio:samsung,sensorhub-rinato: yaml conversion
> >   dt-bindings:iio:health:ti,afe4403: txt to yaml binding
> >   dt-bindings:iio:health:ti,afe4404: txt to yaml conversion
> >   dt-bindings:iio:health:maxim,max30100: txt to yaml conversion
> >   dt-bindings:iio:health:maxim,max30102: txt to yaml conversion
> >   dt-bindings:iio:imu:adi,adis16480: txt to yaml conversion
> >   dt-bindings:iio:imu:st,lsm6dsx: txt to yaml conversion
> >   dt-bindings:iio:light:avago,apds9300: txt to yaml conversion.
> >   dt-bindings:iio:light:avago,apds9960: txt to yaml conversion
> >   dt-bindings:iio:light:capella,cm36651: txt to yaml conversion.
> >   dt-bindings:iio:light:sharp,gp2ap020a00f: txt to yaml conversion.
> >   dt-bindings:iio:light:maxim,max44009: txt to yaml conversion.
> >   dt-bindings:iio:light:ti,opt3001: txt to yaml conversion
> >   dt-bindings:iio:light:upisemi,us51882: txt to yaml conversion.
> >   dt-bindings:iio:light:st,uvis25: txt to yaml conversion for this UV
> >     sensor
> >   dt-bindings:iio:light:vishay,vcnl4035: txt to yaml conversion
> >   dt-bindings:iio:light:st,vl6180: txt to yaml format conversion.
> >   dt-bindings:iio:magnetometer:fsl,mag3110: txt to yaml conversion
> >   dt-bindings:iio:magnetometer:asahi-kasei,ak8974: txt to yaml format
> >     conversion
> >   dt-bindings:iio:magnetometer:bosch,bmc150_magn: txt to yaml
> >     conversion.
> >   dt-bindings:iio:magnetometer:honeywell,hmc5843: txt to yaml format
> >     conversion
> >   dt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion.
> >   dt-bindings:iio:adc:atmel,sama5d2-adc: txt to yaml conversion
> >   dt-bindings:iio:adc:atmel,sama9260-adc: conversion to yaml from
> >     at91_adc.txt
> >   dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion.
> >   dt-bindings:iio:adc:x-powers,axp209-adc: txt to yaml conversion
> >   dt-bindings:iio:adc:brcm,iproc-static-adc: txt to yaml conversion
> >   dt-bindings:iio:adc:mediatek,mt2701-auxadc: rename and yaml
> >     conversion.
> >   dt-bindings:iio:adc:ti,palmas-gpadc: txt to yaml format conversion.
> >   dt-bindings:iio:adc:qcom,pm8018-adc: yaml conversion and rename.
> >   dt-bindings:iio:adc:qcom,spmi-iadc: txt to yaml format conversion.
> >   dt-binding:iio:adc:ti,ads124s08: txt to yaml format conversion.
> >   dt-bindings:iio:dac:ad5592r: txt to yaml format conversion.
> >   dt-bindings:iio:dac:ad5755: txt to yaml format conversion.
> >   dt-bindings:iio:accel:bosch,bma180: txt to yaml format conversion.
> >   dt-bindings:iio:accel:kionix,kxcjk1013: txt to yaml format conversion.
> >   dt-bindings:iio:accel:fsl,mma8452: txt to yaml conversion.
> >   dt-bindings:iio:gyro:bosch,bmg180: txt to yaml format conversion.
> >   dt-bindings:iio:st,st-sensors: txt to yaml conversion.
> >   dt-bindings:iio:frequency:adi,adf4350: txt to yaml format conversion.
> >   dt-bindings:iio:temperature: Drop generic binding file.  
> 
> There's more standard unit properties you can drop the type $ref on and 
> a the couple of nits I raised. With those fixed,
> 
> Reviewed-by: Rob Herring <robh@kernel.org>

Great.  Thanks again,

Jonathan


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion
  2020-11-03 16:10   ` Rob Herring
@ 2020-11-03 17:28     ` Jonathan Cameron
  2020-11-04  0:39       ` Phil Reid
  0 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-03 17:28 UTC (permalink / raw)
  To: Rob Herring; +Cc: Jonathan Cameron, linux-iio, devicetree, Phil Reid

On Tue, 3 Nov 2020 10:10:39 -0600
Rob Herring <robh@kernel.org> wrote:

> On Sat, Oct 31, 2020 at 06:48:10PM +0000, Jonathan Cameron wrote:
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > 
> > Simple direct conversion from txt to yaml as part of a general aim of
> > converting all IIO bindings to this machine readable format.
> > 
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Cc: Phil Reid <preid@electromag.com.au>
> > ---
> >  .../bindings/iio/potentiometer/ad5272.txt     | 27 ----------
> >  .../iio/potentiometer/adi,ad5272.yaml         | 50 +++++++++++++++++++
> >  2 files changed, 50 insertions(+), 27 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt b/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
> > deleted file mode 100644
> > index f9b2eef946aa..000000000000
> > --- a/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
> > +++ /dev/null
> > @@ -1,27 +0,0 @@
> > -* Analog Devices AD5272 digital potentiometer
> > -
> > -The node for this device must be a child node of a I2C controller, hence
> > -all mandatory properties for your controller must be specified. See directory:
> > -
> > -        Documentation/devicetree/bindings/i2c
> > -
> > -for more details.
> > -
> > -Required properties:
> > -	- compatible:  	Must be one of the following, depending on the model:
> > -			adi,ad5272-020
> > -			adi,ad5272-050
> > -			adi,ad5272-100
> > -			adi,ad5274-020
> > -			adi,ad5274-100
> > -
> > -Optional properties:
> > - - reset-gpios: GPIO specification for the RESET input. This is an
> > -		active low signal to the AD5272.
> > -
> > -Example:
> > -ad5272: potentiometer@2f {
> > -	reg = <0x2F>;
> > -	compatible = "adi,ad5272-020";
> > -	reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
> > -};
> > diff --git a/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml b/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
> > new file mode 100644
> > index 000000000000..b9b7d383bff1
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
> > @@ -0,0 +1,50 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/iio/potentiometer/adi,ad5272.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Analog Devices AD5272 digital potentiometer
> > +
> > +maintainers:
> > +  - Phil Reid <preid@electromag.com.au>
> > +
> > +description: |
> > +  Datasheet: https://www.analog.com/en/products/ad5272.html
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - adi,ad5272-020
> > +      - adi,ad5272-050
> > +      - adi,ad5272-100
> > +      - adi,ad5274-020
> > +      - adi,ad5274-100
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  reset-gpios:
> > +    description:
> > +      Active low signal to the AD5272 RESET input.  
> 
> Not a new problem, but active low or...
> 
> > +
> > +additionalProperties: false
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/gpio/gpio.h>
> > +    i2c {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        potentiometer@2f {
> > +            compatible = "adi,ad5272-020";
> > +            reg = <0x2F>;
> > +            reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;  
> 
> active high?

Good spot!  @Phil.  Looks like the driver is setting the reset line to
0 and then to 1 to come out of reset.   So effectively inverting the logic.
I'm tempted to be cynical and suggest we just drop the comment above and leave
it vague but is there a better way we can clarify this?

> 
> > +        };
> > +    };
> > +...
> > -- 
> > 2.28.0
> >   


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion
  2020-11-03 17:28     ` Jonathan Cameron
@ 2020-11-04  0:39       ` Phil Reid
  2020-11-04  3:12         ` Rob Herring
  0 siblings, 1 reply; 104+ messages in thread
From: Phil Reid @ 2020-11-04  0:39 UTC (permalink / raw)
  To: Jonathan Cameron, Rob Herring; +Cc: Jonathan Cameron, linux-iio, devicetree

On 4/11/2020 01:28, Jonathan Cameron wrote:
> On Tue, 3 Nov 2020 10:10:39 -0600
> Rob Herring <robh@kernel.org> wrote:
> 
>> On Sat, Oct 31, 2020 at 06:48:10PM +0000, Jonathan Cameron wrote:
>>> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>>>
>>> Simple direct conversion from txt to yaml as part of a general aim of
>>> converting all IIO bindings to this machine readable format.
>>>
>>> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>>> Cc: Phil Reid <preid@electromag.com.au>
>>> ---
>>>   .../bindings/iio/potentiometer/ad5272.txt     | 27 ----------
>>>   .../iio/potentiometer/adi,ad5272.yaml         | 50 +++++++++++++++++++
>>>   2 files changed, 50 insertions(+), 27 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt b/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
>>> deleted file mode 100644
>>> index f9b2eef946aa..000000000000
>>> --- a/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
>>> +++ /dev/null
>>> @@ -1,27 +0,0 @@
>>> -* Analog Devices AD5272 digital potentiometer
>>> -
>>> -The node for this device must be a child node of a I2C controller, hence
>>> -all mandatory properties for your controller must be specified. See directory:
>>> -
>>> -        Documentation/devicetree/bindings/i2c
>>> -
>>> -for more details.
>>> -
>>> -Required properties:
>>> -	- compatible:  	Must be one of the following, depending on the model:
>>> -			adi,ad5272-020
>>> -			adi,ad5272-050
>>> -			adi,ad5272-100
>>> -			adi,ad5274-020
>>> -			adi,ad5274-100
>>> -
>>> -Optional properties:
>>> - - reset-gpios: GPIO specification for the RESET input. This is an
>>> -		active low signal to the AD5272.
>>> -
>>> -Example:
>>> -ad5272: potentiometer@2f {
>>> -	reg = <0x2F>;
>>> -	compatible = "adi,ad5272-020";
>>> -	reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
>>> -};
>>> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml b/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
>>> new file mode 100644
>>> index 000000000000..b9b7d383bff1
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
>>> @@ -0,0 +1,50 @@
>>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/iio/potentiometer/adi,ad5272.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: Analog Devices AD5272 digital potentiometer
>>> +
>>> +maintainers:
>>> +  - Phil Reid <preid@electromag.com.au>
>>> +
>>> +description: |
>>> +  Datasheet: https://www.analog.com/en/products/ad5272.html
>>> +
>>> +properties:
>>> +  compatible:
>>> +    enum:
>>> +      - adi,ad5272-020
>>> +      - adi,ad5272-050
>>> +      - adi,ad5272-100
>>> +      - adi,ad5274-020
>>> +      - adi,ad5274-100
>>> +
>>> +  reg:
>>> +    maxItems: 1
>>> +
>>> +  reset-gpios:
>>> +    description:
>>> +      Active low signal to the AD5272 RESET input.
>>
>> Not a new problem, but active low or...
>>
>>> +
>>> +additionalProperties: false
>>> +
>>> +required:
>>> +  - compatible
>>> +  - reg
>>> +
>>> +examples:
>>> +  - |
>>> +    #include <dt-bindings/gpio/gpio.h>
>>> +    i2c {
>>> +        #address-cells = <1>;
>>> +        #size-cells = <0>;
>>> +
>>> +        potentiometer@2f {
>>> +            compatible = "adi,ad5272-020";
>>> +            reg = <0x2F>;
>>> +            reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
>>
>> active high?
> 
> Good spot!  @Phil.  Looks like the driver is setting the reset line to
> 0 and then to 1 to come out of reset.   So effectively inverting the logic.
> I'm tempted to be cynical and suggest we just drop the comment above and leave
> it vague but is there a better way we can clarify this?

Had a look at a few other iio drivers in regards how they handle the same thing.
A few do the same thing, ie: the drivers are written to set gpio low to assert reset.
So they need the device tree gpio config to be active high to work correctly.
Not sure if this prevents users setting things up as open collector.

I also reviewed my boards and they aren't using the reset line at the moment.
So I've never properly tested that, but hte code looks ok.

I'm happy to go the vague way.
> 
>>
>>> +        };
>>> +    };
>>> +...
>>> -- 
>>> 2.28.0
>>>    
> 
> 


-- 
Regards
Phil Reid


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion
  2020-11-04  0:39       ` Phil Reid
@ 2020-11-04  3:12         ` Rob Herring
  2020-11-04  4:53           ` Phil Reid
  0 siblings, 1 reply; 104+ messages in thread
From: Rob Herring @ 2020-11-04  3:12 UTC (permalink / raw)
  To: Phil Reid
  Cc: Jonathan Cameron, Jonathan Cameron,
	open list:IIO SUBSYSTEM AND DRIVERS, devicetree

On Tue, Nov 3, 2020 at 6:39 PM Phil Reid <preid@electromag.com.au> wrote:
>
> On 4/11/2020 01:28, Jonathan Cameron wrote:
> > On Tue, 3 Nov 2020 10:10:39 -0600
> > Rob Herring <robh@kernel.org> wrote:
> >
> >> On Sat, Oct 31, 2020 at 06:48:10PM +0000, Jonathan Cameron wrote:
> >>> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >>>
> >>> Simple direct conversion from txt to yaml as part of a general aim of
> >>> converting all IIO bindings to this machine readable format.
> >>>
> >>> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >>> Cc: Phil Reid <preid@electromag.com.au>
> >>> ---
> >>>   .../bindings/iio/potentiometer/ad5272.txt     | 27 ----------
> >>>   .../iio/potentiometer/adi,ad5272.yaml         | 50 +++++++++++++++++++
> >>>   2 files changed, 50 insertions(+), 27 deletions(-)
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt b/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
> >>> deleted file mode 100644
> >>> index f9b2eef946aa..000000000000
> >>> --- a/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
> >>> +++ /dev/null
> >>> @@ -1,27 +0,0 @@
> >>> -* Analog Devices AD5272 digital potentiometer
> >>> -
> >>> -The node for this device must be a child node of a I2C controller, hence
> >>> -all mandatory properties for your controller must be specified. See directory:
> >>> -
> >>> -        Documentation/devicetree/bindings/i2c
> >>> -
> >>> -for more details.
> >>> -
> >>> -Required properties:
> >>> -   - compatible:   Must be one of the following, depending on the model:
> >>> -                   adi,ad5272-020
> >>> -                   adi,ad5272-050
> >>> -                   adi,ad5272-100
> >>> -                   adi,ad5274-020
> >>> -                   adi,ad5274-100
> >>> -
> >>> -Optional properties:
> >>> - - reset-gpios: GPIO specification for the RESET input. This is an
> >>> -           active low signal to the AD5272.
> >>> -
> >>> -Example:
> >>> -ad5272: potentiometer@2f {
> >>> -   reg = <0x2F>;
> >>> -   compatible = "adi,ad5272-020";
> >>> -   reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
> >>> -};
> >>> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml b/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
> >>> new file mode 100644
> >>> index 000000000000..b9b7d383bff1
> >>> --- /dev/null
> >>> +++ b/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
> >>> @@ -0,0 +1,50 @@
> >>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> >>> +%YAML 1.2
> >>> +---
> >>> +$id: http://devicetree.org/schemas/iio/potentiometer/adi,ad5272.yaml#
> >>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> >>> +
> >>> +title: Analog Devices AD5272 digital potentiometer
> >>> +
> >>> +maintainers:
> >>> +  - Phil Reid <preid@electromag.com.au>
> >>> +
> >>> +description: |
> >>> +  Datasheet: https://www.analog.com/en/products/ad5272.html
> >>> +
> >>> +properties:
> >>> +  compatible:
> >>> +    enum:
> >>> +      - adi,ad5272-020
> >>> +      - adi,ad5272-050
> >>> +      - adi,ad5272-100
> >>> +      - adi,ad5274-020
> >>> +      - adi,ad5274-100
> >>> +
> >>> +  reg:
> >>> +    maxItems: 1
> >>> +
> >>> +  reset-gpios:
> >>> +    description:
> >>> +      Active low signal to the AD5272 RESET input.
> >>
> >> Not a new problem, but active low or...
> >>
> >>> +
> >>> +additionalProperties: false
> >>> +
> >>> +required:
> >>> +  - compatible
> >>> +  - reg
> >>> +
> >>> +examples:
> >>> +  - |
> >>> +    #include <dt-bindings/gpio/gpio.h>
> >>> +    i2c {
> >>> +        #address-cells = <1>;
> >>> +        #size-cells = <0>;
> >>> +
> >>> +        potentiometer@2f {
> >>> +            compatible = "adi,ad5272-020";
> >>> +            reg = <0x2F>;
> >>> +            reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
> >>
> >> active high?
> >
> > Good spot!  @Phil.  Looks like the driver is setting the reset line to
> > 0 and then to 1 to come out of reset.   So effectively inverting the logic.
> > I'm tempted to be cynical and suggest we just drop the comment above and leave
> > it vague but is there a better way we can clarify this?
>
> Had a look at a few other iio drivers in regards how they handle the same thing.
> A few do the same thing, ie: the drivers are written to set gpio low to assert reset.
> So they need the device tree gpio config to be active high to work correctly.
> Not sure if this prevents users setting things up as open collector.

The driver is wrong. 'gpiod_set_value(reset_gpio, 1);' should assert
reset as '1' here is set to (reset) active state as defined in the DT.

Given no upstream users, maybe it can be fixed...

We need to make 'reset-gpios' implemented by a reset controller and
stop letting drivers get it wrong.

Rob

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion
  2020-11-04  3:12         ` Rob Herring
@ 2020-11-04  4:53           ` Phil Reid
  2020-11-09  2:56             ` Phil Reid
  0 siblings, 1 reply; 104+ messages in thread
From: Phil Reid @ 2020-11-04  4:53 UTC (permalink / raw)
  To: Rob Herring
  Cc: Jonathan Cameron, Jonathan Cameron,
	open list:IIO SUBSYSTEM AND DRIVERS, devicetree

On 4/11/2020 11:12, Rob Herring wrote:
> On Tue, Nov 3, 2020 at 6:39 PM Phil Reid <preid@electromag.com.au> wrote:
>>
>> On 4/11/2020 01:28, Jonathan Cameron wrote:
>>> On Tue, 3 Nov 2020 10:10:39 -0600
>>> Rob Herring <robh@kernel.org> wrote:
>>>
>>>> On Sat, Oct 31, 2020 at 06:48:10PM +0000, Jonathan Cameron wrote:
>>>>> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>>>>>
>>>>> Simple direct conversion from txt to yaml as part of a general aim of
>>>>> converting all IIO bindings to this machine readable format.
>>>>>
>>>>> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>>>>> Cc: Phil Reid <preid@electromag.com.au>
>>>>> ---
>>>>>    .../bindings/iio/potentiometer/ad5272.txt     | 27 ----------
>>>>>    .../iio/potentiometer/adi,ad5272.yaml         | 50 +++++++++++++++++++
>>>>>    2 files changed, 50 insertions(+), 27 deletions(-)
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt b/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
>>>>> deleted file mode 100644
>>>>> index f9b2eef946aa..000000000000
>>>>> --- a/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
>>>>> +++ /dev/null
>>>>> @@ -1,27 +0,0 @@
>>>>> -* Analog Devices AD5272 digital potentiometer
>>>>> -
>>>>> -The node for this device must be a child node of a I2C controller, hence
>>>>> -all mandatory properties for your controller must be specified. See directory:
>>>>> -
>>>>> -        Documentation/devicetree/bindings/i2c
>>>>> -
>>>>> -for more details.
>>>>> -
>>>>> -Required properties:
>>>>> -   - compatible:   Must be one of the following, depending on the model:
>>>>> -                   adi,ad5272-020
>>>>> -                   adi,ad5272-050
>>>>> -                   adi,ad5272-100
>>>>> -                   adi,ad5274-020
>>>>> -                   adi,ad5274-100
>>>>> -
>>>>> -Optional properties:
>>>>> - - reset-gpios: GPIO specification for the RESET input. This is an
>>>>> -           active low signal to the AD5272.
>>>>> -
>>>>> -Example:
>>>>> -ad5272: potentiometer@2f {
>>>>> -   reg = <0x2F>;
>>>>> -   compatible = "adi,ad5272-020";
>>>>> -   reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
>>>>> -};
>>>>> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml b/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
>>>>> new file mode 100644
>>>>> index 000000000000..b9b7d383bff1
>>>>> --- /dev/null
>>>>> +++ b/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
>>>>> @@ -0,0 +1,50 @@
>>>>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>>>>> +%YAML 1.2
>>>>> +---
>>>>> +$id: http://devicetree.org/schemas/iio/potentiometer/adi,ad5272.yaml#
>>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>>>> +
>>>>> +title: Analog Devices AD5272 digital potentiometer
>>>>> +
>>>>> +maintainers:
>>>>> +  - Phil Reid <preid@electromag.com.au>
>>>>> +
>>>>> +description: |
>>>>> +  Datasheet: https://www.analog.com/en/products/ad5272.html
>>>>> +
>>>>> +properties:
>>>>> +  compatible:
>>>>> +    enum:
>>>>> +      - adi,ad5272-020
>>>>> +      - adi,ad5272-050
>>>>> +      - adi,ad5272-100
>>>>> +      - adi,ad5274-020
>>>>> +      - adi,ad5274-100
>>>>> +
>>>>> +  reg:
>>>>> +    maxItems: 1
>>>>> +
>>>>> +  reset-gpios:
>>>>> +    description:
>>>>> +      Active low signal to the AD5272 RESET input.
>>>>
>>>> Not a new problem, but active low or...
>>>>
>>>>> +
>>>>> +additionalProperties: false
>>>>> +
>>>>> +required:
>>>>> +  - compatible
>>>>> +  - reg
>>>>> +
>>>>> +examples:
>>>>> +  - |
>>>>> +    #include <dt-bindings/gpio/gpio.h>
>>>>> +    i2c {
>>>>> +        #address-cells = <1>;
>>>>> +        #size-cells = <0>;
>>>>> +
>>>>> +        potentiometer@2f {
>>>>> +            compatible = "adi,ad5272-020";
>>>>> +            reg = <0x2F>;
>>>>> +            reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
>>>>
>>>> active high?
>>>
>>> Good spot!  @Phil.  Looks like the driver is setting the reset line to
>>> 0 and then to 1 to come out of reset.   So effectively inverting the logic.
>>> I'm tempted to be cynical and suggest we just drop the comment above and leave
>>> it vague but is there a better way we can clarify this?
>>
>> Had a look at a few other iio drivers in regards how they handle the same thing.
>> A few do the same thing, ie: the drivers are written to set gpio low to assert reset.
>> So they need the device tree gpio config to be active high to work correctly.
>> Not sure if this prevents users setting things up as open collector.
> 
> The driver is wrong. 'gpiod_set_value(reset_gpio, 1);' should assert
> reset as '1' here is set to (reset) active state as defined in the DT.
> 
> Given no upstream users, maybe it can be fixed...
> 
> We need to make 'reset-gpios' implemented by a reset controller and
> stop letting drivers get it wrong.
> 

Yes I agree, the driver is wrong, think I just copied one of the other drivers for the pattern.
I'd be happy to change it, there's probably few (if any) users.

Having a software interface to assert the reset would be nice.


-- 
Regards
Phil Reid


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 24/46] dt-bindings:iio:magnetometer:asahi-kasei,ak8974: txt to yaml format conversion
  2020-10-31 18:48 ` [PATCH 24/46] dt-bindings:iio:magnetometer:asahi-kasei,ak8974: txt to yaml format conversion Jonathan Cameron
@ 2020-11-04 14:47   ` Linus Walleij
  2020-11-08 15:55     ` Jonathan Cameron
  0 siblings, 1 reply; 104+ messages in thread
From: Linus Walleij @ 2020-11-04 14:47 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio, Rob Herring,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Jonathan Cameron

On Sat, Oct 31, 2020 at 7:52 PM Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> Simple conversion.  I have pruned descriptions that did not add much useful
> detail.  Note that the mount-matrix description will form part of a generic
> IIO binding.  No need to repeat that in every driver that uses it.

Writing the mount-matrix YAML binding is going to be interesting!

> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 35/46] dt-bindings:iio:adc:qcom,pm8018-adc: yaml conversion and rename.
  2020-10-31 18:48 ` [PATCH 35/46] dt-bindings:iio:adc:qcom,pm8018-adc: yaml conversion and rename Jonathan Cameron
@ 2020-11-04 14:51   ` Linus Walleij
  0 siblings, 0 replies; 104+ messages in thread
From: Linus Walleij @ 2020-11-04 14:51 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio, Rob Herring,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Jonathan Cameron

On Sat, Oct 31, 2020 at 7:52 PM Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> Renamed to match a listed compatible rather than relying on wildcards
> with all their usual problems.
>
> Dropped the reference supply as a requirement as at least one dtsi doesn't
> include it and the example never did.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>

Looks good:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 24/46] dt-bindings:iio:magnetometer:asahi-kasei,ak8974: txt to yaml format conversion
  2020-11-04 14:47   ` Linus Walleij
@ 2020-11-08 15:55     ` Jonathan Cameron
  0 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-08 15:55 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-iio, Rob Herring,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Jonathan Cameron

On Wed, 4 Nov 2020 15:47:56 +0100
Linus Walleij <linus.walleij@linaro.org> wrote:

> On Sat, Oct 31, 2020 at 7:52 PM Jonathan Cameron <jic23@kernel.org> wrote:
> 
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > Simple conversion.  I have pruned descriptions that did not add much useful
> > detail.  Note that the mount-matrix description will form part of a generic
> > IIO binding.  No need to repeat that in every driver that uses it.  
> 
> Writing the mount-matrix YAML binding is going to be interesting!

Would be amusing to try and fully constrain it to a valid rotation matrix
but for now it's a 9 element string-array.

I'm planning to move the huge amount of documentation to the main docs rather than
bury it in the dt-schema repo.  I'll probably add some cross references
so people have some hope of tracking down that doc.

Jonathan

> 
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Cc: Linus Walleij <linus.walleij@linaro.org>  
> 
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> 
> Yours,
> Linus Walleij


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 37/46] dt-binding:iio:adc:ti,ads124s08: txt to yaml format conversion.
  2020-11-02 12:49   ` Dan Murphy
@ 2020-11-08 16:59     ` Jonathan Cameron
  0 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-08 16:59 UTC (permalink / raw)
  To: Dan Murphy; +Cc: linux-iio, Rob Herring, devicetree, Jonathan Cameron

On Mon, 2 Nov 2020 06:49:54 -0600
Dan Murphy <dmurphy@ti.com> wrote:

> Jonathan
> 
> On 10/31/20 1:48 PM, Jonathan Cameron wrote:
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > Simple binding so straight forward format conversion.
> >
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Cc: Dan Murphy <dmurphy@ti.com>
> > ---
> >   .../bindings/iio/adc/ti,ads124s08.yaml        | 52 +++++++++++++++++++
> >   .../bindings/iio/adc/ti-ads124s08.txt         | 25 ---------
> >   2 files changed, 52 insertions(+), 25 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/iio/adc/ti,ads124s08.yaml b/Documentation/devicetree/bindings/iio/adc/ti,ads124s08.yaml
> > new file mode 100644
> > index 000000000000..5912a52953fa
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/adc/ti,ads124s08.yaml
> > @@ -0,0 +1,52 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)  
> GPL-2.0-only  OR BSD-2-Clause
> 

Fair enough, GPL-2.0 is defined as meaning the same, but is deprecated
according to the SPDX list of names.
@Rob, I assume we aren't taking a strong view on which is preferred for
DT bindings?

Jonathan


> Otherwise
> 
> Reviewed-by: Dan Murphy <dmurphy@ti.com>
> 


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion
  2020-11-04  4:53           ` Phil Reid
@ 2020-11-09  2:56             ` Phil Reid
  2020-11-22 16:35               ` Jonathan Cameron
  0 siblings, 1 reply; 104+ messages in thread
From: Phil Reid @ 2020-11-09  2:56 UTC (permalink / raw)
  To: Rob Herring
  Cc: Jonathan Cameron, Jonathan Cameron,
	open list:IIO SUBSYSTEM AND DRIVERS, devicetree

On 4/11/2020 12:53, Phil Reid wrote:
> On 4/11/2020 11:12, Rob Herring wrote:
>> On Tue, Nov 3, 2020 at 6:39 PM Phil Reid <preid@electromag.com.au> wrote:
>>>
>>> On 4/11/2020 01:28, Jonathan Cameron wrote:
>>>> On Tue, 3 Nov 2020 10:10:39 -0600
>>>> Rob Herring <robh@kernel.org> wrote:
>>>>
>>>>> On Sat, Oct 31, 2020 at 06:48:10PM +0000, Jonathan Cameron wrote:
>>>>>> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>>>>>>
>>>>>> Simple direct conversion from txt to yaml as part of a general aim of
>>>>>> converting all IIO bindings to this machine readable format.
>>>>>>
>>>>>> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>>>>>> Cc: Phil Reid <preid@electromag.com.au>
>>>>>> ---
>>>>>>    .../bindings/iio/potentiometer/ad5272.txt     | 27 ----------
>>>>>>    .../iio/potentiometer/adi,ad5272.yaml         | 50 +++++++++++++++++++
>>>>>>    2 files changed, 50 insertions(+), 27 deletions(-)
>>>>>>
>>>>>> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt b/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
>>>>>> deleted file mode 100644
>>>>>> index f9b2eef946aa..000000000000
>>>>>> --- a/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
>>>>>> +++ /dev/null
>>>>>> @@ -1,27 +0,0 @@
>>>>>> -* Analog Devices AD5272 digital potentiometer
>>>>>> -
>>>>>> -The node for this device must be a child node of a I2C controller, hence
>>>>>> -all mandatory properties for your controller must be specified. See directory:
>>>>>> -
>>>>>> -        Documentation/devicetree/bindings/i2c
>>>>>> -
>>>>>> -for more details.
>>>>>> -
>>>>>> -Required properties:
>>>>>> -   - compatible:   Must be one of the following, depending on the model:
>>>>>> -                   adi,ad5272-020
>>>>>> -                   adi,ad5272-050
>>>>>> -                   adi,ad5272-100
>>>>>> -                   adi,ad5274-020
>>>>>> -                   adi,ad5274-100
>>>>>> -
>>>>>> -Optional properties:
>>>>>> - - reset-gpios: GPIO specification for the RESET input. This is an
>>>>>> -           active low signal to the AD5272.
>>>>>> -
>>>>>> -Example:
>>>>>> -ad5272: potentiometer@2f {
>>>>>> -   reg = <0x2F>;
>>>>>> -   compatible = "adi,ad5272-020";
>>>>>> -   reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
>>>>>> -};
>>>>>> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml b/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
>>>>>> new file mode 100644
>>>>>> index 000000000000..b9b7d383bff1
>>>>>> --- /dev/null
>>>>>> +++ b/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
>>>>>> @@ -0,0 +1,50 @@
>>>>>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>>>>>> +%YAML 1.2
>>>>>> +---
>>>>>> +$id: http://devicetree.org/schemas/iio/potentiometer/adi,ad5272.yaml#
>>>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>>>>> +
>>>>>> +title: Analog Devices AD5272 digital potentiometer
>>>>>> +
>>>>>> +maintainers:
>>>>>> +  - Phil Reid <preid@electromag.com.au>
>>>>>> +
>>>>>> +description: |
>>>>>> +  Datasheet: https://www.analog.com/en/products/ad5272.html
>>>>>> +
>>>>>> +properties:
>>>>>> +  compatible:
>>>>>> +    enum:
>>>>>> +      - adi,ad5272-020
>>>>>> +      - adi,ad5272-050
>>>>>> +      - adi,ad5272-100
>>>>>> +      - adi,ad5274-020
>>>>>> +      - adi,ad5274-100
>>>>>> +
>>>>>> +  reg:
>>>>>> +    maxItems: 1
>>>>>> +
>>>>>> +  reset-gpios:
>>>>>> +    description:
>>>>>> +      Active low signal to the AD5272 RESET input.
>>>>>
>>>>> Not a new problem, but active low or...
>>>>>
>>>>>> +
>>>>>> +additionalProperties: false
>>>>>> +
>>>>>> +required:
>>>>>> +  - compatible
>>>>>> +  - reg
>>>>>> +
>>>>>> +examples:
>>>>>> +  - |
>>>>>> +    #include <dt-bindings/gpio/gpio.h>
>>>>>> +    i2c {
>>>>>> +        #address-cells = <1>;
>>>>>> +        #size-cells = <0>;
>>>>>> +
>>>>>> +        potentiometer@2f {
>>>>>> +            compatible = "adi,ad5272-020";
>>>>>> +            reg = <0x2F>;
>>>>>> +            reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
>>>>>
>>>>> active high?
>>>>
>>>> Good spot!  @Phil.  Looks like the driver is setting the reset line to
>>>> 0 and then to 1 to come out of reset.   So effectively inverting the logic.
>>>> I'm tempted to be cynical and suggest we just drop the comment above and leave
>>>> it vague but is there a better way we can clarify this?
>>>
>>> Had a look at a few other iio drivers in regards how they handle the same thing.
>>> A few do the same thing, ie: the drivers are written to set gpio low to assert reset.
>>> So they need the device tree gpio config to be active high to work correctly.
>>> Not sure if this prevents users setting things up as open collector.
>>
>> The driver is wrong. 'gpiod_set_value(reset_gpio, 1);' should assert
>> reset as '1' here is set to (reset) active state as defined in the DT.
>>
>> Given no upstream users, maybe it can be fixed...
>>
>> We need to make 'reset-gpios' implemented by a reset controller and
>> stop letting drivers get it wrong.
>>
> 
> Yes I agree, the driver is wrong, think I just copied one of the other drivers for the pattern.
> I'd be happy to change it, there's probably few (if any) users.
> 
> Having a software interface to assert the reset would be nice.
> 
> 

If there's no comments against the change, I'll submit a patch in the next day or so.


-- 
Regards
Phil Reid



^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 29/46] dt-bindings:iio:adc:atmel,sama9260-adc: conversion to yaml from at91_adc.txt
  2020-10-31 18:48 ` [PATCH 29/46] dt-bindings:iio:adc:atmel,sama9260-adc: conversion to yaml from at91_adc.txt Jonathan Cameron
@ 2020-11-13  9:22   ` Alexandre Belloni
  2020-11-14 15:37     ` Jonathan Cameron
  0 siblings, 1 reply; 104+ messages in thread
From: Alexandre Belloni @ 2020-11-13  9:22 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio, Rob Herring, devicetree, Jonathan Cameron,
	Nicolas Ferre, Ludovic Desroches

On 31/10/2020 18:48:37+0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> This binding raises a few questions.
> 1) Do we need #address-cells and #size-cells as the child nodes don't have
>    a reg property?  A few dtsi files include these so if we drop the
>    requirement we will need to clean those up as well.

You can drop them.

> 2) Renamed to a specific part.  Given we have another at91 ADC binding
>    it is clear now this won't cover all at91 parts so lets name it
>    after a specific part.
> 3) For atmel,adc-res-names the description is a big vague.  Are other
>    resolution names allowed? We don't seem to have any currently.
> 

I had a look and this is a legacy mess, I'll send a fix soon.

> There are a few things we would do differently in an ADC binding if we
> were starting from scratch but we are stuck with what we have (which
> made sense back when this was written!)
> 
> We may be able to tighten up some elements of this binding in the future
> by careful checking of what values properties can actually take.
> 

Is there anything generic to select the resolution? I'll be happy to
remove atmel,adc-res-names, atmel,adc-res and atmel,adc-use-res as there
is no upstream users and the default is to use the highest resolution.


-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 29/46] dt-bindings:iio:adc:atmel,sama9260-adc: conversion to yaml from at91_adc.txt
  2020-11-13  9:22   ` Alexandre Belloni
@ 2020-11-14 15:37     ` Jonathan Cameron
  2020-11-22 18:09       ` Jonathan Cameron
  0 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-14 15:37 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: linux-iio, Rob Herring, devicetree, Jonathan Cameron,
	Nicolas Ferre, Ludovic Desroches

On Fri, 13 Nov 2020 10:22:05 +0100
Alexandre Belloni <alexandre.belloni@bootlin.com> wrote:

> On 31/10/2020 18:48:37+0000, Jonathan Cameron wrote:
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > 
> > This binding raises a few questions.
> > 1) Do we need #address-cells and #size-cells as the child nodes don't have
> >    a reg property?  A few dtsi files include these so if we drop the
> >    requirement we will need to clean those up as well.  
> 
> You can drop them.
> 
> > 2) Renamed to a specific part.  Given we have another at91 ADC binding
> >    it is clear now this won't cover all at91 parts so lets name it
> >    after a specific part.
> > 3) For atmel,adc-res-names the description is a big vague.  Are other
> >    resolution names allowed? We don't seem to have any currently.
> >   
> 
> I had a look and this is a legacy mess, I'll send a fix soon.
> 
> > There are a few things we would do differently in an ADC binding if we
> > were starting from scratch but we are stuck with what we have (which
> > made sense back when this was written!)
> > 
> > We may be able to tighten up some elements of this binding in the future
> > by careful checking of what values properties can actually take.
> >   
> 
> Is there anything generic to select the resolution? I'll be happy to
> remove atmel,adc-res-names, atmel,adc-res and atmel,adc-use-res as there
> is no upstream users and the default is to use the highest resolution.

Nothing currently defined.  I'm not against it if we have users though.

If it isn't actually useful in this case, even better to just drop it.

Jonathan


> 
> 


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion
  2020-11-09  2:56             ` Phil Reid
@ 2020-11-22 16:35               ` Jonathan Cameron
  2020-11-23 23:33                 ` Phil Reid
  0 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-22 16:35 UTC (permalink / raw)
  To: Phil Reid
  Cc: Rob Herring, Jonathan Cameron,
	open list:IIO SUBSYSTEM AND DRIVERS, devicetree

On Mon, 9 Nov 2020 10:56:47 +0800
Phil Reid <preid@electromag.com.au> wrote:

> On 4/11/2020 12:53, Phil Reid wrote:
> > On 4/11/2020 11:12, Rob Herring wrote:  
> >> On Tue, Nov 3, 2020 at 6:39 PM Phil Reid <preid@electromag.com.au> wrote:  
> >>>
> >>> On 4/11/2020 01:28, Jonathan Cameron wrote:  
> >>>> On Tue, 3 Nov 2020 10:10:39 -0600
> >>>> Rob Herring <robh@kernel.org> wrote:
> >>>>  
> >>>>> On Sat, Oct 31, 2020 at 06:48:10PM +0000, Jonathan Cameron wrote:  
> >>>>>> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >>>>>>
> >>>>>> Simple direct conversion from txt to yaml as part of a general aim of
> >>>>>> converting all IIO bindings to this machine readable format.
> >>>>>>
> >>>>>> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >>>>>> Cc: Phil Reid <preid@electromag.com.au>
> >>>>>> ---
> >>>>>>    .../bindings/iio/potentiometer/ad5272.txt     | 27 ----------
> >>>>>>    .../iio/potentiometer/adi,ad5272.yaml         | 50 +++++++++++++++++++
> >>>>>>    2 files changed, 50 insertions(+), 27 deletions(-)
> >>>>>>
> >>>>>> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt b/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
> >>>>>> deleted file mode 100644
> >>>>>> index f9b2eef946aa..000000000000
> >>>>>> --- a/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
> >>>>>> +++ /dev/null
> >>>>>> @@ -1,27 +0,0 @@
> >>>>>> -* Analog Devices AD5272 digital potentiometer
> >>>>>> -
> >>>>>> -The node for this device must be a child node of a I2C controller, hence
> >>>>>> -all mandatory properties for your controller must be specified. See directory:
> >>>>>> -
> >>>>>> -        Documentation/devicetree/bindings/i2c
> >>>>>> -
> >>>>>> -for more details.
> >>>>>> -
> >>>>>> -Required properties:
> >>>>>> -   - compatible:   Must be one of the following, depending on the model:
> >>>>>> -                   adi,ad5272-020
> >>>>>> -                   adi,ad5272-050
> >>>>>> -                   adi,ad5272-100
> >>>>>> -                   adi,ad5274-020
> >>>>>> -                   adi,ad5274-100
> >>>>>> -
> >>>>>> -Optional properties:
> >>>>>> - - reset-gpios: GPIO specification for the RESET input. This is an
> >>>>>> -           active low signal to the AD5272.
> >>>>>> -
> >>>>>> -Example:
> >>>>>> -ad5272: potentiometer@2f {
> >>>>>> -   reg = <0x2F>;
> >>>>>> -   compatible = "adi,ad5272-020";
> >>>>>> -   reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
> >>>>>> -};
> >>>>>> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml b/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
> >>>>>> new file mode 100644
> >>>>>> index 000000000000..b9b7d383bff1
> >>>>>> --- /dev/null
> >>>>>> +++ b/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
> >>>>>> @@ -0,0 +1,50 @@
> >>>>>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> >>>>>> +%YAML 1.2
> >>>>>> +---
> >>>>>> +$id: http://devicetree.org/schemas/iio/potentiometer/adi,ad5272.yaml#
> >>>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> >>>>>> +
> >>>>>> +title: Analog Devices AD5272 digital potentiometer
> >>>>>> +
> >>>>>> +maintainers:
> >>>>>> +  - Phil Reid <preid@electromag.com.au>
> >>>>>> +
> >>>>>> +description: |
> >>>>>> +  Datasheet: https://www.analog.com/en/products/ad5272.html
> >>>>>> +
> >>>>>> +properties:
> >>>>>> +  compatible:
> >>>>>> +    enum:
> >>>>>> +      - adi,ad5272-020
> >>>>>> +      - adi,ad5272-050
> >>>>>> +      - adi,ad5272-100
> >>>>>> +      - adi,ad5274-020
> >>>>>> +      - adi,ad5274-100
> >>>>>> +
> >>>>>> +  reg:
> >>>>>> +    maxItems: 1
> >>>>>> +
> >>>>>> +  reset-gpios:
> >>>>>> +    description:
> >>>>>> +      Active low signal to the AD5272 RESET input.  
> >>>>>
> >>>>> Not a new problem, but active low or...
> >>>>>  
> >>>>>> +
> >>>>>> +additionalProperties: false
> >>>>>> +
> >>>>>> +required:
> >>>>>> +  - compatible
> >>>>>> +  - reg
> >>>>>> +
> >>>>>> +examples:
> >>>>>> +  - |
> >>>>>> +    #include <dt-bindings/gpio/gpio.h>
> >>>>>> +    i2c {
> >>>>>> +        #address-cells = <1>;
> >>>>>> +        #size-cells = <0>;
> >>>>>> +
> >>>>>> +        potentiometer@2f {
> >>>>>> +            compatible = "adi,ad5272-020";
> >>>>>> +            reg = <0x2F>;
> >>>>>> +            reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;  
> >>>>>
> >>>>> active high?  
> >>>>
> >>>> Good spot!  @Phil.  Looks like the driver is setting the reset line to
> >>>> 0 and then to 1 to come out of reset.   So effectively inverting the logic.
> >>>> I'm tempted to be cynical and suggest we just drop the comment above and leave
> >>>> it vague but is there a better way we can clarify this?  
> >>>
> >>> Had a look at a few other iio drivers in regards how they handle the same thing.
> >>> A few do the same thing, ie: the drivers are written to set gpio low to assert reset.
> >>> So they need the device tree gpio config to be active high to work correctly.
> >>> Not sure if this prevents users setting things up as open collector.  
> >>
> >> The driver is wrong. 'gpiod_set_value(reset_gpio, 1);' should assert
> >> reset as '1' here is set to (reset) active state as defined in the DT.
> >>
> >> Given no upstream users, maybe it can be fixed...
> >>
> >> We need to make 'reset-gpios' implemented by a reset controller and
> >> stop letting drivers get it wrong.
> >>  
> > 
> > Yes I agree, the driver is wrong, think I just copied one of the other drivers for the pattern.
> > I'd be happy to change it, there's probably few (if any) users.
> > 
> > Having a software interface to assert the reset would be nice.
> > 
> >   
> 
> If there's no comments against the change, I'll submit a patch in the next day or so.
Hi Phil, 

So I've fixed the binding example up to have the sense as ACTIVE_LOW as discussed.
If you have time to flip the sense round in the driver to match that it
would be great and I'd propose we then mark that as suitable for stable
so that we get it backported into existing trees.  We could also spin
a patch to the txt binding but perhaps that is more effort than is needed
here.  If I get time before you do I might send a proposed fix patch.

Hopefully anyone then using it will get the sense right and we won't
accidentally break anyone.

At some point soon I'll also try and audit similar cases and hopefully we
will get those fixed up as well.  Obviously if anyone else wants to take
a look at that it would be much appreciated!

Thanks,

Jonathan


> 
> 


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 06/46] dt-bindings:iio:samsung,sensorhub-rinato: yaml conversion
  2020-10-31 18:48 ` [PATCH 06/46] dt-bindings:iio:samsung,sensorhub-rinato: " Jonathan Cameron
@ 2020-11-22 16:43   ` Jonathan Cameron
  0 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-22 16:43 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron

On Sat, 31 Oct 2020 18:48:14 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Renamed to be more specific as I would be surprised if this is the only
> sensorhub Samsung have ever shipped.
> Fixed missing reg property in the example
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Karol Wrona <k.wrona@samsung.com>

Karol's email address is bouncing so I've put myself as maintainer of this
binding.  I'm more than happy to hand it over to someone else if anyone
steps forward.

Applied to the togreg branch of iio.git and pushed out as test for
the autobuilders to possible poke at it.

Thanks,

Jonathan

> ---
>  .../iio/samsung,sensorhub-rinato.yaml         | 72 +++++++++++++++++++
>  .../devicetree/bindings/iio/sensorhub.txt     | 24 -------
>  2 files changed, 72 insertions(+), 24 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/samsung,sensorhub-rinato.yaml b/Documentation/devicetree/bindings/iio/samsung,sensorhub-rinato.yaml
> new file mode 100644
> index 000000000000..62366cbd37e5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/samsung,sensorhub-rinato.yaml
> @@ -0,0 +1,72 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/samsung,sensorhub-rinato.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Samsung Sensorhub driver
> +
> +maintainers:
> +  - Karol Wrona <k.wrona@samsung.com>
> +
> +description: |
> +  Sensorhub is a MCU which manages several sensors and also plays the role
> +  of a virtual sensor device.
> +
> +properties:
> +  compatible:
> +    enum:
> +      - samsung,sensorhub-rinato
> +      - samsung,sensorhub-thermostat
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  ap-mcu-gpios:
> +    maxItems: 1
> +    description:
> +      Application Processor to sensorhub line - used during communication
> +
> +  mcu-ap-gpios:
> +    maxItems: 1
> +    description:
> +      Sensorhub to Application Processor - used during communication
> +
> +  mcu-reset-gpios:
> +    maxItems: 1
> +    description:
> +      Reset the sensorhub.
> +
> +  spi-max-frequency: true
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - ap-mcu-gpios
> +  - mcu-ap-gpios
> +  - mcu-reset-gpios
> +
> +examples:
> +  - |
> +    spi {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        sensorhub@0 {
> +            compatible = "samsung,sensorhub-rinato";
> +            reg = <0>;
> +            spi-max-frequency = <5000000>;
> +            interrupt-parent = <&gpx0>;
> +            interrupts = <2 0>;
> +            ap-mcu-gpios = <&gpx0 0 0>;
> +            mcu-ap-gpios = <&gpx0 4 0>;
> +            mcu-reset-gpios = <&gpx0 5 0>;
> +        };
> +    };
> +...
> diff --git a/Documentation/devicetree/bindings/iio/sensorhub.txt b/Documentation/devicetree/bindings/iio/sensorhub.txt
> deleted file mode 100644
> index b6ac0457d4ea..000000000000
> --- a/Documentation/devicetree/bindings/iio/sensorhub.txt
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -Samsung Sensorhub driver
> -
> -Sensorhub is a MCU which manages several sensors and also plays the role
> -of a virtual sensor device.
> -
> -Required properties:
> -- compatible: "samsung,sensorhub-rinato" or "samsung,sensorhub-thermostat"
> -- spi-max-frequency: max SPI clock frequency
> -- interrupts: communication interrupt
> -- ap-mcu-gpios: [out] ap to sensorhub line - used during communication
> -- mcu-ap-gpios: [in] sensorhub to ap - used during communication
> -- mcu-reset-gpios: [out] sensorhub reset
> -
> -Example:
> -
> -	shub_spi: shub {
> -		compatible = "samsung,sensorhub-rinato";
> -		spi-max-frequency = <5000000>;
> -		interrupt-parent = <&gpx0>;
> -		interrupts = <2 0>;
> -		ap-mcu-gpios = <&gpx0 0 0>;
> -		mcu-ap-gpios = <&gpx0 4 0>;
> -		mcu-reset-gpios = <&gpx0 5 0>;
> -	};


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 09/46] dt-bindings:iio:health:maxim,max30100: txt to yaml conversion
  2020-10-31 21:41   ` Matt Ranostay
@ 2020-11-22 16:58     ` Jonathan Cameron
  2020-11-22 17:24       ` Jonathan Cameron
  0 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-22 16:58 UTC (permalink / raw)
  To: Matt Ranostay
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, Rob Herring, devicetree,
	Jonathan Cameron

On Sat, 31 Oct 2020 14:41:56 -0700
Matt Ranostay <matt.ranostay@konsulko.com> wrote:

> On Sat, Oct 31, 2020 at 11:51 AM Jonathan Cameron <jic23@kernel.org> wrote:
> >
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > Straight forward conversion. As with other bindings I've dropped
> > any standrd description, but kept the unusual bits, in thisscase
> > the maxim,led-current-microamp and it's description.
> >
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > ---
> >  .../bindings/iio/health/max30100.txt          | 28 ----------
> >  .../bindings/iio/health/maxim,max30100.yaml   | 52 +++++++++++++++++++
> >  2 files changed, 52 insertions(+), 28 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/iio/health/max30100.txt b/Documentation/devicetree/bindings/iio/health/max30100.txt
> > deleted file mode 100644
> > index 0054908a6e74..000000000000
> > --- a/Documentation/devicetree/bindings/iio/health/max30100.txt
> > +++ /dev/null
> > @@ -1,28 +0,0 @@
> > -Maxim MAX30100 heart rate and pulse oximeter sensor
> > -
> > -* https://datasheets.maximintegrated.com/en/ds/MAX30100.pdf
> > -
> > -Required properties:
> > -  - compatible: must be "maxim,max30100"
> > -  - reg: the I2C address of the sensor
> > -  - interrupts: the sole interrupt generated by the device
> > -
> > -  Refer to interrupt-controller/interrupts.txt for generic
> > -  interrupt client node bindings.
> > -
> > -Optional properties:
> > -  - maxim,led-current-microamp: configuration for LED current in microamperes
> > -    while the engine is running. First indexed value is the configuration for
> > -    the RED LED, and second value is for the IR LED.
> > -
> > -    Refer to the datasheet for the allowed current values.
> > -
> > -Example:
> > -
> > -max30100@57 {
> > -       compatible = "maxim,max30100";
> > -       reg = <0x57>;
> > -       maxim,led-current-microamp = <24000 50000>;
> > -       interrupt-parent = <&gpio1>;
> > -       interrupts = <16 2>;
> > -};
> > diff --git a/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml b/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml
> > new file mode 100644
> > index 000000000000..5684f2f61bcc
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml
> > @@ -0,0 +1,52 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/iio/health/maxim,max30100.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Maxim MAX30100 heart rate and pulse oximeter sensor
> > +
> > +maintainers:
> > +  - Matt Ranostay <mranostay@gmail.com>  
> 
> Please change to my Konsulko email, but otherwise LGTM
> 
> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Fixed and also dropped the $ref for the *microamp item below
as that's already covered by dt-schema as Rob pointed out for another
occurrence.

Applied to the togreg branch of iio.git and pushed out as testing for
all the normal reasons.

Thanks,

Jonathan

> 
> > +
> > +properties:
> > +  compatible:
> > +    const: maxim,max30100
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +    description: Connected to ADC_RDY pin.
> > +
> > +  maxim,led-current-microamp:
> > +    $ref: /schemas/types.yaml#/definitions/uint32-array
> > +    minItems: 2
> > +    maxItems: 2
> > +    description: |
> > +      LED current whilst the engine is running. First indexed value is
> > +      the configuration for the RED LED, and second value is for the IR LED.
> > +
> > +additionalProperties: false
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - interrupts
> > +
> > +examples:
> > +  - |
> > +    i2c {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        heart-rate@57 {
> > +            compatible = "maxim,max30100";
> > +            reg = <0x57>;
> > +            maxim,led-current-microamp = <24000 50000>;
> > +            interrupt-parent = <&gpio1>;
> > +            interrupts = <16 2>;
> > +        };
> > +    };
> > +...
> > --
> > 2.28.0
> >  


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 09/46] dt-bindings:iio:health:maxim,max30100: txt to yaml conversion
  2020-11-22 16:58     ` Jonathan Cameron
@ 2020-11-22 17:24       ` Jonathan Cameron
  0 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-22 17:24 UTC (permalink / raw)
  To: Matt Ranostay
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, Rob Herring, devicetree,
	Jonathan Cameron

On Sun, 22 Nov 2020 16:58:56 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> On Sat, 31 Oct 2020 14:41:56 -0700
> Matt Ranostay <matt.ranostay@konsulko.com> wrote:
> 
> > On Sat, Oct 31, 2020 at 11:51 AM Jonathan Cameron <jic23@kernel.org> wrote:  
> > >
> > > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > >
> > > Straight forward conversion. As with other bindings I've dropped
> > > any standrd description, but kept the unusual bits, in thisscase
> > > the maxim,led-current-microamp and it's description.
> > >
> > > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > > ---
> > >  .../bindings/iio/health/max30100.txt          | 28 ----------
> > >  .../bindings/iio/health/maxim,max30100.yaml   | 52 +++++++++++++++++++
> > >  2 files changed, 52 insertions(+), 28 deletions(-)
> > >
> > > diff --git a/Documentation/devicetree/bindings/iio/health/max30100.txt b/Documentation/devicetree/bindings/iio/health/max30100.txt
> > > deleted file mode 100644
> > > index 0054908a6e74..000000000000
> > > --- a/Documentation/devicetree/bindings/iio/health/max30100.txt
> > > +++ /dev/null
> > > @@ -1,28 +0,0 @@
> > > -Maxim MAX30100 heart rate and pulse oximeter sensor
> > > -
> > > -* https://datasheets.maximintegrated.com/en/ds/MAX30100.pdf
> > > -
> > > -Required properties:
> > > -  - compatible: must be "maxim,max30100"
> > > -  - reg: the I2C address of the sensor
> > > -  - interrupts: the sole interrupt generated by the device
> > > -
> > > -  Refer to interrupt-controller/interrupts.txt for generic
> > > -  interrupt client node bindings.
> > > -
> > > -Optional properties:
> > > -  - maxim,led-current-microamp: configuration for LED current in microamperes
> > > -    while the engine is running. First indexed value is the configuration for
> > > -    the RED LED, and second value is for the IR LED.
> > > -
> > > -    Refer to the datasheet for the allowed current values.
> > > -
> > > -Example:
> > > -
> > > -max30100@57 {
> > > -       compatible = "maxim,max30100";
> > > -       reg = <0x57>;
> > > -       maxim,led-current-microamp = <24000 50000>;
> > > -       interrupt-parent = <&gpio1>;
> > > -       interrupts = <16 2>;
> > > -};
> > > diff --git a/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml b/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml
> > > new file mode 100644
> > > index 000000000000..5684f2f61bcc
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml
> > > @@ -0,0 +1,52 @@
> > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/iio/health/maxim,max30100.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: Maxim MAX30100 heart rate and pulse oximeter sensor
> > > +
> > > +maintainers:
> > > +  - Matt Ranostay <mranostay@gmail.com>    
> > 
> > Please change to my Konsulko email, but otherwise LGTM
> > 
> > Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>  
> Fixed and also dropped the $ref for the *microamp item below
> as that's already covered by dt-schema as Rob pointed out for another
> occurrence.

I should really not send my replies at the same time as build tests are
running.   I've put the ref back in because without it I'm getting a build
warning.

maxim,max30100.example.dt.yaml: heart-rate@57: maxim,led-current-microamp: [[24000, 50000]] is too short

I assume that is because we have <24000, 50000> whereas it could have been
<24000>, <50000> but I don't get why having the ref to the same type
as implied by microamp doesn't work.

I've backed it out for now.   @Rob, what am I missing here?

I've applied it for now on basis that it can't do any harm, but would like to
understand what is going on here.

Thanks,

Jonathan
	
> 
> Applied to the togreg branch of iio.git and pushed out as testing for
> all the normal reasons.
> 
> Thanks,
> 
> Jonathan
> 
> >   
> > > +
> > > +properties:
> > > +  compatible:
> > > +    const: maxim,max30100
> > > +
> > > +  reg:
> > > +    maxItems: 1
> > > +
> > > +  interrupts:
> > > +    maxItems: 1
> > > +    description: Connected to ADC_RDY pin.
> > > +
> > > +  maxim,led-current-microamp:
> > > +    $ref: /schemas/types.yaml#/definitions/uint32-array
> > > +    minItems: 2
> > > +    maxItems: 2
> > > +    description: |
> > > +      LED current whilst the engine is running. First indexed value is
> > > +      the configuration for the RED LED, and second value is for the IR LED.
> > > +
> > > +additionalProperties: false
> > > +
> > > +required:
> > > +  - compatible
> > > +  - reg
> > > +  - interrupts
> > > +
> > > +examples:
> > > +  - |
> > > +    i2c {
> > > +        #address-cells = <1>;
> > > +        #size-cells = <0>;
> > > +
> > > +        heart-rate@57 {
> > > +            compatible = "maxim,max30100";
> > > +            reg = <0x57>;
> > > +            maxim,led-current-microamp = <24000 50000>;
> > > +            interrupt-parent = <&gpio1>;
> > > +            interrupts = <16 2>;
> > > +        };
> > > +    };
> > > +...
> > > --
> > > 2.28.0
> > >    
> 


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 10/46] dt-bindings:iio:health:maxim,max30102: txt to yaml conversion
  2020-10-31 21:38   ` Matt Ranostay
@ 2020-11-22 17:29     ` Jonathan Cameron
  0 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-22 17:29 UTC (permalink / raw)
  To: Matt Ranostay
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, Rob Herring, devicetree,
	Jonathan Cameron, Matt Ranostay

On Sat, 31 Oct 2020 14:38:29 -0700
Matt Ranostay <matt.ranostay@konsulko.com> wrote:

> On Sat, Oct 31, 2020 at 11:51 AM Jonathan Cameron <jic23@kernel.org> wrote:
> >
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > Straight forward binding.  Title was a bit of a challenge to keep short
> > as this binding covers sensors for two entirely different purposes.
> >
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Cc: Matt Ranostay <mranostay@gmail.com>
> > ---
> >  .../bindings/iio/health/max30102.txt          | 33 --------
> >  .../bindings/iio/health/maxim,max30102.yaml   | 75 +++++++++++++++++++
> >  2 files changed, 75 insertions(+), 33 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/iio/health/max30102.txt b/Documentation/devicetree/bindings/iio/health/max30102.txt
> > deleted file mode 100644
> > index 7ef7ae40ae4f..000000000000
> > --- a/Documentation/devicetree/bindings/iio/health/max30102.txt
> > +++ /dev/null
> > @@ -1,33 +0,0 @@
> > -Maxim MAX30102 heart rate and pulse oximeter sensor
> > -Maxim MAX30105 optical particle-sensing module
> > -
> > -* https://datasheets.maximintegrated.com/en/ds/MAX30102.pdf
> > -* https://datasheets.maximintegrated.com/en/ds/MAX30105.pdf
> > -
> > -Required properties:
> > -  - compatible: must be "maxim,max30102" or "maxim,max30105"
> > -  - reg: the I2C address of the sensor
> > -  - interrupts: the sole interrupt generated by the device
> > -
> > -  Refer to interrupt-controller/interrupts.txt for generic
> > -  interrupt client node bindings.
> > -
> > -Optional properties:
> > -  - maxim,red-led-current-microamp: configuration for red LED current
> > -  - maxim,ir-led-current-microamp: configuration for IR LED current
> > -  - maxim,green-led-current-microamp: configuration for green LED current
> > -    (max30105 only)
> > -
> > -    Note that each step is approximately 200 microamps, ranging from 0 uA to
> > -    50800 uA.
> > -
> > -Example:
> > -
> > -max30102@57 {
> > -       compatible = "maxim,max30102";
> > -       reg = <0x57>;
> > -       maxim,red-led-current-microamp = <7000>;
> > -       maxim,ir-led-current-microamp = <7000>;
> > -       interrupt-parent = <&gpio1>;
> > -       interrupts = <16 2>;
> > -};
> > diff --git a/Documentation/devicetree/bindings/iio/health/maxim,max30102.yaml b/Documentation/devicetree/bindings/iio/health/maxim,max30102.yaml
> > new file mode 100644
> > index 000000000000..67d40f4a91a7
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/health/maxim,max30102.yaml
> > @@ -0,0 +1,75 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/iio/health/maxim,max30102.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Maxim MAX30102 heart rate and pulse oximeter and MAX30105 particle-sensor
> > +
> > +maintainers:
> > +  - Matt Ranostay <mranostay@gmail.com>  
> 
> Change to my Konsulko email please, otherwise LGTM
> 
> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>

Done and this time I can drop the refs as per Rob's suggestion
as there isn't any interaction with minItems / maxItems.

Jonathan

> 
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - maxim,max30102
> > +      - maxim,max30105
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +    description: Connected to ADC_RDY pin.
> > +
> > +  maxim,red-led-current-microamp:
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    description: RED LED current. Each step is approximately 200 microamps.
> > +    minimum: 0
> > +    maximum: 50800
> > +
> > +  maxim,ir-led-current-microamp:
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    description: IR LED current. Each step is approximately 200 microamps.
> > +    minimum: 0
> > +    maximum: 50800
> > +
> > +  maxim,green-led-current-microamp:
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    description: Green LED current. Each step is approximately 200 microamps.
> > +    minimum: 0
> > +    maximum: 50800
> > +
> > +allOf:
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            const: maxim,max30100
> > +    then:
> > +      properties:
> > +        maxim,green-led-current-microamp: false
> > +
> > +additionalProperties: false
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - interrupts
> > +
> > +examples:
> > +  - |
> > +    i2c {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        heart-rate@57 {
> > +            compatible = "maxim,max30102";
> > +            reg = <0x57>;
> > +            maxim,red-led-current-microamp = <7000>;
> > +            maxim,ir-led-current-microamp = <7000>;
> > +            interrupt-parent = <&gpio1>;
> > +            interrupts = <16 2>;
> > +        };
> > +    };
> > +...
> > --
> > 2.28.0
> >  


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 07/46] dt-bindings:iio:health:ti,afe4403: txt to yaml binding
  2020-10-31 18:48 ` [PATCH 07/46] dt-bindings:iio:health:ti,afe4403: txt to yaml binding Jonathan Cameron
@ 2020-11-22 17:32   ` Jonathan Cameron
  2020-11-28 16:15     ` Jonathan Cameron
  0 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-22 17:32 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron

On Sat, 31 Oct 2020 18:48:15 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> A few questions came up whilst converting this one.
> 1) What is actually required?
>   - Checking Linux driver, interrupt is not, and the tx-supply could
>     be supplied by a stub regulator as long as it's always on.
>     As such I have reduced the required list to just compatible and reg.
> 2) What is the regulator called?
>   - It's tx-supply in the binding doc, but the driver request tx_sup
>     I've left this alone for now.  Andrew could you confirm what is
>     intended for this?

Andrew's email seems to be bouncing so I've reached out to him via another
means.  Will wait to see if that works before applying this or the next
patch given the questions.

Thanks,

Jonathan

> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Andrew F. Davis <afd@ti.com>
> ---
>  .../bindings/iio/health/afe4403.txt           | 33 ------------
>  .../bindings/iio/health/ti,afe4403.yaml       | 54 +++++++++++++++++++
>  2 files changed, 54 insertions(+), 33 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/health/afe4403.txt b/Documentation/devicetree/bindings/iio/health/afe4403.txt
> deleted file mode 100644
> index 8e412054d6d5..000000000000
> --- a/Documentation/devicetree/bindings/iio/health/afe4403.txt
> +++ /dev/null
> @@ -1,33 +0,0 @@
> -Texas Instruments AFE4403 Heart rate and Pulse Oximeter
> -
> -Required properties:
> - - compatible		: Should be "ti,afe4403".
> - - reg			: SPI chip select address of device.
> - - tx-supply		: Regulator supply to transmitting LEDs.
> - - interrupts		: The interrupt line the device ADC_RDY pin is
> -			  connected to. For details refer to,
> -			  ../../interrupt-controller/interrupts.txt.
> -
> -Optional properties:
> - - reset-gpios		: GPIO used to reset the device.
> -			  For details refer to, ../../gpio/gpio.txt.
> -
> -For other required and optional properties of SPI slave nodes
> -please refer to ../../spi/spi-bus.txt.
> -
> -Example:
> -
> -&spi0 {
> -	heart_mon@0 {
> -		compatible = "ti,afe4403";
> -		reg = <0>;
> -		spi-max-frequency = <10000000>;
> -
> -		tx-supply = <&vbat>;
> -
> -		interrupt-parent = <&gpio1>;
> -		interrupts = <28 IRQ_TYPE_EDGE_RISING>;
> -
> -		reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
> -	};
> -};
> diff --git a/Documentation/devicetree/bindings/iio/health/ti,afe4403.yaml b/Documentation/devicetree/bindings/iio/health/ti,afe4403.yaml
> new file mode 100644
> index 000000000000..5c86db65c033
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/health/ti,afe4403.yaml
> @@ -0,0 +1,54 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/health/ti,afe4403.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Texas Instruments AFE4403 Heart rate and Pulse Oximeter
> +
> +maintainers:
> +  - Andrew F. Davis <afd@ti.com>
> +
> +properties:
> +  compatible:
> +    const: ti,afe4403
> +
> +  reg:
> +    maxItems: 1
> +
> +  tx-supply:
> +    description: Supply to transmitting LEDs.
> +
> +  interrupts:
> +    maxItems: 1
> +    description: Connected to ADC_RDY pin.
> +
> +  reset-gpios: true
> +
> +  spi-max-frequency: true
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    spi {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        heart_mon@0 {
> +            compatible = "ti,afe4403";
> +            reg = <0>;
> +            spi-max-frequency = <10000000>;
> +            tx-supply = <&vbat>;
> +            interrupt-parent = <&gpio1>;
> +            interrupts = <28 IRQ_TYPE_EDGE_RISING>;
> +            reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
> +        };
> +    };
> +...


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 16/46] dt-bindings:iio:light:sharp,gp2ap020a00f: txt to yaml conversion.
  2020-10-31 18:48 ` [PATCH 16/46] dt-bindings:iio:light:sharp,gp2ap020a00f: " Jonathan Cameron
@ 2020-11-22 17:42   ` Jonathan Cameron
  0 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-22 17:42 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Kyungmin Park

On Sat, 31 Oct 2020 18:48:24 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Simple conversion.  Maintainers as per original binding file authors,
> but that was a long time back so as with others, if email addresses bounce
> I'll switch this to me.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Jacek Anaszewski <j.anaszewski@samsung.com>
Jacek's emails bouncing so dropped from maintainers.

Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to poke at it.

Thanks,

Jonathan

> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  .../bindings/iio/light/gp2ap020a00f.txt       | 21 --------
>  .../iio/light/sharp,gp2ap020a00f.yaml         | 49 +++++++++++++++++++
>  2 files changed, 49 insertions(+), 21 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/light/gp2ap020a00f.txt b/Documentation/devicetree/bindings/iio/light/gp2ap020a00f.txt
> deleted file mode 100644
> index 9231c82317ad..000000000000
> --- a/Documentation/devicetree/bindings/iio/light/gp2ap020a00f.txt
> +++ /dev/null
> @@ -1,21 +0,0 @@
> -* Sharp GP2AP020A00F I2C Proximity/ALS sensor
> -
> -The proximity detector sensor requires power supply
> -for its built-in led. It is also defined by this binding.
> -
> -Required properties:
> -
> -  - compatible : should be "sharp,gp2ap020a00f"
> -  - reg : the I2C slave address of the light sensor
> -  - interrupts : interrupt specifier for the sole interrupt generated
> -		 by the device
> -  - vled-supply : VLED power supply, as covered in ../regulator/regulator.txt
> -
> -Example:
> -
> -gp2ap020a00f@39 {
> -	compatible = "sharp,gp2ap020a00f";
> -	reg = <0x39>;
> -	interrupts = <2 0>;
> -	vled-supply = <...>;
> -};
> diff --git a/Documentation/devicetree/bindings/iio/light/sharp,gp2ap020a00f.yaml b/Documentation/devicetree/bindings/iio/light/sharp,gp2ap020a00f.yaml
> new file mode 100644
> index 000000000000..d6a4b47467f2
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/light/sharp,gp2ap020a00f.yaml
> @@ -0,0 +1,49 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/light/sharp,gp2ap020a00f.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Sharp GP2AP020A00F I2C Proximity/ALS sensor
> +
> +maintainers:
> +  - Jacek Anaszewski <j.anaszewski@samsung.com>
> +  - Kyungmin Park <kyungmin.park@samsung.com>
> +
> +description: |
> +  The proximity detector sensor requires power supply for its built-in led.
> +
> +properties:
> +  compatible:
> +    const: sharp,gp2ap020a00f
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  vled-supply: true
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - vled-supply
> +
> +examples:
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        light-sensor@39 {
> +            compatible = "sharp,gp2ap020a00f";
> +            reg = <0x39>;
> +            interrupts = <2 0>;
> +            vled-supply = <&als_reg>;
> +        };
> +    };
> +...


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 21/46] dt-bindings:iio:light:vishay,vcnl4035: txt to yaml conversion
  2020-10-31 18:48 ` [PATCH 21/46] dt-bindings:iio:light:vishay,vcnl4035: txt to yaml conversion Jonathan Cameron
@ 2020-11-22 17:52   ` Jonathan Cameron
  0 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-22 17:52 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron

On Sat, 31 Oct 2020 18:48:29 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Only significant change in here was dropping the statement that the
> i2c address should be 60.  The datasheet suggests there are variants
> available with several different addresses.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Parthiban Nallathambi <pn@denx.de>
Parithiban's email address is bouncing so for now I've put myself as maintainer.

Applied to the togreg branch of iio.git etc.

Thanks,

Jonathan

> ---
>  .../bindings/iio/light/vcnl4035.txt           | 18 --------
>  .../bindings/iio/light/vishay,vcnl4035.yaml   | 45 +++++++++++++++++++
>  2 files changed, 45 insertions(+), 18 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/light/vcnl4035.txt b/Documentation/devicetree/bindings/iio/light/vcnl4035.txt
> deleted file mode 100644
> index c07c7f052556..000000000000
> --- a/Documentation/devicetree/bindings/iio/light/vcnl4035.txt
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -VISHAY VCNL4035 -  Ambient Light and proximity sensor
> -
> -Link to datasheet: https://www.vishay.com/docs/84251/vcnl4035x01.pdf
> -
> -Required properties:
> -
> -	-compatible: should be "vishay,vcnl4035"
> -	-reg: I2C address of the sensor, should be 0x60
> -	-interrupts: interrupt mapping for GPIO IRQ (level active low)
> -
> -Example:
> -
> -light-sensor@60 {
> -	compatible = "vishay,vcnl4035";
> -	reg = <0x60>;
> -	interrupt-parent = <&gpio4>;
> -	interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
> -};
> diff --git a/Documentation/devicetree/bindings/iio/light/vishay,vcnl4035.yaml b/Documentation/devicetree/bindings/iio/light/vishay,vcnl4035.yaml
> new file mode 100644
> index 000000000000..e41c25817dd8
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/light/vishay,vcnl4035.yaml
> @@ -0,0 +1,45 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/light/vishay,vcnl4035.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: VISHAY VCNL4035 ambient Light and proximity sensor
> +
> +maintainers:
> +  - Parthiban Nallathambi <pn@denx.de>
> +
> +description: |
> +  Datasheet at https://www.vishay.com/docs/84251/vcnl4035x01.pdf
> +
> +properties:
> +  compatible:
> +    const: vishay,vcnl4035
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        light-sensor@60 {
> +            compatible = "vishay,vcnl4035";
> +            reg = <0x60>;
> +            interrupt-parent = <&gpio4>;
> +            interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
> +        };
> +    };
> +...


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 28/46] dt-bindings:iio:adc:atmel,sama5d2-adc: txt to yaml conversion
  2020-10-31 18:48 ` [PATCH 28/46] dt-bindings:iio:adc:atmel,sama5d2-adc: " Jonathan Cameron
@ 2020-11-22 18:07   ` Jonathan Cameron
  0 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-22 18:07 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree
  Cc: Jonathan Cameron, Ludovic Desroches, Eugen Hristev

On Sat, 31 Oct 2020 18:48:36 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Whilst this binding has a lot of elements they are all fairly standard.
> Hence pretty much direct txt to yaml line by line conversion.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Ludovic Desroches <ludovic.desroches@atmel.com>
> Cc: Eugen Hristev <eugen.hristev@microchip.com>
Applied with -hz and -ms $ref dropped as per Rob's suggestion.

Thanks,

Jonathan

> ---
>  .../bindings/iio/adc/at91-sama5d2_adc.txt     |  50 ---------
>  .../bindings/iio/adc/atmel,sama5d2-adc.yaml   | 104 ++++++++++++++++++
>  2 files changed, 104 insertions(+), 50 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/at91-sama5d2_adc.txt b/Documentation/devicetree/bindings/iio/adc/at91-sama5d2_adc.txt
> deleted file mode 100644
> index 07c59f301b31..000000000000
> --- a/Documentation/devicetree/bindings/iio/adc/at91-sama5d2_adc.txt
> +++ /dev/null
> @@ -1,50 +0,0 @@
> -* AT91 SAMA5D2 Analog to Digital Converter (ADC)
> -
> -Required properties:
> -  - compatible: Should be "atmel,sama5d2-adc" or "microchip,sam9x60-adc".
> -  - reg: Should contain ADC registers location and length.
> -  - interrupts: Should contain the IRQ line for the ADC.
> -  - clocks: phandle to device clock.
> -  - clock-names: Must be "adc_clk".
> -  - vref-supply: Supply used as reference for conversions.
> -  - vddana-supply: Supply for the adc device.
> -  - atmel,min-sample-rate-hz: Minimum sampling rate, it depends on SoC.
> -  - atmel,max-sample-rate-hz: Maximum sampling rate, it depends on SoC.
> -  - atmel,startup-time-ms: Startup time expressed in ms, it depends on SoC.
> -  - atmel,trigger-edge-type: One of possible edge types for the ADTRG hardware
> -  trigger pin. When the specific edge type is detected, the conversion will
> -  start. Possible values are rising, falling, or both.
> -  This property uses the IRQ edge types values: IRQ_TYPE_EDGE_RISING ,
> -  IRQ_TYPE_EDGE_FALLING or IRQ_TYPE_EDGE_BOTH
> -
> -Optional properties:
> -  - dmas: Phandle to dma channel for the ADC.
> -  - dma-names: Must be "rx" when dmas property is being used.
> -  See ../../dma/dma.txt for details.
> -  - #io-channel-cells: in case consumer drivers are attached, this must be 1.
> -  See <Documentation/devicetree/bindings/iio/iio-bindings.txt> for details.
> -
> -Properties for consumer drivers:
> -  - Consumer drivers can be connected to this producer device, as specified
> -  in <Documentation/devicetree/bindings/iio/iio-bindings.txt>
> -  - Channels exposed are specified in:
> -  <dt-bindings/iio/adc/at91-sama5d2_adc.txt>
> -
> -Example:
> -
> -adc: adc@fc030000 {
> -	compatible = "atmel,sama5d2-adc";
> -	reg = <0xfc030000 0x100>;
> -	interrupts = <40 IRQ_TYPE_LEVEL_HIGH 7>;
> -	clocks = <&adc_clk>;
> -	clock-names = "adc_clk";
> -	atmel,min-sample-rate-hz = <200000>;
> -	atmel,max-sample-rate-hz = <20000000>;
> -	atmel,startup-time-ms = <4>;
> -	vddana-supply = <&vdd_3v3_lp_reg>;
> -	vref-supply = <&vdd_3v3_lp_reg>;
> -	atmel,trigger-edge-type = <IRQ_TYPE_EDGE_BOTH>;
> -	dmas = <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) | AT91_XDMAC_DT_PERID(25))>;
> -	dma-names = "rx";
> -	#io-channel-cells = <1>;
> -}
> diff --git a/Documentation/devicetree/bindings/iio/adc/atmel,sama5d2-adc.yaml b/Documentation/devicetree/bindings/iio/adc/atmel,sama5d2-adc.yaml
> new file mode 100644
> index 000000000000..9b282c3ee8fb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/atmel,sama5d2-adc.yaml
> @@ -0,0 +1,104 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/adc/atmel,sama5d2-adc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: AT91 SAMA5D2 Analog to Digital Converter (ADC)
> +
> +maintainers:
> +  - Ludovic Desroches <ludovic.desroches@atmel.com>
> +  - Eugen Hristev <eugen.hristev@microchip.com>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - atmel,sama5d2-adc
> +      - microchip,sam9x60-adc
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +
> +  clock-names:
> +    const: adc_clk
> +
> +  vref-supply: true
> +  vddana-supply: true
> +
> +  atmel,min-sample-rate-hz:
> +    $ref: '/schemas/types.yaml#/definitions/uint32'
> +    description: Minimum sampling rate, it depends on SoC.
> +
> +  atmel,max-sample-rate-hz:
> +    $ref: '/schemas/types.yaml#/definitions/uint32'
> +    description: Maximum sampling rate, it depends on SoC.
> +
> +  atmel,startup-time-ms:
> +    $ref: '/schemas/types.yaml#/definitions/uint32'
> +    description: Startup time expressed in ms, it depends on SoC.
> +
> +  atmel,trigger-edge-type:
> +    $ref: '/schemas/types.yaml#/definitions/uint32'
> +    description:
> +      One of possible edge types for the ADTRG hardware trigger pin.
> +      When the specific edge type is detected, the conversion will
> +      start. Should be one of IRQ_TYPE_EDGE_RISING, IRQ_TYPE_EDGE_FALLING
> +      or IRQ_TYPE_EDGE_BOTH.
> +    enum: [1, 2, 3]
> +
> +  dmas:
> +    maxItems: 1
> +
> +  dma-names:
> +    const: rx
> +
> +  "#io-channel-cells":
> +    const: 1
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - clock-names
> +  - vref-supply
> +  - vddana-supply
> +  - atmel,min-sample-rate-hz
> +  - atmel,max-sample-rate-hz
> +  - atmel,startup-time-ms
> +  - atmel,trigger-edge-type
> +
> +examples:
> +  - |
> +    #include <dt-bindings/dma/at91.h>
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    soc {
> +        #address-cells = <1>;
> +        #size-cells = <1>;
> +
> +        adc@fc030000 {
> +            compatible = "atmel,sama5d2-adc";
> +            reg = <0xfc030000 0x100>;
> +            interrupts = <40 IRQ_TYPE_LEVEL_HIGH 7>;
> +            clocks = <&adc_clk>;
> +            clock-names = "adc_clk";
> +            atmel,min-sample-rate-hz = <200000>;
> +            atmel,max-sample-rate-hz = <20000000>;
> +            atmel,startup-time-ms = <4>;
> +            vddana-supply = <&vdd_3v3_lp_reg>;
> +            vref-supply = <&vdd_3v3_lp_reg>;
> +            atmel,trigger-edge-type = <IRQ_TYPE_EDGE_BOTH>;
> +            dmas = <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) | AT91_XDMAC_DT_PERID(25))>;
> +            dma-names = "rx";
> +            #io-channel-cells = <1>;
> +        };
> +    };
> +...


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 29/46] dt-bindings:iio:adc:atmel,sama9260-adc: conversion to yaml from at91_adc.txt
  2020-11-14 15:37     ` Jonathan Cameron
@ 2020-11-22 18:09       ` Jonathan Cameron
  0 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-22 18:09 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: linux-iio, Rob Herring, devicetree, Jonathan Cameron,
	Nicolas Ferre, Ludovic Desroches

On Sat, 14 Nov 2020 15:37:08 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> On Fri, 13 Nov 2020 10:22:05 +0100
> Alexandre Belloni <alexandre.belloni@bootlin.com> wrote:
> 
> > On 31/10/2020 18:48:37+0000, Jonathan Cameron wrote:  
> > > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > > 
> > > This binding raises a few questions.
> > > 1) Do we need #address-cells and #size-cells as the child nodes don't have
> > >    a reg property?  A few dtsi files include these so if we drop the
> > >    requirement we will need to clean those up as well.    
> > 
> > You can drop them.
> >   
> > > 2) Renamed to a specific part.  Given we have another at91 ADC binding
> > >    it is clear now this won't cover all at91 parts so lets name it
> > >    after a specific part.
> > > 3) For atmel,adc-res-names the description is a big vague.  Are other
> > >    resolution names allowed? We don't seem to have any currently.
> > >     
> > 
> > I had a look and this is a legacy mess, I'll send a fix soon.
> >   
> > > There are a few things we would do differently in an ADC binding if we
> > > were starting from scratch but we are stuck with what we have (which
> > > made sense back when this was written!)
> > > 
> > > We may be able to tighten up some elements of this binding in the future
> > > by careful checking of what values properties can actually take.
> > >     
> > 
> > Is there anything generic to select the resolution? I'll be happy to
> > remove atmel,adc-res-names, atmel,adc-res and atmel,adc-use-res as there
> > is no upstream users and the default is to use the highest resolution.  
> 
> Nothing currently defined.  I'm not against it if we have users though.
> 
> If it isn't actually useful in this case, even better to just drop it.
> 
> Jonathan
For reference in this thread, Alexandre has picked this on up as part of
his series cleaning up related stuff in the driver and bindings.

Thanks,

Jonathan

> 
> 
> > 
> >   
> 


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 31/46] dt-bindings:iio:adc:x-powers,axp209-adc: txt to yaml conversion
  2020-10-31 18:48 ` [PATCH 31/46] dt-bindings:iio:adc:x-powers,axp209-adc: " Jonathan Cameron
@ 2020-11-22 18:15   ` Jonathan Cameron
  2020-11-23  3:02     ` Chen-Yu Tsai
  0 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-22 18:15 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree
  Cc: Jonathan Cameron, Quentin Schulz, Chen-Yu Tsai

On Sat, 31 Oct 2020 18:48:39 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> This is a very small binding.  It might make sense at some stage
> to just roll it into the parent mfd.  For now, converted as is.
> The main advantage of this document is the identification of the
> channel index values when this is used as a provider of ADC channels
> to consumers.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Quentin Schulz <quentin.schulz@bootlin.com>
Quentin's email address is boucing so for now I've put myself as maintainer
of this binding.

+CC Chen-Yu Tsai who 'might' be the a better choice.

Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to poke at it.

Thanks,

Jonathan

> ---
>  .../bindings/iio/adc/axp20x_adc.txt           | 48 -------------
>  .../bindings/iio/adc/x-powers,axp209-adc.yaml | 67 +++++++++++++++++++
>  2 files changed, 67 insertions(+), 48 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt b/Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt
> deleted file mode 100644
> index 7a6313913923..000000000000
> --- a/Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt
> +++ /dev/null
> @@ -1,48 +0,0 @@
> -* X-Powers AXP ADC bindings
> -
> -Required properties:
> -  - compatible: should be one of:
> -    - "x-powers,axp209-adc",
> -    - "x-powers,axp221-adc",
> -    - "x-powers,axp813-adc",
> -  - #io-channel-cells: should be 1,
> -
> -Example:
> -
> -&axp22x {
> -	adc {
> -		compatible = "x-powers,axp221-adc";
> -		#io-channel-cells = <1>;
> -	};
> -};
> -
> -ADC channels and their indexes per variant:
> -
> -AXP209
> -------
> - 0 | acin_v
> - 1 | acin_i
> - 2 | vbus_v
> - 3 | vbus_i
> - 4 | pmic_temp
> - 5 | gpio0_v
> - 6 | gpio1_v
> - 7 | ipsout_v
> - 8 | batt_v
> - 9 | batt_chrg_i
> -10 | batt_dischrg_i
> -
> -AXP22x
> -------
> - 0 | pmic_temp
> - 1 | batt_v
> - 2 | batt_chrg_i
> - 3 | batt_dischrg_i
> -
> -AXP813
> -------
> - 0 | pmic_temp
> - 1 | gpio0_v
> - 2 | batt_v
> - 3 | batt_chrg_i
> - 4 | batt_dischrg_i
> diff --git a/Documentation/devicetree/bindings/iio/adc/x-powers,axp209-adc.yaml b/Documentation/devicetree/bindings/iio/adc/x-powers,axp209-adc.yaml
> new file mode 100644
> index 000000000000..288a5ac31a16
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/x-powers,axp209-adc.yaml
> @@ -0,0 +1,67 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/adc/x-powers,axp209-adc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: X-Powers AXP ADC bindings
> +
> +maintainers:
> +  - Quentin Schulz <quentin.schulz@bootlin.com>
> +
> +description: |
> +  ADC is frequently used as a provider to consumers of the ADC channels.
> +  Device is a child of an axp209 multifunction device
> +  ADC channels and their indexes per variant:
> +
> +  AXP209
> +  ------
> +   0 | acin_v
> +   1 | acin_i
> +   2 | vbus_v
> +   3 | vbus_i
> +   4 | pmic_temp
> +   5 | gpio0_v
> +   6 | gpio1_v
> +   7 | ipsout_v
> +   8 | batt_v
> +   9 | batt_chrg_i
> +  10 | batt_dischrg_i
> +
> +  AXP22x
> +  ------
> +   0 | pmic_temp
> +   1 | batt_v
> +   2 | batt_chrg_i
> +   3 | batt_dischrg_i
> +
> +  AXP813
> +  ------
> +   0 | pmic_temp
> +   1 | gpio0_v
> +   2 | batt_v
> +   3 | batt_chrg_i
> +   4 | batt_dischrg_i
> +
> +
> +properties:
> +  compatible:
> +    enum:
> +      - x-powers,axp209-adc
> +      - x-powers,axp221-adc
> +      - x-powers,axp813-adc
> +
> +  "#io-channel-cells":
> +    const: 1
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    axp221 {
> +        adc {
> +            compatible = "x-powers,axp221-adc";
> +            #io-channel-cells = <1>;
> +        };
> +    };
> +...


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 34/46] dt-bindings:iio:adc:ti,palmas-gpadc: txt to yaml format conversion.
  2020-10-31 18:48 ` [PATCH 34/46] dt-bindings:iio:adc:ti,palmas-gpadc: txt to yaml format conversion Jonathan Cameron
@ 2020-11-22 18:20   ` Jonathan Cameron
  0 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-22 18:20 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Tony Lindgren

On Sat, 31 Oct 2020 18:48:42 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Simple conversion of the binding doc for this subnode of the palmas
> PMIC.
> Given age of driver and lack interaction with original authors,
> I've guessed at Tony for a maintainer on this one.  Tony, if you
> are happy with that great, otherwise I can default back to myself.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Tony Lindgren <tony@atomide.com>
Applied.  @Tony, if you aren't happy being listed as maintainer for this
binding we can either fix that up before I send a pull request of if
necessary send a follow up patch.

Thanks,

Jonathan

> ---
>  .../bindings/iio/adc/palmas-gpadc.txt         | 48 ----------
>  .../bindings/iio/adc/ti,palmas-gpadc.yaml     | 87 +++++++++++++++++++
>  2 files changed, 87 insertions(+), 48 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/palmas-gpadc.txt b/Documentation/devicetree/bindings/iio/adc/palmas-gpadc.txt
> deleted file mode 100644
> index 4bb9a86065d1..000000000000
> --- a/Documentation/devicetree/bindings/iio/adc/palmas-gpadc.txt
> +++ /dev/null
> @@ -1,48 +0,0 @@
> -* Palmas general purpose ADC IP block devicetree bindings
> -
> -Channels list:
> -	0 battery type
> -	1 battery temp NTC (optional current source)
> -	2 GP
> -	3 temp (with ext. diode, optional current source)
> -	4 GP
> -	5 GP
> -	6 VBAT_SENSE
> -	7 VCC_SENSE
> -	8 Backup Battery voltage
> -	9 external charger (VCHG)
> -	10 VBUS
> -	11 DC-DC current probe (how does this work?)
> -	12 internal die temp
> -	13 internal die temp
> -	14 USB ID pin voltage
> -	15 test network
> -
> -Required properties:
> -- compatible : Must be "ti,palmas-gpadc".
> -- #io-channel-cells: Should be set to <1>.
> -
> -Optional sub-nodes:
> -ti,channel0-current-microamp: Channel 0 current in uA.
> -	Values are rounded to derive 0uA, 5uA, 15uA, 20uA.
> -ti,channel3-current-microamp: Channel 3 current in uA.
> -	Values are rounded to derive 0uA, 10uA, 400uA, 800uA.
> -ti,enable-extended-delay: Enable extended delay.
> -
> -Example:
> -
> -pmic {
> -	compatible = "ti,twl6035-pmic", "ti,palmas-pmic";
> -	...
> -	gpadc {
> -		compatible = "ti,palmas-gpadc";
> -		interrupts = <18 0
> -			      16 0
> -			      17 0>;
> -		#io-channel-cells = <1>;
> -		ti,channel0-current-microamp = <5>;
> -		ti,channel3-current-microamp = <10>;
> -		};
> -	};
> -	...
> -};
> diff --git a/Documentation/devicetree/bindings/iio/adc/ti,palmas-gpadc.yaml b/Documentation/devicetree/bindings/iio/adc/ti,palmas-gpadc.yaml
> new file mode 100644
> index 000000000000..692dacd0fee5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/ti,palmas-gpadc.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/ti,palmas-gpadc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Palmas general purpose ADC IP block devicetree bindings
> +
> +maintainers:
> +  - Tony Lindgren <tony@atomide.com>
> +
> +description: |
> +  This ADC is often used to provide channels via the io-channels
> +  consumer framework.
> +  Channels list:
> +    0 battery type
> +    1 battery temp NTC (optional current source)
> +    2 GP
> +    3 temp (with ext. diode, optional current source)
> +    4 GP
> +    5 GP
> +    6 VBAT_SENSE
> +    7 VCC_SENSE
> +    8 Backup Battery voltage
> +    9 external charger (VCHG)
> +    10 VBUS
> +    11 DC-DC current probe (how does this work?)
> +    12 internal die temp
> +    13 internal die temp
> +    14 USB ID pin voltage
> +    15 test network
> +
> +properties:
> +  compatible:
> +    const: ti,palmas-gpadc
> +
> +  interrupts:
> +    minItems: 1
> +    maxItems: 3
> +
> +  "#io-channel-cells":
> +    const: 1
> +
> +  ti,channel0-current-microamp:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: Channel 0 current in uA.
> +    enum:
> +      - 0
> +      - 5
> +      - 15
> +      - 20
> +
> +  ti,channel3-current-microamp:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: Channel 3 current in uA.
> +    enum:
> +      - 0
> +      - 10
> +      - 400
> +      - 800
> +
> +  ti,enable-extended-delay:
> +    $ref: /schemas/types.yaml#/definitions/flag
> +    description: Enable extended delay.
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - "#io-channel-cells"
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/mt8183-clk.h>
> +    pmic {
> +        compatible = "ti,twl6035-pmic", "ti,palmas-pmic";
> +        adc {
> +            compatible = "ti,palmas-gpadc";
> +            interrupts = <18 0
> +                          16 0
> +                          17 0>;
> +            #io-channel-cells = <1>;
> +            ti,channel0-current-microamp = <5>;
> +            ti,channel3-current-microamp = <10>;
> +        };
> +    };
> +...


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 36/46] dt-bindings:iio:adc:qcom,spmi-iadc: txt to yaml format conversion.
  2020-10-31 18:48 ` [PATCH 36/46] dt-bindings:iio:adc:qcom,spmi-iadc: txt to yaml format conversion Jonathan Cameron
@ 2020-11-22 18:25   ` Jonathan Cameron
  0 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-22 18:25 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron, Ivan T . Ivanov

On Sat, 31 Oct 2020 18:48:44 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Straight forward conversion.  Not heard from Ivan in a while so if the
> email bounces, I'll change the maintainer to myself for this binding unless
> anyone else comes forwards.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Ivan T. Ivanov <iivanov@mm-sol.com>
Ivan's email is bouncing, so I've put myself as temporary maintainer
on this one until someone else steps up.

Otherwise, dropped $ref for standard unit case -ohms as suggested by RobH.

Applied to the togreg branch of iio.git and pushed out as testing for
all the normal reasons.

Thanks,

Jonathan

> ---
>  .../bindings/iio/adc/qcom,spmi-iadc.txt       | 46 --------------
>  .../bindings/iio/adc/qcom,spmi-iadc.yaml      | 62 +++++++++++++++++++
>  2 files changed, 62 insertions(+), 46 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.txt b/Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.txt
> deleted file mode 100644
> index 4e36d6e2f7b6..000000000000
> --- a/Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.txt
> +++ /dev/null
> @@ -1,46 +0,0 @@
> -Qualcomm's SPMI PMIC current ADC
> -
> -QPNP PMIC current ADC (IADC) provides interface to clients to read current.
> -A 16 bit ADC is used for current measurements. IADC can measure the current
> -through an external resistor (channel 1) or internal (built-in) resistor
> -(channel 0). When using an external resistor it is to be described by
> -qcom,external-resistor-micro-ohms property.
> -
> -IADC node:
> -
> -- compatible:
> -    Usage: required
> -    Value type: <string>
> -    Definition: Should contain "qcom,spmi-iadc".
> -
> -- reg:
> -    Usage: required
> -    Value type: <prop-encoded-array>
> -    Definition: IADC base address and length in the SPMI PMIC register map
> -
> -- interrupts:
> -    Usage: optional
> -    Value type: <prop-encoded-array>
> -    Definition: End of ADC conversion.
> -
> -- qcom,external-resistor-micro-ohms:
> -    Usage: optional
> -    Value type: <u32>
> -    Definition: Sense resister value in micro Ohm.
> -                If not defined value of 10000 micro Ohms will be used.
> -
> -Example:
> -	/* IADC node */
> -	pmic_iadc: iadc@3600 {
> -		compatible = "qcom,spmi-iadc";
> -		reg = <0x3600 0x100>;
> -		interrupts = <0x0 0x36 0x0 IRQ_TYPE_EDGE_RISING>;
> -		qcom,external-resistor-micro-ohms = <10000>;
> -		#io-channel-cells  = <1>;
> -	};
> -
> -	/* IIO client node */
> -	bat {
> -		io-channels = <&pmic_iadc  0>;
> -		io-channel-names = "iadc";
> -	};
> diff --git a/Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.yaml b/Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.yaml
> new file mode 100644
> index 000000000000..359e1ede0ae2
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.yaml
> @@ -0,0 +1,62 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/adc/qcom,spmi-iadc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Qualcomm's SPMI PMIC current ADC
> +
> +maintainers:
> +  - Ivan T. Ivanov <iivanov@mm-sol.com>
> +
> +description: |
> +  QPNP PMIC current ADC (IADC) provides interface to clients to read current.
> +  A 16 bit ADC is used for current measurements. IADC can measure the current
> +  through an external resistor (channel 1) or internal (built-in) resistor
> +  (channel 0). When using an external resistor it is to be described by
> +  qcom,external-resistor-micro-ohms property.
> +
> +properties:
> +  compatible:
> +    const: qcom,spmi-iadc
> +
> +  reg:
> +    description: IADC base address and length in the SPMI PMIC register map
> +    maxItems: 1
> +
> +  qcom,external-resistor-micro-ohms:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      Sensor resistor value. If not defined value of 10000 micro Ohms
> +      will be used.
> +
> +  interrupts:
> +    maxItems: 1
> +    description:
> +      End of conversion interrupt.
> +
> +  "#io-channel-cells":
> +    const: 1
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    spmi_bus {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        pmic_iadc: adc@3600 {
> +            compatible = "qcom,spmi-iadc";
> +            reg = <0x3600 0x100>;
> +            interrupts = <0x0 0x36 0x0 IRQ_TYPE_EDGE_RISING>;
> +            qcom,external-resistor-micro-ohms = <10000>;
> +            #io-channel-cells  = <1>;
> +        };
> +    };
> +...
> +


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 38/46] dt-bindings:iio:dac:ad5592r: txt to yaml format conversion.
  2020-11-03 16:31   ` Rob Herring
@ 2020-11-22 18:38     ` Jonathan Cameron
  0 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-22 18:38 UTC (permalink / raw)
  To: Rob Herring; +Cc: linux-iio, devicetree, Jonathan Cameron, Michael Hennerich

On Tue, 3 Nov 2020 10:31:20 -0600
Rob Herring <robh@kernel.org> wrote:

> On Sat, Oct 31, 2020 at 06:48:46PM +0000, Jonathan Cameron wrote:
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > 
> > This is a more complex binding. Whilst conversion is straight forward
> > I am unsure if the full nature of required properties has been captured.
> > 
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Cc: Michael Hennerich <michael.hennerich@analog.com>
Tweaked as suggested by Rob and applied.

thanks,

Jonathan

> > ---
> >  .../devicetree/bindings/iio/dac/ad5592r.txt   | 155 --------------
> >  .../bindings/iio/dac/adi,ad5592r.yaml         | 201 ++++++++++++++++++
> >  2 files changed, 201 insertions(+), 155 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/dac/ad5592r.txt b/Documentation/devicetree/bindings/iio/dac/ad5592r.txt
> > deleted file mode 100644
> > index 989f96f31c66..000000000000
> > --- a/Documentation/devicetree/bindings/iio/dac/ad5592r.txt
> > +++ /dev/null
> > @@ -1,155 +0,0 @@
> > -Analog Devices AD5592R/AD5593R DAC/ADC device driver
> > -
> > -Required properties for the AD5592R:
> > -	- compatible: Must be "adi,ad5592r"
> > -	- reg: SPI chip select number for the device
> > -	- spi-max-frequency: Max SPI frequency to use (< 30000000)
> > -	- spi-cpol: The AD5592R requires inverse clock polarity (CPOL) mode
> > -
> > -Required properties for the AD5593R:
> > -	- compatible: Must be "adi,ad5593r"
> > -	- reg: I2C address of the device
> > -
> > -Required properties for all supported chips:
> > -	- #address-cells: Should be 1.
> > -	- #size-cells: Should be 0.
> > -	- channel nodes:
> > -	  Each child node represents one channel and has the following
> > -	  Required properties:
> > -		* reg: Pin on which this channel is connected to.
> > -		* adi,mode: Mode or function of this channel.
> > -			    Macros specifying the valid values
> > -			    can be found in <dt-bindings/iio/adi,ad5592r.h>.
> > -
> > -			    The following values are currently supported:
> > -				* CH_MODE_UNUSED (the pin is unused)
> > -				* CH_MODE_ADC (the pin is ADC input)
> > -				* CH_MODE_DAC (the pin is DAC output)
> > -				* CH_MODE_DAC_AND_ADC (the pin is DAC output
> > -					but can be monitored by an ADC, since
> > -					there is no disadvantage this
> > -					this should be considered as the
> > -					preferred DAC mode)
> > -				* CH_MODE_GPIO (the pin is registered
> > -					with GPIOLIB)
> > -	 Optional properties:
> > -		* adi,off-state: State of this channel when unused or the
> > -				 device gets removed. Macros specifying the
> > -				 valid values can be found in
> > -				 <dt-bindings/iio/adi,ad5592r.h>.
> > -
> > -				* CH_OFFSTATE_PULLDOWN (the pin is pulled down)
> > -				* CH_OFFSTATE_OUT_LOW  (the pin is output low)
> > -				* CH_OFFSTATE_OUT_HIGH (the pin is output high)
> > -				* CH_OFFSTATE_OUT_TRISTATE (the pin is
> > -					tristated output)
> > -
> > -
> > -Optional properties:
> > -	- vref-supply: Phandle to the external reference voltage supply. This should
> > -	  only be set if there is an external reference voltage connected to the VREF
> > -	  pin. If the property is not set the internal 2.5V reference is used.
> > -	- reset-gpios : GPIO spec for the RESET pin. If specified, it will be
> > -	  asserted during driver probe.
> > -	- gpio-controller: Marks the device node as a GPIO controller.
> > -	- #gpio-cells: Should be 2. The first cell is the GPIO number and the second
> > -	  cell specifies GPIO flags, as defined in <dt-bindings/gpio/gpio.h>.
> > -
> > -AD5592R Example:
> > -
> > -	#include <dt-bindings/iio/adi,ad5592r.h>
> > -
> > -	vref: regulator-vref {
> > -		compatible = "regulator-fixed";
> > -		regulator-name = "vref-ad559x";
> > -		regulator-min-microvolt = <3300000>;
> > -		regulator-max-microvolt = <3300000>;
> > -		regulator-always-on;
> > -	};
> > -
> > -	ad5592r@0 {
> > -		#size-cells = <0>;
> > -		#address-cells = <1>;
> > -		#gpio-cells = <2>;
> > -		compatible = "adi,ad5592r";
> > -		reg = <0>;
> > -
> > -		spi-max-frequency = <1000000>;
> > -		spi-cpol;
> > -
> > -		vref-supply = <&vref>; /* optional */
> > -		reset-gpios = <&gpio0 86 0>;  /* optional */
> > -		gpio-controller;
> > -
> > -		channel@0 {
> > -			reg = <0>;
> > -			adi,mode = <CH_MODE_DAC>;
> > -		};
> > -		channel@1 {
> > -			reg = <1>;
> > -			adi,mode = <CH_MODE_ADC>;
> > -		};
> > -		channel@2 {
> > -			reg = <2>;
> > -			adi,mode = <CH_MODE_DAC_AND_ADC>;
> > -		};
> > -		channel@3 {
> > -			reg = <3>;
> > -			adi,mode = <CH_MODE_DAC_AND_ADC>;
> > -			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> > -		};
> > -		channel@4 {
> > -			reg = <4>;
> > -			adi,mode = <CH_MODE_UNUSED>;
> > -			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> > -		};
> > -		channel@5 {
> > -			reg = <5>;
> > -			adi,mode = <CH_MODE_GPIO>;
> > -			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> > -		};
> > -		channel@6 {
> > -			reg = <6>;
> > -			adi,mode = <CH_MODE_GPIO>;
> > -			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> > -		};
> > -		channel@7 {
> > -			reg = <7>;
> > -			adi,mode = <CH_MODE_GPIO>;
> > -			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> > -		};
> > -	};
> > -
> > -AD5593R Example:
> > -
> > -	#include <dt-bindings/iio/adi,ad5592r.h>
> > -
> > -	ad5593r@10 {
> > -		#size-cells = <0>;
> > -		#address-cells = <1>;
> > -		#gpio-cells = <2>;
> > -		compatible = "adi,ad5593r";
> > -		reg = <0x10>;
> > -		gpio-controller;
> > -
> > -		channel@0 {
> > -			reg = <0>;
> > -			adi,mode = <CH_MODE_DAC>;
> > -			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> > -		};
> > -		channel@1 {
> > -			reg = <1>;
> > -			adi,mode = <CH_MODE_ADC>;
> > -			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> > -		};
> > -		channel@2 {
> > -			reg = <2>;
> > -			adi,mode = <CH_MODE_DAC_AND_ADC>;
> > -			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> > -		};
> > -		channel@6 {
> > -			reg = <6>;
> > -			adi,mode = <CH_MODE_GPIO>;
> > -			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
> > -		};
> > -	};
> > diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml
> > new file mode 100644
> > index 000000000000..c49646825c37
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml
> > @@ -0,0 +1,201 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/iio/dac/adi,ad5592r.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Analog Devices AD5592R/AD5593R DAC/ADC
> > +
> > +maintainers:
> > +  - Michael Hennerich <michael.hennerich@analog.com>
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - adi,ad5592r
> > +      - adi,ad5593r
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  spi-max-frequency:
> > +    maximum: 30000000
> > +
> > +  spi-cpol: true
> > +
> > +  "#address-cells":
> > +    const: 1
> > +
> > +  "#size-cells":
> > +    const: 0
> > +
> > +  "#io-channel-cells":
> > +    const: 1
> > +
> > +  vref-supply:
> > +    description: If not set internal 2.5V reference used.
> > +
> > +  reset-gpios:
> > +    maxItems: 1
> > +
> > +  gpio-controller:
> > +    description: Marks the device node as a GPIO controller.
> > +
> > +  "#gpio-cells":
> > +    const: 2
> > +    description:
> > +      The first cell is the GPIO number and the second cell specifies
> > +      GPIO flags, as defined in <dt-bindings/gpio/gpio.h>.
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - "#address-cells"
> > +  - "#size-cells"
> > +
> > +allOf:
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            const: adi,ad5592r
> > +    then:
> > +      required:
> > +        - spi-cpol
> > +    else:
> > +      properties:
> > +        spi-cpol: false
> > +
> > +additionalProperties: false
> > +
> > +patternProperties:
> > +  "^(channel@)[0-7]$":
> > +    type: object
> > +    description: Child node to describe a channel
> > +    properties:
> > +      reg:
> > +        maxItems: 1  
> 
> minimum: 0
> maximum: 7

Dropped the maxItems to avoid a resulting clash.

> 
> > +
> > +      adi,mode:
> > +        $ref: /schemas/types.yaml#/definitions/uint32
> > +        description: |
> > +          Mode or function of this channel.
> > +          Macros specifying the valid values can be found in
> > +          <dt-bindings/iio/adi,ad5592r.h>.
> > +
> > +          The following values are currently supported:
> > +          * CH_MODE_UNUSED (the pin is unused)
> > +          * CH_MODE_ADC (the pin is ADC input)
> > +          * CH_MODE_DAC (the pin is DAC output)
> > +          * CH_MODE_DAC_AND_ADC (the pin is DAC output but can be monitored
> > +            by an ADC, since there is no disadvantage this should be
> > +            considered as the preferred DAC mode)
> > +          * CH_MODE_GPIO (the pin is registered with GPIOLIB)  
> 
> Sounds like constraints.
indeed, made it an enum: [0, 1, 2 3, 8] to reflect values
> 
> > +
> > +      adi,off-state:
> > +        $ref: /schemas/types.yaml#/definitions/uint32
> > +        description: |
> > +          State of this channel when unused or the device gets removed.
> > +          Macros specifying the  valid values can be found in
> > +          <dt-bindings/iio/adi,ad5592r.h>.
> > +          * CH_OFFSTATE_PULLDOWN (the pin is pulled down)
> > +          * CH_OFFSTATE_OUT_LOW  (the pin is output low)
> > +          * CH_OFFSTATE_OUT_HIGH (the pin is output high)
> > +          * CH_OFFSTATE_OUT_TRISTATE (the pin is tristated output)  
> 
> Here too.
> 
Changed to an enum: [0, 1, 2, 3] to reflect underlying values.
 


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 39/46] dt-bindings:iio:dac:ad5755: txt to yaml format conversion.
  2020-11-03 16:32   ` Rob Herring
@ 2020-11-22 18:40     ` Jonathan Cameron
  2021-02-21 16:33       ` Jonathan Cameron
  0 siblings, 1 reply; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-22 18:40 UTC (permalink / raw)
  To: Rob Herring; +Cc: linux-iio, devicetree, Jonathan Cameron, Sean Nyekjaer

On Tue, 3 Nov 2020 10:32:37 -0600
Rob Herring <robh@kernel.org> wrote:

> On Sat, Oct 31, 2020 at 06:48:47PM +0000, Jonathan Cameron wrote:
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > 
> > Straight forward conversion.  Only fiddly bit is the XOR of
> > spi-cpol and spi-cpha.
> > 
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Cc: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
> > ---
> >  .../devicetree/bindings/iio/dac/ad5755.txt    | 124 ------------
> >  .../bindings/iio/dac/adi,ad5755.yaml          | 178 ++++++++++++++++++
> >  2 files changed, 178 insertions(+), 124 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/dac/ad5755.txt b/Documentation/devicetree/bindings/iio/dac/ad5755.txt
> > deleted file mode 100644
> > index 502e1e55adbd..000000000000
> > --- a/Documentation/devicetree/bindings/iio/dac/ad5755.txt
> > +++ /dev/null
> > @@ -1,124 +0,0 @@
> > -* Analog Devices AD5755 IIO Multi-Channel DAC Linux Driver
> > -
> > -Required properties:
> > - - compatible: Has to contain one of the following:
> > -	adi,ad5755
> > -	adi,ad5755-1
> > -	adi,ad5757
> > -	adi,ad5735
> > -	adi,ad5737
> > -
> > - - reg: spi chip select number for the device
> > - - spi-cpha or spi-cpol: is the only modes that is supported
> > -
> > -Recommended properties:
> > - - spi-max-frequency: Definition as per
> > -		Documentation/devicetree/bindings/spi/spi-bus.txt
> > -
> > -Optional properties:
> > -See include/dt-bindings/iio/ad5755.h
> > - - adi,ext-dc-dc-compenstation-resistor: boolean set if the hardware have an
> > -					 external resistor and thereby bypasses
> > -					 the internal compensation resistor.
> > - - adi,dc-dc-phase:
> > -	Valid values for DC DC Phase control is:
> > -	0: All dc-to-dc converters clock on the same edge.
> > -	1: Channel A and Channel B clock on the same edge,
> > -	   Channel C and Channel D clock on opposite edges.
> > -	2: Channel A and Channel C clock on the same edge,
> > -	   Channel B and Channel D clock on opposite edges.
> > -	3: Channel A, Channel B, Channel C, and Channel D
> > -	   clock 90 degrees out of phase from each other.
> > - - adi,dc-dc-freq-hz:
> > -	Valid values for DC DC frequency is [Hz]:
> > -	250000
> > -	410000
> > -	650000
> > - - adi,dc-dc-max-microvolt:
> > -	Valid values for the maximum allowed Vboost voltage supplied by
> > -	the dc-to-dc converter is:
> > -	23000000
> > -	24500000
> > -	27000000
> > -	29500000
> > -
> > -Optional for every channel:
> > - - adi,mode:
> > -	Valid values for DAC modes is:
> > -	0: 0 V to 5 V voltage range.
> > -	1: 0 V to 10 V voltage range.
> > -	2: Plus minus 5 V voltage range.
> > -	3: Plus minus 10 V voltage range.
> > -	4: 4 mA to 20 mA current range.
> > -	5: 0 mA to 20 mA current range.
> > -	6: 0 mA to 24 mA current range.
> > - - adi,ext-current-sense-resistor: boolean set if the hardware a external
> > -				   current sense resistor.
> > - - adi,enable-voltage-overrange: boolean enable voltage overrange
> > - - adi,slew: Array of slewrate settings should contain 3 fields:
> > -	1: Should be either 0 or 1 in order to enable or disable slewrate.
> > -	2: Slew rate settings:
> > -		Valid values for the slew rate update frequency:
> > -		64000
> > -		32000
> > -		16000
> > -		8000
> > -		4000
> > -		2000
> > -		1000
> > -		500
> > -		250
> > -		125
> > -		64
> > -		32
> > -		16
> > -		8
> > -		4
> > -		0
> > -	3: Slew step size:
> > -		Valid values for the step size LSBs:
> > -		1
> > -		2
> > -		4
> > -		16
> > -		32
> > -		64
> > -		128
> > -		256
> > -
> > -Example:
> > -dac@0 {
> > -	#address-cells = <1>;
> > -	#size-cells = <0>;
> > -	compatible = "adi,ad5755";
> > -	reg = <0>;
> > -	spi-max-frequency = <1000000>;
> > -	spi-cpha;
> > -	adi,dc-dc-phase = <0>;
> > -	adi,dc-dc-freq-hz = <410000>;
> > -	adi,dc-dc-max-microvolt = <23000000>;
> > -	channel@0 {
> > -		reg = <0>;
> > -		adi,mode = <4>;
> > -		adi,ext-current-sense-resistor;
> > -		adi,slew = <0 64000 1>;
> > -	};
> > -	channel@1 {
> > -		reg = <1>;
> > -		adi,mode = <4>;
> > -		adi,ext-current-sense-resistor;
> > -		adi,slew = <0 64000 1>;
> > -	};
> > -	channel@2 {
> > -		reg = <2>;
> > -		adi,mode = <4>;
> > -		adi,ext-current-sense-resistor;
> > -		adi,slew = <0 64000 1>;
> > -	};
> > -	channel@3 {
> > -		reg = <3>;
> > -		adi,mode = <4>;
> > -		adi,ext-current-sense-resistor;
> > -		adi,slew = <0 64000 1>;
> > -	};
> > -};
> > diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml
> > new file mode 100644
> > index 000000000000..74edff3e8408
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml
> > @@ -0,0 +1,178 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/iio/dac/adi,ad5755.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Analog Devices AD5755 Multi-Channel DAC
> > +
> > +maintainers:
> > +  - Sean Nyekjaer <sean.nyekjaer@prevas.dk>
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - adi,ad5755
> > +      - adi,ad5755-1
> > +      - adi,ad5757
> > +      - adi,ad5735
> > +      - adi,ad5737
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  spi-cpha:
> > +    description: Either this or spi-cpol but not both.
> > +  spi-cpol: true
> > +
> > +  spi-max-frequency: true
> > +
> > +  adi,ext-dc-dc-compenstation-resistor:
> > +    $ref: /schemas/types.yaml#/definitions/flag
> > +    description:
> > +      Set if the hardware have an external resistor and thereby bypasses
> > +      the internal compensation resistor.
> > +
> > +  adi,dc-dc-phase:
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    enum: [0, 1, 2, 3]
> > +    description: |
> > +      Valid values for DC DC Phase control is:
> > +      0: All dc-to-dc converters clock on the same edge.
> > +      1: Channel A and Channel B clock on the same edge,
> > +         Channel C and Channel D clock on opposite edges.
> > +      2: Channel A and Channel C clock on the same edge,
> > +         Channel B and Channel D clock on opposite edges.
> > +      3: Channel A, Channel B, Channel C, and Channel D
> > +         clock 90 degrees out of phase from each other.
> > +
> > +  adi,dc-dc-freq-hz:
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    enum: [250000, 410000, 650000]
> > +
> > +  adi,dc-dc-max-microvolt:
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    description:
> > +      Maximum allowed Vboost voltage supplied by the dc-to-dc converter.
> > +    enum: [23000000, 24500000, 27000000, 29500000]
> > +
> > +  "#address-cells":
> > +    const: 1
> > +
> > +  "#size-cells":
> > +    const: 0
> > +
> > +  "#io-channel-cells":
> > +    const: 1
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +
> > +additionalProperties: false
> > +
> > +patternProperties:
> > +  "^(channel@)[0-7]$":
> > +    type: object
> > +    description: Child node to describe a channel
> > +    properties:
> > +      reg:
> > +        maxItems: 1
> > +
> > +      adi,mode:
> > +        $ref: /schemas/types.yaml#/definitions/uint32
> > +        minimum: 0
> > +        maximum: 6
> > +        description: |
> > +          Valid values for DAC modes is:
> > +          0: 0 V to 5 V voltage range.
> > +          1: 0 V to 10 V voltage range.
> > +          2: Plus minus 5 V voltage range.
> > +          3: Plus minus 10 V voltage range.
> > +          4: 4 mA to 20 mA current range.
> > +          5: 0 mA to 20 mA current range.
> > +          6: 0 mA to 24 mA current range.
> > +
> > +      adi,ext-current-sense-resistor:
> > +        $ref: /schemas/types.yaml#/definitions/flag
> > +        description:
> > +          Set if the hardware has an external current sense resistor
> > +
> > +      adi,enable-voltage-overrange:
> > +        $ref: /schemas/types.yaml#/definitions/flag
> > +        description: Enable voltage overrange
> > +
> > +      adi,slew:
> > +        $ref: /schemas/types.yaml#/definitions/uint32-array
> > +        description: |
> > +          Array of slewrate settings should contain 3 fields:
> > +          1: Should be either 0 or 1 in order to enable or disable slewrate.
> > +          2: Slew rate update frequency
> > +          3: Slew step size
> > +        items:
> > +          - enum: [0, 1]
> > +          - enum: [64000, 32000, 16000, 8000, 4000, 2000, 1000, 500, 250, 125, 64, 32, 16, 8, 4, 0]
> > +          - enum: [1, 2, 4, 16, 32, 64, 128, 256]
> > +
> > +    required:
> > +      - reg
> > +
> > +    additionalProperties: false
> > +
> > +allOf:
> > +  - $ref: '#/definitions/cpolXORcpha'
> > +
> > +definitions:
> > +  cpolXORcpha:  
> 
> Like the other one, you can drop 'definitions'.

As replied to the other one I can't figure out a syntax that allows me to
do that.

Get an issues along the lines of

... iio/dac/ti,dac082s085.yaml: allOf:0: 'not' is not one of ['$ref', 'if', 'then', 'else']

(obviously that's form the other driver that does this).

Any suggestions much appreciated!

Thanks,

Jonathan


> 
> > +    not:
> > +      required: [spi-cpha, spi-cpol]
> > +    oneOf:
> > +      - required:
> > +          - spi-cpha
> > +      - required:
> > +          - spi-cpol
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/iio/adi,ad5592r.h>
> > +    spi {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        dac@0 {
> > +            #address-cells = <1>;
> > +            #size-cells = <0>;
> > +            compatible = "adi,ad5755";
> > +            reg = <0>;
> > +            spi-max-frequency = <1000000>;
> > +            spi-cpha;
> > +            adi,dc-dc-phase = <0>;
> > +            adi,dc-dc-freq-hz = <410000>;
> > +            adi,dc-dc-max-microvolt = <23000000>;
> > +            channel@0 {
> > +                reg = <0>;
> > +                adi,mode = <4>;
> > +                adi,ext-current-sense-resistor;
> > +                adi,slew = <0 64000 1>;
> > +            };
> > +            channel@1 {
> > +                reg = <1>;
> > +                adi,mode = <4>;
> > +                adi,ext-current-sense-resistor;
> > +                adi,slew = <0 64000 1>;
> > +            };
> > +            channel@2 {
> > +                reg = <2>;
> > +                adi,mode = <4>;
> > +                adi,ext-current-sense-resistor;
> > +                adi,slew = <0 64000 1>;
> > +            };
> > +            channel@3 {
> > +                reg = <3>;
> > +                adi,mode = <4>;
> > +                adi,ext-current-sense-resistor;
> > +                adi,slew = <0 64000 1>;
> > +            };
> > +        };
> > +    };
> > +...
> > -- 
> > 2.28.0
> >   


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 40/46] dt-bindings:iio:accel:bosch,bma180: txt to yaml format conversion.
  2020-10-31 18:48 ` [PATCH 40/46] dt-bindings:iio:accel:bosch,bma180: " Jonathan Cameron
@ 2020-11-22 18:44   ` Jonathan Cameron
  0 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-22 18:44 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron

On Sat, 31 Oct 2020 18:48:48 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> One question in here is whether we want to constrain the number of
> interrupts.  Some parts definitely only have 1 such pin, and others
> 2 pins but I can not find information on the bma254.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
Olkesandr's email address is bouncing so I've listed myself as maintainer
for now.

Applied.

Thanks,

Jonathan

> ---
>  .../devicetree/bindings/iio/accel/bma180.txt  | 35 -----------
>  .../bindings/iio/accel/bosch,bma180.yaml      | 62 +++++++++++++++++++
>  2 files changed, 62 insertions(+), 35 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/accel/bma180.txt b/Documentation/devicetree/bindings/iio/accel/bma180.txt
> deleted file mode 100644
> index 33da4a6fdb39..000000000000
> --- a/Documentation/devicetree/bindings/iio/accel/bma180.txt
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -* Bosch BMA023 / BMA150/ BMA180 / BMA25x / SMB380 triaxial acceleration sensor
> -
> -https://media.digikey.com/pdf/Data%20Sheets/Bosch/BMA150.pdf
> -http://omapworld.com/BMA180_111_1002839.pdf
> -http://ae-bst.resource.bosch.com/media/products/dokumente/bma250/bst-bma250-ds002-05.pdf
> -
> -Required properties:
> -
> -  - compatible : should be one of:
> -    "bosch,bma023"
> -    "bosch,bma150"
> -    "bosch,bma180"
> -    "bosch,bma250"
> -    "bosch,bma254"
> -    "bosch,smb380"
> -  - reg : the I2C address of the sensor
> -  - vdd-supply : regulator phandle connected to the VDD pin
> -  - vddio-supply : regulator phandle connected to the VDDIO pin
> -
> -Optional properties:
> -
> -  - interrupts : interrupt mapping for GPIO IRQ, it should by configured with
> -		flags IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING
> -		For the bma250 the first interrupt listed must be the one
> -		connected to the INT1 pin, the second (optional) interrupt
> -		listed must be the one connected to the INT2 pin.
> -
> -Example:
> -
> -bma180@40 {
> -	compatible = "bosch,bma180";
> -	reg = <0x40>;
> -	interrupt-parent = <&gpio6>;
> -	interrupts = <18 (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING)>;
> -};
> diff --git a/Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml b/Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml
> new file mode 100644
> index 000000000000..14e48290ffe3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml
> @@ -0,0 +1,62 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/accel/bosch,bma180.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Bosch BMA023 / BMA150/ BMA180 / BMA25x / SMB380 triaxial accelerometers
> +
> +maintainers:
> +  - Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
> +
> +description: |
> +  https://media.digikey.com/pdf/Data%20Sheets/Bosch/BMA150.pdf
> +  http://omapworld.com/BMA180_111_1002839.pdf
> +  http://ae-bst.resource.bosch.com/media/products/dokumente/bma250/bst-bma250-ds002-05.pdf
> +
> +properties:
> +  compatible:
> +    enum:
> +      - bosch,bma023
> +      - bosch,bma150
> +      - bosch,bma180
> +      - bosch,bma250
> +      - bosch,bma254
> +      - bosch,smb380
> +
> +  reg:
> +    maxItems: 1
> +
> +  vdd-supply: true
> +
> +  vddio-supply: true
> +
> +  interrupts:
> +    minItems: 1
> +    maxItems: 2
> +    description: |
> +      Type should be either IRQ_TYPE_LEVEL_HIGH or IRQ_TYPE_EDGE_RISING.
> +      For the bma250 the first interrupt listed must be the one
> +      connected to the INT1 pin, the second (optional) interrupt
> +      listed must be the one connected to the INT2 pin.
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        accel@40 {
> +            compatible = "bosch,bma180";
> +            reg = <0x40>;
> +            interrupt-parent = <&gpio6>;
> +            interrupts = <18 (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING)>;
> +        };
> +    };
> +...


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 42/46] dt-bindings:iio:accel:fsl,mma8452: txt to yaml conversion.
  2020-11-03 16:34   ` Rob Herring
@ 2020-11-22 18:50     ` Jonathan Cameron
  0 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-22 18:50 UTC (permalink / raw)
  To: Rob Herring; +Cc: linux-iio, devicetree, Jonathan Cameron, Martin Kepplinger

On Tue, 3 Nov 2020 10:34:07 -0600
Rob Herring <robh@kernel.org> wrote:

> On Sat, Oct 31, 2020 at 06:48:50PM +0000, Jonathan Cameron wrote:
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > 
> > Simple binding so mostly straight forward to convert.
> > Original binding was unclear on how many interrupts there are.
> > The device has two such lines, whilst I believe the driver currently
> > only uses one at a time.  The binding should allow both to be specified.
> > 
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Cc: Martin Kepplinger <martin.kepplinger@theobroma-systems.com>
> > ---
> >  .../bindings/iio/accel/fsl,mma8452.yaml       | 62 +++++++++++++++++++
> >  .../devicetree/bindings/iio/accel/mma8452.txt | 35 -----------
> >  2 files changed, 62 insertions(+), 35 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/accel/fsl,mma8452.yaml b/Documentation/devicetree/bindings/iio/accel/fsl,mma8452.yaml
> > new file mode 100644
> > index 000000000000..3b8e5ebdf90c
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/accel/fsl,mma8452.yaml
> > @@ -0,0 +1,62 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/iio/accel/fsl,mma8452.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title:
> > +  Freescale MMA8451Q, MMA8452Q, MMA8453Q, MMA8652FC, MMA8653FC or FXLS8471Q
> > +  triaxial accelerometer
> > +
> > +maintainers:
> > +  - Martin Kepplinger <martin.kepplinger@theobroma-systems.com>
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - fsl,mma8451
> > +      - fsl,mma8452
> > +      - fsl,mma8453
> > +      - fsl,mma8652
> > +      - fsl,mma8653
> > +      - fsl,fxls8471
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    description:
> > +      2 highly configurable interrupt lines exist.
> > +    minItems: 1
> > +    maxItems: 2
> > +
> > +  interrupt-names:
> > +    description: Specify which interrupt line is in use.
> > +    enum:
> > +      - INT1
> > +      - INT2  
> 
> This will default to only 1 item allowed. You need minItems/maxItems.
> 
Done, plus stuck the enum under an items: to avoid a build error.

Thanks,

Jonathan

> > +
> > +  vdd-supply: true
> > +  vddio-supply: true
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    i2c {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        accel@1d {
> > +            compatible = "fsl,mma8453";
> > +            reg = <0x1d>;
> > +            interrupt-parent = <&gpio1>;
> > +            interrupts = <5 0>;
> > +            interrupt-names = "INT2";
> > +        };
> > +    };
> > +...
> > diff --git a/Documentation/devicetree/bindings/iio/accel/mma8452.txt b/Documentation/devicetree/bindings/iio/accel/mma8452.txt
> > deleted file mode 100644
> > index e132394375a1..000000000000
> > --- a/Documentation/devicetree/bindings/iio/accel/mma8452.txt
> > +++ /dev/null
> > @@ -1,35 +0,0 @@
> > -Freescale MMA8451Q, MMA8452Q, MMA8453Q, MMA8652FC, MMA8653FC or FXLS8471Q
> > -triaxial accelerometer
> > -
> > -Required properties:
> > -
> > -  - compatible: should contain one of
> > -    * "fsl,mma8451"
> > -    * "fsl,mma8452"
> > -    * "fsl,mma8453"
> > -    * "fsl,mma8652"
> > -    * "fsl,mma8653"
> > -    * "fsl,fxls8471"
> > -
> > -  - reg: the I2C address of the chip
> > -
> > -Optional properties:
> > -
> > -  - interrupts: interrupt mapping for GPIO IRQ
> > -
> > -  - interrupt-names: should contain "INT1" and/or "INT2", the accelerometer's
> > -		     interrupt line in use.
> > -
> > -  - vdd-supply: phandle to the regulator that provides vdd power to the accelerometer.
> > -
> > -  - vddio-supply: phandle to the regulator that provides vddio power to the accelerometer.
> > -
> > -Example:
> > -
> > -	mma8453fc@1d {
> > -		compatible = "fsl,mma8453";
> > -		reg = <0x1d>;
> > -		interrupt-parent = <&gpio1>;
> > -		interrupts = <5 0>;
> > -		interrupt-names = "INT2";
> > -	};
> > -- 
> > 2.28.0
> >   


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions
  2020-11-03 17:24   ` Jonathan Cameron
@ 2020-11-22 18:59     ` Jonathan Cameron
  0 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-22 18:59 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Rob Herring, linux-iio, devicetree

On Tue, 3 Nov 2020 17:24:08 +0000
Jonathan Cameron <Jonathan.Cameron@Huawei.com> wrote:

> On Tue, 3 Nov 2020 10:38:00 -0600
> Rob Herring <robh@kernel.org> wrote:
> 
> > On Sat, Oct 31, 2020 at 06:48:08PM +0000, Jonathan Cameron wrote:  
> > > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > > 
> > > This set is basically all the stuff bindings where I couldn't come up
> > > with a unifying theme to split them out into smaller more palatble sets.
> > > 
> > > So there is all sorts in here :)  Enjoy.    
> > 
> > Thanks for filling my inbox... :)  
> Always happy to do that :)
> 
> I definitely recall you saying you liked to review them lots at a time.
> *evil laugh*
> 
> Thanks for ploughing through them so quickly.
> 
> Jonathan
> 
Quick status update on this series.

I've applied everything (with fixes as suggested and a few maintainers changed
due to bouncing emails) except:

7, 8 : Andrew's email is bouncing and there are questions open on differences
       between the binding and the driver so I've reached out to him via
       other means.

29:  Going as part of a difference series.

39:  XOR tricks and the question on what syntax will let me drop the definitions
     block as suggested as I can't figure it out! @Rob this is the same question
     raised on the other similar case.

I've applied 9, but couldn't make a simplification I thought should work so have
an open question on that one.

In the interests of making it easier to keep track of what is left, I may well
just pull all the remaining patches from my various series into a single one
one which we can address outstanding questions.  Still a few more to catch up
on before I can do that however!

Thanks,

Jonathan


> 
> >   
> > > There are a few more binding files left after these are done.
> > > * io-channel-mux:  Needs conversion of the mux subsystem bindings
> > > * xilinx-xadc: I think Lars is working on this one already.
> > > * lis302: This one got moved to IIO directory, but reflects a bunch of stuff
> > >   that would not have made it into an IIO binding.  The driver is still in
> > >   misc and in theory has been replaced by the st-sensors driver.
> > >   Need to think what to do about this one.
> > > * mount-matrix.txt:  The binding part is under review for inclusion in
> > >   dt-schema rather than kernel tree, but this document has a wealth of
> > >   information we don't want hidden away there.  As such I'm probably
> > >   going to convert it to general kernel documentation.
> > > 
> > > Final patch in here drops the generic temperatures sensor binding.
> > > Whilst I'm keen on that we only currently have one user.  So I'd
> > > rather we had a second before we went to the effort of defining a
> > > proper yaml binding for that.
> > > 
> > > Jonathan Cameron (46):
> > >   dt-bindings:iio:resolver:adi,ad2s90: Conversion of binding to yaml.
> > >   dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion
> > >   dt-bindings:iio:potentiometer:microchip,mcp4131 txt to yaml conversion
> > >   dt-bindings:iio:potentiometer:microchip,mcp41010 txt to yaml
> > >     conversion
> > >   dt-bindings:iio:impedance-analyzer:adi,ad5933 yaml conversion.
> > >   dt-bindings:iio:samsung,sensorhub-rinato: yaml conversion
> > >   dt-bindings:iio:health:ti,afe4403: txt to yaml binding
> > >   dt-bindings:iio:health:ti,afe4404: txt to yaml conversion
> > >   dt-bindings:iio:health:maxim,max30100: txt to yaml conversion
> > >   dt-bindings:iio:health:maxim,max30102: txt to yaml conversion
> > >   dt-bindings:iio:imu:adi,adis16480: txt to yaml conversion
> > >   dt-bindings:iio:imu:st,lsm6dsx: txt to yaml conversion
> > >   dt-bindings:iio:light:avago,apds9300: txt to yaml conversion.
> > >   dt-bindings:iio:light:avago,apds9960: txt to yaml conversion
> > >   dt-bindings:iio:light:capella,cm36651: txt to yaml conversion.
> > >   dt-bindings:iio:light:sharp,gp2ap020a00f: txt to yaml conversion.
> > >   dt-bindings:iio:light:maxim,max44009: txt to yaml conversion.
> > >   dt-bindings:iio:light:ti,opt3001: txt to yaml conversion
> > >   dt-bindings:iio:light:upisemi,us51882: txt to yaml conversion.
> > >   dt-bindings:iio:light:st,uvis25: txt to yaml conversion for this UV
> > >     sensor
> > >   dt-bindings:iio:light:vishay,vcnl4035: txt to yaml conversion
> > >   dt-bindings:iio:light:st,vl6180: txt to yaml format conversion.
> > >   dt-bindings:iio:magnetometer:fsl,mag3110: txt to yaml conversion
> > >   dt-bindings:iio:magnetometer:asahi-kasei,ak8974: txt to yaml format
> > >     conversion
> > >   dt-bindings:iio:magnetometer:bosch,bmc150_magn: txt to yaml
> > >     conversion.
> > >   dt-bindings:iio:magnetometer:honeywell,hmc5843: txt to yaml format
> > >     conversion
> > >   dt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion.
> > >   dt-bindings:iio:adc:atmel,sama5d2-adc: txt to yaml conversion
> > >   dt-bindings:iio:adc:atmel,sama9260-adc: conversion to yaml from
> > >     at91_adc.txt
> > >   dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion.
> > >   dt-bindings:iio:adc:x-powers,axp209-adc: txt to yaml conversion
> > >   dt-bindings:iio:adc:brcm,iproc-static-adc: txt to yaml conversion
> > >   dt-bindings:iio:adc:mediatek,mt2701-auxadc: rename and yaml
> > >     conversion.
> > >   dt-bindings:iio:adc:ti,palmas-gpadc: txt to yaml format conversion.
> > >   dt-bindings:iio:adc:qcom,pm8018-adc: yaml conversion and rename.
> > >   dt-bindings:iio:adc:qcom,spmi-iadc: txt to yaml format conversion.
> > >   dt-binding:iio:adc:ti,ads124s08: txt to yaml format conversion.
> > >   dt-bindings:iio:dac:ad5592r: txt to yaml format conversion.
> > >   dt-bindings:iio:dac:ad5755: txt to yaml format conversion.
> > >   dt-bindings:iio:accel:bosch,bma180: txt to yaml format conversion.
> > >   dt-bindings:iio:accel:kionix,kxcjk1013: txt to yaml format conversion.
> > >   dt-bindings:iio:accel:fsl,mma8452: txt to yaml conversion.
> > >   dt-bindings:iio:gyro:bosch,bmg180: txt to yaml format conversion.
> > >   dt-bindings:iio:st,st-sensors: txt to yaml conversion.
> > >   dt-bindings:iio:frequency:adi,adf4350: txt to yaml format conversion.
> > >   dt-bindings:iio:temperature: Drop generic binding file.    
> > 
> > There's more standard unit properties you can drop the type $ref on and 
> > a the couple of nits I raised. With those fixed,
> > 
> > Reviewed-by: Rob Herring <robh@kernel.org>  
> 
> Great.  Thanks again,
> 
> Jonathan
> 


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 31/46] dt-bindings:iio:adc:x-powers,axp209-adc: txt to yaml conversion
  2020-11-22 18:15   ` Jonathan Cameron
@ 2020-11-23  3:02     ` Chen-Yu Tsai
  2020-11-23 20:36       ` Jonathan Cameron
  0 siblings, 1 reply; 104+ messages in thread
From: Chen-Yu Tsai @ 2020-11-23  3:02 UTC (permalink / raw)
  To: jic23
  Cc: linux-iio, Rob Herring, devicetree, Jonathan Cameron, Quentin Schulz

Hi,

On Mon, Nov 23, 2020 at 2:22 AM Jonathan Cameron
<jic23@jic23.retrosnub.co.uk> wrote:
>
> On Sat, 31 Oct 2020 18:48:39 +0000
> Jonathan Cameron <jic23@kernel.org> wrote:
>
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > This is a very small binding.  It might make sense at some stage
> > to just roll it into the parent mfd.  For now, converted as is.
> > The main advantage of this document is the identification of the
> > channel index values when this is used as a provider of ADC channels
> > to consumers.
> >
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Cc: Quentin Schulz <quentin.schulz@bootlin.com>
> Quentin's email address is boucing so for now I've put myself as maintainer
> of this binding.
>
> +CC Chen-Yu Tsai who 'might' be the a better choice.

Yes you can list me as the maintainer if you yourself don't wish to be.
I am listed as the maintainer for all AXP hardware, excluding the AXP288.

ChenYu


> Applied to the togreg branch of iio.git and pushed out as testing for
> the autobuilders to poke at it.
>
> Thanks,
>
> Jonathan
>
> > ---
> >  .../bindings/iio/adc/axp20x_adc.txt           | 48 -------------
> >  .../bindings/iio/adc/x-powers,axp209-adc.yaml | 67 +++++++++++++++++++
> >  2 files changed, 67 insertions(+), 48 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt b/Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt
> > deleted file mode 100644
> > index 7a6313913923..000000000000
> > --- a/Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt
> > +++ /dev/null
> > @@ -1,48 +0,0 @@
> > -* X-Powers AXP ADC bindings
> > -
> > -Required properties:
> > -  - compatible: should be one of:
> > -    - "x-powers,axp209-adc",
> > -    - "x-powers,axp221-adc",
> > -    - "x-powers,axp813-adc",
> > -  - #io-channel-cells: should be 1,
> > -
> > -Example:
> > -
> > -&axp22x {
> > -     adc {
> > -             compatible = "x-powers,axp221-adc";
> > -             #io-channel-cells = <1>;
> > -     };
> > -};
> > -
> > -ADC channels and their indexes per variant:
> > -
> > -AXP209
> > -------
> > - 0 | acin_v
> > - 1 | acin_i
> > - 2 | vbus_v
> > - 3 | vbus_i
> > - 4 | pmic_temp
> > - 5 | gpio0_v
> > - 6 | gpio1_v
> > - 7 | ipsout_v
> > - 8 | batt_v
> > - 9 | batt_chrg_i
> > -10 | batt_dischrg_i
> > -
> > -AXP22x
> > -------
> > - 0 | pmic_temp
> > - 1 | batt_v
> > - 2 | batt_chrg_i
> > - 3 | batt_dischrg_i
> > -
> > -AXP813
> > -------
> > - 0 | pmic_temp
> > - 1 | gpio0_v
> > - 2 | batt_v
> > - 3 | batt_chrg_i
> > - 4 | batt_dischrg_i
> > diff --git a/Documentation/devicetree/bindings/iio/adc/x-powers,axp209-adc.yaml b/Documentation/devicetree/bindings/iio/adc/x-powers,axp209-adc.yaml
> > new file mode 100644
> > index 000000000000..288a5ac31a16
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/adc/x-powers,axp209-adc.yaml
> > @@ -0,0 +1,67 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/iio/adc/x-powers,axp209-adc.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: X-Powers AXP ADC bindings
> > +
> > +maintainers:
> > +  - Quentin Schulz <quentin.schulz@bootlin.com>
> > +
> > +description: |
> > +  ADC is frequently used as a provider to consumers of the ADC channels.
> > +  Device is a child of an axp209 multifunction device
> > +  ADC channels and their indexes per variant:
> > +
> > +  AXP209
> > +  ------
> > +   0 | acin_v
> > +   1 | acin_i
> > +   2 | vbus_v
> > +   3 | vbus_i
> > +   4 | pmic_temp
> > +   5 | gpio0_v
> > +   6 | gpio1_v
> > +   7 | ipsout_v
> > +   8 | batt_v
> > +   9 | batt_chrg_i
> > +  10 | batt_dischrg_i
> > +
> > +  AXP22x
> > +  ------
> > +   0 | pmic_temp
> > +   1 | batt_v
> > +   2 | batt_chrg_i
> > +   3 | batt_dischrg_i
> > +
> > +  AXP813
> > +  ------
> > +   0 | pmic_temp
> > +   1 | gpio0_v
> > +   2 | batt_v
> > +   3 | batt_chrg_i
> > +   4 | batt_dischrg_i
> > +
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - x-powers,axp209-adc
> > +      - x-powers,axp221-adc
> > +      - x-powers,axp813-adc
> > +
> > +  "#io-channel-cells":
> > +    const: 1
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    axp221 {
> > +        adc {
> > +            compatible = "x-powers,axp221-adc";
> > +            #io-channel-cells = <1>;
> > +        };
> > +    };
> > +...
>

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 31/46] dt-bindings:iio:adc:x-powers,axp209-adc: txt to yaml conversion
  2020-11-23  3:02     ` Chen-Yu Tsai
@ 2020-11-23 20:36       ` Jonathan Cameron
  0 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-23 20:36 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: linux-iio, Rob Herring, devicetree, Jonathan Cameron, Quentin Schulz

On Mon, 23 Nov 2020 11:02:58 +0800
Chen-Yu Tsai <wens@csie.org> wrote:

> Hi,
> 
> On Mon, Nov 23, 2020 at 2:22 AM Jonathan Cameron
> <jic23@jic23.retrosnub.co.uk> wrote:
> >
> > On Sat, 31 Oct 2020 18:48:39 +0000
> > Jonathan Cameron <jic23@kernel.org> wrote:
> >  
> > > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > >
> > > This is a very small binding.  It might make sense at some stage
> > > to just roll it into the parent mfd.  For now, converted as is.
> > > The main advantage of this document is the identification of the
> > > channel index values when this is used as a provider of ADC channels
> > > to consumers.
> > >
> > > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > > Cc: Quentin Schulz <quentin.schulz@bootlin.com>  
> > Quentin's email address is boucing so for now I've put myself as maintainer
> > of this binding.
> >
> > +CC Chen-Yu Tsai who 'might' be the a better choice.  
> 
> Yes you can list me as the maintainer if you yourself don't wish to be.
> I am listed as the maintainer for all AXP hardware, excluding the AXP288.
> 
Great thanks - you are more likely to be able to answer questions on this
than I am so I've put you in as maintainer + I'll get them anyway
as IIO maintainer :)

Jonathan

> ChenYu
> 
> 
> > Applied to the togreg branch of iio.git and pushed out as testing for
> > the autobuilders to poke at it.
> >
> > Thanks,
> >
> > Jonathan
> >  
> > > ---
> > >  .../bindings/iio/adc/axp20x_adc.txt           | 48 -------------
> > >  .../bindings/iio/adc/x-powers,axp209-adc.yaml | 67 +++++++++++++++++++
> > >  2 files changed, 67 insertions(+), 48 deletions(-)
> > >
> > > diff --git a/Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt b/Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt
> > > deleted file mode 100644
> > > index 7a6313913923..000000000000
> > > --- a/Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt
> > > +++ /dev/null
> > > @@ -1,48 +0,0 @@
> > > -* X-Powers AXP ADC bindings
> > > -
> > > -Required properties:
> > > -  - compatible: should be one of:
> > > -    - "x-powers,axp209-adc",
> > > -    - "x-powers,axp221-adc",
> > > -    - "x-powers,axp813-adc",
> > > -  - #io-channel-cells: should be 1,
> > > -
> > > -Example:
> > > -
> > > -&axp22x {
> > > -     adc {
> > > -             compatible = "x-powers,axp221-adc";
> > > -             #io-channel-cells = <1>;
> > > -     };
> > > -};
> > > -
> > > -ADC channels and their indexes per variant:
> > > -
> > > -AXP209
> > > -------
> > > - 0 | acin_v
> > > - 1 | acin_i
> > > - 2 | vbus_v
> > > - 3 | vbus_i
> > > - 4 | pmic_temp
> > > - 5 | gpio0_v
> > > - 6 | gpio1_v
> > > - 7 | ipsout_v
> > > - 8 | batt_v
> > > - 9 | batt_chrg_i
> > > -10 | batt_dischrg_i
> > > -
> > > -AXP22x
> > > -------
> > > - 0 | pmic_temp
> > > - 1 | batt_v
> > > - 2 | batt_chrg_i
> > > - 3 | batt_dischrg_i
> > > -
> > > -AXP813
> > > -------
> > > - 0 | pmic_temp
> > > - 1 | gpio0_v
> > > - 2 | batt_v
> > > - 3 | batt_chrg_i
> > > - 4 | batt_dischrg_i
> > > diff --git a/Documentation/devicetree/bindings/iio/adc/x-powers,axp209-adc.yaml b/Documentation/devicetree/bindings/iio/adc/x-powers,axp209-adc.yaml
> > > new file mode 100644
> > > index 000000000000..288a5ac31a16
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/iio/adc/x-powers,axp209-adc.yaml
> > > @@ -0,0 +1,67 @@
> > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/iio/adc/x-powers,axp209-adc.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: X-Powers AXP ADC bindings
> > > +
> > > +maintainers:
> > > +  - Quentin Schulz <quentin.schulz@bootlin.com>
> > > +
> > > +description: |
> > > +  ADC is frequently used as a provider to consumers of the ADC channels.
> > > +  Device is a child of an axp209 multifunction device
> > > +  ADC channels and their indexes per variant:
> > > +
> > > +  AXP209
> > > +  ------
> > > +   0 | acin_v
> > > +   1 | acin_i
> > > +   2 | vbus_v
> > > +   3 | vbus_i
> > > +   4 | pmic_temp
> > > +   5 | gpio0_v
> > > +   6 | gpio1_v
> > > +   7 | ipsout_v
> > > +   8 | batt_v
> > > +   9 | batt_chrg_i
> > > +  10 | batt_dischrg_i
> > > +
> > > +  AXP22x
> > > +  ------
> > > +   0 | pmic_temp
> > > +   1 | batt_v
> > > +   2 | batt_chrg_i
> > > +   3 | batt_dischrg_i
> > > +
> > > +  AXP813
> > > +  ------
> > > +   0 | pmic_temp
> > > +   1 | gpio0_v
> > > +   2 | batt_v
> > > +   3 | batt_chrg_i
> > > +   4 | batt_dischrg_i
> > > +
> > > +
> > > +properties:
> > > +  compatible:
> > > +    enum:
> > > +      - x-powers,axp209-adc
> > > +      - x-powers,axp221-adc
> > > +      - x-powers,axp813-adc
> > > +
> > > +  "#io-channel-cells":
> > > +    const: 1
> > > +
> > > +additionalProperties: false
> > > +
> > > +examples:
> > > +  - |
> > > +    axp221 {
> > > +        adc {
> > > +            compatible = "x-powers,axp221-adc";
> > > +            #io-channel-cells = <1>;
> > > +        };
> > > +    };
> > > +...  
> >  


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion
  2020-11-22 16:35               ` Jonathan Cameron
@ 2020-11-23 23:33                 ` Phil Reid
  0 siblings, 0 replies; 104+ messages in thread
From: Phil Reid @ 2020-11-23 23:33 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Rob Herring, Jonathan Cameron,
	open list:IIO SUBSYSTEM AND DRIVERS, devicetree

On 23/11/2020 00:35, Jonathan Cameron wrote:
>>> Having a software interface to assert the reset would be nice.
>>>
>>>    
>> If there's no comments against the change, I'll submit a patch in the next day or so.
> Hi Phil,
> 
> So I've fixed the binding example up to have the sense as ACTIVE_LOW as discussed.
> If you have time to flip the sense round in the driver to match that it
> would be great and I'd propose we then mark that as suitable for stable
> so that we get it backported into existing trees.  We could also spin
> a patch to the txt binding but perhaps that is more effort than is needed
> here.  If I get time before you do I might send a proposed fix patch.
> 
> Hopefully anyone then using it will get the sense right and we won't
> accidentally break anyone.
> 
> At some point soon I'll also try and audit similar cases and hopefully we
> will get those fixed up as well.  Obviously if anyone else wants to take
> a look at that it would be much appreciated!
> 

G'day Jonathan,

Sorry this had slipped a bit on my list.
I'll send a patch in next day or so.



-- 
Regards
Phil Reid


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 30/46] dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion.
  2020-10-31 18:48 ` [PATCH 30/46] dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion Jonathan Cameron
  2020-11-03 16:26   ` Rob Herring
@ 2020-11-27  8:14   ` Geert Uytterhoeven
  1 sibling, 0 replies; 104+ messages in thread
From: Geert Uytterhoeven @ 2020-11-27  8:14 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio, Rob Herring,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Jonathan Cameron, Marek Vasut

Hi Jonathan,

On Sat, Oct 31, 2020 at 7:52 PM Jonathan Cameron <jic23@kernel.org> wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> This is a somewhat unusual device, in that it effectively does
> spi offload.   That means that it doesn't act as a full SPI
> master, but supports some functionality.  As such it supports
> a subset of specific SPI ADCs.  There is potential for a future
> clash in bindings, but as these are simple devices hopefully that
> will not occur.
>
> One addition to this from testing it against existing dts files
> was to add a resets property.
> This is specified in arch/arm/boot/dts/r8a7791.dtsi
> If it's the dtsi that is wrong and not the binding doc, then
> we can fix that instead.

Documenting the resets property was the right thing to do.
Thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 07/46] dt-bindings:iio:health:ti,afe4403: txt to yaml binding
  2020-11-22 17:32   ` Jonathan Cameron
@ 2020-11-28 16:15     ` Jonathan Cameron
  0 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-28 16:15 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron

On Sun, 22 Nov 2020 17:32:11 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> On Sat, 31 Oct 2020 18:48:15 +0000
> Jonathan Cameron <jic23@kernel.org> wrote:
> 
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > 
> > A few questions came up whilst converting this one.
> > 1) What is actually required?
> >   - Checking Linux driver, interrupt is not, and the tx-supply could
> >     be supplied by a stub regulator as long as it's always on.
> >     As such I have reduced the required list to just compatible and reg.
> > 2) What is the regulator called?
> >   - It's tx-supply in the binding doc, but the driver request tx_sup
> >     I've left this alone for now.  Andrew could you confirm what is
> >     intended for this?  
> 
> Andrew's email seems to be bouncing so I've reached out to him via another
> means.  Will wait to see if that works before applying this or the next
> patch given the questions.

In order to move forwards with this I've put myself as maintainer and
decided to send out a fix for the driver naming of that supply.

Thanks,

Jonathan

> 
> Thanks,
> 
> Jonathan
> 
> > 
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Cc: Andrew F. Davis <afd@ti.com>
> > ---
> >  .../bindings/iio/health/afe4403.txt           | 33 ------------
> >  .../bindings/iio/health/ti,afe4403.yaml       | 54 +++++++++++++++++++
> >  2 files changed, 54 insertions(+), 33 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/health/afe4403.txt b/Documentation/devicetree/bindings/iio/health/afe4403.txt
> > deleted file mode 100644
> > index 8e412054d6d5..000000000000
> > --- a/Documentation/devicetree/bindings/iio/health/afe4403.txt
> > +++ /dev/null
> > @@ -1,33 +0,0 @@
> > -Texas Instruments AFE4403 Heart rate and Pulse Oximeter
> > -
> > -Required properties:
> > - - compatible		: Should be "ti,afe4403".
> > - - reg			: SPI chip select address of device.
> > - - tx-supply		: Regulator supply to transmitting LEDs.
> > - - interrupts		: The interrupt line the device ADC_RDY pin is
> > -			  connected to. For details refer to,
> > -			  ../../interrupt-controller/interrupts.txt.
> > -
> > -Optional properties:
> > - - reset-gpios		: GPIO used to reset the device.
> > -			  For details refer to, ../../gpio/gpio.txt.
> > -
> > -For other required and optional properties of SPI slave nodes
> > -please refer to ../../spi/spi-bus.txt.
> > -
> > -Example:
> > -
> > -&spi0 {
> > -	heart_mon@0 {
> > -		compatible = "ti,afe4403";
> > -		reg = <0>;
> > -		spi-max-frequency = <10000000>;
> > -
> > -		tx-supply = <&vbat>;
> > -
> > -		interrupt-parent = <&gpio1>;
> > -		interrupts = <28 IRQ_TYPE_EDGE_RISING>;
> > -
> > -		reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
> > -	};
> > -};
> > diff --git a/Documentation/devicetree/bindings/iio/health/ti,afe4403.yaml b/Documentation/devicetree/bindings/iio/health/ti,afe4403.yaml
> > new file mode 100644
> > index 000000000000..5c86db65c033
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/health/ti,afe4403.yaml
> > @@ -0,0 +1,54 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/iio/health/ti,afe4403.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Texas Instruments AFE4403 Heart rate and Pulse Oximeter
> > +
> > +maintainers:
> > +  - Andrew F. Davis <afd@ti.com>
> > +
> > +properties:
> > +  compatible:
> > +    const: ti,afe4403
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  tx-supply:
> > +    description: Supply to transmitting LEDs.
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +    description: Connected to ADC_RDY pin.
> > +
> > +  reset-gpios: true
> > +
> > +  spi-max-frequency: true
> > +
> > +additionalProperties: false
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/gpio/gpio.h>
> > +    #include <dt-bindings/interrupt-controller/irq.h>
> > +    spi {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        heart_mon@0 {
> > +            compatible = "ti,afe4403";
> > +            reg = <0>;
> > +            spi-max-frequency = <10000000>;
> > +            tx-supply = <&vbat>;
> > +            interrupt-parent = <&gpio1>;
> > +            interrupts = <28 IRQ_TYPE_EDGE_RISING>;
> > +            reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
> > +        };
> > +    };
> > +...  
> 


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 08/46] dt-bindings:iio:health:ti,afe4404: txt to yaml conversion
  2020-10-31 18:48 ` [PATCH 08/46] dt-bindings:iio:health:ti,afe4404: txt to yaml conversion Jonathan Cameron
@ 2020-11-28 16:24   ` Jonathan Cameron
  2020-12-18 19:42   ` Rob Herring
  1 sibling, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-11-28 16:24 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree; +Cc: Jonathan Cameron

On Sat, 31 Oct 2020 18:48:16 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> This basically has same questions as for the afe4403.  We could combine
> the two bindings, but as the drivers are separate and it would be a little
> fiddly due to different buses let's keep the separating.
> To repeat questions from the ti,afe4403 binding.
> 
> A few questions came up whilst converting this one.
> 1) What is actually required?
>    - Checking Linux driver, interrupt is not, and the tx-supply could
>      be supplied by a stub regulator as long as it's always on.
>      As such I have reduced the required list to just compatible and reg.
> 2) What is the regulator called?
>    - It's tx-supply in the binding doc, but the driver request tx_sup
>      I've left this alone for now.  Andrew could you confirm what is
>      intended for this?
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Andrew F. Davis <afd@ti.com>
Applied. with the maintainer switched to me for now as Andrew's email is
bouncing.

Thanks,

Jonathan

> ---
>  .../bindings/iio/health/afe4404.txt           | 29 -----------
>  .../bindings/iio/health/ti,afe4404.yaml       | 51 +++++++++++++++++++
>  2 files changed, 51 insertions(+), 29 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/health/afe4404.txt b/Documentation/devicetree/bindings/iio/health/afe4404.txt
> deleted file mode 100644
> index 0b52830a0d9c..000000000000
> --- a/Documentation/devicetree/bindings/iio/health/afe4404.txt
> +++ /dev/null
> @@ -1,29 +0,0 @@
> -Texas Instruments AFE4404 Heart rate and Pulse Oximeter
> -
> -Required properties:
> - - compatible		: Should be "ti,afe4404".
> - - reg			: I2C address of the device.
> - - tx-supply		: Regulator supply to transmitting LEDs.
> - - interrupts		: The interrupt line the device ADC_RDY pin is
> -			  connected to. For details refer to,
> -			  ../interrupt-controller/interrupts.txt.
> -
> -Optional properties:
> - - reset-gpios		: GPIO used to reset the device.
> -			  For details refer to, ../gpio/gpio.txt.
> -
> -Example:
> -
> -&i2c2 {
> -	heart_mon@58 {
> -		compatible = "ti,afe4404";
> -		reg = <0x58>;
> -
> -		tx-supply = <&vbat>;
> -
> -		interrupt-parent = <&gpio1>;
> -		interrupts = <28 IRQ_TYPE_EDGE_RISING>;
> -
> -		reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
> -	};
> -};
> diff --git a/Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml b/Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml
> new file mode 100644
> index 000000000000..187b99b22312
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml
> @@ -0,0 +1,51 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/health/ti,afe4404.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Texas Instruments AFE4404 Heart rate and Pulse Oximeter
> +
> +maintainers:
> +  - Andrew F. Davis <afd@ti.com>
> +
> +properties:
> +  compatible:
> +    const: ti,afe4403
> +
> +  reg:
> +    maxItems: 1
> +
> +  tx-supply:
> +    description: Supply to transmitting LEDs.
> +
> +  interrupts:
> +    maxItems: 1
> +    description: Connected to ADC_RDY pin.
> +
> +  reset-gpios: true
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        heart_mon@58 {
> +            compatible = "ti,afe4404";
> +            reg = <0x58>;
> +            tx-supply = <&vbat>;
> +            interrupt-parent = <&gpio1>;
> +            interrupts = <28 IRQ_TYPE_EDGE_RISING>;
> +            reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
> +        };
> +    };
> +...


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 08/46] dt-bindings:iio:health:ti,afe4404: txt to yaml conversion
  2020-10-31 18:48 ` [PATCH 08/46] dt-bindings:iio:health:ti,afe4404: txt to yaml conversion Jonathan Cameron
  2020-11-28 16:24   ` Jonathan Cameron
@ 2020-12-18 19:42   ` Rob Herring
  2020-12-30 12:21     ` Jonathan Cameron
  1 sibling, 1 reply; 104+ messages in thread
From: Rob Herring @ 2020-12-18 19:42 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, devicetree,
	Jonathan Cameron, Andrew F . Davis

On Sat, Oct 31, 2020 at 1:51 PM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> This basically has same questions as for the afe4403.  We could combine
> the two bindings, but as the drivers are separate and it would be a little
> fiddly due to different buses let's keep the separating.
> To repeat questions from the ti,afe4403 binding.
>
> A few questions came up whilst converting this one.
> 1) What is actually required?
>    - Checking Linux driver, interrupt is not, and the tx-supply could
>      be supplied by a stub regulator as long as it's always on.
>      As such I have reduced the required list to just compatible and reg.
> 2) What is the regulator called?
>    - It's tx-supply in the binding doc, but the driver request tx_sup
>      I've left this alone for now.  Andrew could you confirm what is
>      intended for this?
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Andrew F. Davis <afd@ti.com>
> ---
>  .../bindings/iio/health/afe4404.txt           | 29 -----------
>  .../bindings/iio/health/ti,afe4404.yaml       | 51 +++++++++++++++++++
>  2 files changed, 51 insertions(+), 29 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/iio/health/afe4404.txt b/Documentation/devicetree/bindings/iio/health/afe4404.txt
> deleted file mode 100644
> index 0b52830a0d9c..000000000000
> --- a/Documentation/devicetree/bindings/iio/health/afe4404.txt
> +++ /dev/null
> @@ -1,29 +0,0 @@
> -Texas Instruments AFE4404 Heart rate and Pulse Oximeter
> -
> -Required properties:
> - - compatible          : Should be "ti,afe4404".
> - - reg                 : I2C address of the device.
> - - tx-supply           : Regulator supply to transmitting LEDs.
> - - interrupts          : The interrupt line the device ADC_RDY pin is
> -                         connected to. For details refer to,
> -                         ../interrupt-controller/interrupts.txt.
> -
> -Optional properties:
> - - reset-gpios         : GPIO used to reset the device.
> -                         For details refer to, ../gpio/gpio.txt.
> -
> -Example:
> -
> -&i2c2 {
> -       heart_mon@58 {
> -               compatible = "ti,afe4404";
> -               reg = <0x58>;
> -
> -               tx-supply = <&vbat>;
> -
> -               interrupt-parent = <&gpio1>;
> -               interrupts = <28 IRQ_TYPE_EDGE_RISING>;
> -
> -               reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
> -       };
> -};
> diff --git a/Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml b/Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml
> new file mode 100644
> index 000000000000..187b99b22312
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml
> @@ -0,0 +1,51 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/health/ti,afe4404.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Texas Instruments AFE4404 Heart rate and Pulse Oximeter
> +
> +maintainers:
> +  - Andrew F. Davis <afd@ti.com>
> +
> +properties:
> +  compatible:
> +    const: ti,afe4403

Typo here, which causes this warning:

Documentation/devicetree/bindings/iio/health/ti,afe4403.example.dt.yaml:
heart_mon@0: 'spi-max-frequency' does not match any of the regexes:
'pinctrl-[0-9]+'

Took me a minute staring at ti,afe4403.yaml to figure out what was happening.

Rob

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 08/46] dt-bindings:iio:health:ti,afe4404: txt to yaml conversion
  2020-12-18 19:42   ` Rob Herring
@ 2020-12-30 12:21     ` Jonathan Cameron
  0 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2020-12-30 12:21 UTC (permalink / raw)
  To: Rob Herring
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, devicetree,
	Jonathan Cameron, Andrew F . Davis

On Fri, 18 Dec 2020 13:42:19 -0600
Rob Herring <robh+dt@kernel.org> wrote:

> On Sat, Oct 31, 2020 at 1:51 PM Jonathan Cameron <jic23@kernel.org> wrote:
> >
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > This basically has same questions as for the afe4403.  We could combine
> > the two bindings, but as the drivers are separate and it would be a little
> > fiddly due to different buses let's keep the separating.
> > To repeat questions from the ti,afe4403 binding.
> >
> > A few questions came up whilst converting this one.
> > 1) What is actually required?
> >    - Checking Linux driver, interrupt is not, and the tx-supply could
> >      be supplied by a stub regulator as long as it's always on.
> >      As such I have reduced the required list to just compatible and reg.
> > 2) What is the regulator called?
> >    - It's tx-supply in the binding doc, but the driver request tx_sup
> >      I've left this alone for now.  Andrew could you confirm what is
> >      intended for this?
> >
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Cc: Andrew F. Davis <afd@ti.com>
> > ---
> >  .../bindings/iio/health/afe4404.txt           | 29 -----------
> >  .../bindings/iio/health/ti,afe4404.yaml       | 51 +++++++++++++++++++
> >  2 files changed, 51 insertions(+), 29 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/iio/health/afe4404.txt b/Documentation/devicetree/bindings/iio/health/afe4404.txt
> > deleted file mode 100644
> > index 0b52830a0d9c..000000000000
> > --- a/Documentation/devicetree/bindings/iio/health/afe4404.txt
> > +++ /dev/null
> > @@ -1,29 +0,0 @@
> > -Texas Instruments AFE4404 Heart rate and Pulse Oximeter
> > -
> > -Required properties:
> > - - compatible          : Should be "ti,afe4404".
> > - - reg                 : I2C address of the device.
> > - - tx-supply           : Regulator supply to transmitting LEDs.
> > - - interrupts          : The interrupt line the device ADC_RDY pin is
> > -                         connected to. For details refer to,
> > -                         ../interrupt-controller/interrupts.txt.
> > -
> > -Optional properties:
> > - - reset-gpios         : GPIO used to reset the device.
> > -                         For details refer to, ../gpio/gpio.txt.
> > -
> > -Example:
> > -
> > -&i2c2 {
> > -       heart_mon@58 {
> > -               compatible = "ti,afe4404";
> > -               reg = <0x58>;
> > -
> > -               tx-supply = <&vbat>;
> > -
> > -               interrupt-parent = <&gpio1>;
> > -               interrupts = <28 IRQ_TYPE_EDGE_RISING>;
> > -
> > -               reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
> > -       };
> > -};
> > diff --git a/Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml b/Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml
> > new file mode 100644
> > index 000000000000..187b99b22312
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml
> > @@ -0,0 +1,51 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/iio/health/ti,afe4404.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Texas Instruments AFE4404 Heart rate and Pulse Oximeter
> > +
> > +maintainers:
> > +  - Andrew F. Davis <afd@ti.com>
> > +
> > +properties:
> > +  compatible:
> > +    const: ti,afe4403  
> 
> Typo here, which causes this warning:
> 
> Documentation/devicetree/bindings/iio/health/ti,afe4403.example.dt.yaml:
> heart_mon@0: 'spi-max-frequency' does not match any of the regexes:
> 'pinctrl-[0-9]+'
> 
> Took me a minute staring at ti,afe4403.yaml to figure out what was happening.
Doh!

Patch on it's way.

Thanks,

Jonathan

> 
> Rob


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 39/46] dt-bindings:iio:dac:ad5755: txt to yaml format conversion.
  2020-11-22 18:40     ` Jonathan Cameron
@ 2021-02-21 16:33       ` Jonathan Cameron
  0 siblings, 0 replies; 104+ messages in thread
From: Jonathan Cameron @ 2021-02-21 16:33 UTC (permalink / raw)
  To: Rob Herring; +Cc: linux-iio, devicetree, Jonathan Cameron, Sean Nyekjaer


Hi Rob,

I still have an open question below on this one.

If you have a chance to take a look that would be great.

Jonathan


> > > diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml
> > > new file mode 100644
> > > index 000000000000..74edff3e8408
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml
> > > @@ -0,0 +1,178 @@
> > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/iio/dac/adi,ad5755.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: Analog Devices AD5755 Multi-Channel DAC
> > > +
> > > +maintainers:
> > > +  - Sean Nyekjaer <sean.nyekjaer@prevas.dk>
> > > +
> > > +properties:
> > > +  compatible:
> > > +    enum:
> > > +      - adi,ad5755
> > > +      - adi,ad5755-1
> > > +      - adi,ad5757
> > > +      - adi,ad5735
> > > +      - adi,ad5737
> > > +
> > > +  reg:
> > > +    maxItems: 1
> > > +
> > > +  spi-cpha:
> > > +    description: Either this or spi-cpol but not both.
> > > +  spi-cpol: true
> > > +
> > > +  spi-max-frequency: true
> > > +
> > > +  adi,ext-dc-dc-compenstation-resistor:
> > > +    $ref: /schemas/types.yaml#/definitions/flag
> > > +    description:
> > > +      Set if the hardware have an external resistor and thereby bypasses
> > > +      the internal compensation resistor.
> > > +
> > > +  adi,dc-dc-phase:
> > > +    $ref: /schemas/types.yaml#/definitions/uint32
> > > +    enum: [0, 1, 2, 3]
> > > +    description: |
> > > +      Valid values for DC DC Phase control is:
> > > +      0: All dc-to-dc converters clock on the same edge.
> > > +      1: Channel A and Channel B clock on the same edge,
> > > +         Channel C and Channel D clock on opposite edges.
> > > +      2: Channel A and Channel C clock on the same edge,
> > > +         Channel B and Channel D clock on opposite edges.
> > > +      3: Channel A, Channel B, Channel C, and Channel D
> > > +         clock 90 degrees out of phase from each other.
> > > +
> > > +  adi,dc-dc-freq-hz:
> > > +    $ref: /schemas/types.yaml#/definitions/uint32
> > > +    enum: [250000, 410000, 650000]
> > > +
> > > +  adi,dc-dc-max-microvolt:
> > > +    $ref: /schemas/types.yaml#/definitions/uint32
> > > +    description:
> > > +      Maximum allowed Vboost voltage supplied by the dc-to-dc converter.
> > > +    enum: [23000000, 24500000, 27000000, 29500000]
> > > +
> > > +  "#address-cells":
> > > +    const: 1
> > > +
> > > +  "#size-cells":
> > > +    const: 0
> > > +
> > > +  "#io-channel-cells":
> > > +    const: 1
> > > +
> > > +required:
> > > +  - compatible
> > > +  - reg
> > > +
> > > +additionalProperties: false
> > > +
> > > +patternProperties:
> > > +  "^(channel@)[0-7]$":
> > > +    type: object
> > > +    description: Child node to describe a channel
> > > +    properties:
> > > +      reg:
> > > +        maxItems: 1
> > > +
> > > +      adi,mode:
> > > +        $ref: /schemas/types.yaml#/definitions/uint32
> > > +        minimum: 0
> > > +        maximum: 6
> > > +        description: |
> > > +          Valid values for DAC modes is:
> > > +          0: 0 V to 5 V voltage range.
> > > +          1: 0 V to 10 V voltage range.
> > > +          2: Plus minus 5 V voltage range.
> > > +          3: Plus minus 10 V voltage range.
> > > +          4: 4 mA to 20 mA current range.
> > > +          5: 0 mA to 20 mA current range.
> > > +          6: 0 mA to 24 mA current range.
> > > +
> > > +      adi,ext-current-sense-resistor:
> > > +        $ref: /schemas/types.yaml#/definitions/flag
> > > +        description:
> > > +          Set if the hardware has an external current sense resistor
> > > +
> > > +      adi,enable-voltage-overrange:
> > > +        $ref: /schemas/types.yaml#/definitions/flag
> > > +        description: Enable voltage overrange
> > > +
> > > +      adi,slew:
> > > +        $ref: /schemas/types.yaml#/definitions/uint32-array
> > > +        description: |
> > > +          Array of slewrate settings should contain 3 fields:
> > > +          1: Should be either 0 or 1 in order to enable or disable slewrate.
> > > +          2: Slew rate update frequency
> > > +          3: Slew step size
> > > +        items:
> > > +          - enum: [0, 1]
> > > +          - enum: [64000, 32000, 16000, 8000, 4000, 2000, 1000, 500, 250, 125, 64, 32, 16, 8, 4, 0]
> > > +          - enum: [1, 2, 4, 16, 32, 64, 128, 256]
> > > +
> > > +    required:
> > > +      - reg
> > > +
> > > +    additionalProperties: false
> > > +
> > > +allOf:
> > > +  - $ref: '#/definitions/cpolXORcpha'
> > > +
> > > +definitions:
> > > +  cpolXORcpha:    
> > 
> > Like the other one, you can drop 'definitions'.  
> 
> As replied to the other one I can't figure out a syntax that allows me to
> do that.
> 
> Get an issues along the lines of
> 
> ... iio/dac/ti,dac082s085.yaml: allOf:0: 'not' is not one of ['$ref', 'if', 'then', 'else']
> 
> (obviously that's form the other driver that does this).
> 
> Any suggestions much appreciated!
> 
> Thanks,
> 
> Jonathan
> 
> 
> >   
> > > +    not:
> > > +      required: [spi-cpha, spi-cpol]
> > > +    oneOf:
> > > +      - required:
> > > +          - spi-cpha
> > > +      - required:
> > > +          - spi-cpol
> > > +
> > > +examples:
> > > +  - |
> > > +    #include <dt-bindings/iio/adi,ad5592r.h>
> > > +    spi {
> > > +        #address-cells = <1>;
> > > +        #size-cells = <0>;
> > > +
> > > +        dac@0 {
> > > +            #address-cells = <1>;
> > > +            #size-cells = <0>;
> > > +            compatible = "adi,ad5755";
> > > +            reg = <0>;
> > > +            spi-max-frequency = <1000000>;
> > > +            spi-cpha;
> > > +            adi,dc-dc-phase = <0>;
> > > +            adi,dc-dc-freq-hz = <410000>;
> > > +            adi,dc-dc-max-microvolt = <23000000>;
> > > +            channel@0 {
> > > +                reg = <0>;
> > > +                adi,mode = <4>;
> > > +                adi,ext-current-sense-resistor;
> > > +                adi,slew = <0 64000 1>;
> > > +            };
> > > +            channel@1 {
> > > +                reg = <1>;
> > > +                adi,mode = <4>;
> > > +                adi,ext-current-sense-resistor;
> > > +                adi,slew = <0 64000 1>;
> > > +            };
> > > +            channel@2 {
> > > +                reg = <2>;
> > > +                adi,mode = <4>;
> > > +                adi,ext-current-sense-resistor;
> > > +                adi,slew = <0 64000 1>;
> > > +            };
> > > +            channel@3 {
> > > +                reg = <3>;
> > > +                adi,mode = <4>;
> > > +                adi,ext-current-sense-resistor;
> > > +                adi,slew = <0 64000 1>;
> > > +            };
> > > +        };
> > > +    };
> > > +...
> > > -- 
> > > 2.28.0
> > >     
> 


^ permalink raw reply	[flat|nested] 104+ messages in thread

end of thread, other threads:[~2021-02-21 16:34 UTC | newest]

Thread overview: 104+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
2020-10-31 18:48 ` [PATCH 01/46] dt-bindings:iio:resolver:adi,ad2s90: Conversion of binding to yaml Jonathan Cameron
2020-10-31 18:48 ` [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion Jonathan Cameron
2020-11-02  4:48   ` Phil Reid
2020-11-03 16:10   ` Rob Herring
2020-11-03 17:28     ` Jonathan Cameron
2020-11-04  0:39       ` Phil Reid
2020-11-04  3:12         ` Rob Herring
2020-11-04  4:53           ` Phil Reid
2020-11-09  2:56             ` Phil Reid
2020-11-22 16:35               ` Jonathan Cameron
2020-11-23 23:33                 ` Phil Reid
2020-10-31 18:48 ` [PATCH 03/46] dt-bindings:iio:potentiometer:microchip,mcp4131 txt to " Jonathan Cameron
2020-11-02 16:19   ` Slawomir Stepien
2020-11-03 16:11   ` Rob Herring
2020-10-31 18:48 ` [PATCH 04/46] dt-bindings:iio:potentiometer:microchip,mcp41010 " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 05/46] dt-bindings:iio:impedance-analyzer:adi,ad5933 " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 06/46] dt-bindings:iio:samsung,sensorhub-rinato: " Jonathan Cameron
2020-11-22 16:43   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 07/46] dt-bindings:iio:health:ti,afe4403: txt to yaml binding Jonathan Cameron
2020-11-22 17:32   ` Jonathan Cameron
2020-11-28 16:15     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 08/46] dt-bindings:iio:health:ti,afe4404: txt to yaml conversion Jonathan Cameron
2020-11-28 16:24   ` Jonathan Cameron
2020-12-18 19:42   ` Rob Herring
2020-12-30 12:21     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 09/46] dt-bindings:iio:health:maxim,max30100: " Jonathan Cameron
2020-10-31 21:41   ` Matt Ranostay
2020-11-22 16:58     ` Jonathan Cameron
2020-11-22 17:24       ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 10/46] dt-bindings:iio:health:maxim,max30102: " Jonathan Cameron
2020-10-31 21:38   ` Matt Ranostay
2020-11-22 17:29     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 11/46] dt-bindings:iio:imu:adi,adis16480: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 12/46] dt-bindings:iio:imu:st,lsm6dsx: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 13/46] dt-bindings:iio:light:avago,apds9300: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 14/46] dt-bindings:iio:light:avago,apds9960: " Jonathan Cameron
2020-10-31 21:33   ` Matt Ranostay
2020-10-31 21:35     ` Matt Ranostay
2020-11-01 14:57       ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 15/46] dt-bindings:iio:light:capella,cm36651: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 16/46] dt-bindings:iio:light:sharp,gp2ap020a00f: " Jonathan Cameron
2020-11-22 17:42   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 17/46] dt-bindings:iio:light:maxim,max44009: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 18/46] dt-bindings:iio:light:ti,opt3001: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 19/46] dt-bindings:iio:light:upisemi,us51882: " Jonathan Cameron
2020-11-03 16:18   ` Rob Herring
2020-10-31 18:48 ` [PATCH 20/46] dt-bindings:iio:light:st,uvis25: txt to yaml conversion for this UV sensor Jonathan Cameron
2020-10-31 18:48 ` [PATCH 21/46] dt-bindings:iio:light:vishay,vcnl4035: txt to yaml conversion Jonathan Cameron
2020-11-22 17:52   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 22/46] dt-bindings:iio:light:st,vl6180: txt to yaml format conversion Jonathan Cameron
2020-11-01 15:26   ` Manivannan Sadhasivam
2020-10-31 18:48 ` [PATCH 23/46] dt-bindings:iio:magnetometer:fsl,mag3110: txt to yaml conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 24/46] dt-bindings:iio:magnetometer:asahi-kasei,ak8974: txt to yaml format conversion Jonathan Cameron
2020-11-04 14:47   ` Linus Walleij
2020-11-08 15:55     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 25/46] dt-bindings:iio:magnetometer:bosch,bmc150_magn: txt to yaml conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 26/46] dt-bindings:iio:magnetometer:honeywell,hmc5843: txt to yaml format conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 27/46] dt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 28/46] dt-bindings:iio:adc:atmel,sama5d2-adc: " Jonathan Cameron
2020-11-22 18:07   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 29/46] dt-bindings:iio:adc:atmel,sama9260-adc: conversion to yaml from at91_adc.txt Jonathan Cameron
2020-11-13  9:22   ` Alexandre Belloni
2020-11-14 15:37     ` Jonathan Cameron
2020-11-22 18:09       ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 30/46] dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion Jonathan Cameron
2020-11-03 16:26   ` Rob Herring
2020-11-27  8:14   ` Geert Uytterhoeven
2020-10-31 18:48 ` [PATCH 31/46] dt-bindings:iio:adc:x-powers,axp209-adc: " Jonathan Cameron
2020-11-22 18:15   ` Jonathan Cameron
2020-11-23  3:02     ` Chen-Yu Tsai
2020-11-23 20:36       ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 32/46] dt-bindings:iio:adc:brcm,iproc-static-adc: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 33/46] dt-bindings:iio:adc:mediatek,mt2701-auxadc: rename and " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 34/46] dt-bindings:iio:adc:ti,palmas-gpadc: txt to yaml format conversion Jonathan Cameron
2020-11-22 18:20   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 35/46] dt-bindings:iio:adc:qcom,pm8018-adc: yaml conversion and rename Jonathan Cameron
2020-11-04 14:51   ` Linus Walleij
2020-10-31 18:48 ` [PATCH 36/46] dt-bindings:iio:adc:qcom,spmi-iadc: txt to yaml format conversion Jonathan Cameron
2020-11-22 18:25   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 37/46] dt-binding:iio:adc:ti,ads124s08: " Jonathan Cameron
2020-11-02 12:49   ` Dan Murphy
2020-11-08 16:59     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 38/46] dt-bindings:iio:dac:ad5592r: " Jonathan Cameron
2020-11-03 16:31   ` Rob Herring
2020-11-22 18:38     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 39/46] dt-bindings:iio:dac:ad5755: " Jonathan Cameron
2020-11-03 16:32   ` Rob Herring
2020-11-22 18:40     ` Jonathan Cameron
2021-02-21 16:33       ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 40/46] dt-bindings:iio:accel:bosch,bma180: " Jonathan Cameron
2020-11-22 18:44   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 41/46] dt-bindings:iio:accel:kionix,kxcjk1013: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 42/46] dt-bindings:iio:accel:fsl,mma8452: txt to yaml conversion Jonathan Cameron
2020-11-03 16:34   ` Rob Herring
2020-11-22 18:50     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 43/46] dt-bindings:iio:gyro:bosch,bmg180: txt to yaml format conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 44/46] dt-bindings:iio:st,st-sensors: txt to yaml conversion Jonathan Cameron
2020-11-02 16:16   ` Denis CIOCCA
2020-10-31 18:48 ` [PATCH 45/46] dt-bindings:iio:frequency:adi,adf4350: txt to yaml format conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 46/46] dt-bindings:iio:temperature: Drop generic binding file Jonathan Cameron
2020-11-03 16:38 ` [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Rob Herring
2020-11-03 17:24   ` Jonathan Cameron
2020-11-22 18:59     ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.