Lines Matching refs:sensors

55 	struct intel_soc_dts_sensors *sensors;  in sys_get_trip_temp()  local
58 sensors = dts->sensors; in sys_get_trip_temp()
59 mutex_lock(&sensors->dts_update_lock); in sys_get_trip_temp()
62 mutex_unlock(&sensors->dts_update_lock); in sys_get_trip_temp()
70 *temp = sensors->tj_max - out * 1000; in sys_get_trip_temp()
88 struct intel_soc_dts_sensors *sensors = dts->sensors; in update_trip_temp() local
90 if (sensors->intr_type == INTEL_SOC_DTS_INTERRUPT_MSI) in update_trip_temp()
93 temp_out = (sensors->tj_max - temp) / 1000; in update_trip_temp()
172 struct intel_soc_dts_sensors *sensors = dts->sensors; in sys_set_trip_temp() local
175 if (temp > sensors->tj_max) in sys_set_trip_temp()
178 mutex_lock(&sensors->dts_update_lock); in sys_set_trip_temp()
181 mutex_unlock(&sensors->dts_update_lock); in sys_set_trip_temp()
204 struct intel_soc_dts_sensors *sensors; in sys_get_curr_temp() local
208 sensors = dts->sensors; in sys_get_curr_temp()
216 *temp = sensors->tj_max - out * 1000; in sys_get_curr_temp()
323 struct intel_soc_dts_sensors *sensors, int critical_offset) in intel_soc_dts_iosf_add_read_only_critical_trip() argument
328 struct intel_soc_dts_sensor_entry *entry = &sensors->soc_dts[i]; in intel_soc_dts_iosf_add_read_only_critical_trip()
329 int temp = sensors->tj_max - critical_offset; in intel_soc_dts_iosf_add_read_only_critical_trip()
342 void intel_soc_dts_iosf_interrupt_handler(struct intel_soc_dts_sensors *sensors) in intel_soc_dts_iosf_interrupt_handler() argument
349 spin_lock_irqsave(&sensors->intr_notify_lock, flags); in intel_soc_dts_iosf_interrupt_handler()
365 spin_unlock_irqrestore(&sensors->intr_notify_lock, flags); in intel_soc_dts_iosf_interrupt_handler()
369 thermal_zone_device_update(sensors->soc_dts[i].tzone, in intel_soc_dts_iosf_interrupt_handler()
373 spin_unlock_irqrestore(&sensors->intr_notify_lock, flags); in intel_soc_dts_iosf_interrupt_handler()
381 struct intel_soc_dts_sensors *sensors; in intel_soc_dts_iosf_init() local
397 sensors = kzalloc(sizeof(*sensors), GFP_KERNEL); in intel_soc_dts_iosf_init()
398 if (!sensors) in intel_soc_dts_iosf_init()
401 spin_lock_init(&sensors->intr_notify_lock); in intel_soc_dts_iosf_init()
402 mutex_init(&sensors->dts_update_lock); in intel_soc_dts_iosf_init()
403 sensors->intr_type = intr_type; in intel_soc_dts_iosf_init()
404 sensors->tj_max = tj_max; in intel_soc_dts_iosf_init()
410 sensors->soc_dts[i].sensors = sensors; in intel_soc_dts_iosf_init()
411 ret = add_dts_thermal_zone(i, &sensors->soc_dts[i], in intel_soc_dts_iosf_init()
419 ret = update_trip_temp(&sensors->soc_dts[i], 0, 0, in intel_soc_dts_iosf_init()
424 ret = update_trip_temp(&sensors->soc_dts[i], 1, 0, in intel_soc_dts_iosf_init()
430 return sensors; in intel_soc_dts_iosf_init()
433 remove_dts_thermal_zone(&sensors->soc_dts[i]); in intel_soc_dts_iosf_init()
436 kfree(sensors); in intel_soc_dts_iosf_init()
441 void intel_soc_dts_iosf_exit(struct intel_soc_dts_sensors *sensors) in intel_soc_dts_iosf_exit() argument
446 update_trip_temp(&sensors->soc_dts[i], 0, 0, 0); in intel_soc_dts_iosf_exit()
447 update_trip_temp(&sensors->soc_dts[i], 1, 0, 0); in intel_soc_dts_iosf_exit()
448 remove_dts_thermal_zone(&sensors->soc_dts[i]); in intel_soc_dts_iosf_exit()
450 kfree(sensors); in intel_soc_dts_iosf_exit()