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

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

Merge "ASoC: wsa881x: export wsa881x_get_temp API"

parents dff640a7 82a32f5c
Loading
Loading
Loading
Loading
+17 −3
Original line number Diff line number Diff line
@@ -24,7 +24,16 @@
#define HIGH_TEMP_THRESHOLD 45
#define TEMP_INVALID	0xFFFF

static int wsa881x_get_temp(struct thermal_zone_device *thermal,
/*
 * wsa881x_get_temp - get wsa temperature
 * @thermal: thermal zone device
 * @temp: temperature value
 *
 * Get the temperature of wsa881x.
 *
 * Return: 0 on success or negative error code on failure.
 */
int wsa881x_get_temp(struct thermal_zone_device *thermal,
		     unsigned long *temp)
{
	struct wsa881x_tz_priv *pdata;
@@ -36,6 +45,9 @@ static int wsa881x_get_temp(struct thermal_zone_device *thermal,
	int t1 = T1_TEMP;
	int t2 = T2_TEMP;

	if (!thermal)
		return -EINVAL;

	if (thermal->devdata) {
		pdata = thermal->devdata;
		if (pdata->codec) {
@@ -90,11 +102,13 @@ static int wsa881x_get_temp(struct thermal_zone_device *thermal,
				   __func__, temp_val, LOW_TEMP_THRESHOLD,
				   HIGH_TEMP_THRESHOLD);
	}
	if (temp)
		*temp = temp_val;
	pr_debug("%s: t0 measured: %ld dmeas = %d, d1 = %d, d2 = %d\n",
		  __func__, temp_val, dmeas, d1, d2);
	return ret;
}
EXPORT_SYMBOL(wsa881x_get_temp);

static struct thermal_zone_device_ops wsa881x_thermal_ops = {
	.get_temp = wsa881x_get_temp,
+1 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ struct wsa881x_tz_priv {
	wsa_temp_register_read wsa_temp_reg_read;
};

int wsa881x_get_temp(struct thermal_zone_device *tz_dev, unsigned long *temp);
int wsa881x_init_thermal(struct wsa881x_tz_priv *tz_pdata);
void wsa881x_deinit_thermal(struct thermal_zone_device *tz_dev);
#endif