Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sensor: Add support for defining sensor channel in DT
This functionality is needed at least in the case of temperature sensors. Zephyr specifies three temperature related channels: - SENSOR_CHAN_DIE_TEMP - SENSOR_CHAN_AMBIENT_TEMP - SENSOR_CHAN_GAUGE_TEMP In addition to that some devices can report temperature from multiple probes. This normally handled by using a sensor specific channels. Right now the consumers of such devices need to hardcode the sensor channel in their logic. Ideally the sensor channel would to use would be defined in DT. This is necessary to make a "generic" application that would work with a variety of different sensors. In the future we might also want to introduce a thermal management framework similar to thermal zones implemented in Linux. Such logic would need a way to specify a sensor channel in DT too. The "sensor-cells" property is marked as optional to retain backward compatibility with existing sensor DT nodes. For now only temperature related channels have been redefined in the dt-bindings header. Note that since dtc can't parse enums, the channel values had to be redefined as macros. Signed-off-by: Kornel Dulęba <mindal@semihalf.com>
- Loading branch information