• Sascha Hauer's avatar
    thermal: Add support for hardware-tracked trip points · 060c034a
    Sascha Hauer authored
    This adds support for hardware-tracked trip points to the device tree
    thermal sensor framework.
    
    The framework supports an arbitrary number of trip points. Whenever
    the current temperature is updated, the trip points immediately
    below and above the current temperature are found. A .set_trips
    callback is then called with the temperatures. If there is no trip
    point above or below the current temperature, the passed trip
    temperature will be -INT_MAX or INT_MAX respectively. In this callback,
    the driver should program the hardware such that it is notified
    when either of these trip points are triggered. When a trip point
    is triggered, the driver should call `thermal_zone_device_update'
    for the respective thermal zone. This will cause the trip points
    to be updated again.
    
    If .set_trips is not implemented, the framework behaves as before.
    
    This patch is based on an earlier version from Mikko Perttunen
    <mikko.perttunen@kapsi.fi>
    Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
    Signed-off-by: default avatarCaesar Wang <wxt@rock-chips.com>
    Cc: Zhang Rui <rui.zhang@intel.com>
    Cc: Eduardo Valentin <edubezval@gmail.com>
    Cc: linux-pm@vger.kernel.org
    Reviewed-by: default avatarJavi Merino <javi.merino@arm.com>
    Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
    Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
    060c034a
sysfs-api.txt 24.1 KB