Loading sound/soc/codecs/wsa881x-temp-sensor.c +17 −3 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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) { Loading Loading @@ -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, Loading sound/soc/codecs/wsa881x-temp-sensor.h +1 −0 Original line number Diff line number Diff line Loading @@ -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 Loading
sound/soc/codecs/wsa881x-temp-sensor.c +17 −3 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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) { Loading Loading @@ -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, Loading
sound/soc/codecs/wsa881x-temp-sensor.h +1 −0 Original line number Diff line number Diff line Loading @@ -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