Lines Matching refs:sensors

79 	struct intel_soc_dts_sensors *sensors;  in sys_get_trip_temp()  local
82 sensors = dts->sensors; in sys_get_trip_temp()
83 mutex_lock(&sensors->dts_update_lock); in sys_get_trip_temp()
86 mutex_unlock(&sensors->dts_update_lock); in sys_get_trip_temp()
94 *temp = sensors->tj_max - out * 1000; in sys_get_trip_temp()
111 struct intel_soc_dts_sensors *sensors = dts->sensors; in update_trip_temp() local
113 if (sensors->intr_type == INTEL_SOC_DTS_INTERRUPT_MSI) in update_trip_temp()
116 temp_out = (sensors->tj_max - temp) / 1000; in update_trip_temp()
193 struct intel_soc_dts_sensors *sensors = dts->sensors; in sys_set_trip_temp() local
196 if (temp > sensors->tj_max) in sys_set_trip_temp()
199 mutex_lock(&sensors->dts_update_lock); in sys_set_trip_temp()
202 mutex_unlock(&sensors->dts_update_lock); in sys_set_trip_temp()
225 struct intel_soc_dts_sensors *sensors; in sys_get_curr_temp() local
228 sensors = dts->sensors; in sys_get_curr_temp()
236 *temp = sensors->tj_max - out * 1000; in sys_get_curr_temp()
340 struct intel_soc_dts_sensors *sensors, int critical_offset) in intel_soc_dts_iosf_add_read_only_critical_trip() argument
345 for (j = 0; j < sensors->soc_dts[i].trip_count; ++j) { in intel_soc_dts_iosf_add_read_only_critical_trip()
346 if (!(sensors->soc_dts[i].trip_mask & BIT(j))) { in intel_soc_dts_iosf_add_read_only_critical_trip()
347 return update_trip_temp(&sensors->soc_dts[i], j, in intel_soc_dts_iosf_add_read_only_critical_trip()
348 sensors->tj_max - critical_offset, in intel_soc_dts_iosf_add_read_only_critical_trip()
358 void intel_soc_dts_iosf_interrupt_handler(struct intel_soc_dts_sensors *sensors) in intel_soc_dts_iosf_interrupt_handler() argument
365 spin_lock_irqsave(&sensors->intr_notify_lock, flags); in intel_soc_dts_iosf_interrupt_handler()
381 spin_unlock_irqrestore(&sensors->intr_notify_lock, flags); in intel_soc_dts_iosf_interrupt_handler()
385 thermal_zone_device_update(sensors->soc_dts[i].tzone, in intel_soc_dts_iosf_interrupt_handler()
389 spin_unlock_irqrestore(&sensors->intr_notify_lock, flags); in intel_soc_dts_iosf_interrupt_handler()
397 struct intel_soc_dts_sensors *sensors; in intel_soc_dts_iosf_init() local
412 sensors = kzalloc(sizeof(*sensors), GFP_KERNEL); in intel_soc_dts_iosf_init()
413 if (!sensors) in intel_soc_dts_iosf_init()
416 spin_lock_init(&sensors->intr_notify_lock); in intel_soc_dts_iosf_init()
417 mutex_init(&sensors->dts_update_lock); in intel_soc_dts_iosf_init()
418 sensors->intr_type = intr_type; in intel_soc_dts_iosf_init()
419 sensors->tj_max = tj_max; in intel_soc_dts_iosf_init()
425 sensors->soc_dts[i].sensors = sensors; in intel_soc_dts_iosf_init()
426 ret = add_dts_thermal_zone(i, &sensors->soc_dts[i], in intel_soc_dts_iosf_init()
434 ret = update_trip_temp(&sensors->soc_dts[i], 0, 0, in intel_soc_dts_iosf_init()
439 ret = update_trip_temp(&sensors->soc_dts[i], 1, 0, in intel_soc_dts_iosf_init()
445 return sensors; in intel_soc_dts_iosf_init()
448 remove_dts_thermal_zone(&sensors->soc_dts[i]); in intel_soc_dts_iosf_init()
451 kfree(sensors); in intel_soc_dts_iosf_init()
456 void intel_soc_dts_iosf_exit(struct intel_soc_dts_sensors *sensors) in intel_soc_dts_iosf_exit() argument
461 update_trip_temp(&sensors->soc_dts[i], 0, 0, 0); in intel_soc_dts_iosf_exit()
462 update_trip_temp(&sensors->soc_dts[i], 1, 0, 0); in intel_soc_dts_iosf_exit()
463 remove_dts_thermal_zone(&sensors->soc_dts[i]); in intel_soc_dts_iosf_exit()
465 kfree(sensors); in intel_soc_dts_iosf_exit()