204282301fb1c2c5e92acdecd71d66016b7ff8c2
2 * Copyright 2012 The Nouveau community
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
22 * Authors: Martin Peres
27 #include <core/object.h>
28 #include <core/device.h>
30 #include <subdev/bios.h>
33 nouveau_therm_temp_set_defaults(struct nouveau_therm
*therm
)
35 struct nouveau_therm_priv
*priv
= (void *)therm
;
37 priv
->bios_sensor
.slope_mult
= 1;
38 priv
->bios_sensor
.slope_div
= 1;
39 priv
->bios_sensor
.offset_num
= 0;
40 priv
->bios_sensor
.offset_den
= 1;
41 priv
->bios_sensor
.offset_constant
= 0;
43 priv
->bios_sensor
.thrs_fan_boost
.temp
= 90;
44 priv
->bios_sensor
.thrs_fan_boost
.hysteresis
= 3;
46 priv
->bios_sensor
.thrs_down_clock
.temp
= 95;
47 priv
->bios_sensor
.thrs_down_clock
.hysteresis
= 3;
49 priv
->bios_sensor
.thrs_critical
.temp
= 105;
50 priv
->bios_sensor
.thrs_critical
.hysteresis
= 5;
52 priv
->bios_sensor
.thrs_shutdown
.temp
= 135;
53 priv
->bios_sensor
.thrs_shutdown
.hysteresis
= 5; /*not that it matters */
58 nouveau_therm_temp_safety_checks(struct nouveau_therm
*therm
)
60 struct nouveau_therm_priv
*priv
= (void *)therm
;
62 if (!priv
->bios_sensor
.slope_div
)
63 priv
->bios_sensor
.slope_div
= 1;
64 if (!priv
->bios_sensor
.offset_den
)
65 priv
->bios_sensor
.offset_den
= 1;
69 nouveau_therm_sensor_ctor(struct nouveau_therm
*therm
)
71 struct nouveau_therm_priv
*priv
= (void *)therm
;
72 struct nouveau_bios
*bios
= nouveau_bios(therm
);
74 nouveau_therm_temp_set_defaults(therm
);
75 if (nvbios_therm_sensor_parse(bios
, NVBIOS_THERM_DOMAIN_CORE
,
77 nv_error(therm
, "nvbios_therm_sensor_parse failed\n");
78 nouveau_therm_temp_safety_checks(therm
);
This page took 0.033337 seconds and 4 git commands to generate.