[PATCH 1/5] dt-bindings: iio: imu: Add ICM-20948

Bharadwaj Raju posted 5 patches 1 month ago
[PATCH 1/5] dt-bindings: iio: imu: Add ICM-20948
Posted by Bharadwaj Raju 1 month ago
Document device-tree bindings for the InvenSense ICM-20948 device.

Signed-off-by: Bharadwaj Raju <bharadwaj.raju777@gmail.com>
---
 .../bindings/iio/imu/invensense,icm20948.yaml      | 36 ++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/imu/invensense,icm20948.yaml b/Documentation/devicetree/bindings/iio/imu/invensense,icm20948.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..00c8210a0285972f8084137c69a4618a1f674485
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/imu/invensense,icm20948.yaml
@@ -0,0 +1,36 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/imu/invensense,icm20948.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: InvenSense ICM-20948 Inertial Measurement Unit
+
+maintainers:
+  - Bharadwaj Raju <bharadwaj.raju777@gmail.com>
+
+description: |
+  9-axis motion-tracking device that combines a 3-axis gyroscope, 3-axis
+  accelerometer, and a 3-axis magnetometer.
+
+  https://invensense.tdk.com/wp-content/uploads/2024/03/DS-000189-ICM-20948-v1.6.pdf
+
+properties:
+  compatible:
+    enum:
+      - invensense,icm20948
+
+  reg:
+    maxItems: 1
+
+examples:
+  - |
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      icm20948 {
+        compatible = "invensense,icm20948";
+        reg = <0x69>;
+      }
+    }

-- 
2.51.0
Re: [PATCH 1/5] dt-bindings: iio: imu: Add ICM-20948
Posted by Krzysztof Kozlowski 1 month ago
On Sun, Aug 31, 2025 at 12:12:45AM +0530, Bharadwaj Raju wrote:
> +properties:
> +  compatible:
> +    enum:
> +      - invensense,icm20948
> +
> +  reg:
> +    maxItems: 1
> +

... and this was never tested. Missing additional props.

> +examples:

Best regards,
Krzysztof
Re: [PATCH 1/5] dt-bindings: iio: imu: Add ICM-20948
Posted by Krzysztof Kozlowski 1 month ago
On 30/08/2025 20:42, Bharadwaj Raju wrote:
> +description: |
> +  9-axis motion-tracking device that combines a 3-axis gyroscope, 3-axis
> +  accelerometer, and a 3-axis magnetometer.
> +
> +  https://invensense.tdk.com/wp-content/uploads/2024/03/DS-000189-ICM-20948-v1.6.pdf
> +
> +properties:
> +  compatible:
> +    enum:
> +      - invensense,icm20948
> +

That's pretty incomplete. See existing invense bindings. Explain in
commit msg how this is different than existing devices.

> +  reg:
> +    maxItems: 1
> +
> +examples:
> +  - |
> +    i2c {
> +      #address-cells = <1>;
> +      #size-cells = <0>;
> +
> +      icm20948 {

Node names should be generic. See also an explanation and list of
examples (not exhaustive) in DT specification:
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
If you cannot find a name matching your device, please check in kernel
sources for similar cases or you can grow the spec (via pull request to
DT spec repo).


> +        compatible = "invensense,icm20948";
> +        reg = <0x69>;
> +      }
> +    }
> 


Best regards,
Krzysztof