Skip to contentSkip to conversation

dt-bindings:iio: yet more txt to yam conversions

PATCH Applied Jonathan Cameron 15 participants 104 messages Oct 31, 2020 – Feb 21, 2021

Subsystems (13)
lore
Share & tools
lore

Jonathan Cameron

author maintainer
#0 lore raw

cover dt-bindings:iio: yet more txt to yam conversions

From: Jonathan Cameron <[email protected]>

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
Signature · 1 line
2.28.0
author maintainer
#1 lore raw

PATCH 1/46 dt-bindings:iio:resolver:adi,ad2s90: Conversion of binding to yaml.

From: Jonathan Cameron <[email protected]>

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.

Cc Matheus Tavares <[email protected]>
Cc Alexandru Ardelean <[email protected]>
---
 .../bindings/iio/resolver/ad2s90.txt          | 31 ----------
 .../bindings/iio/resolver/adi,ad2s90.yaml     | 60 +++++++++++++++++++
 2 files changed, 60 insertions(+), 31 deletions(-)
Documentation/devicetree/bindings/iio/resolver/ad2s90.txt deleted +0 -31
deleted file mode 100644
index 477d41fa6467..000000000000
@@ -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;
-};
Documentation/devicetree/bindings/iio/resolver/adi,ad2s90.yaml new file +60 -0

60 lines not on this page · raw message

Signature · 1 line
2.28.0
author maintainer
#2 lore raw

PATCH 2/46 dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

---
 .../bindings/iio/potentiometer/ad5272.txt     | 27 ----------
 .../iio/potentiometer/adi,ad5272.yaml         | 50 +++++++++++++++++++
 2 files changed, 50 insertions(+), 27 deletions(-)
Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt deleted +0 -27
deleted file mode 100644
index f9b2eef946aa..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +50 -0

50 lines not on this page · raw message

Signature · 1 line
2.28.0
Reviewed-by on v1 2/46
#3 lore raw

Re: [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion

Quoted 7 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

Quoted 95 lines
---
  .../bindings/iio/potentiometer/ad5272.txt     | 27 ----------
  .../iio/potentiometer/adi,ad5272.yaml         | 50 +++++++++++++++++++
  2 files changed, 50 insertions(+), 27 deletions(-)
Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt deleted +0 -27
deleted file mode 100644
index f9b2eef946aa..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +50 -0
new file mode 100644
index 000000000000..b9b7d383bff1
@@ -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 <[email protected]>
+
+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>;
+        };
+    };
+...
Signature · 11 lines
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: [email protected]
maintainer
#4 lore raw

Re: [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion

In reply to Jonathan Cameron
Quoted 70 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

---
 .../bindings/iio/potentiometer/ad5272.txt     | 27 ----------
 .../iio/potentiometer/adi,ad5272.yaml         | 50 +++++++++++++++++++
 2 files changed, 50 insertions(+), 27 deletions(-)
Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt deleted +0 -27
deleted file mode 100644
index f9b2eef946aa..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +19 -0
new file mode 100644
index 000000000000..b9b7d383bff1
@@ -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 <[email protected]>
+
+description: |
+  Datasheet: https://www.analog.com/en/products/ad5272.html
+
+properties:
+  compatible:
+    enum:
+      - adi,ad5272-020
+      - adi,ad5272-050

Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml line 29

Quoted 10 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +10 -0
+      - 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...

Quoted 8 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +8 -0
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:

Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml line 47

Quoted 10 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +10 -0
+  - |
+    #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?

Quoted 6 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +3 -0
+        };
+    };
+...
Signature · 1 line
2.28.0
#5 lore raw

Re: [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion

Quoted 96 lines · On Tue, 3 Nov 2020 10:10:39 -0600 Rob Herring <[email protected]> wrote:
Quoted 70 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

---
 .../bindings/iio/potentiometer/ad5272.txt     | 27 ----------
 .../iio/potentiometer/adi,ad5272.yaml         | 50 +++++++++++++++++++
 2 files changed, 50 insertions(+), 27 deletions(-)
Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt deleted +0 -27
deleted file mode 100644
index f9b2eef946aa..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +19 -0
new file mode 100644
index 000000000000..b9b7d383bff1
@@ -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 <[email protected]>
+
+description: |
+  Datasheet: https://www.analog.com/en/products/ad5272.html
+
+properties:
+  compatible:
+    enum:
+      - adi,ad5272-020
+      - adi,ad5272-050

Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml line 29

Quoted 10 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +10 -0
+      - 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...

Quoted 12 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +12 -0
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    i2c {
+        #address-cells = <1>;
Quoted 8 lines

Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml line 47

Quoted 6 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +6 -0
+        #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?

Quoted 7 lines
Quoted 7 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +3 -0
+        };
+    };
+...
Signature · 1 line
2.28.0
#6 lore raw

Re: [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion

Quoted 108 lines · Jonathan Cameron
Quoted 96 lines · On Tue, 3 Nov 2020 10:10:39 -0600 Rob Herring <[email protected]> wrote:
Quoted 70 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

---
  .../bindings/iio/potentiometer/ad5272.txt     | 27 ----------
  .../iio/potentiometer/adi,ad5272.yaml         | 50 +++++++++++++++++++
  2 files changed, 50 insertions(+), 27 deletions(-)
Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt deleted +0 -27
deleted file mode 100644
index f9b2eef946aa..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +19 -0
new file mode 100644
index 000000000000..b9b7d383bff1
@@ -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 <[email protected]>
+
+description: |
+  Datasheet: https://www.analog.com/en/products/ad5272.html
+
+properties:
+  compatible:
+    enum:
+      - adi,ad5272-020
+      - adi,ad5272-050

Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml line 29

Quoted 10 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +10 -0
+      - 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...

Quoted 12 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +12 -0
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    i2c {
+        #address-cells = <1>;
Quoted 8 lines

Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml line 47

Quoted 6 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +6 -0
+        #size-cells = <0>;
+
+        potentiometer@2f {
+            compatible = "adi,ad5272-020";
+            reg = <0x2F>;
+            reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;

active high?

Quoted 4 lines

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.

Quoted 10 lines
Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +3 -0
+        };
+    };
+...
Signature · 1 line
2.28.0
Signature · 2 lines
Regards
Phil Reid
maintainer
#7 lore raw

Re: [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion

Quoted 115 lines · Phil Reid
Quoted 108 lines · Jonathan Cameron
Quoted 96 lines · On Tue, 3 Nov 2020 10:10:39 -0600 Rob Herring <[email protected]> wrote:
Quoted 70 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

---
  .../bindings/iio/potentiometer/ad5272.txt     | 27 ----------
  .../iio/potentiometer/adi,ad5272.yaml         | 50 +++++++++++++++++++
  2 files changed, 50 insertions(+), 27 deletions(-)
Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt deleted +0 -27
deleted file mode 100644
index f9b2eef946aa..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +19 -0
new file mode 100644
index 000000000000..b9b7d383bff1
@@ -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 <[email protected]>
+
+description: |
+  Datasheet: https://www.analog.com/en/products/ad5272.html
+
+properties:
+  compatible:
+    enum:
+      - adi,ad5272-020
+      - adi,ad5272-050

Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml line 29

Quoted 10 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +10 -0
+      - 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...

Quoted 12 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +12 -0
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    i2c {
+        #address-cells = <1>;
Quoted 8 lines

Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml line 47

Quoted 6 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +6 -0
+        #size-cells = <0>;
+
+        potentiometer@2f {
+            compatible = "adi,ad5272-020";
+            reg = <0x2F>;
+            reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;

active high?

Quoted 4 lines

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?

Quoted 4 lines

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

#8 lore raw

Re: [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion

Quoted 121 lines · Rob Herring
Quoted 115 lines · Phil Reid
Quoted 108 lines · Jonathan Cameron
Quoted 96 lines · On Tue, 3 Nov 2020 10:10:39 -0600 Rob Herring <[email protected]> wrote:
Quoted 70 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

---
   .../bindings/iio/potentiometer/ad5272.txt     | 27 ----------
   .../iio/potentiometer/adi,ad5272.yaml         | 50 +++++++++++++++++++
   2 files changed, 50 insertions(+), 27 deletions(-)
Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt deleted +0 -27
deleted file mode 100644
index f9b2eef946aa..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +19 -0
new file mode 100644
index 000000000000..b9b7d383bff1
@@ -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 <[email protected]>
+
+description: |
+  Datasheet: https://www.analog.com/en/products/ad5272.html
+
+properties:
+  compatible:
+    enum:
+      - adi,ad5272-020
+      - adi,ad5272-050

Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml line 29

Quoted 10 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +10 -0
+      - 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...

Quoted 12 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +12 -0
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    i2c {
+        #address-cells = <1>;
Quoted 8 lines

Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml line 47

Quoted 6 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +6 -0
+        #size-cells = <0>;
+
+        potentiometer@2f {
+            compatible = "adi,ad5272-020";
+            reg = <0x2F>;
+            reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;

active high?

Quoted 4 lines

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?

Quoted 4 lines

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.

Quoted 8 lines

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.

Signature · 2 lines
Regards
Phil Reid
#9 lore raw

Re: [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion

Quoted 127 lines · Phil Reid
Quoted 126 lines · Rob Herring
Quoted 115 lines · Phil Reid
Quoted 108 lines · Jonathan Cameron
Quoted 96 lines · On Tue, 3 Nov 2020 10:10:39 -0600 Rob Herring <[email protected]> wrote:
Quoted 70 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

---
   .../bindings/iio/potentiometer/ad5272.txt     | 27 ---------- .../iio/potentiometer/adi,ad5272.yaml         | 50 +++++++++++++++++++

   2 files changed, 50 insertions(+), 27 deletions(-)
Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt deleted +0 -27
deleted file mode 100644
index f9b2eef946aa..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +19 -0
new file mode 100644
index 000000000000..b9b7d383bff1
@@ -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 <[email protected]>
+
+description: |
+  Datasheet: https://www.analog.com/en/products/ad5272.html
+
+properties:
+  compatible:
+    enum:
+      - adi,ad5272-020
+      - adi,ad5272-050

Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml line 29

Quoted 10 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +10 -0
+      - 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...

Quoted 12 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +12 -0
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    i2c {
+        #address-cells = <1>;
Quoted 8 lines

Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml line 47

Quoted 6 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +6 -0
+        #size-cells = <0>;
+
+        potentiometer@2f {
+            compatible = "adi,ad5272-020";
+            reg = <0x2F>;
+            reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;

active high?

Quoted 4 lines

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?

Quoted 4 lines

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...

Quoted 10 lines
Quoted 3 lines

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.

Signature · 2 lines
Regards
Phil Reid
author maintainer
#10 lore raw

Re: [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion

Quoted 132 lines · On Mon, 9 Nov 2020 10:56:47 +0800 Phil Reid <[email protected]> wrote:
Quoted 131 lines · Phil Reid
Quoted 129 lines · Rob Herring
Quoted 115 lines · Phil Reid
Quoted 108 lines · Jonathan Cameron
Quoted 96 lines · On Tue, 3 Nov 2020 10:10:39 -0600 Rob Herring <[email protected]> wrote:
Quoted 70 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

---
   .../bindings/iio/potentiometer/ad5272.txt     | 27 ---------- .../iio/potentiometer/adi,ad5272.yaml         | 50 +++++++++++++++++++

   2 files changed, 50 insertions(+), 27 deletions(-)
Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt deleted +0 -27
deleted file mode 100644
index f9b2eef946aa..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +19 -0
new file mode 100644
index 000000000000..b9b7d383bff1
@@ -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 <[email protected]>
+
+description: |
+  Datasheet: https://www.analog.com/en/products/ad5272.html
+
+properties:
+  compatible:
+    enum:
+      - adi,ad5272-020
+      - adi,ad5272-050

Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml line 29

Quoted 10 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +10 -0
+      - 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...

Quoted 12 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +12 -0
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    i2c {
+        #address-cells = <1>;
Quoted 8 lines

Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml line 47

Quoted 6 lines
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml new file +6 -0
+        #size-cells = <0>;
+
+        potentiometer@2f {
+            compatible = "adi,ad5272-020";
+            reg = <0x2F>;
+            reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;  

active high?

Quoted 4 lines

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?

Quoted 4 lines

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.

Quoted 8 lines
Quoted 6 lines

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

Quoted 2 lines
#11 lore raw

Re: [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion

Quoted 13 lines · Jonathan Cameron
Quoted 4 lines
Quoted 3 lines

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.

Quoted 7 lines

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.

Signature · 2 lines
Regards
Phil Reid
author maintainer
#12 lore raw

PATCH 3/46 dt-bindings:iio:potentiometer:microchip,mcp4131 txt to yaml conversion

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 .../bindings/iio/potentiometer/mcp4131.txt    |  84 ---------------
 .../iio/potentiometer/microchip,mcp4131.yaml  | 102 ++++++++++++++++++
 2 files changed, 102 insertions(+), 84 deletions(-)
Documentation/devicetree/bindings/iio/potentiometer/mcp4131.txt deleted +0 -84
deleted file mode 100644
index 3ccba16f7035..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp4131.yaml new file +102 -0

102 lines not on this page · raw message

Signature · 1 line
2.28.0
Reviewed-by on v1 3/46
#13 lore raw

Re: [PATCH 03/46] dt-bindings:iio:potentiometer:microchip,mcp4131 txt to yaml conversion

Quoted 9 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Quoted 203 lines
---
 .../bindings/iio/potentiometer/mcp4131.txt    |  84 ---------------
 .../iio/potentiometer/microchip,mcp4131.yaml  | 102 ++++++++++++++++++
 2 files changed, 102 insertions(+), 84 deletions(-)
Documentation/devicetree/bindings/iio/potentiometer/mcp4131.txt deleted +0 -84
deleted file mode 100644
index 3ccba16f7035..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp4131.yaml new file +102 -0
new file mode 100644
index 000000000000..834d17ae3730
@@ -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 <[email protected]>
+
+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>;
+        };
+    };
+...
Signature · 1 line
Slawomir Stepien
maintainer
#14 lore raw

Re: [PATCH 03/46] dt-bindings:iio:potentiometer:microchip,mcp4131 txt to yaml conversion

In reply to Jonathan Cameron
Quoted 110 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 .../bindings/iio/potentiometer/mcp4131.txt    |  84 ---------------
 .../iio/potentiometer/microchip,mcp4131.yaml  | 102 ++++++++++++++++++
 2 files changed, 102 insertions(+), 84 deletions(-)
Documentation/devicetree/bindings/iio/potentiometer/mcp4131.txt deleted +0 -84
deleted file mode 100644
index 3ccba16f7035..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp4131.yaml new file +0 -0
new file mode 100644
index 000000000000..834d17ae3730

Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp4131.yaml line 7

Quoted 7 lines
Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp4131.yaml new file +7 -0
@@ -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.

Quoted 98 lines
Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp4131.yaml new file +95 -0
+maintainers:
+  - Slawomir Stepien <[email protected]>
+
+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>;
+        };
+    };
+...
Signature · 1 line
2.28.0
author maintainer
#15 lore raw

PATCH 4/46 dt-bindings:iio:potentiometer:microchip,mcp41010 txt to yaml conversion

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 .../bindings/iio/potentiometer/mcp41010.txt   | 28 -----------
 .../iio/potentiometer/microchip,mcp41010.yaml | 48 +++++++++++++++++++
 2 files changed, 48 insertions(+), 28 deletions(-)
Documentation/devicetree/bindings/iio/potentiometer/mcp41010.txt deleted +0 -28
deleted file mode 100644
index 4f245e8469fd..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp41010.yaml new file +48 -0

48 lines not on this page · raw message

Signature · 1 line
2.28.0
author maintainer
#16 lore raw

PATCH 5/46 dt-bindings:iio:impedance-analyzer:adi,ad5933 yaml conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Cc Marcelo Schmitt <[email protected]>
Cc Gabriel Capella <[email protected]>
Cc Alexandru Ardelean <[email protected]>
---
 .../iio/impedance-analyzer/ad5933.txt         | 26 --------
 .../iio/impedance-analyzer/adi,ad5933.yaml    | 59 +++++++++++++++++++
 2 files changed, 59 insertions(+), 26 deletions(-)
Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt deleted +0 -26
deleted file mode 100644
index 5ff38728ff91..000000000000
@@ -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";
-	};
Documentation/devicetree/bindings/iio/impedance-analyzer/adi,ad5933.yaml new file +59 -0

59 lines not on this page · raw message

Signature · 1 line
2.28.0
author maintainer
#17 lore raw

PATCH 6/46 dt-bindings:iio:samsung,sensorhub-rinato: yaml conversion

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

---
 .../iio/samsung,sensorhub-rinato.yaml         | 72 +++++++++++++++++++
 .../devicetree/bindings/iio/sensorhub.txt     | 24 -------
 2 files changed, 72 insertions(+), 24 deletions(-)
Documentation/devicetree/bindings/iio/samsung,sensorhub-rinato.yaml new file +72 -0
new file mode 100644
index 000000000000..62366cbd37e5
@@ -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 <[email protected]>
+
+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>;
+        };
+    };
+...
Documentation/devicetree/bindings/iio/sensorhub.txt deleted +0 -24
deleted file mode 100644
index b6ac0457d4ea..000000000000
@@ -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>;
-	};
Signature · 1 line
2.28.0
author maintainer
#18 lore raw

Re: [PATCH 06/46] dt-bindings:iio:samsung,sensorhub-rinato: yaml conversion

Quoted 8 lines · On Sat, 31 Oct 2020 18:48:14 +0000 Jonathan Cameron <[email protected]> wrote:

From: Jonathan Cameron <[email protected]>

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

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

Quoted 113 lines
---
 .../iio/samsung,sensorhub-rinato.yaml         | 72 +++++++++++++++++++
 .../devicetree/bindings/iio/sensorhub.txt     | 24 -------
 2 files changed, 72 insertions(+), 24 deletions(-)
Documentation/devicetree/bindings/iio/samsung,sensorhub-rinato.yaml new file +72 -0
new file mode 100644
index 000000000000..62366cbd37e5
@@ -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 <[email protected]>
+
+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>;
+        };
+    };
+...
Documentation/devicetree/bindings/iio/sensorhub.txt deleted +0 -24
deleted file mode 100644
index b6ac0457d4ea..000000000000
@@ -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>;
-	};
author maintainer
#19 lore raw

PATCH 7/46 dt-bindings:iio:health:ti,afe4403: txt to yaml binding

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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?

---
 .../bindings/iio/health/afe4403.txt           | 33 ------------
 .../bindings/iio/health/ti,afe4403.yaml       | 54 +++++++++++++++++++
 2 files changed, 54 insertions(+), 33 deletions(-)
Documentation/devicetree/bindings/iio/health/afe4403.txt deleted +0 -33
deleted file mode 100644
index 8e412054d6d5..000000000000
@@ -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>;
-	};
-};
Documentation/devicetree/bindings/iio/health/ti,afe4403.yaml new file +54 -0

54 lines not on this page · raw message

Signature · 1 line
2.28.0
author maintainer
#20 lore raw

Re: [PATCH 07/46] dt-bindings:iio:health:ti,afe4403: txt to yaml binding

Quoted 11 lines · On Sat, 31 Oct 2020 18:48:15 +0000 Jonathan Cameron <[email protected]> wrote:

From: Jonathan Cameron <[email protected]>

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

Quoted 107 lines
---
 .../bindings/iio/health/afe4403.txt           | 33 ------------
 .../bindings/iio/health/ti,afe4403.yaml       | 54 +++++++++++++++++++
 2 files changed, 54 insertions(+), 33 deletions(-)
Documentation/devicetree/bindings/iio/health/afe4403.txt deleted +0 -33
deleted file mode 100644
index 8e412054d6d5..000000000000
@@ -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>;
-	};
-};
Documentation/devicetree/bindings/iio/health/ti,afe4403.yaml new file +54 -0
new file mode 100644
index 000000000000..5c86db65c033
@@ -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 <[email protected]>
+
+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>;
+        };
+    };
+...
author maintainer
#21 lore raw

Re: [PATCH 07/46] dt-bindings:iio:health:ti,afe4403: txt to yaml binding

Quoted 15 lines · On Sun, 22 Nov 2020 17:32:11 +0000 Jonathan Cameron <[email protected]> wrote:
Quoted 11 lines · On Sat, 31 Oct 2020 18:48:15 +0000 Jonathan Cameron <[email protected]> wrote:

From: Jonathan Cameron <[email protected]>

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?

Quoted 3 lines

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

Quoted 113 lines

Thanks,

Jonathan

Quoted 107 lines
---
 .../bindings/iio/health/afe4403.txt           | 33 ------------
 .../bindings/iio/health/ti,afe4403.yaml       | 54 +++++++++++++++++++
 2 files changed, 54 insertions(+), 33 deletions(-)
Documentation/devicetree/bindings/iio/health/afe4403.txt deleted +0 -33
deleted file mode 100644
index 8e412054d6d5..000000000000
@@ -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>;
-	};
-};
Documentation/devicetree/bindings/iio/health/ti,afe4403.yaml new file +54 -0
new file mode 100644
index 000000000000..5c86db65c033
@@ -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 <[email protected]>
+
+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>;
+        };
+    };
+...  
author maintainer
#22 lore raw

PATCH 8/46 dt-bindings:iio:health:ti,afe4404: txt to yaml conversion

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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?

---
 .../bindings/iio/health/afe4404.txt           | 29 -----------
 .../bindings/iio/health/ti,afe4404.yaml       | 51 +++++++++++++++++++
 2 files changed, 51 insertions(+), 29 deletions(-)
Documentation/devicetree/bindings/iio/health/afe4404.txt deleted +0 -29
deleted file mode 100644
index 0b52830a0d9c..000000000000
@@ -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>;
-	};
-};
Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml new file +51 -0

51 lines not on this page · raw message

Signature · 1 line
2.28.0
author maintainer Applied
#23 lore raw

Re: [PATCH 08/46] dt-bindings:iio:health:ti,afe4404: txt to yaml conversion

Quoted 17 lines · On Sat, 31 Oct 2020 18:48:16 +0000 Jonathan Cameron <[email protected]> wrote:

From: Jonathan Cameron <[email protected]>

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?

Quoted 2 lines

Applied. with the maintainer switched to me for now as Andrew's email is bouncing.

Thanks,

Jonathan

Quoted 97 lines
---
 .../bindings/iio/health/afe4404.txt           | 29 -----------
 .../bindings/iio/health/ti,afe4404.yaml       | 51 +++++++++++++++++++
 2 files changed, 51 insertions(+), 29 deletions(-)
Documentation/devicetree/bindings/iio/health/afe4404.txt deleted +0 -29
deleted file mode 100644
index 0b52830a0d9c..000000000000
@@ -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>;
-	};
-};
Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml new file +51 -0
new file mode 100644
index 000000000000..187b99b22312
@@ -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 <[email protected]>
+
+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>;
+        };
+    };
+...
#24 lore raw

Re: [PATCH 08/46] dt-bindings:iio:health:ti,afe4404: txt to yaml conversion

In reply to Jonathan Cameron
Quoted 70 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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?

---
 .../bindings/iio/health/afe4404.txt           | 29 -----------
 .../bindings/iio/health/ti,afe4404.yaml       | 51 +++++++++++++++++++
 2 files changed, 51 insertions(+), 29 deletions(-)
Documentation/devicetree/bindings/iio/health/afe4404.txt deleted +0 -29
deleted file mode 100644
index 0b52830a0d9c..000000000000
@@ -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>;
-       };
-};
Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml new file +4 -0
new file mode 100644
index 000000000000..187b99b22312
@@ -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#

Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml line 14

Quoted 10 lines
Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml new file +10 -0
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments AFE4404 Heart rate and Pulse Oximeter
+
+maintainers:
+  - Andrew F. Davis <[email protected]>
+
+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

author maintainer
#25 lore raw

Re: [PATCH 08/46] dt-bindings:iio:health:ti,afe4404: txt to yaml conversion

Quoted 84 lines · On Fri, 18 Dec 2020 13:42:19 -0600 Rob Herring <[email protected]> wrote:
Quoted 70 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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?

---
 .../bindings/iio/health/afe4404.txt           | 29 -----------
 .../bindings/iio/health/ti,afe4404.yaml       | 51 +++++++++++++++++++
 2 files changed, 51 insertions(+), 29 deletions(-)
Documentation/devicetree/bindings/iio/health/afe4404.txt deleted +0 -29
deleted file mode 100644
index 0b52830a0d9c..000000000000
@@ -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>;
-       };
-};
Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml new file +4 -0
new file mode 100644
index 000000000000..187b99b22312
@@ -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#

Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml line 14

Quoted 10 lines
Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml new file +10 -0
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments AFE4404 Heart rate and Pulse Oximeter
+
+maintainers:
+  - Andrew F. Davis <[email protected]>
+
+properties:
+  compatible:
+    const: ti,afe4403  

Typo here, which causes this warning:

Quoted 5 lines

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

Quoted 2 lines

Rob

author maintainer
#26 lore raw

PATCH 9/46 dt-bindings:iio:health:maxim,max30100: txt to yaml conversion

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 .../bindings/iio/health/max30100.txt          | 28 ----------
 .../bindings/iio/health/maxim,max30100.yaml   | 52 +++++++++++++++++++
 2 files changed, 52 insertions(+), 28 deletions(-)
Documentation/devicetree/bindings/iio/health/max30100.txt deleted +0 -28
deleted file mode 100644
index 0054908a6e74..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml new file +52 -0

52 lines not on this page · raw message

Signature · 1 line
2.28.0
Acked-by on v1 9/46
#27 lore raw

Re: [PATCH 09/46] dt-bindings:iio:health:maxim,max30100: txt to yaml conversion

Quoted 53 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 .../bindings/iio/health/max30100.txt          | 28 ----------
 .../bindings/iio/health/maxim,max30100.yaml   | 52 +++++++++++++++++++
 2 files changed, 52 insertions(+), 28 deletions(-)
Documentation/devicetree/bindings/iio/health/max30100.txt deleted +0 -28
deleted file mode 100644
index 0054908a6e74..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml new file +0 -0
new file mode 100644
index 000000000000..5684f2f61bcc

Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml line 10

Quoted 10 lines
Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml new file +10 -0
@@ -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 <[email protected]>

Please change to my Konsulko email, but otherwise LGTM

Quoted 45 lines
Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml new file +42 -1
+
+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

author maintainer
#28 lore raw

Re: [PATCH 09/46] dt-bindings:iio:health:maxim,max30100: txt to yaml conversion

Quoted 67 lines · On Sat, 31 Oct 2020 14:41:56 -0700 Matt Ranostay <[email protected]>…
Quoted 53 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 .../bindings/iio/health/max30100.txt          | 28 ----------
 .../bindings/iio/health/maxim,max30100.yaml   | 52 +++++++++++++++++++
 2 files changed, 52 insertions(+), 28 deletions(-)
Documentation/devicetree/bindings/iio/health/max30100.txt deleted +0 -28
deleted file mode 100644
index 0054908a6e74..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml new file +0 -0
new file mode 100644
index 000000000000..5684f2f61bcc

Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml line 10

Quoted 10 lines
Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml new file +10 -0
@@ -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 <[email protected]>  

Please change to my Konsulko email, but otherwise LGTM

Quoted 1 line

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

Quoted 46 lines
Quoted 46 lines
Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml new file +42 -1
+
+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

author maintainer
#29 lore raw

Re: [PATCH 09/46] dt-bindings:iio:health:maxim,max30100: txt to yaml conversion

Quoted 70 lines · On Sun, 22 Nov 2020 16:58:56 +0000 Jonathan Cameron <[email protected]> wrote:
Quoted 67 lines · On Sat, 31 Oct 2020 14:41:56 -0700 Matt Ranostay <[email protected]>…
Quoted 53 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 .../bindings/iio/health/max30100.txt          | 28 ----------
 .../bindings/iio/health/maxim,max30100.yaml   | 52 +++++++++++++++++++
 2 files changed, 52 insertions(+), 28 deletions(-)
Documentation/devicetree/bindings/iio/health/max30100.txt deleted +0 -28
deleted file mode 100644
index 0054908a6e74..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml new file +0 -0
new file mode 100644
index 000000000000..5684f2f61bcc

Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml line 10

Quoted 10 lines
Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml new file +10 -0
@@ -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 <[email protected]>    

Please change to my Konsulko email, but otherwise LGTM

Quoted 4 lines
Quoted 1 line

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

Quoted 55 lines

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

Thanks,

Jonathan

Quoted 46 lines
Quoted 46 lines
Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml new file +42 -1
+
+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

author maintainer
#30 lore raw

PATCH 10/46 dt-bindings:iio:health:maxim,max30102: txt to yaml conversion

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

---
 .../bindings/iio/health/max30102.txt          | 33 --------
 .../bindings/iio/health/maxim,max30102.yaml   | 75 +++++++++++++++++++
 2 files changed, 75 insertions(+), 33 deletions(-)
Documentation/devicetree/bindings/iio/health/max30102.txt deleted +0 -33
deleted file mode 100644
index 7ef7ae40ae4f..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/health/maxim,max30102.yaml new file +75 -0

75 lines not on this page · raw message

Signature · 1 line
2.28.0
Acked-by on v1 10/46
#31 lore raw

Re: [PATCH 10/46] dt-bindings:iio:health:maxim,max30102: txt to yaml conversion

Quoted 58 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

---
 .../bindings/iio/health/max30102.txt          | 33 --------
 .../bindings/iio/health/maxim,max30102.yaml   | 75 +++++++++++++++++++
 2 files changed, 75 insertions(+), 33 deletions(-)
Documentation/devicetree/bindings/iio/health/max30102.txt deleted +0 -33
deleted file mode 100644
index 7ef7ae40ae4f..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/health/maxim,max30102.yaml new file +0 -0
new file mode 100644
index 000000000000..67d40f4a91a7

Documentation/devicetree/bindings/iio/health/maxim,max30102.yaml line 10

Quoted 10 lines
Documentation/devicetree/bindings/iio/health/maxim,max30102.yaml new file +10 -0
@@ -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 <[email protected]>

Change to my Konsulko email please, otherwise LGTM

Quoted 68 lines
Documentation/devicetree/bindings/iio/health/maxim,max30102.yaml new file +65 -1
+
+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

author maintainer
#32 lore raw

Re: [PATCH 10/46] dt-bindings:iio:health:maxim,max30102: txt to yaml conversion

Quoted 72 lines · On Sat, 31 Oct 2020 14:38:29 -0700 Matt Ranostay <[email protected]>…
Quoted 58 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

---
 .../bindings/iio/health/max30102.txt          | 33 --------
 .../bindings/iio/health/maxim,max30102.yaml   | 75 +++++++++++++++++++
 2 files changed, 75 insertions(+), 33 deletions(-)
Documentation/devicetree/bindings/iio/health/max30102.txt deleted +0 -33
deleted file mode 100644
index 7ef7ae40ae4f..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/health/maxim,max30102.yaml new file +0 -0
new file mode 100644
index 000000000000..67d40f4a91a7

Documentation/devicetree/bindings/iio/health/maxim,max30102.yaml line 10

Quoted 10 lines
Documentation/devicetree/bindings/iio/health/maxim,max30102.yaml new file +10 -0
@@ -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 <[email protected]>  

Change to my Konsulko email please, otherwise LGTM

Quoted 1 line

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

Jonathan

Quoted 69 lines
Quoted 69 lines
Documentation/devicetree/bindings/iio/health/maxim,max30102.yaml new file +65 -1
+
+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

author maintainer
#33 lore raw

PATCH 11/46 dt-bindings:iio:imu:adi,adis16480: txt to yaml conversion

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Cc Alexandru Ardelean <[email protected]>
---
 .../bindings/iio/imu/adi,adis16480.txt        |  86 ------------
 .../bindings/iio/imu/adi,adis16480.yaml       | 130 ++++++++++++++++++
 2 files changed, 130 insertions(+), 86 deletions(-)
Documentation/devicetree/bindings/iio/imu/adi,adis16480.txt deleted +0 -86
deleted file mode 100644
index cd903a1d880d..000000000000
@@ -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";
-	};
Documentation/devicetree/bindings/iio/imu/adi,adis16480.yaml new file +130 -0

130 lines not on this page · raw message

Signature · 1 line
2.28.0
author maintainer
#34 lore raw

PATCH 12/46 dt-bindings:iio:imu:st,lsm6dsx: txt to yaml conversion

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 .../bindings/iio/imu/st,lsm6dsx.yaml          | 86 +++++++++++++++++++
 .../bindings/iio/imu/st_lsm6dsx.txt           | 49 -----------
 2 files changed, 86 insertions(+), 49 deletions(-)
Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml new file +86 -0
new file mode 100644
index 000000000000..49d0687e0c06
@@ -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 <[email protected]>
+
+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>;
+        };
+    };
+...
Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt deleted +0 -49

49 lines not on this page · raw message

Signature · 1 line
2.28.0
author maintainer
#35 lore raw

PATCH 13/46 dt-bindings:iio:light:avago,apds9300: txt to yaml conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Cc Oleksandr Kravchenko <[email protected]>
---
 .../bindings/iio/light/apds9300.txt           | 21 ---------
 .../bindings/iio/light/avago,apds9300.yaml    | 44 +++++++++++++++++++
 2 files changed, 44 insertions(+), 21 deletions(-)
Documentation/devicetree/bindings/iio/light/apds9300.txt deleted +0 -21
deleted file mode 100644
index 3aa6db3ee99d..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/light/avago,apds9300.yaml new file +44 -0

44 lines not on this page · raw message

Signature · 1 line
2.28.0
author maintainer
#36 lore raw

PATCH 14/46 dt-bindings:iio:light:avago,apds9960: txt to yaml conversion

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

---
 .../bindings/iio/light/apds9960.txt           | 21 ---------
 .../bindings/iio/light/avago,apds9960.yaml    | 44 +++++++++++++++++++
 2 files changed, 44 insertions(+), 21 deletions(-)
Documentation/devicetree/bindings/iio/light/apds9960.txt deleted +0 -21
deleted file mode 100644
index c53ddb81c4aa..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml new file +44 -0

44 lines not on this page · raw message

Signature · 1 line
2.28.0
Acked-by on v1 14/46
#37 lore raw

Re: [PATCH 14/46] dt-bindings:iio:light:avago,apds9960: txt to yaml conversion

Quoted 8 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

Quoted 85 lines
---
 .../bindings/iio/light/apds9960.txt           | 21 ---------
 .../bindings/iio/light/avago,apds9960.yaml    | 44 +++++++++++++++++++
 2 files changed, 44 insertions(+), 21 deletions(-)
Documentation/devicetree/bindings/iio/light/apds9960.txt deleted +0 -21
deleted file mode 100644
index c53ddb81c4aa..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml new file +44 -1
new file mode 100644
index 000000000000..eae8c7327c0f
@@ -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 <[email protected]>
+
+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

#38 lore raw

Re: [PATCH 14/46] dt-bindings:iio:light:avago,apds9960: txt to yaml conversion

Quoted 5 lines · Matt Ranostay
Quoted 3 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Quoted 7 lines
Quoted 5 lines

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

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

Thanks,

Matt

Quoted 85 lines
Quoted 85 lines
---
 .../bindings/iio/light/apds9960.txt           | 21 ---------
 .../bindings/iio/light/avago,apds9960.yaml    | 44 +++++++++++++++++++
 2 files changed, 44 insertions(+), 21 deletions(-)
Documentation/devicetree/bindings/iio/light/apds9960.txt deleted +0 -21
deleted file mode 100644
index c53ddb81c4aa..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml new file +44 -1
new file mode 100644
index 000000000000..eae8c7327c0f
@@ -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 <[email protected]>
+
+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

author maintainer
#39 lore raw

Re: [PATCH 14/46] dt-bindings:iio:light:avago,apds9960: txt to yaml conversion

Quoted 10 lines · On Sat, 31 Oct 2020 14:35:56 -0700 Matt Ranostay <[email protected]>…
Quoted 8 lines · Matt Ranostay
Quoted 6 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

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

Will do.

Quoted 90 lines

Thanks,

Matt

Quoted 85 lines
Quoted 85 lines
---
 .../bindings/iio/light/apds9960.txt           | 21 ---------
 .../bindings/iio/light/avago,apds9960.yaml    | 44 +++++++++++++++++++
 2 files changed, 44 insertions(+), 21 deletions(-)
Documentation/devicetree/bindings/iio/light/apds9960.txt deleted +0 -21
deleted file mode 100644
index c53ddb81c4aa..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml new file +44 -1
new file mode 100644
index 000000000000..eae8c7327c0f
@@ -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 <[email protected]>
+
+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

author maintainer
#40 lore raw

PATCH 15/46 dt-bindings:iio:light:capella,cm36651: txt to yaml conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

---
 .../bindings/iio/light/capella,cm36651.yaml   | 48 +++++++++++++++++++
 .../devicetree/bindings/iio/light/cm36651.txt | 26 ----------
 2 files changed, 48 insertions(+), 26 deletions(-)
Documentation/devicetree/bindings/iio/light/capella,cm36651.yaml new file +48 -0
new file mode 100644
index 000000000000..446d94f3a89f
@@ -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 <[email protected]>
+
+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>;
+        };
+    };
+...
Documentation/devicetree/bindings/iio/light/cm36651.txt deleted +0 -26
deleted file mode 100644
index c03e19db4550..000000000000
@@ -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>;
-		};
-
-		/* ... */
-	};
Signature · 1 line
2.28.0
author maintainer
#41 lore raw

PATCH 16/46 dt-bindings:iio:light:sharp,gp2ap020a00f: txt to yaml conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Cc Jacek Anaszewski <[email protected]>
Cc Kyungmin Park <[email protected]>
---
 .../bindings/iio/light/gp2ap020a00f.txt       | 21 --------
 .../iio/light/sharp,gp2ap020a00f.yaml         | 49 +++++++++++++++++++
 2 files changed, 49 insertions(+), 21 deletions(-)
Documentation/devicetree/bindings/iio/light/gp2ap020a00f.txt deleted +0 -21
deleted file mode 100644
index 9231c82317ad..000000000000
@@ -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 = <...>;
-};
Documentation/devicetree/bindings/iio/light/sharp,gp2ap020a00f.yaml new file +49 -0

49 lines not on this page · raw message

Signature · 1 line
2.28.0
#42 lore raw

Re: [PATCH 16/46] dt-bindings:iio:light:sharp,gp2ap020a00f: txt to yaml conversion.

Quoted 8 lines · On Sat, 31 Oct 2020 18:48:24 +0000 Jonathan Cameron <[email protected]> wrote:

From: Jonathan Cameron <[email protected]>

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.

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

Quoted 88 lines
Cc Kyungmin Park <[email protected]>
---
 .../bindings/iio/light/gp2ap020a00f.txt       | 21 --------
 .../iio/light/sharp,gp2ap020a00f.yaml         | 49 +++++++++++++++++++
 2 files changed, 49 insertions(+), 21 deletions(-)
Documentation/devicetree/bindings/iio/light/gp2ap020a00f.txt deleted +0 -21
deleted file mode 100644
index 9231c82317ad..000000000000
@@ -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 = <...>;
-};
Documentation/devicetree/bindings/iio/light/sharp,gp2ap020a00f.yaml new file +49 -0
new file mode 100644
index 000000000000..d6a4b47467f2
@@ -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 <[email protected]>
+  - Kyungmin Park <[email protected]>
+
+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>;
+        };
+    };
+...
author maintainer
#43 lore raw

PATCH 17/46 dt-bindings:iio:light:maxim,max44009: txt to yaml conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Straight forward format conversion.

---
 .../bindings/iio/light/max44009.txt           | 24 ----------
 .../bindings/iio/light/maxim,max44009.yaml    | 45 +++++++++++++++++++
 2 files changed, 45 insertions(+), 24 deletions(-)
Documentation/devicetree/bindings/iio/light/max44009.txt deleted +0 -24
deleted file mode 100644
index 4a98848e35c0..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/light/maxim,max44009.yaml new file +45 -0

45 lines not on this page · raw message

Signature · 1 line
2.28.0
author maintainer
#44 lore raw

PATCH 18/46 dt-bindings:iio:light:ti,opt3001: txt to yaml conversion

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Straight forward format conversion of this simple binding.

Cc Andreas Dannenberg <[email protected]>
---
 .../devicetree/bindings/iio/light/opt3001.txt | 25 ----------
 .../bindings/iio/light/ti,opt3001.yaml        | 47 +++++++++++++++++++
 2 files changed, 47 insertions(+), 25 deletions(-)
Documentation/devicetree/bindings/iio/light/opt3001.txt deleted +0 -25
deleted file mode 100644
index 9e6f2998e751..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/light/ti,opt3001.yaml new file +47 -0

47 lines not on this page · raw message

Signature · 1 line
2.28.0
author maintainer
#45 lore raw

PATCH 19/46 dt-bindings:iio:light:upisemi,us51882: txt to yaml conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 .../bindings/iio/light/upisemi,us5182.yaml    | 75 +++++++++++++++++++
 .../devicetree/bindings/iio/light/us5182d.txt | 45 -----------
 2 files changed, 75 insertions(+), 45 deletions(-)
Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml new file +75 -0
new file mode 100644
index 000000000000..b9dc8ae25bf0
@@ -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 <[email protected]>
+
+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>;
+        };
+    };
+...
Documentation/devicetree/bindings/iio/light/us5182d.txt deleted +0 -45

45 lines not on this page · raw message

Signature · 1 line
2.28.0
maintainer
#46 lore raw

Re: [PATCH 19/46] dt-bindings:iio:light:upisemi,us51882: txt to yaml conversion.

Quoted 35 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 .../bindings/iio/light/upisemi,us5182.yaml    | 75 +++++++++++++++++++
 .../devicetree/bindings/iio/light/us5182d.txt | 45 -----------
 2 files changed, 75 insertions(+), 45 deletions(-)
Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml new file +13 -0
new file mode 100644
index 000000000000..b9dc8ae25bf0
@@ -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 <[email protected]>
+
+properties:
+  compatible:

Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml line 23

Quoted 10 lines
Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml new file +10 -0
+    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

Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml line 36

Quoted 13 lines
Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml new file +13 -0
+
+  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

Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml line 42

Quoted 6 lines
Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml new file +6 -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
Quoted 87 lines
Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml new file +33 -0
+
+  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>;
+        };
+    };
+...
Documentation/devicetree/bindings/iio/light/us5182d.txt deleted +0 -45
deleted file mode 100644
index a61979997f37..000000000000
@@ -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>;
-    };
Signature · 1 line
2.28.0
author maintainer
#47 lore raw

PATCH 20/46 dt-bindings:iio:light:st,uvis25: txt to yaml conversion for this UV sensor

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 .../bindings/iio/light/st,uvis25.yaml         | 42 +++++++++++++++++++
 .../devicetree/bindings/iio/light/uvis25.txt  | 22 ----------
 2 files changed, 42 insertions(+), 22 deletions(-)
Documentation/devicetree/bindings/iio/light/st,uvis25.yaml new file +42 -0
new file mode 100644
index 000000000000..c86e5e1d135e
@@ -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 <[email protected]>
+
+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>;
+        };
+    };
+...
Documentation/devicetree/bindings/iio/light/uvis25.txt deleted +0 -22
deleted file mode 100644
index 043c139d91e6..000000000000
@@ -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>;
-};
Signature · 1 line
2.28.0
author maintainer
#48 lore raw

PATCH 21/46 dt-bindings:iio:light:vishay,vcnl4035: txt to yaml conversion

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Cc Parthiban Nallathambi <[email protected]>
---
 .../bindings/iio/light/vcnl4035.txt           | 18 --------
 .../bindings/iio/light/vishay,vcnl4035.yaml   | 45 +++++++++++++++++++
 2 files changed, 45 insertions(+), 18 deletions(-)
Documentation/devicetree/bindings/iio/light/vcnl4035.txt deleted +0 -18
deleted file mode 100644
index c07c7f052556..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/light/vishay,vcnl4035.yaml new file +45 -0

45 lines not on this page · raw message

Signature · 1 line
2.28.0
author maintainer Applied
#49 lore raw

Re: [PATCH 21/46] dt-bindings:iio:light:vishay,vcnl4035: txt to yaml conversion

Quoted 8 lines · On Sat, 31 Oct 2020 18:48:29 +0000 Jonathan Cameron <[email protected]> wrote:

From: Jonathan Cameron <[email protected]>

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.

Cc Parthiban Nallathambi <[email protected]>

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

Quoted 80 lines
---
 .../bindings/iio/light/vcnl4035.txt           | 18 --------
 .../bindings/iio/light/vishay,vcnl4035.yaml   | 45 +++++++++++++++++++
 2 files changed, 45 insertions(+), 18 deletions(-)
Documentation/devicetree/bindings/iio/light/vcnl4035.txt deleted +0 -18
deleted file mode 100644
index c07c7f052556..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/light/vishay,vcnl4035.yaml new file +45 -0
new file mode 100644
index 000000000000..e41c25817dd8
@@ -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 <[email protected]>
+
+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>;
+        };
+    };
+...
author maintainer
#50 lore raw

PATCH 22/46 dt-bindings:iio:light:st,vl6180: txt to yaml format conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Cc Manivannan Sadhasivam <[email protected]>
Cc Peter Meerwald-Stadler <[email protected]>
---
 .../bindings/iio/light/st,vl6180.yaml         | 45 +++++++++++++++++++
 .../devicetree/bindings/iio/light/vl6180.txt  | 15 -------
 2 files changed, 45 insertions(+), 15 deletions(-)
Documentation/devicetree/bindings/iio/light/st,vl6180.yaml new file +45 -0
new file mode 100644
index 000000000000..27c36ab7990d
@@ -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 <[email protected]>
+  - Peter Meerwald-Stadler <[email protected]>
+
+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>;
+        };
+    };
+...
Documentation/devicetree/bindings/iio/light/vl6180.txt deleted +0 -15
deleted file mode 100644
index fb9137d85df9..000000000000
@@ -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>;
-};
Signature · 1 line
2.28.0
Acked-by on v1 22/46
#51 lore raw

Re: [PATCH 22/46] dt-bindings:iio:light:st,vl6180: txt to yaml format conversion.

Quoted 10 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Thanks,
Mani

Quoted 82 lines
Cc Manivannan Sadhasivam <[email protected]>
Cc Peter Meerwald-Stadler <[email protected]>
---
 .../bindings/iio/light/st,vl6180.yaml         | 45 +++++++++++++++++++
 .../devicetree/bindings/iio/light/vl6180.txt  | 15 -------
 2 files changed, 45 insertions(+), 15 deletions(-)
Documentation/devicetree/bindings/iio/light/st,vl6180.yaml new file +45 -0
new file mode 100644
index 000000000000..27c36ab7990d
@@ -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 <[email protected]>
+  - Peter Meerwald-Stadler <[email protected]>
+
+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>;
+        };
+    };
+...
Documentation/devicetree/bindings/iio/light/vl6180.txt deleted +0 -15
deleted file mode 100644
index fb9137d85df9..000000000000
@@ -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>;
-};
Signature · 1 line
2.28.0
author maintainer
#52 lore raw

PATCH 23/46 dt-bindings:iio:magnetometer:fsl,mag3110: txt to yaml conversion

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

---
 .../iio/magnetometer/fsl,mag3110.yaml         | 48 +++++++++++++++++++
 .../bindings/iio/magnetometer/mag3110.txt     | 27 -----------
 2 files changed, 48 insertions(+), 27 deletions(-)
Documentation/devicetree/bindings/iio/magnetometer/fsl,mag3110.yaml new file +48 -0
new file mode 100644
index 000000000000..6b54d32323fc
@@ -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 <[email protected]>
+
+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>;
+        };
+    };
+...
Documentation/devicetree/bindings/iio/magnetometer/mag3110.txt deleted +0 -27
deleted file mode 100644
index bdd40bcaaa1f..000000000000
@@ -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>;
-};
Signature · 1 line
2.28.0
author maintainer
#53 lore raw

PATCH 24/46 dt-bindings:iio:magnetometer:asahi-kasei,ak8974: txt to yaml format conversion

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 .../bindings/iio/magnetometer/ak8974.txt      | 31 ----------
 .../iio/magnetometer/asahi-kasei,ak8974.yaml  | 57 +++++++++++++++++++
 2 files changed, 57 insertions(+), 31 deletions(-)
Documentation/devicetree/bindings/iio/magnetometer/ak8974.txt deleted +0 -31
deleted file mode 100644
index 7f06eff3b504..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/magnetometer/asahi-kasei,ak8974.yaml new file +57 -0

57 lines not on this page · raw message

Signature · 1 line
2.28.0
Reviewed-by on v1 24/46
#54 lore raw

Re: [PATCH 24/46] dt-bindings:iio:magnetometer:asahi-kasei,ak8974: txt to yaml format conversion

Quoted 5 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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!

Quoted 2 lines

Yours,
Linus Walleij

author maintainer
#55 lore raw

Re: [PATCH 24/46] dt-bindings:iio:magnetometer:asahi-kasei,ak8974: txt to yaml format conversion

Quoted 9 lines · On Wed, 4 Nov 2020 15:47:56 +0100 Linus Walleij <[email protected]>…
Quoted 5 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

Quoted 8 lines
Quoted 3 lines

Yours,
Linus Walleij

author maintainer
#56 lore raw

PATCH 25/46 dt-bindings:iio:magnetometer:bosch,bmc150_magn: txt to yaml conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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!

---
 .../bindings/iio/magnetometer/bmc150_magn.txt | 25 ---------
 .../iio/magnetometer/bosch,bmc150_magn.yaml   | 55 +++++++++++++++++++
 2 files changed, 55 insertions(+), 25 deletions(-)
Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt deleted +0 -25
deleted file mode 100644
index 22912e43b60c..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/magnetometer/bosch,bmc150_magn.yaml new file +55 -0

55 lines not on this page · raw message

Signature · 1 line
2.28.0
author maintainer
#57 lore raw

PATCH 26/46 dt-bindings:iio:magnetometer:honeywell,hmc5843: txt to yaml format conversion

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 .../bindings/iio/magnetometer/hmc5843.txt     | 21 ---------
 .../iio/magnetometer/honeywell,hmc5843.yaml   | 43 +++++++++++++++++++
 2 files changed, 43 insertions(+), 21 deletions(-)
Documentation/devicetree/bindings/iio/magnetometer/hmc5843.txt deleted +0 -21
deleted file mode 100644
index 8e191eef014e..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/magnetometer/honeywell,hmc5843.yaml new file +43 -0

43 lines not on this page · raw message

Signature · 1 line
2.28.0
author maintainer
#58 lore raw

PATCH 27/46 dt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Simple binding format conversion.

---
 .../bindings/iio/magnetometer/pni,rm3100.txt  | 20 ---------
 .../bindings/iio/magnetometer/pni,rm3100.yaml | 42 +++++++++++++++++++
 2 files changed, 42 insertions(+), 20 deletions(-)
Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.txt deleted +0 -20
deleted file mode 100644
index 497c932e9e39..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.yaml new file +42 -0

42 lines not on this page · raw message

Signature · 1 line
2.28.0
author maintainer
#59 lore raw

PATCH 28/46 dt-bindings:iio:adc:atmel,sama5d2-adc: txt to yaml conversion

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

Cc Ludovic Desroches <[email protected]>
Cc Eugen Hristev <[email protected]>
---
 .../bindings/iio/adc/at91-sama5d2_adc.txt     |  50 ---------
 .../bindings/iio/adc/atmel,sama5d2-adc.yaml   | 104 ++++++++++++++++++
 2 files changed, 104 insertions(+), 50 deletions(-)
Documentation/devicetree/bindings/iio/adc/at91-sama5d2_adc.txt deleted +0 -50
deleted file mode 100644
index 07c59f301b31..000000000000
@@ -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>;
-}
Documentation/devicetree/bindings/iio/adc/atmel,sama5d2-adc.yaml new file +104 -0

104 lines not on this page · raw message

Signature · 1 line
2.28.0
#60 lore raw

Re: [PATCH 28/46] dt-bindings:iio:adc:atmel,sama5d2-adc: txt to yaml conversion

Quoted 8 lines · On Sat, 31 Oct 2020 18:48:36 +0000 Jonathan Cameron <[email protected]> wrote:

From: Jonathan Cameron <[email protected]>

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

Cc Ludovic Desroches <[email protected]>
Cc Eugen Hristev <[email protected]>

Applied with -hz and -ms $ref dropped as per Rob's suggestion.

Thanks,

Jonathan

Quoted 171 lines
---
 .../bindings/iio/adc/at91-sama5d2_adc.txt     |  50 ---------
 .../bindings/iio/adc/atmel,sama5d2-adc.yaml   | 104 ++++++++++++++++++
 2 files changed, 104 insertions(+), 50 deletions(-)
Documentation/devicetree/bindings/iio/adc/at91-sama5d2_adc.txt deleted +0 -50
deleted file mode 100644
index 07c59f301b31..000000000000
@@ -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>;
-}
Documentation/devicetree/bindings/iio/adc/atmel,sama5d2-adc.yaml new file +104 -0
new file mode 100644
index 000000000000..9b282c3ee8fb
@@ -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 <[email protected]>
+  - Eugen Hristev <[email protected]>
+
+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>;
+        };
+    };
+...
author maintainer
#61 lore raw

PATCH 29/46 dt-bindings:iio:adc:atmel,sama9260-adc: conversion to yaml from at91_adc.txt

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Cc Alexandre Belloni <[email protected]>
Cc Nicolas Ferre <[email protected]>
Cc Ludovic Desroches <[email protected]>
---
 .../devicetree/bindings/iio/adc/at91_adc.txt  |  83 --------
 .../bindings/iio/adc/atmel,sama9260-adc.yaml  | 178 ++++++++++++++++++
 2 files changed, 178 insertions(+), 83 deletions(-)
Documentation/devicetree/bindings/iio/adc/at91_adc.txt deleted +0 -83
deleted file mode 100644
index f65b04fb7962..000000000000
@@ -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>;
-	};
-};
Documentation/devicetree/bindings/iio/adc/atmel,sama9260-adc.yaml new file +178 -0

178 lines not on this page · raw message

Signature · 1 line
2.28.0
#62 lore raw

Re: [PATCH 29/46] dt-bindings:iio:adc:atmel,sama9260-adc: conversion to yaml from at91_adc.txt

Quoted 6 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Quoted 6 lines

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.

Quoted 7 lines

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.

Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
author maintainer
#63 lore raw

Re: [PATCH 29/46] dt-bindings:iio:adc:atmel,sama9260-adc: conversion to yaml from at91_adc.txt

Quoted 23 lines · On Fri, 13 Nov 2020 10:22:05 +0100 Alexandre Belloni…
Quoted 6 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Quoted 6 lines

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.

Quoted 4 lines

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!)

Quoted 7 lines
Quoted 3 lines

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

Quoted 2 lines
#64 lore raw

Re: [PATCH 29/46] dt-bindings:iio:adc:atmel,sama9260-adc: conversion to yaml from at91_adc.txt

Quoted 34 lines · On Sat, 14 Nov 2020 15:37:08 +0000 Jonathan Cameron <[email protected]> wrote:
Quoted 23 lines · On Fri, 13 Nov 2020 10:22:05 +0100 Alexandre Belloni…
Quoted 6 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Quoted 6 lines

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.

Quoted 4 lines

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!)

Quoted 7 lines
Quoted 3 lines

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.

Quoted 5 lines

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

Quoted 5 lines
Quoted 4 lines
author maintainer
#65 lore raw

PATCH 30/46 dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 .../bindings/iio/adc/renesas,gyroadc.txt      |  98 ------------
 .../iio/adc/renesas,rcar-gyroadc.yaml         | 141 ++++++++++++++++++
 2 files changed, 141 insertions(+), 98 deletions(-)
Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt deleted +0 -98
deleted file mode 100644
index df5b9f2ad8d8..000000000000
@@ -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>;
-		};
-	};
Documentation/devicetree/bindings/iio/adc/renesas,rcar-gyroadc.yaml new file +141 -0

141 lines not on this page · raw message

Signature · 1 line
2.28.0
maintainer
#66 lore raw

Re: [PATCH 30/46] dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion.

Quoted 180 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 .../bindings/iio/adc/renesas,gyroadc.txt      |  98 ------------
 .../iio/adc/renesas,rcar-gyroadc.yaml         | 141 ++++++++++++++++++
 2 files changed, 141 insertions(+), 98 deletions(-)
Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt deleted +0 -98
deleted file mode 100644
index df5b9f2ad8d8..000000000000
@@ -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>;
-		};
-	};
Documentation/devicetree/bindings/iio/adc/renesas,rcar-gyroadc.yaml new file +48 -0
new file mode 100644
index 000000000000..aeaa9d372450
@@ -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 <[email protected]>
+
+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
+

Documentation/devicetree/bindings/iio/adc/renesas,rcar-gyroadc.yaml line 58

Quoted 10 lines
Documentation/devicetree/bindings/iio/adc/renesas,rcar-gyroadc.yaml new file +10 -0
+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]$"

Quoted 28 lines
Documentation/devicetree/bindings/iio/adc/renesas,rcar-gyroadc.yaml new file +28 -0
+    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

Documentation/devicetree/bindings/iio/adc/renesas,rcar-gyroadc.yaml line 96

Quoted 10 lines
Documentation/devicetree/bindings/iio/adc/renesas,rcar-gyroadc.yaml new file +10 -0
+            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

Quoted 48 lines
Documentation/devicetree/bindings/iio/adc/renesas,rcar-gyroadc.yaml new file +45 -0
+
+      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>;
+            };
+        };
+    };
+...
Signature · 1 line
2.28.0
#67 lore raw

Re: [PATCH 30/46] dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion.

In reply to Jonathan Cameron

Hi Jonathan,

Quoted 9 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Quoted 5 lines

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

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
author maintainer
#68 lore raw

PATCH 31/46 dt-bindings:iio:adc:x-powers,axp209-adc: txt to yaml conversion

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 .../bindings/iio/adc/axp20x_adc.txt           | 48 -------------
 .../bindings/iio/adc/x-powers,axp209-adc.yaml | 67 +++++++++++++++++++
 2 files changed, 67 insertions(+), 48 deletions(-)
Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt deleted +0 -48
deleted file mode 100644
index 7a6313913923..000000000000
@@ -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
Documentation/devicetree/bindings/iio/adc/x-powers,axp209-adc.yaml new file +67 -0

67 lines not on this page · raw message

Signature · 1 line
2.28.0
#69 lore raw

Re: [PATCH 31/46] dt-bindings:iio:adc:x-powers,axp209-adc: txt to yaml conversion

Quoted 10 lines · On Sat, 31 Oct 2020 18:48:39 +0000 Jonathan Cameron <[email protected]> wrote:

From: Jonathan Cameron <[email protected]>

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.

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

Quoted 132 lines
---
 .../bindings/iio/adc/axp20x_adc.txt           | 48 -------------
 .../bindings/iio/adc/x-powers,axp209-adc.yaml | 67 +++++++++++++++++++
 2 files changed, 67 insertions(+), 48 deletions(-)
Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt deleted +0 -48
deleted file mode 100644
index 7a6313913923..000000000000
@@ -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
Documentation/devicetree/bindings/iio/adc/x-powers,axp209-adc.yaml new file +67 -0
new file mode 100644
index 000000000000..288a5ac31a16
@@ -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 <[email protected]>
+
+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>;
+        };
+    };
+...
#70 lore raw

Re: [PATCH 31/46] dt-bindings:iio:adc:x-powers,axp209-adc: txt to yaml conversion

Hi,

Quoted 12 lines · Jonathan Cameron
Quoted 8 lines · On Sat, 31 Oct 2020 18:48:39 +0000 Jonathan Cameron <[email protected]> wrote:

From: Jonathan Cameron <[email protected]>

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.

Quoted 6 lines
Quoted 2 lines

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

Quoted 140 lines

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

Thanks,

Jonathan

Quoted 132 lines
---
 .../bindings/iio/adc/axp20x_adc.txt           | 48 -------------
 .../bindings/iio/adc/x-powers,axp209-adc.yaml | 67 +++++++++++++++++++
 2 files changed, 67 insertions(+), 48 deletions(-)
Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt deleted +0 -48
deleted file mode 100644
index 7a6313913923..000000000000
@@ -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
Documentation/devicetree/bindings/iio/adc/x-powers,axp209-adc.yaml new file +67 -0
new file mode 100644
index 000000000000..288a5ac31a16
@@ -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 <[email protected]>
+
+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>;
+        };
+    };
+...
#71 lore raw

Re: [PATCH 31/46] dt-bindings:iio:adc:x-powers,axp209-adc: txt to yaml conversion

Quoted 18 lines · On Mon, 23 Nov 2020 11:02:58 +0800 Chen-Yu Tsai <[email protected]> wrote:

Hi,

Quoted 14 lines · Jonathan Cameron
Quoted 10 lines · On Sat, 31 Oct 2020 18:48:39 +0000 Jonathan Cameron <[email protected]> wrote:

From: Jonathan Cameron <[email protected]>

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.

Quoted 8 lines
Quoted 4 lines

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

Quoted 143 lines

ChenYu

Quoted 140 lines

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

Thanks,

Jonathan

Quoted 132 lines
---
 .../bindings/iio/adc/axp20x_adc.txt           | 48 -------------
 .../bindings/iio/adc/x-powers,axp209-adc.yaml | 67 +++++++++++++++++++
 2 files changed, 67 insertions(+), 48 deletions(-)
Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt deleted +0 -48
deleted file mode 100644
index 7a6313913923..000000000000
@@ -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
Documentation/devicetree/bindings/iio/adc/x-powers,axp209-adc.yaml new file +67 -0
new file mode 100644
index 000000000000..288a5ac31a16
@@ -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 <[email protected]>
+
+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>;
+        };
+    };
+...  
author maintainer
#72 lore raw

PATCH 32/46 dt-bindings:iio:adc:brcm,iproc-static-adc: txt to yaml conversion

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Cc Raveendra Padasalagi <[email protected]>
---
 .../iio/adc/brcm,iproc-static-adc.txt         | 40 -----------
 .../iio/adc/brcm,iproc-static-adc.yaml        | 70 +++++++++++++++++++
 2 files changed, 70 insertions(+), 40 deletions(-)
Documentation/devicetree/bindings/iio/adc/brcm,iproc-static-adc.txt deleted +0 -40
deleted file mode 100644
index 7b1b1e4086d4..000000000000
@@ -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>;
-	};
Documentation/devicetree/bindings/iio/adc/brcm,iproc-static-adc.yaml new file +70 -0

70 lines not on this page · raw message

Signature · 1 line
2.28.0
author maintainer
#73 lore raw

PATCH 33/46 dt-bindings:iio:adc:mediatek,mt2701-auxadc: rename and yaml conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Cc Zhiyong Tao <[email protected]>
Cc Matthias Brugger <[email protected]>
---
 .../iio/adc/mediatek,mt2701-auxadc.yaml       | 77 +++++++++++++++++++
 .../bindings/iio/adc/mt6577_auxadc.txt        | 34 --------
 2 files changed, 77 insertions(+), 34 deletions(-)
Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml new file +77 -0
new file mode 100644
index 000000000000..5b21a9fba5dd
@@ -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 <[email protected]>
+  - Matthias Brugger <[email protected]>
+
+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>;
+        };
+    };
+...
Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt deleted +0 -34
deleted file mode 100644
index 1b7ff9e5615a..000000000000
@@ -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>;
-};
Signature · 1 line
2.28.0
author maintainer
#74 lore raw

PATCH 34/46 dt-bindings:iio:adc:ti,palmas-gpadc: txt to yaml format conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 .../bindings/iio/adc/palmas-gpadc.txt         | 48 ----------
 .../bindings/iio/adc/ti,palmas-gpadc.yaml     | 87 +++++++++++++++++++
 2 files changed, 87 insertions(+), 48 deletions(-)
Documentation/devicetree/bindings/iio/adc/palmas-gpadc.txt deleted +0 -48
deleted file mode 100644
index 4bb9a86065d1..000000000000
@@ -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>;
-		};
-	};
-	...
-};
Documentation/devicetree/bindings/iio/adc/ti,palmas-gpadc.yaml new file +87 -0

87 lines not on this page · raw message

Signature · 1 line
2.28.0
#75 lore raw

Re: [PATCH 34/46] dt-bindings:iio:adc:ti,palmas-gpadc: txt to yaml format conversion.

Quoted 10 lines · On Sat, 31 Oct 2020 18:48:42 +0000 Jonathan Cameron <[email protected]> wrote:

From: Jonathan Cameron <[email protected]>

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.

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

Quoted 152 lines
---
 .../bindings/iio/adc/palmas-gpadc.txt         | 48 ----------
 .../bindings/iio/adc/ti,palmas-gpadc.yaml     | 87 +++++++++++++++++++
 2 files changed, 87 insertions(+), 48 deletions(-)
Documentation/devicetree/bindings/iio/adc/palmas-gpadc.txt deleted +0 -48
deleted file mode 100644
index 4bb9a86065d1..000000000000
@@ -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>;
-		};
-	};
-	...
-};
Documentation/devicetree/bindings/iio/adc/ti,palmas-gpadc.yaml new file +87 -0
new file mode 100644
index 000000000000..692dacd0fee5
@@ -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 <[email protected]>
+
+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>;
+        };
+    };
+...
author maintainer
#76 lore raw

PATCH 35/46 dt-bindings:iio:adc:qcom,pm8018-adc: yaml conversion and rename.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 .../bindings/iio/adc/qcom,pm8018-adc.yaml     | 166 ++++++++++++++++++
 .../bindings/iio/adc/qcom,pm8xxx-xoadc.txt    | 157 -----------------
 2 files changed, 166 insertions(+), 157 deletions(-)
Documentation/devicetree/bindings/iio/adc/qcom,pm8018-adc.yaml new file +166 -0
new file mode 100644
index 000000000000..d186b713d6a7
@@ -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 <[email protected]>
+
+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>;
+           };
+        };
+    };
+...
Documentation/devicetree/bindings/iio/adc/qcom,pm8xxx-xoadc.txt deleted +0 -157

157 lines not on this page · raw message

Signature · 1 line
2.28.0
Reviewed-by on v1 35/46
#77 lore raw

Re: [PATCH 35/46] dt-bindings:iio:adc:qcom,pm8018-adc: yaml conversion and rename.

Quoted 10 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Looks good:

Yours,
Linus Walleij

author maintainer
#78 lore raw

PATCH 36/46 dt-bindings:iio:adc:qcom,spmi-iadc: txt to yaml format conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 .../bindings/iio/adc/qcom,spmi-iadc.txt       | 46 --------------
 .../bindings/iio/adc/qcom,spmi-iadc.yaml      | 62 +++++++++++++++++++
 2 files changed, 62 insertions(+), 46 deletions(-)
Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.txt deleted +0 -46
deleted file mode 100644
index 4e36d6e2f7b6..000000000000
@@ -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";
-	};
Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.yaml new file +62 -0

62 lines not on this page · raw message

Signature · 1 line
2.28.0
author maintainer
#79 lore raw

Re: [PATCH 36/46] dt-bindings:iio:adc:qcom,spmi-iadc: txt to yaml format conversion.

Quoted 8 lines · On Sat, 31 Oct 2020 18:48:44 +0000 Jonathan Cameron <[email protected]> wrote:

From: Jonathan Cameron <[email protected]>

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.

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

Quoted 125 lines
---
 .../bindings/iio/adc/qcom,spmi-iadc.txt       | 46 --------------
 .../bindings/iio/adc/qcom,spmi-iadc.yaml      | 62 +++++++++++++++++++
 2 files changed, 62 insertions(+), 46 deletions(-)
Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.txt deleted +0 -46
deleted file mode 100644
index 4e36d6e2f7b6..000000000000
@@ -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";
-	};
Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.yaml new file +62 -0
new file mode 100644
index 000000000000..359e1ede0ae2
@@ -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 <[email protected]>
+
+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>;
+        };
+    };
+...
+
author maintainer
#80 lore raw

PATCH 37/46 dt-binding:iio:adc:ti,ads124s08: txt to yaml format conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Simple binding so straight forward format conversion.

---
 .../bindings/iio/adc/ti,ads124s08.yaml        | 52 +++++++++++++++++++
 .../bindings/iio/adc/ti-ads124s08.txt         | 25 ---------
 2 files changed, 52 insertions(+), 25 deletions(-)
Documentation/devicetree/bindings/iio/adc/ti,ads124s08.yaml new file +52 -0
new file mode 100644
index 000000000000..5912a52953fa
@@ -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 <[email protected]>
+
+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>;
+        };
+    };
+...
Documentation/devicetree/bindings/iio/adc/ti-ads124s08.txt deleted +0 -25
deleted file mode 100644
index ecf807bb32f7..000000000000
@@ -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>;
-};
Signature · 1 line
2.28.0
Reviewed-by on v1 37/46
#81 lore raw

Re: [PATCH 37/46] dt-binding:iio:adc:ti,ads124s08: txt to yaml format conversion.

Jonathan

Quoted 17 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Simple binding so straight forward format conversion.

---
  .../bindings/iio/adc/ti,ads124s08.yaml        | 52 +++++++++++++++++++
  .../bindings/iio/adc/ti-ads124s08.txt         | 25 ---------
  2 files changed, 52 insertions(+), 25 deletions(-)
Documentation/devicetree/bindings/iio/adc/ti,ads124s08.yaml new file +0 -0
new file mode 100644
index 000000000000..5912a52953fa

Documentation/devicetree/bindings/iio/adc/ti,ads124s08.yaml line 1

Quoted 1 line
Documentation/devicetree/bindings/iio/adc/ti,ads124s08.yaml new file +1 -0
@@ -0,0 +1,52 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)

GPL-2.0-only  OR BSD-2-Clause

Otherwise

author maintainer
#82 lore raw

Re: [PATCH 37/46] dt-binding:iio:adc:ti,ads124s08: txt to yaml format conversion.

Quoted 14 lines · On Mon, 2 Nov 2020 06:49:54 -0600 Dan Murphy <[email protected]> wrote:

Jonathan

Quoted 11 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Simple binding so straight forward format conversion.

---
  .../bindings/iio/adc/ti,ads124s08.yaml        | 52 +++++++++++++++++++
  .../bindings/iio/adc/ti-ads124s08.txt         | 25 ---------
  2 files changed, 52 insertions(+), 25 deletions(-)
Quoted 9 lines

Documentation/devicetree/bindings/iio/adc/ti,ads124s08.yaml line 1

Quoted 7 lines
Documentation/devicetree/bindings/iio/adc/ti,ads124s08.yaml new file +1 -0
new file mode 100644
index 000000000000..5912a52953fa
@@ -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

Quoted 4 lines

Otherwise

author maintainer
#83 lore raw

PATCH 38/46 dt-bindings:iio:dac:ad5592r: txt to yaml format conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

Cc Michael Hennerich <[email protected]>
---
 .../devicetree/bindings/iio/dac/ad5592r.txt   | 155 --------------
 .../bindings/iio/dac/adi,ad5592r.yaml         | 201 ++++++++++++++++++
 2 files changed, 201 insertions(+), 155 deletions(-)
Documentation/devicetree/bindings/iio/dac/ad5592r.txt deleted +0 -155
deleted file mode 100644
index 989f96f31c66..000000000000
@@ -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>;
-		};
-	};
Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml new file +201 -0

201 lines not on this page · raw message

Signature · 1 line
2.28.0
maintainer
#84 lore raw

Re: [PATCH 38/46] dt-bindings:iio:dac:ad5592r: txt to yaml format conversion.

Quoted 246 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

Cc Michael Hennerich <[email protected]>
---
 .../devicetree/bindings/iio/dac/ad5592r.txt   | 155 --------------
 .../bindings/iio/dac/adi,ad5592r.yaml         | 201 ++++++++++++++++++
 2 files changed, 201 insertions(+), 155 deletions(-)
Documentation/devicetree/bindings/iio/dac/ad5592r.txt deleted +0 -155
deleted file mode 100644
index 989f96f31c66..000000000000
@@ -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>;
-		};
-	};
Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml new file +67 -0
new file mode 100644
index 000000000000..c49646825c37
@@ -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 <[email protected]>
+
+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

Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml line 77

Quoted 10 lines
Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml new file +10 -0
+
+additionalProperties: false
+
+patternProperties:
+  "^(channel@)[0-7]$":
+    type: object
+    description: Child node to describe a channel
+    properties:
+      reg:
+        maxItems: 1

minimum: 0
maximum: 7

Quoted 6 lines
Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml new file +6 -0
+
+      adi,mode:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: |
+          Mode or function of this channel.
+          Macros specifying the valid values can be found in

Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml line 93

Quoted 10 lines
Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml new file +10 -0
+          <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.

Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml line 104

Quoted 11 lines
Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml new file +11 -0
+
+      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.

Quoted 100 lines
Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml new file +97 -0
+
+    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>;
+            };
+        };
+    };
+...
Signature · 1 line
2.28.0
author maintainer
#85 lore raw

Re: [PATCH 38/46] dt-bindings:iio:dac:ad5592r: txt to yaml format conversion.

Quoted 8 lines · On Tue, 3 Nov 2020 10:31:20 -0600 Rob Herring <[email protected]> wrote:
Quoted 7 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

Cc Michael Hennerich <[email protected]>

Tweaked as suggested by Rob and applied.

thanks,

Jonathan

Quoted 244 lines
Quoted 244 lines
---
 .../devicetree/bindings/iio/dac/ad5592r.txt   | 155 --------------
 .../bindings/iio/dac/adi,ad5592r.yaml         | 201 ++++++++++++++++++
 2 files changed, 201 insertions(+), 155 deletions(-)
Documentation/devicetree/bindings/iio/dac/ad5592r.txt deleted +0 -155
deleted file mode 100644
index 989f96f31c66..000000000000
@@ -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>;
-		};
-	};
Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml new file +72 -0
new file mode 100644
index 000000000000..c49646825c37
@@ -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 <[email protected]>
+
+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]$":
Quoted 8 lines

Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml line 77

Quoted 5 lines
Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml new file +5 -0
+    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.

Quoted 11 lines
Quoted 11 lines
Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml new file +10 -0
+
+      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)
Quoted 8 lines

Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml line 93

Quoted 6 lines
Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml new file +6 -0
+          * 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

Quoted 13 lines

Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml line 104

Quoted 12 lines
Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml new file +11 -0
+
+      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)  
Quoted 2 lines

Here too.

Changed to an enum: [0, 1, 2, 3] to reflect underlying values.

author maintainer
#86 lore raw

PATCH 39/46 dt-bindings:iio:dac:ad5755: txt to yaml format conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

---
 .../devicetree/bindings/iio/dac/ad5755.txt    | 124 ------------
 .../bindings/iio/dac/adi,ad5755.yaml          | 178 ++++++++++++++++++
 2 files changed, 178 insertions(+), 124 deletions(-)
Documentation/devicetree/bindings/iio/dac/ad5755.txt deleted +0 -124
deleted file mode 100644
index 502e1e55adbd..000000000000
@@ -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>;
-	};
-};
Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml new file +178 -0

178 lines not on this page · raw message

Signature · 1 line
2.28.0
maintainer
#87 lore raw

Re: [PATCH 39/46] dt-bindings:iio:dac:ad5755: txt to yaml format conversion.

Quoted 264 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

---
 .../devicetree/bindings/iio/dac/ad5755.txt    | 124 ------------
 .../bindings/iio/dac/adi,ad5755.yaml          | 178 ++++++++++++++++++
 2 files changed, 178 insertions(+), 124 deletions(-)
Documentation/devicetree/bindings/iio/dac/ad5755.txt deleted +0 -124
deleted file mode 100644
index 502e1e55adbd..000000000000
@@ -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>;
-	};
-};
Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml new file +116 -0
new file mode 100644
index 000000000000..74edff3e8408
@@ -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 <[email protected]>
+
+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]
+

Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml line 126

Quoted 10 lines
Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml new file +10 -0
+    required:
+      - reg
+
+    additionalProperties: false
+
+allOf:
+  - $ref: '#/definitions/cpolXORcpha'
+
+definitions:
+  cpolXORcpha:

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

Quoted 55 lines
Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml new file +52 -0
+    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>;
+            };
+        };
+    };
+...
Signature · 1 line
2.28.0
author maintainer
#88 lore raw

Re: [PATCH 39/46] dt-bindings:iio:dac:ad5755: txt to yaml format conversion.

Quoted 269 lines · On Tue, 3 Nov 2020 10:32:37 -0600 Rob Herring <[email protected]> wrote:
Quoted 268 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

---
 .../devicetree/bindings/iio/dac/ad5755.txt    | 124 ------------
 .../bindings/iio/dac/adi,ad5755.yaml          | 178 ++++++++++++++++++
 2 files changed, 178 insertions(+), 124 deletions(-)
Documentation/devicetree/bindings/iio/dac/ad5755.txt deleted +0 -124
deleted file mode 100644
index 502e1e55adbd..000000000000
@@ -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>;
-	};
-};
Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml new file +120 -0
new file mode 100644
index 000000000000..74edff3e8408
@@ -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 <[email protected]>
+
+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
Quoted 8 lines

Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml line 126

Quoted 6 lines
Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml new file +6 -0
+
+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

Quoted 56 lines
Quoted 56 lines
Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml new file +52 -0
+    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>;
+            };
+        };
+    };
+...
Signature · 1 line
2.28.0
author maintainer
#89 lore raw

Re: [PATCH 39/46] dt-bindings:iio:dac:ad5755: txt to yaml format conversion.

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

Quoted 208 lines
Quoted 126 lines
Quoted 126 lines
Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml new file +120 -0
new file mode 100644
index 000000000000..74edff3e8408
@@ -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 <[email protected]>
+
+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
Quoted 8 lines

Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml line 126

Quoted 6 lines
Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml new file +6 -0
+
+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

Quoted 56 lines
Quoted 56 lines
Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml new file +52 -0
+    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>;
+            };
+        };
+    };
+...
Signature · 1 line
2.28.0
author maintainer
#90 lore raw

PATCH 40/46 dt-bindings:iio:accel:bosch,bma180: txt to yaml format conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Cc Oleksandr Kravchenko <[email protected]>
---
 .../devicetree/bindings/iio/accel/bma180.txt  | 35 -----------
 .../bindings/iio/accel/bosch,bma180.yaml      | 62 +++++++++++++++++++
 2 files changed, 62 insertions(+), 35 deletions(-)
Documentation/devicetree/bindings/iio/accel/bma180.txt deleted +0 -35
deleted file mode 100644
index 33da4a6fdb39..000000000000
@@ -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)>;
-};
Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml new file +62 -0

62 lines not on this page · raw message

Signature · 1 line
2.28.0
#91 lore raw

Re: [PATCH 40/46] dt-bindings:iio:accel:bosch,bma180: txt to yaml format conversion.

Quoted 8 lines · On Sat, 31 Oct 2020 18:48:48 +0000 Jonathan Cameron <[email protected]> wrote:

From: Jonathan Cameron <[email protected]>

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.

Cc Oleksandr Kravchenko <[email protected]>

Olkesandr's email address is bouncing so I've listed myself as maintainer for now.

Applied.

Thanks,

Jonathan

Quoted 114 lines
---
 .../devicetree/bindings/iio/accel/bma180.txt  | 35 -----------
 .../bindings/iio/accel/bosch,bma180.yaml      | 62 +++++++++++++++++++
 2 files changed, 62 insertions(+), 35 deletions(-)
Documentation/devicetree/bindings/iio/accel/bma180.txt deleted +0 -35
deleted file mode 100644
index 33da4a6fdb39..000000000000
@@ -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)>;
-};
Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml new file +62 -0
new file mode 100644
index 000000000000..14e48290ffe3
@@ -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 <[email protected]>
+
+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)>;
+        };
+    };
+...
author maintainer
#92 lore raw

PATCH 41/46 dt-bindings:iio:accel:kionix,kxcjk1013: txt to yaml format conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Very simple binding hence a straight forward conversion.

Cc Dmitry Osipenko <[email protected]>
Cc Robert Yang <[email protected]>
---
 .../bindings/iio/accel/kionix,kxcjk1013.txt   | 24 ----------
 .../bindings/iio/accel/kionix,kxcjk1013.yaml  | 46 +++++++++++++++++++
 2 files changed, 46 insertions(+), 24 deletions(-)
Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.txt deleted +0 -24
deleted file mode 100644
index ce950e162d5d..000000000000
@@ -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";
-};
Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.yaml new file +46 -0

46 lines not on this page · raw message

Signature · 1 line
2.28.0
author maintainer
#93 lore raw

PATCH 42/46 dt-bindings:iio:accel:fsl,mma8452: txt to yaml conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Cc Martin Kepplinger <[email protected]>
---
 .../bindings/iio/accel/fsl,mma8452.yaml       | 62 +++++++++++++++++++
 .../devicetree/bindings/iio/accel/mma8452.txt | 35 -----------
 2 files changed, 62 insertions(+), 35 deletions(-)
Documentation/devicetree/bindings/iio/accel/fsl,mma8452.yaml new file +62 -0
new file mode 100644
index 000000000000..3b8e5ebdf90c
@@ -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 <[email protected]>
+
+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";
+        };
+    };
+...
Documentation/devicetree/bindings/iio/accel/mma8452.txt deleted +0 -35
deleted file mode 100644
index e132394375a1..000000000000
@@ -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";
-	};
Signature · 1 line
2.28.0
maintainer
#94 lore raw

Re: [PATCH 42/46] dt-bindings:iio:accel:fsl,mma8452: txt to yaml conversion.

Quoted 47 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Cc Martin Kepplinger <[email protected]>
---
 .../bindings/iio/accel/fsl,mma8452.yaml       | 62 +++++++++++++++++++
 .../devicetree/bindings/iio/accel/mma8452.txt | 35 -----------
 2 files changed, 62 insertions(+), 35 deletions(-)
Documentation/devicetree/bindings/iio/accel/fsl,mma8452.yaml new file +27 -0
new file mode 100644
index 000000000000..3b8e5ebdf90c
@@ -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 <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - fsl,mma8451
+      - fsl,mma8452
+      - fsl,mma8453
+      - fsl,mma8652
+      - fsl,mma8653
+      - fsl,fxls8471
+
+  reg:
+    maxItems: 1
+
+  interrupts:

Documentation/devicetree/bindings/iio/accel/fsl,mma8452.yaml line 37

Quoted 10 lines
Documentation/devicetree/bindings/iio/accel/fsl,mma8452.yaml new file +10 -0
+    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.

Quoted 69 lines
Documentation/devicetree/bindings/iio/accel/fsl,mma8452.yaml new file +25 -0
+
+  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";
+        };
+    };
+...
Documentation/devicetree/bindings/iio/accel/mma8452.txt deleted +0 -35
deleted file mode 100644
index e132394375a1..000000000000
@@ -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";
-	};
Signature · 1 line
2.28.0
author maintainer
#95 lore raw

Re: [PATCH 42/46] dt-bindings:iio:accel:fsl,mma8452: txt to yaml conversion.

Quoted 52 lines · On Tue, 3 Nov 2020 10:34:07 -0600 Rob Herring <[email protected]> wrote:
Quoted 51 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Cc Martin Kepplinger <[email protected]>
---
 .../bindings/iio/accel/fsl,mma8452.yaml       | 62 +++++++++++++++++++
 .../devicetree/bindings/iio/accel/mma8452.txt | 35 -----------
 2 files changed, 62 insertions(+), 35 deletions(-)
Documentation/devicetree/bindings/iio/accel/fsl,mma8452.yaml new file +31 -0
new file mode 100644
index 000000000000..3b8e5ebdf90c
@@ -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 <[email protected]>
+
+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
Quoted 9 lines

Documentation/devicetree/bindings/iio/accel/fsl,mma8452.yaml line 37

Quoted 6 lines
Documentation/devicetree/bindings/iio/accel/fsl,mma8452.yaml new file +6 -0
+
+  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

Quoted 69 lines
Quoted 69 lines
Documentation/devicetree/bindings/iio/accel/fsl,mma8452.yaml new file +25 -0
+
+  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";
+        };
+    };
+...
Documentation/devicetree/bindings/iio/accel/mma8452.txt deleted +0 -35
deleted file mode 100644
index e132394375a1..000000000000
@@ -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";
-	};
Signature · 1 line
2.28.0
author maintainer
#96 lore raw

PATCH 43/46 dt-bindings:iio:gyro:bosch,bmg180: txt to yaml format conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Very simple direct conversion of existing txt file.

Cc H. Nikolaus Schaller <[email protected]>
---
 .../bindings/iio/gyroscope/bmg160.txt         | 20 --------
 .../bindings/iio/gyroscope/bosch,bmg160.yaml  | 46 +++++++++++++++++++
 2 files changed, 46 insertions(+), 20 deletions(-)
Documentation/devicetree/bindings/iio/gyroscope/bmg160.txt deleted +0 -20
deleted file mode 100644
index bb43d1ad9c9f..000000000000
@@ -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)>;
-};
Documentation/devicetree/bindings/iio/gyroscope/bosch,bmg160.yaml new file +46 -0

46 lines not on this page · raw message

Signature · 1 line
2.28.0
author maintainer
#97 lore raw

PATCH 44/46 dt-bindings:iio:st,st-sensors: txt to yaml conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 .../bindings/iio/st,st-sensors.yaml           | 123 ++++++++++++++++++
 .../devicetree/bindings/iio/st-sensors.txt    |  82 ------------
 2 files changed, 123 insertions(+), 82 deletions(-)
Documentation/devicetree/bindings/iio/st,st-sensors.yaml new file +123 -0
new file mode 100644
index 000000000000..db291a9390b7
@@ -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 <[email protected]>
+
+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";
+        };
+    };
+...
Documentation/devicetree/bindings/iio/st-sensors.txt deleted +0 -82

82 lines not on this page · raw message

Signature · 1 line
2.28.0
Acked-by on v1 44/46
#98 lore raw

RE: [PATCH 44/46] dt-bindings:iio:st,st-sensors: txt to yaml conversion.

Hello Jonathan,

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

Thanks,
Denis

Quoted 249 lines

-----Original Message-----
From: Jonathan Cameron <[email protected]>
Sent: Saturday, October 31, 2020 11:49 AM
To: [email protected]; Rob Herring <[email protected]>; [email protected]
Cc: Jonathan Cameron <[email protected]>; Denis CIOCCA <[email protected]>
Subject: [PATCH 44/46] dt-bindings:iio:st,st-sensors: txt to yaml conversion.

From: Jonathan Cameron <[email protected]>

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.

---
 .../bindings/iio/st,st-sensors.yaml           | 123 ++++++++++++++++++
 .../devicetree/bindings/iio/st-sensors.txt    |  82 ------------
 2 files changed, 123 insertions(+), 82 deletions(-)
Documentation/devicetree/bindings/iio/st,st-sensors.yaml new file +125 -0
new file mode 100644
index 000000000000..db291a9390b7
@@ -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 <[email protected]>
+
+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";
+        };
+    };
+...
Documentation/devicetree/bindings/iio/st-sensors.txt deleted +0 -3
deleted file mode 100644
index 3213599c5071..000000000000
@@ -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.

Documentation/devicetree/bindings/iio/st-sensors.txt deleted +0 -19
-
-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.

Documentation/devicetree/bindings/iio/st-sensors.txt deleted +0 -58
-
-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

author maintainer
#99 lore raw

PATCH 45/46 dt-bindings:iio:frequency:adi,adf4350: txt to yaml format conversion.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Cc Michael Hennerich <[email protected]>
---
 .../bindings/iio/frequency/adf4350.txt        |  86 --------
 .../bindings/iio/frequency/adi,adf4350.yaml   | 190 ++++++++++++++++++
 2 files changed, 190 insertions(+), 86 deletions(-)
Documentation/devicetree/bindings/iio/frequency/adf4350.txt deleted +0 -86
deleted file mode 100644
index f8c181d81d2d..000000000000
@@ -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;
-		};
Documentation/devicetree/bindings/iio/frequency/adi,adf4350.yaml new file +190 -0

190 lines not on this page · raw message

Signature · 1 line
2.28.0
author maintainer
#100 lore raw

PATCH 46/46 dt-bindings:iio:temperature: Drop generic binding file.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Cc Patrick Havelange <[email protected]>
---
 .../bindings/iio/temperature/temperature-bindings.txt      | 7 -------
 1 file changed, 7 deletions(-)
Documentation/devicetree/bindings/iio/temperature/temperature-bindings.txt deleted +0 -7
deleted file mode 100644
index 8f339cab74ae..000000000000
@@ -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.
Signature · 1 line
2.28.0
maintainer Reviewed-by on the v1 series
#101 lore raw
In reply to Jonathan Cameron
Quoted 6 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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... :)

Quoted 63 lines

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.

Quoted 8 lines

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,

#102 lore raw
Quoted 9 lines · On Tue, 3 Nov 2020 10:38:00 -0600 Rob Herring <[email protected]> wrote:
Quoted 6 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

Quoted 73 lines
Quoted 64 lines

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.

Quoted 8 lines

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.

Quoted 4 lines

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

Great. Thanks again,

Jonathan

author maintainer
#103 lore raw
Quoted 12 lines · On Tue, 3 Nov 2020 17:24:08 +0000 Jonathan Cameron…
Quoted 9 lines · On Tue, 3 Nov 2020 10:38:00 -0600 Rob Herring <[email protected]> wrote:
Quoted 6 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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... :)

Quoted 9 lines

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

Quoted 83 lines
Quoted 74 lines
Quoted 65 lines

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.

Quoted 8 lines

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.

Quoted 4 lines

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

Great. Thanks again,

Jonathan