lkml.org 
[lkml]   [2022]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v5 24/30] thermal/drivers/broadcom: Use generic thermal_zone_get_trip() function
    Date
    The thermal framework gives the possibility to register the trip
    points with the thermal zone. When that is done, no get_trip_* ops are
    needed and they can be removed.

    Convert ops content logic into generic trip points and register them with the
    thermal zone.

    Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
    ---
    drivers/thermal/broadcom/bcm2835_thermal.c | 8 +++++---
    1 file changed, 5 insertions(+), 3 deletions(-)

    diff --git a/drivers/thermal/broadcom/bcm2835_thermal.c b/drivers/thermal/broadcom/bcm2835_thermal.c
    index 2c67841a1115..5485e59d03a9 100644
    --- a/drivers/thermal/broadcom/bcm2835_thermal.c
    +++ b/drivers/thermal/broadcom/bcm2835_thermal.c
    @@ -18,6 +18,7 @@
    #include <linux/platform_device.h>
    #include <linux/thermal.h>

    +#include "../thermal_core.h"
    #include "../thermal_hwmon.h"

    #define BCM2835_TS_TSENSCTL 0x00
    @@ -224,7 +225,8 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
    */
    val = readl(data->regs + BCM2835_TS_TSENSCTL);
    if (!(val & BCM2835_TS_TSENSCTL_RSTB)) {
    - int trip_temp, offset, slope;
    + struct thermal_trip trip;
    + int offset, slope;

    slope = thermal_zone_get_slope(tz);
    offset = thermal_zone_get_offset(tz);
    @@ -232,7 +234,7 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
    * For now we deal only with critical, otherwise
    * would need to iterate
    */
    - err = tz->ops->get_trip_temp(tz, 0, &trip_temp);
    + err = thermal_zone_get_trip(tz, 0, &trip);
    if (err < 0) {
    dev_err(&pdev->dev,
    "Not able to read trip_temp: %d\n",
    @@ -249,7 +251,7 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
    val |= (0xFE << BCM2835_TS_TSENSCTL_RSTDELAY_SHIFT);

    /* trip_adc value from info */
    - val |= bcm2835_thermal_temp2adc(trip_temp,
    + val |= bcm2835_thermal_temp2adc(trip.temperature,
    offset,
    slope)
    << BCM2835_TS_TSENSCTL_THOLD_SHIFT;
    --
    2.34.1
    \
     
     \ /
      Last update: 2022-09-26 17:24    [W:4.035 / U:0.100 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site