Lines Matching refs:sensors
88 struct intel_soc_dts_sensors *sensors; in sys_get_trip_temp() local
91 sensors = dts->sensors; in sys_get_trip_temp()
92 mutex_lock(&sensors->dts_update_lock); in sys_get_trip_temp()
95 mutex_unlock(&sensors->dts_update_lock); in sys_get_trip_temp()
103 *temp = sensors->tj_max - out * 1000; in sys_get_trip_temp()
120 struct intel_soc_dts_sensors *sensors = dts->sensors; in update_trip_temp() local
122 if (sensors->intr_type == INTEL_SOC_DTS_INTERRUPT_MSI) in update_trip_temp()
125 temp_out = (sensors->tj_max - temp) / 1000; in update_trip_temp()
202 struct intel_soc_dts_sensors *sensors = dts->sensors; in sys_set_trip_temp() local
205 if (temp > sensors->tj_max) in sys_set_trip_temp()
208 mutex_lock(&sensors->dts_update_lock); in sys_set_trip_temp()
211 mutex_unlock(&sensors->dts_update_lock); in sys_set_trip_temp()
234 struct intel_soc_dts_sensors *sensors; in sys_get_curr_temp() local
237 sensors = dts->sensors; in sys_get_curr_temp()
245 *temp = sensors->tj_max - out * 1000; in sys_get_curr_temp()
350 struct intel_soc_dts_sensors *sensors, int critical_offset) in intel_soc_dts_iosf_add_read_only_critical_trip() argument
355 for (j = 0; j < sensors->soc_dts[i].trip_count; ++j) { in intel_soc_dts_iosf_add_read_only_critical_trip()
356 if (!(sensors->soc_dts[i].trip_mask & BIT(j))) { in intel_soc_dts_iosf_add_read_only_critical_trip()
357 return update_trip_temp(&sensors->soc_dts[i], j, in intel_soc_dts_iosf_add_read_only_critical_trip()
358 sensors->tj_max - critical_offset, in intel_soc_dts_iosf_add_read_only_critical_trip()
368 void intel_soc_dts_iosf_interrupt_handler(struct intel_soc_dts_sensors *sensors) in intel_soc_dts_iosf_interrupt_handler() argument
375 spin_lock_irqsave(&sensors->intr_notify_lock, flags); in intel_soc_dts_iosf_interrupt_handler()
391 spin_unlock_irqrestore(&sensors->intr_notify_lock, flags); in intel_soc_dts_iosf_interrupt_handler()
395 thermal_zone_device_update(sensors->soc_dts[i].tzone); in intel_soc_dts_iosf_interrupt_handler()
398 spin_unlock_irqrestore(&sensors->intr_notify_lock, flags); in intel_soc_dts_iosf_interrupt_handler()
406 struct intel_soc_dts_sensors *sensors; in intel_soc_dts_iosf_init() local
421 sensors = kzalloc(sizeof(*sensors), GFP_KERNEL); in intel_soc_dts_iosf_init()
422 if (!sensors) in intel_soc_dts_iosf_init()
425 spin_lock_init(&sensors->intr_notify_lock); in intel_soc_dts_iosf_init()
426 mutex_init(&sensors->dts_update_lock); in intel_soc_dts_iosf_init()
427 sensors->intr_type = intr_type; in intel_soc_dts_iosf_init()
428 sensors->tj_max = tj_max; in intel_soc_dts_iosf_init()
434 sensors->soc_dts[i].sensors = sensors; in intel_soc_dts_iosf_init()
435 ret = add_dts_thermal_zone(i, &sensors->soc_dts[i], in intel_soc_dts_iosf_init()
443 ret = update_trip_temp(&sensors->soc_dts[i], 0, 0, in intel_soc_dts_iosf_init()
448 ret = update_trip_temp(&sensors->soc_dts[i], 1, 0, in intel_soc_dts_iosf_init()
454 return sensors; in intel_soc_dts_iosf_init()
457 remove_dts_thermal_zone(&sensors->soc_dts[i]); in intel_soc_dts_iosf_init()
460 kfree(sensors); in intel_soc_dts_iosf_init()
465 void intel_soc_dts_iosf_exit(struct intel_soc_dts_sensors *sensors) in intel_soc_dts_iosf_exit() argument
470 update_trip_temp(&sensors->soc_dts[i], 0, 0, 0); in intel_soc_dts_iosf_exit()
471 update_trip_temp(&sensors->soc_dts[i], 1, 0, 0); in intel_soc_dts_iosf_exit()
472 remove_dts_thermal_zone(&sensors->soc_dts[i]); in intel_soc_dts_iosf_exit()
474 kfree(sensors); in intel_soc_dts_iosf_exit()