drivers: thermal: tsens: Add new operation to check if a sensor is enabled
is_sensor_enabled() checks if the sensors are enabled on this platform. It is possible that the SoC might choose not to enable all the sensors that the IP block is capable of supporting. Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
This commit is contained in:

committed by
Eduardo Valentin

parent
fc7d18cf6a
commit
3e6a8fb330
@@ -82,6 +82,11 @@ static int tsens_register(struct tsens_priv *priv)
|
||||
struct thermal_zone_device *tzd;
|
||||
|
||||
for (i = 0; i < priv->num_sensors; i++) {
|
||||
if (!is_sensor_enabled(priv, priv->sensor[i].hw_id)) {
|
||||
dev_err(priv->dev, "sensor %d: disabled\n",
|
||||
priv->sensor[i].hw_id);
|
||||
continue;
|
||||
}
|
||||
priv->sensor[i].priv = priv;
|
||||
priv->sensor[i].id = i;
|
||||
tzd = devm_thermal_zone_of_sensor_register(priv->dev, i,
|
||||
|
Reference in New Issue
Block a user