mirror of https://github.com/torvalds/linux.git
hwmon: (scmi) Enable sensors to assure they can be read
The SCMI specification states that SENSOR_CONFIG_SET is used to enable/disable the sensors. The sensors can be disabled by default, which is the case at least on NXP i.MX95. Explicitly trigger the SENSOR_CONFIG_SET to enable the sensors, otherwise sensor read may fail and won't return valid data. Signed-off-by: Marek Vasut <marek.vasut@mailbox.org> Link: https://lore.kernel.org/r/20251015114953.148706-1-marek.vasut@mailbox.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
578652bef0
commit
72804d1631
|
|
@ -240,6 +240,8 @@ static int scmi_hwmon_probe(struct scmi_device *sdev)
|
||||||
const struct hwmon_channel_info **ptr_scmi_ci;
|
const struct hwmon_channel_info **ptr_scmi_ci;
|
||||||
const struct scmi_handle *handle = sdev->handle;
|
const struct scmi_handle *handle = sdev->handle;
|
||||||
struct scmi_protocol_handle *ph;
|
struct scmi_protocol_handle *ph;
|
||||||
|
u32 sensor_config = FIELD_PREP(SCMI_SENS_CFG_SENSOR_ENABLED_MASK,
|
||||||
|
SCMI_SENS_CFG_SENSOR_ENABLE);
|
||||||
|
|
||||||
if (!handle)
|
if (!handle)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
@ -339,6 +341,13 @@ static int scmi_hwmon_probe(struct scmi_device *sdev)
|
||||||
if (!sensor)
|
if (!sensor)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
ret = sensor_ops->config_set(ph, i, sensor_config);
|
||||||
|
if (ret) {
|
||||||
|
dev_err(dev, "Error enabling sensor %s. err=%d\n",
|
||||||
|
sensor->name, ret);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Warn on any misconfiguration related to thermal zones but
|
* Warn on any misconfiguration related to thermal zones but
|
||||||
* bail out of probing only on memory errors.
|
* bail out of probing only on memory errors.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue