Loading drivers/thermal/tsens.h +4 −4 Original line number Diff line number Diff line /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -73,9 +73,9 @@ struct tsens_dbg_context { }; struct tsens_context { enum thermal_device_mode high_th_state; enum thermal_device_mode low_th_state; enum thermal_device_mode crit_th_state; enum thermal_trip_activation_mode high_th_state; enum thermal_trip_activation_mode low_th_state; enum thermal_trip_activation_mode crit_th_state; int high_temp; int low_temp; int crit_temp; Loading drivers/thermal/tsens1xxx.c +15 −15 Original line number Diff line number Diff line /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -166,7 +166,7 @@ static int tsens1xxx_get_temp(struct tsens_sensor *sensor, int *temp) } static int tsens_tz_activate_trip_type(struct tsens_sensor *tm_sensor, int trip, enum thermal_device_mode mode) int trip, enum thermal_trip_activation_mode mode) { struct tsens_device *tmdev = NULL; unsigned int reg_cntl, code, hi_code, lo_code, mask; Loading Loading @@ -212,7 +212,7 @@ static int tsens_tz_activate_trip_type(struct tsens_sensor *tm_sensor, return -EINVAL; } if (mode == THERMAL_DEVICE_DISABLED) if (mode == THERMAL_TRIP_ACTIVATION_DISABLED) writel_relaxed(reg_cntl | mask, (TSENS_S0_UPPER_LOWER_STATUS_CTRL_ADDR(tmdev->tsens_tm_addr) + (tm_sensor->hw_id * TSENS_SN_ADDR_OFFSET))); Loading Loading @@ -291,7 +291,7 @@ static int tsens1xxx_set_trip_temp(struct tsens_sensor *tm_sensor, if (high_temp != INT_MAX) { rc = tsens_tz_activate_trip_type(tm_sensor, THERMAL_TRIP_CONFIGURABLE_HI, THERMAL_DEVICE_ENABLED); THERMAL_TRIP_ACTIVATION_ENABLED); if (rc) { pr_err("trip high enable error :%d\n", rc); goto fail; Loading @@ -299,7 +299,7 @@ static int tsens1xxx_set_trip_temp(struct tsens_sensor *tm_sensor, } else { rc = tsens_tz_activate_trip_type(tm_sensor, THERMAL_TRIP_CONFIGURABLE_HI, THERMAL_DEVICE_DISABLED); THERMAL_TRIP_ACTIVATION_DISABLED); if (rc) { pr_err("trip high disable error :%d\n", rc); goto fail; Loading @@ -309,7 +309,7 @@ static int tsens1xxx_set_trip_temp(struct tsens_sensor *tm_sensor, if (low_temp != INT_MIN) { rc = tsens_tz_activate_trip_type(tm_sensor, THERMAL_TRIP_CONFIGURABLE_LOW, THERMAL_DEVICE_ENABLED); THERMAL_TRIP_ACTIVATION_ENABLED); if (rc) { pr_err("trip low enable activation error :%d\n", rc); goto fail; Loading @@ -317,7 +317,7 @@ static int tsens1xxx_set_trip_temp(struct tsens_sensor *tm_sensor, } else { rc = tsens_tz_activate_trip_type(tm_sensor, THERMAL_TRIP_CONFIGURABLE_LOW, THERMAL_DEVICE_DISABLED); THERMAL_TRIP_ACTIVATION_DISABLED); if (rc) { pr_err("trip low disable error :%d\n", rc); goto fail; Loading Loading @@ -381,13 +381,13 @@ static irqreturn_t tsens_irq_thread(int irq, void *data) rc = tsens_tz_activate_trip_type( &tm->sensor[i], THERMAL_TRIP_CONFIGURABLE_HI, THERMAL_DEVICE_ENABLED); THERMAL_TRIP_ACTIVATION_ENABLED); if (rc) pr_err("high rearm failed"); } else { upper_thr = true; tm->sensor[i].thr_state.high_th_state = THERMAL_DEVICE_DISABLED; THERMAL_TRIP_ACTIVATION_DISABLED; } } Loading @@ -403,13 +403,13 @@ static irqreturn_t tsens_irq_thread(int irq, void *data) rc = tsens_tz_activate_trip_type( &tm->sensor[i], THERMAL_TRIP_CONFIGURABLE_LOW, THERMAL_DEVICE_ENABLED); THERMAL_TRIP_ACTIVATION_ENABLED); if (rc) pr_err("low rearm failed"); } else { lower_thr = true; tm->sensor[i].thr_state.low_th_state = THERMAL_DEVICE_DISABLED; THERMAL_TRIP_ACTIVATION_DISABLED; } } spin_unlock_irqrestore(&tm->tsens_upp_low_lock, flags); Loading drivers/thermal/tsens2xxx.c +7 −4 Original line number Diff line number Diff line /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -381,7 +381,8 @@ static irqreturn_t tsens_tm_critical_irq_thread(int irq, void *data) TSENS_TM_CRITICAL_INT_CLEAR( tm->tsens_tm_addr)); tm->sensor[i].thr_state. crit_th_state = THERMAL_DEVICE_DISABLED; crit_th_state = THERMAL_TRIP_ACTIVATION_DISABLED; } spin_unlock_irqrestore(&tm->tsens_crit_lock, flags); } Loading Loading @@ -458,7 +459,8 @@ static irqreturn_t tsens_tm_irq_thread(int irq, void *data) } else { upper_thr = true; tm->sensor[i].thr_state. high_th_state = THERMAL_DEVICE_DISABLED; high_th_state = THERMAL_TRIP_ACTIVATION_DISABLED; } } Loading Loading @@ -490,7 +492,8 @@ static irqreturn_t tsens_tm_irq_thread(int irq, void *data) } else { lower_thr = true; tm->sensor[i].thr_state. low_th_state = THERMAL_DEVICE_DISABLED; low_th_state = THERMAL_TRIP_ACTIVATION_DISABLED; } } spin_unlock_irqrestore(&tm->tsens_upp_low_lock, flags); Loading Loading
drivers/thermal/tsens.h +4 −4 Original line number Diff line number Diff line /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -73,9 +73,9 @@ struct tsens_dbg_context { }; struct tsens_context { enum thermal_device_mode high_th_state; enum thermal_device_mode low_th_state; enum thermal_device_mode crit_th_state; enum thermal_trip_activation_mode high_th_state; enum thermal_trip_activation_mode low_th_state; enum thermal_trip_activation_mode crit_th_state; int high_temp; int low_temp; int crit_temp; Loading
drivers/thermal/tsens1xxx.c +15 −15 Original line number Diff line number Diff line /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -166,7 +166,7 @@ static int tsens1xxx_get_temp(struct tsens_sensor *sensor, int *temp) } static int tsens_tz_activate_trip_type(struct tsens_sensor *tm_sensor, int trip, enum thermal_device_mode mode) int trip, enum thermal_trip_activation_mode mode) { struct tsens_device *tmdev = NULL; unsigned int reg_cntl, code, hi_code, lo_code, mask; Loading Loading @@ -212,7 +212,7 @@ static int tsens_tz_activate_trip_type(struct tsens_sensor *tm_sensor, return -EINVAL; } if (mode == THERMAL_DEVICE_DISABLED) if (mode == THERMAL_TRIP_ACTIVATION_DISABLED) writel_relaxed(reg_cntl | mask, (TSENS_S0_UPPER_LOWER_STATUS_CTRL_ADDR(tmdev->tsens_tm_addr) + (tm_sensor->hw_id * TSENS_SN_ADDR_OFFSET))); Loading Loading @@ -291,7 +291,7 @@ static int tsens1xxx_set_trip_temp(struct tsens_sensor *tm_sensor, if (high_temp != INT_MAX) { rc = tsens_tz_activate_trip_type(tm_sensor, THERMAL_TRIP_CONFIGURABLE_HI, THERMAL_DEVICE_ENABLED); THERMAL_TRIP_ACTIVATION_ENABLED); if (rc) { pr_err("trip high enable error :%d\n", rc); goto fail; Loading @@ -299,7 +299,7 @@ static int tsens1xxx_set_trip_temp(struct tsens_sensor *tm_sensor, } else { rc = tsens_tz_activate_trip_type(tm_sensor, THERMAL_TRIP_CONFIGURABLE_HI, THERMAL_DEVICE_DISABLED); THERMAL_TRIP_ACTIVATION_DISABLED); if (rc) { pr_err("trip high disable error :%d\n", rc); goto fail; Loading @@ -309,7 +309,7 @@ static int tsens1xxx_set_trip_temp(struct tsens_sensor *tm_sensor, if (low_temp != INT_MIN) { rc = tsens_tz_activate_trip_type(tm_sensor, THERMAL_TRIP_CONFIGURABLE_LOW, THERMAL_DEVICE_ENABLED); THERMAL_TRIP_ACTIVATION_ENABLED); if (rc) { pr_err("trip low enable activation error :%d\n", rc); goto fail; Loading @@ -317,7 +317,7 @@ static int tsens1xxx_set_trip_temp(struct tsens_sensor *tm_sensor, } else { rc = tsens_tz_activate_trip_type(tm_sensor, THERMAL_TRIP_CONFIGURABLE_LOW, THERMAL_DEVICE_DISABLED); THERMAL_TRIP_ACTIVATION_DISABLED); if (rc) { pr_err("trip low disable error :%d\n", rc); goto fail; Loading Loading @@ -381,13 +381,13 @@ static irqreturn_t tsens_irq_thread(int irq, void *data) rc = tsens_tz_activate_trip_type( &tm->sensor[i], THERMAL_TRIP_CONFIGURABLE_HI, THERMAL_DEVICE_ENABLED); THERMAL_TRIP_ACTIVATION_ENABLED); if (rc) pr_err("high rearm failed"); } else { upper_thr = true; tm->sensor[i].thr_state.high_th_state = THERMAL_DEVICE_DISABLED; THERMAL_TRIP_ACTIVATION_DISABLED; } } Loading @@ -403,13 +403,13 @@ static irqreturn_t tsens_irq_thread(int irq, void *data) rc = tsens_tz_activate_trip_type( &tm->sensor[i], THERMAL_TRIP_CONFIGURABLE_LOW, THERMAL_DEVICE_ENABLED); THERMAL_TRIP_ACTIVATION_ENABLED); if (rc) pr_err("low rearm failed"); } else { lower_thr = true; tm->sensor[i].thr_state.low_th_state = THERMAL_DEVICE_DISABLED; THERMAL_TRIP_ACTIVATION_DISABLED; } } spin_unlock_irqrestore(&tm->tsens_upp_low_lock, flags); Loading
drivers/thermal/tsens2xxx.c +7 −4 Original line number Diff line number Diff line /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -381,7 +381,8 @@ static irqreturn_t tsens_tm_critical_irq_thread(int irq, void *data) TSENS_TM_CRITICAL_INT_CLEAR( tm->tsens_tm_addr)); tm->sensor[i].thr_state. crit_th_state = THERMAL_DEVICE_DISABLED; crit_th_state = THERMAL_TRIP_ACTIVATION_DISABLED; } spin_unlock_irqrestore(&tm->tsens_crit_lock, flags); } Loading Loading @@ -458,7 +459,8 @@ static irqreturn_t tsens_tm_irq_thread(int irq, void *data) } else { upper_thr = true; tm->sensor[i].thr_state. high_th_state = THERMAL_DEVICE_DISABLED; high_th_state = THERMAL_TRIP_ACTIVATION_DISABLED; } } Loading Loading @@ -490,7 +492,8 @@ static irqreturn_t tsens_tm_irq_thread(int irq, void *data) } else { lower_thr = true; tm->sensor[i].thr_state. low_th_state = THERMAL_DEVICE_DISABLED; low_th_state = THERMAL_TRIP_ACTIVATION_DISABLED; } } spin_unlock_irqrestore(&tm->tsens_upp_low_lock, flags); Loading