diff mbox series

[v3,5/7] dt-bindings: iio: bosch,bme680: Add supply properties

Message ID 20241102131311.36210-6-vassilisamir@gmail.com
State Changes Requested
Headers show
Series : iio: chemical: bme680: 2nd round of cleanup | expand

Checks

Context Check Description
robh/dt-meta-schema success
robh/checkpatch success
robh/patch-applied success
robh/dtbs-check warning build log

Commit Message

Vasileios Amoiridis Nov. 2, 2024, 1:13 p.m. UTC
Extend dt-binding for BME680 gas sensor device. The device incorporates
as well temperature, pressure and relative humidity sensors.

Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
---
 .../bindings/iio/chemical/bosch,bme680.yaml   | 62 +++++++++++++++++++
 .../devicetree/bindings/trivial-devices.yaml  |  2 -
 2 files changed, 62 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/iio/chemical/bosch,bme680.yaml

Comments

Jonathan Cameron Nov. 2, 2024, 3:33 p.m. UTC | #1
On Sat,  2 Nov 2024 14:13:09 +0100
Vasileios Amoiridis <vassilisamir@gmail.com> wrote:

> Extend dt-binding for BME680 gas sensor device. The device incorporates
> as well temperature, pressure and relative humidity sensors.
This description should make it clear it is moving from trivial-devices.yaml

dt-bindings: iio: bosch,bme680: Move from trivial-bindings and add missing supplies.

Then say a little more on why you are moving it.

> 
> Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>

There was an open question on the previous version about
setting the supplies as required (which I see you've removed).
My understanding previously was that it is fine to make that change
in a binding if it reflects supplies that are required to be enabled
for the device to function at all.  If there were previously missing
that's a binding bug we should fix.

I'd like a clarification from the DT binding maintainers on that.
Obviously doesn't work for other users of dt bindings but in
Linux this would be fine as they were already on for any board
that worked and the regulator framework will through us a fake
regulator for cases like this.

https://lore.kernel.org/all/20241022182451.00007ac0@Huawei.com/

Jonathan

https://lore.kernel.org/all/20241022182451.00007ac0@Huawei.com/

> ---
>  .../bindings/iio/chemical/bosch,bme680.yaml   | 62 +++++++++++++++++++
>  .../devicetree/bindings/trivial-devices.yaml  |  2 -
>  2 files changed, 62 insertions(+), 2 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/iio/chemical/bosch,bme680.yaml
> 
> diff --git a/Documentation/devicetree/bindings/iio/chemical/bosch,bme680.yaml b/Documentation/devicetree/bindings/iio/chemical/bosch,bme680.yaml
> new file mode 100644
> index 000000000000..0eac22e465e7
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/chemical/bosch,bme680.yaml
> @@ -0,0 +1,62 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/chemical/bosch,bme680.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Bosch BME680 Gas sensor
> +
> +maintainers:
> +  - Vasileios Amoiridis <vassilisamir@gmail.com>
> +
> +description: >
> +  BME680 is a gas sensor which combines relative humidity, barometric pressure,
> +  ambient temperature and gas (VOC - Volatile Organic Compounds) measurements.
> +
> +  https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bme680-ds001.pdf
> +
> +properties:
> +  compatible:
> +    const: bosch,bme680
> +
> +  reg:
> +    maxItems: 1
> +
> +  vdd-supply: true
> +  vddio-supply: true
> +
> +required:
> +  - compatible
> +  - reg
> +
> +allOf:
> +  - $ref: /schemas/spi/spi-peripheral-props.yaml#
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        bme680@77 {
> +            compatible = "bosch,bme680";
> +            reg = <0x77>;
> +            vddio-supply = <&vddio>;
> +            vdd-supply = <&vdd>;
> +        };
> +    };
> +  - |
> +    spi {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        bme680@0 {
> +            compatible = "bosch,bme680";
> +            reg = <0>;
> +            spi-max-frequency = <500000>;
> +            vddio-supply = <&vddio>;
> +            vdd-supply = <&vdd>;
> +        };
> +    };
> diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
> index 9bf0fb17a05e..b651826e2d21 100644
> --- a/Documentation/devicetree/bindings/trivial-devices.yaml
> +++ b/Documentation/devicetree/bindings/trivial-devices.yaml
> @@ -55,8 +55,6 @@ properties:
>            - atmel,atsha204a
>              # BPA-RS600: Power Supply
>            - blutek,bpa-rs600
> -            # Bosch Sensortec pressure, temperature, humididty and VOC sensor
> -          - bosch,bme680
>              # CM32181: Ambient Light Sensor
>            - capella,cm32181
>              # CM3232: Ambient Light Sensor
Krzysztof Kozlowski Nov. 3, 2024, 9:46 a.m. UTC | #2
On Sat, Nov 02, 2024 at 03:33:15PM +0000, Jonathan Cameron wrote:
> On Sat,  2 Nov 2024 14:13:09 +0100
> Vasileios Amoiridis <vassilisamir@gmail.com> wrote:
> 
> > Extend dt-binding for BME680 gas sensor device. The device incorporates
> > as well temperature, pressure and relative humidity sensors.
> This description should make it clear it is moving from trivial-devices.yaml
> 
> dt-bindings: iio: bosch,bme680: Move from trivial-bindings and add missing supplies.
> 
> Then say a little more on why you are moving it.
> 
> > 
> > Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
> 
> There was an open question on the previous version about
> setting the supplies as required (which I see you've removed).
> My understanding previously was that it is fine to make that change
> in a binding if it reflects supplies that are required to be enabled
> for the device to function at all.  If there were previously missing
> that's a binding bug we should fix.
> 
> I'd like a clarification from the DT binding maintainers on that.
> Obviously doesn't work for other users of dt bindings but in
> Linux this would be fine as they were already on for any board
> that worked and the regulator framework will through us a fake
> regulator for cases like this.
> 
> https://lore.kernel.org/all/20241022182451.00007ac0@Huawei.com/
> 
> Jonathan

That was Rob's objection so I will leave it to him, but putting my two
cents in for Linux it is not an ABI break because missing regulator
supplies are substituted with dummy ones. Unless something changed...

Best regards,
Krzysztof
Rob Herring (Arm) Nov. 4, 2024, 4:10 p.m. UTC | #3
On Sun, Nov 03, 2024 at 10:46:46AM +0100, Krzysztof Kozlowski wrote:
> On Sat, Nov 02, 2024 at 03:33:15PM +0000, Jonathan Cameron wrote:
> > On Sat,  2 Nov 2024 14:13:09 +0100
> > Vasileios Amoiridis <vassilisamir@gmail.com> wrote:
> > 
> > > Extend dt-binding for BME680 gas sensor device. The device incorporates
> > > as well temperature, pressure and relative humidity sensors.
> > This description should make it clear it is moving from trivial-devices.yaml
> > 
> > dt-bindings: iio: bosch,bme680: Move from trivial-bindings and add missing supplies.
> > 
> > Then say a little more on why you are moving it.
> > 
> > > 
> > > Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
> > 
> > There was an open question on the previous version about
> > setting the supplies as required (which I see you've removed).
> > My understanding previously was that it is fine to make that change
> > in a binding if it reflects supplies that are required to be enabled
> > for the device to function at all.  If there were previously missing
> > that's a binding bug we should fix.
> > 
> > I'd like a clarification from the DT binding maintainers on that.
> > Obviously doesn't work for other users of dt bindings but in
> > Linux this would be fine as they were already on for any board
> > that worked and the regulator framework will through us a fake
> > regulator for cases like this.
> > 
> > https://lore.kernel.org/all/20241022182451.00007ac0@Huawei.com/
> > 
> > Jonathan
> 
> That was Rob's objection so I will leave it to him, but putting my two
> cents in for Linux it is not an ABI break because missing regulator
> supplies are substituted with dummy ones. Unless something changed...

Shrug. I don't think we're entirely consistent on this. If we're saying 
supplies are always required, then every device in trivial-devices.yaml 
is wrong. Since Linux handles them missing, you can also argue that 
supplies are never required.

I'd prefer not to special case regulators as an exception I have to 
remember. I have some rudimentary ABI checking I'm working on that 
checks for things like new required properties. Though it wouldn't catch 
this particular change given it moves the schema.

Rob
Vasileios Amoiridis Nov. 11, 2024, 6:48 p.m. UTC | #4
On Mon, Nov 04, 2024 at 10:10:33AM -0600, Rob Herring wrote:
> On Sun, Nov 03, 2024 at 10:46:46AM +0100, Krzysztof Kozlowski wrote:
> > On Sat, Nov 02, 2024 at 03:33:15PM +0000, Jonathan Cameron wrote:
> > > On Sat,  2 Nov 2024 14:13:09 +0100
> > > Vasileios Amoiridis <vassilisamir@gmail.com> wrote:
> > > 
> > > > Extend dt-binding for BME680 gas sensor device. The device incorporates
> > > > as well temperature, pressure and relative humidity sensors.
> > > This description should make it clear it is moving from trivial-devices.yaml
> > > 
> > > dt-bindings: iio: bosch,bme680: Move from trivial-bindings and add missing supplies.
> > > 
> > > Then say a little more on why you are moving it.
> > > 
> > > > 
> > > > Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
> > > 
> > > There was an open question on the previous version about
> > > setting the supplies as required (which I see you've removed).
> > > My understanding previously was that it is fine to make that change
> > > in a binding if it reflects supplies that are required to be enabled
> > > for the device to function at all.  If there were previously missing
> > > that's a binding bug we should fix.
> > > 
> > > I'd like a clarification from the DT binding maintainers on that.
> > > Obviously doesn't work for other users of dt bindings but in
> > > Linux this would be fine as they were already on for any board
> > > that worked and the regulator framework will through us a fake
> > > regulator for cases like this.
> > > 
> > > https://lore.kernel.org/all/20241022182451.00007ac0@Huawei.com/
> > > 
> > > Jonathan
> > 
> > That was Rob's objection so I will leave it to him, but putting my two
> > cents in for Linux it is not an ABI break because missing regulator
> > supplies are substituted with dummy ones. Unless something changed...
> 
> Shrug. I don't think we're entirely consistent on this. If we're saying 
> supplies are always required, then every device in trivial-devices.yaml 
> is wrong. Since Linux handles them missing, you can also argue that 
> supplies are never required.
> 
> I'd prefer not to special case regulators as an exception I have to 
> remember. I have some rudimentary ABI checking I'm working on that 
> checks for things like new required properties. Though it wouldn't catch 
> this particular change given it moves the schema.
> 
> Rob

Hi Jonathan,

According to Rob's answer, do you think that we can move on with the
last 3 patches as they are or do you want some changes?

Cheers,
Vasilis
Rob Herring (Arm) Nov. 19, 2024, 2:04 p.m. UTC | #5
On Mon, Nov 11, 2024 at 07:48:48PM +0100, Vasileios Amoiridis wrote:
> On Mon, Nov 04, 2024 at 10:10:33AM -0600, Rob Herring wrote:
> > On Sun, Nov 03, 2024 at 10:46:46AM +0100, Krzysztof Kozlowski wrote:
> > > On Sat, Nov 02, 2024 at 03:33:15PM +0000, Jonathan Cameron wrote:
> > > > On Sat,  2 Nov 2024 14:13:09 +0100
> > > > Vasileios Amoiridis <vassilisamir@gmail.com> wrote:
> > > > 
> > > > > Extend dt-binding for BME680 gas sensor device. The device incorporates
> > > > > as well temperature, pressure and relative humidity sensors.
> > > > This description should make it clear it is moving from trivial-devices.yaml
> > > > 
> > > > dt-bindings: iio: bosch,bme680: Move from trivial-bindings and add missing supplies.
> > > > 
> > > > Then say a little more on why you are moving it.
> > > > 
> > > > > 
> > > > > Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
> > > > 
> > > > There was an open question on the previous version about
> > > > setting the supplies as required (which I see you've removed).
> > > > My understanding previously was that it is fine to make that change
> > > > in a binding if it reflects supplies that are required to be enabled
> > > > for the device to function at all.  If there were previously missing
> > > > that's a binding bug we should fix.
> > > > 
> > > > I'd like a clarification from the DT binding maintainers on that.
> > > > Obviously doesn't work for other users of dt bindings but in
> > > > Linux this would be fine as they were already on for any board
> > > > that worked and the regulator framework will through us a fake
> > > > regulator for cases like this.
> > > > 
> > > > https://lore.kernel.org/all/20241022182451.00007ac0@Huawei.com/
> > > > 
> > > > Jonathan
> > > 
> > > That was Rob's objection so I will leave it to him, but putting my two
> > > cents in for Linux it is not an ABI break because missing regulator
> > > supplies are substituted with dummy ones. Unless something changed...
> > 
> > Shrug. I don't think we're entirely consistent on this. If we're saying 
> > supplies are always required, then every device in trivial-devices.yaml 
> > is wrong. Since Linux handles them missing, you can also argue that 
> > supplies are never required.
> > 
> > I'd prefer not to special case regulators as an exception I have to 
> > remember. I have some rudimentary ABI checking I'm working on that 
> > checks for things like new required properties. Though it wouldn't catch 
> > this particular change given it moves the schema.
> > 
> > Rob
> 
> Hi Jonathan,
> 
> According to Rob's answer, do you think that we can move on with the
> last 3 patches as they are or do you want some changes?

Please update the commit message as Jonathan requested and resend 
(though you might as well wait til the end of the merge window now).

Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/chemical/bosch,bme680.yaml b/Documentation/devicetree/bindings/iio/chemical/bosch,bme680.yaml
new file mode 100644
index 000000000000..0eac22e465e7
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/chemical/bosch,bme680.yaml
@@ -0,0 +1,62 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/chemical/bosch,bme680.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Bosch BME680 Gas sensor
+
+maintainers:
+  - Vasileios Amoiridis <vassilisamir@gmail.com>
+
+description: >
+  BME680 is a gas sensor which combines relative humidity, barometric pressure,
+  ambient temperature and gas (VOC - Volatile Organic Compounds) measurements.
+
+  https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bme680-ds001.pdf
+
+properties:
+  compatible:
+    const: bosch,bme680
+
+  reg:
+    maxItems: 1
+
+  vdd-supply: true
+  vddio-supply: true
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        bme680@77 {
+            compatible = "bosch,bme680";
+            reg = <0x77>;
+            vddio-supply = <&vddio>;
+            vdd-supply = <&vdd>;
+        };
+    };
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        bme680@0 {
+            compatible = "bosch,bme680";
+            reg = <0>;
+            spi-max-frequency = <500000>;
+            vddio-supply = <&vddio>;
+            vdd-supply = <&vdd>;
+        };
+    };
diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
index 9bf0fb17a05e..b651826e2d21 100644
--- a/Documentation/devicetree/bindings/trivial-devices.yaml
+++ b/Documentation/devicetree/bindings/trivial-devices.yaml
@@ -55,8 +55,6 @@  properties:
           - atmel,atsha204a
             # BPA-RS600: Power Supply
           - blutek,bpa-rs600
-            # Bosch Sensortec pressure, temperature, humididty and VOC sensor
-          - bosch,bme680
             # CM32181: Ambient Light Sensor
           - capella,cm32181
             # CM3232: Ambient Light Sensor