Lines Matching full:sensors
80 struct intel_soc_dts_sensors *sensors; in sys_get_trip_temp() local
83 sensors = dts->sensors; in sys_get_trip_temp()
84 mutex_lock(&sensors->dts_update_lock); in sys_get_trip_temp()
87 mutex_unlock(&sensors->dts_update_lock); in sys_get_trip_temp()
95 *temp = sensors->tj_max - out * 1000; in sys_get_trip_temp()
113 struct intel_soc_dts_sensors *sensors = dts->sensors; in update_trip_temp() local
115 if (sensors->intr_type == INTEL_SOC_DTS_INTERRUPT_MSI) in update_trip_temp()
118 temp_out = (sensors->tj_max - temp) / 1000; in update_trip_temp()
197 struct intel_soc_dts_sensors *sensors = dts->sensors; in sys_set_trip_temp() local
200 if (temp > sensors->tj_max) in sys_set_trip_temp()
203 mutex_lock(&sensors->dts_update_lock); in sys_set_trip_temp()
206 mutex_unlock(&sensors->dts_update_lock); in sys_set_trip_temp()
229 struct intel_soc_dts_sensors *sensors; in sys_get_curr_temp() local
233 sensors = dts->sensors; in sys_get_curr_temp()
241 *temp = sensors->tj_max - out * 1000; in sys_get_curr_temp()
348 struct intel_soc_dts_sensors *sensors, int critical_offset) in intel_soc_dts_iosf_add_read_only_critical_trip() argument
353 for (j = 0; j < sensors->soc_dts[i].trip_count; ++j) { in intel_soc_dts_iosf_add_read_only_critical_trip()
354 if (!(sensors->soc_dts[i].trip_mask & BIT(j))) { in intel_soc_dts_iosf_add_read_only_critical_trip()
355 return update_trip_temp(&sensors->soc_dts[i], j, in intel_soc_dts_iosf_add_read_only_critical_trip()
356 sensors->tj_max - critical_offset, in intel_soc_dts_iosf_add_read_only_critical_trip()
366 void intel_soc_dts_iosf_interrupt_handler(struct intel_soc_dts_sensors *sensors) in intel_soc_dts_iosf_interrupt_handler() argument
373 spin_lock_irqsave(&sensors->intr_notify_lock, flags); in intel_soc_dts_iosf_interrupt_handler()
389 spin_unlock_irqrestore(&sensors->intr_notify_lock, flags); in intel_soc_dts_iosf_interrupt_handler()
393 thermal_zone_device_update(sensors->soc_dts[i].tzone, in intel_soc_dts_iosf_interrupt_handler()
397 spin_unlock_irqrestore(&sensors->intr_notify_lock, flags); in intel_soc_dts_iosf_interrupt_handler()
405 struct intel_soc_dts_sensors *sensors; in intel_soc_dts_iosf_init() local
420 sensors = kzalloc(sizeof(*sensors), GFP_KERNEL); in intel_soc_dts_iosf_init()
421 if (!sensors) in intel_soc_dts_iosf_init()
424 spin_lock_init(&sensors->intr_notify_lock); in intel_soc_dts_iosf_init()
425 mutex_init(&sensors->dts_update_lock); in intel_soc_dts_iosf_init()
426 sensors->intr_type = intr_type; in intel_soc_dts_iosf_init()
427 sensors->tj_max = tj_max; in intel_soc_dts_iosf_init()
433 sensors->soc_dts[i].sensors = sensors; in intel_soc_dts_iosf_init()
434 ret = add_dts_thermal_zone(i, &sensors->soc_dts[i], in intel_soc_dts_iosf_init()
442 ret = update_trip_temp(&sensors->soc_dts[i], 0, 0, in intel_soc_dts_iosf_init()
447 ret = update_trip_temp(&sensors->soc_dts[i], 1, 0, in intel_soc_dts_iosf_init()
453 return sensors; in intel_soc_dts_iosf_init()
456 remove_dts_thermal_zone(&sensors->soc_dts[i]); in intel_soc_dts_iosf_init()
459 kfree(sensors); in intel_soc_dts_iosf_init()
464 void intel_soc_dts_iosf_exit(struct intel_soc_dts_sensors *sensors) in intel_soc_dts_iosf_exit() argument
469 update_trip_temp(&sensors->soc_dts[i], 0, 0, 0); in intel_soc_dts_iosf_exit()
470 update_trip_temp(&sensors->soc_dts[i], 1, 0, 0); in intel_soc_dts_iosf_exit()
471 remove_dts_thermal_zone(&sensors->soc_dts[i]); in intel_soc_dts_iosf_exit()
473 kfree(sensors); in intel_soc_dts_iosf_exit()