Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 67e6cf19 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: thermal: Maintain state in the mitigation device monitor"

parents 1a02bf1f 2eb3c5a2
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -5166,10 +5166,16 @@ static void tsens_threshold_notify(struct therm_threshold *tsens_cb_data)
		break;
	}

	if (tsens_cb_data->cur_state != tsens_cb_data->trip_triggered) {
		rc = sensor_mgr_set_threshold(tsens_cb_data->sensor_id,
						tsens_cb_data->threshold);
		if (rc < 0)
		cpr_err(cpr_vreg, "Failed to set temp. threshold, rc=%d\n", rc);
			cpr_err(cpr_vreg,
			"Failed to set temp. threshold, rc=%d\n", rc);
		else
			tsens_cb_data->cur_state =
				tsens_cb_data->trip_triggered;
	}
}

static int cpr_check_tsens(struct cpr_regulator *cpr_vreg)
+20 −5
Original line number Diff line number Diff line
@@ -2694,8 +2694,12 @@ static void vdd_mx_notify(struct therm_threshold *trig_thresh)
			pr_err("Failed to remove vdd mx restriction\n");
	}
	mutex_unlock(&vdd_mx_mutex);

	if (trig_thresh->cur_state != trig_thresh->trip_triggered) {
		sensor_mgr_set_threshold(trig_thresh->sensor_id,
					trig_thresh->threshold);
		trig_thresh->cur_state = trig_thresh->trip_triggered;
	}
}

static void msm_thermal_bite(int zone_id, long temp)
@@ -4064,8 +4068,11 @@ static void cx_phase_ctrl_notify(struct therm_threshold *trig_thresh)
cx_phase_unlock_exit:
	mutex_unlock(&cx_mutex);
cx_phase_ctrl_exit:
	if (trig_thresh->cur_state != trig_thresh->trip_triggered) {
		sensor_mgr_set_threshold(trig_thresh->sensor_id,
					trig_thresh->threshold);
		trig_thresh->cur_state = trig_thresh->trip_triggered;
	}
	return;
}

@@ -4193,8 +4200,11 @@ static void vdd_restriction_notify(struct therm_threshold *trig_thresh)
unlock_and_exit:
	mutex_unlock(&vdd_rstr_mutex);
set_and_exit:
	if (trig_thresh->cur_state != trig_thresh->trip_triggered) {
		sensor_mgr_set_threshold(trig_thresh->sensor_id,
					trig_thresh->threshold);
		trig_thresh->cur_state = trig_thresh->trip_triggered;
	}
	return;
}

@@ -4242,8 +4252,11 @@ static void ocr_notify(struct therm_threshold *trig_thresh)
unlock_and_exit:
	mutex_unlock(&ocr_mutex);
set_and_exit:
	if (trig_thresh->cur_state != trig_thresh->trip_triggered) {
		sensor_mgr_set_threshold(trig_thresh->sensor_id,
				trig_thresh->threshold);
		trig_thresh->cur_state = trig_thresh->trip_triggered;
	}
	return;
}

@@ -4478,6 +4491,7 @@ int sensor_mgr_init_threshold(struct threshold_info *thresh_inp,
			thresh_ptr[i].notify = callback;
			thresh_ptr[i].trip_triggered = -1;
			thresh_ptr[i].parent = thresh_inp;
			thresh_ptr[i].cur_state = -1;
			thresh_ptr[i].threshold[0].temp =
				high_temp * tsens_scaling_factor;
			thresh_ptr[i].threshold[0].trip =
@@ -4498,6 +4512,7 @@ int sensor_mgr_init_threshold(struct threshold_info *thresh_inp,
		thresh_ptr->notify = callback;
		thresh_ptr->trip_triggered = -1;
		thresh_ptr->parent = thresh_inp;
		thresh_ptr->cur_state = -1;
		thresh_ptr->threshold[0].temp = high_temp * tsens_scaling_factor;
		thresh_ptr->threshold[0].trip =
			THERMAL_TRIP_CONFIGURABLE_HI;
+2 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2016, 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
@@ -91,6 +91,7 @@ struct therm_threshold {
	int32_t                     trip_triggered;
	void (*notify)(struct therm_threshold *);
	struct threshold_info       *parent;
	int32_t                     cur_state;
};

struct threshold_info {