/* * Copyright 2012 The Nouveau community * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Authors: Martin Peres
*/ #include"priv.h"
/* must be called with alarm_program_lock taken ! */ void
nvkm_therm_sensor_set_threshold_state(struct nvkm_therm *therm, enum nvkm_therm_thrs thrs, enum nvkm_therm_thrs_state st)
{
therm->sensor.alarm_state[thrs] = st;
}
/* must be called with alarm_program_lock taken ! */ enum nvkm_therm_thrs_state
nvkm_therm_sensor_get_threshold_state(struct nvkm_therm *therm, enum nvkm_therm_thrs thrs)
{ return therm->sensor.alarm_state[thrs];
}
if (dir == NVKM_THERM_THRS_FALLING)
nvkm_info(subdev, "temperature (%i C) went below the '%s' threshold\n",
temperature, thresholds[thrs]); else
nvkm_info(subdev, "temperature (%i C) hit the '%s' threshold\n",
temperature, thresholds[thrs]);
active = (dir == NVKM_THERM_THRS_RISING); switch (thrs) { case NVKM_THERM_THRS_FANBOOST: if (active) {
nvkm_therm_fan_set(therm, true, 100);
nvkm_therm_fan_mode(therm, NVKM_THERM_CTRL_AUTO);
} break; case NVKM_THERM_THRS_DOWNCLOCK: if (therm->emergency.downclock)
therm->emergency.downclock(therm, active); break; case NVKM_THERM_THRS_CRITICAL: if (therm->emergency.pause)
therm->emergency.pause(therm, active); break; case NVKM_THERM_THRS_SHUTDOWN: if (active) { struct work_struct *work;
work = kmalloc(sizeof(*work), GFP_ATOMIC); if (work) {
INIT_WORK(work, nv_poweroff_work);
schedule_work(work);
}
} break; case NVKM_THERM_THRS_NR: break;
}
}
/* must be called with alarm_program_lock taken ! */ staticvoid
nvkm_therm_threshold_hyst_polling(struct nvkm_therm *therm, conststruct nvbios_therm_threshold *thrs, enum nvkm_therm_thrs thrs_name)
{ enum nvkm_therm_thrs_direction direction; enum nvkm_therm_thrs_state prev_state, new_state; int temp = therm->func->temp_get(therm);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.