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

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

Merge "thermal: tsens: Fix CLANG compilation issues in TSENS for kernel 4.9"

parents b2602fa1 b5203665
Loading
Loading
Loading
Loading
+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
@@ -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;
+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
@@ -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;
@@ -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)));
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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;
			}
		}

@@ -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);
+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
@@ -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);
	}
@@ -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;
			}
		}

@@ -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);