1 #ifndef __NOUVEAU_THERM_H__
2 #define __NOUVEAU_THERM_H__
4 #include <core/device.h>
5 #include <core/subdev.h>
7 enum nouveau_therm_fan_mode {
9 FAN_CONTROL_MANUAL = 1,
13 enum nouveau_therm_attr_type {
14 NOUVEAU_THERM_ATTR_FAN_MIN_DUTY = 0,
15 NOUVEAU_THERM_ATTR_FAN_MAX_DUTY = 1,
16 NOUVEAU_THERM_ATTR_FAN_MODE = 2,
18 NOUVEAU_THERM_ATTR_THRS_FAN_BOOST = 10,
19 NOUVEAU_THERM_ATTR_THRS_FAN_BOOST_HYST = 11,
20 NOUVEAU_THERM_ATTR_THRS_DOWN_CLK = 12,
21 NOUVEAU_THERM_ATTR_THRS_DOWN_CLK_HYST = 13,
22 NOUVEAU_THERM_ATTR_THRS_CRITICAL = 14,
23 NOUVEAU_THERM_ATTR_THRS_CRITICAL_HYST = 15,
24 NOUVEAU_THERM_ATTR_THRS_SHUTDOWN = 16,
25 NOUVEAU_THERM_ATTR_THRS_SHUTDOWN_HYST = 17,
28 struct nouveau_therm {
29 struct nouveau_subdev base;
31 int (*fan_get)(struct nouveau_therm *);
32 int (*fan_set)(struct nouveau_therm *, int);
33 int (*fan_sense)(struct nouveau_therm *);
35 int (*temp_get)(struct nouveau_therm *);
37 int (*attr_get)(struct nouveau_therm *, enum nouveau_therm_attr_type);
38 int (*attr_set)(struct nouveau_therm *,
39 enum nouveau_therm_attr_type, int);
42 static inline struct nouveau_therm *
43 nouveau_therm(void *obj)
45 return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_THERM];
48 #define nouveau_therm_create(p,e,o,d) \
49 nouveau_subdev_create((p), (e), (o), 0, "THERM", "therm", d)
50 #define nouveau_therm_destroy(p) \
51 nouveau_subdev_destroy(&(p)->base)
53 #define _nouveau_therm_dtor _nouveau_subdev_dtor
55 extern struct nouveau_oclass nv40_therm_oclass;
56 extern struct nouveau_oclass nv50_therm_oclass;