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 <maureen.helm@intel.com>
This commit is contained in:
Maureen Helm 2022-08-16 14:19:50 -05:00 committed by Carles Cufí
parent 2ead05f4ed
commit d8736afd93
1 changed files with 19 additions and 0 deletions

View File

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