• Rafael J. Wysocki's avatar
    thermal: core: Add flags to struct thermal_trip · 5340f764
    Rafael J. Wysocki authored
    In order to allow thermal zone creators to specify the writability of
    trip point temperature and hysteresis on a per-trip basis, add a flags
    field to struct thermal_trip and define flags to represent the desired
    trip properties.
    
    Also make thermal_zone_device_register_with_trips() set the
    THERMAL_TRIP_FLAG_RW_TEMP flag for all trips covered by the writable
    trips mask passed to it and modify the thermal sysfs code to look at
    the trip flags instead of using the writable trips mask directly or
    checking the presence of the .set_trip_hyst() zone callback.
    
    Additionally, make trip_point_temp_store() and trip_point_hyst_store()
    fail with an error code if the trip passed to one of them has
    THERMAL_TRIP_FLAG_RW_TEMP or THERMAL_TRIP_FLAG_RW_HYST,
    respectively, clear in its flags.
    
    No intentional functional impact.
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    5340f764
thermal_sysfs.c 22.4 KB