From d8736afd93848c4188961e857298386335da7510 Mon Sep 17 00:00:00 2001 From: Maureen Helm Date: Tue, 16 Aug 2022 14:19:50 -0500 Subject: [PATCH] dts: bindings: Introduce base sensor device properties Introduces an initial set of devicetree properties to be inherited by all sensor devices, similar to how we define a base set of devicetree properties for I2C and SPI devices. These properties will be used by the future sensor subsystem to manage and expose sensors to a host operating system, through HID or another protocol. Additional properties may be added in the future. An earlier version of this patch attempted to use the label property instead of friendly-name, as it was noted during code review as a possibly legitimate usage of the mostly-deprecated label property. However, in practice it was difficult to implement because most sensor bindings also inherit from i2c-device.yaml or spi-device.yaml, and therefore inherit the deprecated label property from base.yaml. To work around the deprecation, every sensor binding would have needed to explicitly block the label property with a property-blocklist, which would somewhat defeat the purpose of having a shared sensor-device.yaml. Signed-off-by: Maureen Helm --- dts/bindings/sensor/sensor-device.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 dts/bindings/sensor/sensor-device.yaml diff --git a/dts/bindings/sensor/sensor-device.yaml b/dts/bindings/sensor/sensor-device.yaml new file mode 100644 index 00000000000..ad905e26957 --- /dev/null +++ b/dts/bindings/sensor/sensor-device.yaml @@ -0,0 +1,19 @@ +# Copyright (c) 2022 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +description: Sensor Device + +include: base.yaml + +properties: + friendly-name: + type: string + description: | + Human readable string describing the sensor. It can be used to + distinguish multiple instances of the same model (e.g., lid accelerometer + vs. base accelerometer in a laptop) to a host operating system. + + This property is defined in the Generic Sensor Property Usages of the HID + Usage Tables specification + (https://usb.org/sites/default/files/hut1_3_0.pdf, section 22.5).