* [PATCH v3 3/5] dt-bindings: iio: pressure: Add MS5637
[not found] <20260820141224.23730-1-adamianlouis@gmail.com>
@ 2026-08-20 14:12 ` Louis Adamian
2026-08-20 14:21 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Louis Adamian @ 2026-08-20 14:12 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Louis Adamian
Cc: linux-iio, devicetree, linux-kernel
Create meas,ms5637 devicetree binding and move existing devices from
trivial-devices.yaml. Explicit compatible strings are added for the
different sub-variants because each requires different constants for the
second-order temperature compensation formulas. Previously, the driver
exposed the generic compatibles for the ms5637, MS5803, MS5805
and MS5837 families and applied the MS5637-02BA compensation to all of
them. To preserve the DT ABI the existing compatibles are retained and
mapped to the -02BA variant of each family (ms5637-02ba, ms5803-02ba,
ms5837-02ba).
Signed-off-by: Louis Adamian <adamianlouis@gmail.com>
---
.../bindings/iio/pressure/meas,ms5637.yaml | 93 +++++++++++++++++++
.../devicetree/bindings/trivial-devices.yaml | 10 --
2 files changed, 93 insertions(+), 10 deletions(-)
create mode 100644 Documentation/devicetree/bindings/iio/pressure/meas,ms5637.yaml
diff --git a/Documentation/devicetree/bindings/iio/pressure/meas,ms5637.yaml b/Documentation/devicetree/bindings/iio/pressure/meas,ms5637.yaml
new file mode 100644
index 000000000000..befd81d1907b
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/pressure/meas,ms5637.yaml
@@ -0,0 +1,93 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/pressure/meas,ms5637.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+title: Measurement Specialties ms5637 and similar pressure sensors
+
+maintainers:
+ - Louis Adamian <adamianlouis@gmail.com>
+
+description:
+ Measurement Specialties pressure and temperature sensors. The MS5803
+ family supports both I2C and SPI interfaces. All other variants are I2C only.
+
+properties:
+ compatible:
+ oneOf:
+ - enum:
+ - meas,ms5637-02ba
+ - meas,ms5637-30ba
+ - meas,ms5803-01ba
+ - meas,ms5803-02ba
+ - meas,ms5803-05ba
+ - meas,ms5803-14ba
+ - meas,ms5803-30ba
+ - meas,ms5805
+ - meas,ms5837-02ba
+ - meas,ms5837-30ba
+ - meas,ms8607-temppressure
+ # These generic compatible strings do not identify the sub-variants of
+ # the part. They are retained so that existing device trees continue
+ # to bind, and each is treated as the -02BA variant of its family.
+ - enum:
+ - meas,ms5637
+ - meas,ms5803
+ - meas,ms5837
+ deprecated: true
+
+ reg:
+ maxItems: 1
+
+ vdd-supply:
+ description: Regulator that provides power to the sensor
+
+required:
+ - compatible
+ - reg
+ - vdd-supply
+
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - meas,ms5803
+ - meas,ms5803-01ba
+ - meas,ms5803-02ba
+ - meas,ms5803-05ba
+ - meas,ms5803-14ba
+ - meas,ms5803-30ba
+ then:
+ $ref: /schemas/spi/spi-peripheral-props.yaml#
+ properties:
+ spi-max-frequency:
+ maximum: 20000000
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ pressure@76 {
+ compatible = "meas,ms5637-02ba";
+ reg = <0x76>;
+ vdd-supply = <&vcc_3v3>;
+ };
+ };
+ - |
+ spi {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ pressure@0 {
+ compatible = "meas,ms5803-14ba";
+ reg = <0>;
+ vdd-supply = <&vcc_3v3>;
+ spi-max-frequency = <20000000>;
+ };
+ };
diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
index 435c4baab436..2671040e8802 100644
--- a/Documentation/devicetree/bindings/trivial-devices.yaml
+++ b/Documentation/devicetree/bindings/trivial-devices.yaml
@@ -240,18 +240,8 @@ properties:
- meas,htu21
# Measurement Specialities I2C temperature and humidity sensor
- meas,htu31
- # Measurement Specialities I2C pressure and temperature sensor
- - meas,ms5637
- # Measurement Specialities I2C pressure and temperature sensor
- - meas,ms5803
- # Measurement Specialities I2C pressure and temperature sensor
- - meas,ms5805
- # Measurement Specialities I2C pressure and temperature sensor
- - meas,ms5837
# Measurement Specialities temp and humidity part of ms8607 device
- meas,ms8607-humidity
- # Measurement Specialities temp and pressure part of ms8607 device
- - meas,ms8607-temppressure
# Measurement Specialties temperature sensor
- meas,tsys01
# MEMSIC magnetometer
--
2.55.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v3 3/5] dt-bindings: iio: pressure: Add MS5637
2026-08-20 14:12 ` [PATCH v3 3/5] dt-bindings: iio: pressure: Add MS5637 Louis Adamian
@ 2026-08-20 14:21 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-08-20 14:21 UTC (permalink / raw)
To: Louis Adamian; +Cc: robh, conor+dt, devicetree
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Making `vdd-supply` an unconditionally required property breaks backward compatibility for existing device trees.
--
--- Patch [3]: [PATCH v3 3/5] dt-bindings: iio: pressure: Add MS5637 ---
commit f37736f8c819b5be2f362b907ebbc2d3373ecbfe
Author: Louis Adamian <adamianlouis@gmail.com>
dt-bindings: iio: pressure: Add MS5637
Create meas,ms5637 devicetree binding and move existing devices from
trivial-devices.yaml. Explicit compatible strings are added for the
different sub-variants because each requires different constants for the
second-order temperature compensation formulas.
> diff --git a/Documentation/devicetree/bindings/iio/pressure/meas,ms5637.yaml b/Documentation/devicetree/bindings/iio/pressure/meas,ms5637.yaml
> new file mode 100644
> index 0000000000000..befd81d1907b4
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/pressure/meas,ms5637.yaml
[ ... ]
> +properties:
> + compatible:
> + oneOf:
> + - enum:
> + - meas,ms5637-02ba
> + - meas,ms5637-30ba
> + - meas,ms5803-01ba
> + - meas,ms5803-02ba
> + - meas,ms5803-05ba
> + - meas,ms5803-14ba
> + - meas,ms5803-30ba
> + - meas,ms5805
> + - meas,ms5837-02ba
> + - meas,ms5837-30ba
> + - meas,ms8607-temppressure
> + # These generic compatible strings do not identify the sub-variants of
> + # the part. They are retained so that existing device trees continue
> + # to bind, and each is treated as the -02BA variant of its family.
> + - enum:
> + - meas,ms5637
> + - meas,ms5803
> + - meas,ms5837
> + deprecated: true
> +
> + reg:
> + maxItems: 1
> +
> + vdd-supply:
> + description: Regulator that provides power to the sensor
> +
> +required:
> + - compatible
> + - reg
> + - vdd-supply
[Severity: Medium]
Will making vdd-supply unconditionally required break backward compatibility
for existing device trees?
These generic compatible strings (e.g., meas,ms5637, meas,ms5803) were
previously documented in trivial-devices.yaml. That schema restricts
properties to a very narrow set and strictly forbids vdd-supply via
additionalProperties: false.
Consequently, existing valid device trees do not include vdd-supply.
By moving these devices to a new standalone binding and making vdd-supply
unconditionally required, won't previously valid device trees fail validation?
Should newly documented properties remain optional, or be conditionally
required using an if-then block only for the newly added specific compatible
strings to preserve the DT ABI when extracting devices from
trivial-devices.yaml?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260820141224.23730-1-adamianlouis@gmail.com?part=3
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-20 14:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260820141224.23730-1-adamianlouis@gmail.com>
2026-08-20 14:12 ` [PATCH v3 3/5] dt-bindings: iio: pressure: Add MS5637 Louis Adamian
2026-08-20 14:21 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox