Lines Matching full:sensors

43 static int update_trip_temp(struct intel_soc_dts_sensors *sensors,  in update_trip_temp()  argument
56 if (sensors->intr_type == INTEL_SOC_DTS_INTERRUPT_MSI) in update_trip_temp()
59 temp_out = (sensors->tj_max - temp) / 1000; in update_trip_temp()
137 struct intel_soc_dts_sensors *sensors = dts->sensors; in sys_set_trip_temp() local
141 if (temp > sensors->tj_max) in sys_set_trip_temp()
144 mutex_lock(&sensors->dts_update_lock); in sys_set_trip_temp()
145 status = update_trip_temp(sensors, trip_index, temp); in sys_set_trip_temp()
146 mutex_unlock(&sensors->dts_update_lock); in sys_set_trip_temp()
157 struct intel_soc_dts_sensors *sensors; in sys_get_curr_temp() local
160 sensors = dts->sensors; in sys_get_curr_temp()
168 *temp = sensors->tj_max - out * 1000; in sys_get_curr_temp()
256 void intel_soc_dts_iosf_interrupt_handler(struct intel_soc_dts_sensors *sensors) in intel_soc_dts_iosf_interrupt_handler() argument
263 spin_lock_irqsave(&sensors->intr_notify_lock, flags); in intel_soc_dts_iosf_interrupt_handler()
279 spin_unlock_irqrestore(&sensors->intr_notify_lock, flags); in intel_soc_dts_iosf_interrupt_handler()
283 thermal_zone_device_update(sensors->soc_dts[i].tzone, in intel_soc_dts_iosf_interrupt_handler()
287 spin_unlock_irqrestore(&sensors->intr_notify_lock, flags); in intel_soc_dts_iosf_interrupt_handler()
291 static void dts_trips_reset(struct intel_soc_dts_sensors *sensors, int dts_index) in dts_trips_reset() argument
293 update_trip_temp(sensors, 0, 0); in dts_trips_reset()
294 update_trip_temp(sensors, 1, 0); in dts_trips_reset()
311 struct intel_soc_dts_sensors *sensors; in intel_soc_dts_iosf_init() local
323 sensors = kzalloc(sizeof(*sensors), GFP_KERNEL); in intel_soc_dts_iosf_init()
324 if (!sensors) in intel_soc_dts_iosf_init()
327 spin_lock_init(&sensors->intr_notify_lock); in intel_soc_dts_iosf_init()
328 mutex_init(&sensors->dts_update_lock); in intel_soc_dts_iosf_init()
329 sensors->intr_type = intr_type; in intel_soc_dts_iosf_init()
330 sensors->tj_max = tj_max * 1000; in intel_soc_dts_iosf_init()
335 sensors->soc_dts[i].sensors = sensors; in intel_soc_dts_iosf_init()
340 ret = update_trip_temp(sensors, 0, 0); in intel_soc_dts_iosf_init()
345 temp = sensors->tj_max - crit_offset; in intel_soc_dts_iosf_init()
353 ret = update_trip_temp(sensors, 1, temp); in intel_soc_dts_iosf_init()
359 ret = add_dts_thermal_zone(i, &sensors->soc_dts[i], trips[i]); in intel_soc_dts_iosf_init()
364 return sensors; in intel_soc_dts_iosf_init()
368 remove_dts_thermal_zone(&sensors->soc_dts[i]); in intel_soc_dts_iosf_init()
372 dts_trips_reset(sensors, i); in intel_soc_dts_iosf_init()
374 kfree(sensors); in intel_soc_dts_iosf_init()
379 void intel_soc_dts_iosf_exit(struct intel_soc_dts_sensors *sensors) in intel_soc_dts_iosf_exit() argument
384 remove_dts_thermal_zone(&sensors->soc_dts[i]); in intel_soc_dts_iosf_exit()
385 dts_trips_reset(sensors, i); in intel_soc_dts_iosf_exit()
387 kfree(sensors); in intel_soc_dts_iosf_exit()