cros_ec hwmon driver probes available thermal sensors when probing the driver. Register these thermal sensors to the thermal framework as well via setting HWMON_C_REGISTER_TZ as a chip info, such that thermal framework can adopt these sensors as well. To make cros_ec registrable to thermal framework, the cros_ec dts need the corresponding changes: &cros_ec { #thermal-sensor-cells = <1>; }; Signed-off-by: Sung-Chi, Li <lschyi@xxxxxxxxxxxx> --- Changes in v2: - Rename `cros_ec_sensor_data` to `cros_ec_hwmon_thermal_zone_data`. - Rename `addr` in struct `cros_ec_hwmon_thermal_zone_data` to `idx`. - Use `cros_ec_hwmon_temp_to_millicelsius` to do value conversion in `cros_ec_thermal_get_temp` function. - Rename `cros_ec_thermal_get_temp` to `cros_ec_hwmon_thermal_get_temp` to make `cros_ec_hwmon` a prefix. - Use `%pe` in `cros_ec_hwmon_probe_temp_sensors` when printing out `data->tz_dev` if failed register thermal device. - Remove `cros_ec_hwmon_remove`, and the `.remove` value in `cros_ec_hwmon_driver` since there is no need to call `devm_thermal_of_zone_unregister` for clean up. - Revert function signature of `cros_ec_hwmon_probe_temp_sensors` since all needed parameters are presented. - Revert include of `linux/list.h` because no list data structure is used. --- Changes in v3: - Revert all changes and just as add HWMON_C_REGISTER_TZ as a chip info. - Remove unneeded Change-Id tag in commit message. --- drivers/hwmon/cros_ec_hwmon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hwmon/cros_ec_hwmon.c b/drivers/hwmon/cros_ec_hwmon.c index 5514cf780b8b..9991c3fa020a 100644 --- a/drivers/hwmon/cros_ec_hwmon.c +++ b/drivers/hwmon/cros_ec_hwmon.c @@ -141,6 +141,7 @@ static umode_t cros_ec_hwmon_is_visible(const void *data, enum hwmon_sensor_type } static const struct hwmon_channel_info * const cros_ec_hwmon_info[] = { + HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ), HWMON_CHANNEL_INFO(fan, HWMON_F_INPUT | HWMON_F_FAULT, HWMON_F_INPUT | HWMON_F_FAULT, -- 2.47.0.338.g60cca15819-goog