-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drm/nouveau/therm: move thermal-related functions to the therm subdev
It looks scary because of the size, but I tried to keep the differences minimal. Further patches will fix the actual "driver" code and add new features. v2: change filenames, split to submodules v3: add a missing include v4: Ben Skeggs <bskeggs@redhat.com> - fixed set_defaults() to allow min_duty < 30 (thermal table will override this if it's actually necessary) - fixed set_defaults() to not provide pwm_freq so nv4x (which only has pwm_div) can actually work. the boards using pwm_freq will have a thermal table entry to provide us the value. - removed unused files Signed-off-by: Martin Peres <martin.peres@labri.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
- Loading branch information
Martin Peres
authored and
Ben Skeggs
committed
Oct 3, 2012
1 parent
d46497d
commit aa1b9b4
Showing
22 changed files
with
1,048 additions
and
542 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#ifndef __NOUVEAU_THERM_H__ | ||
#define __NOUVEAU_THERM_H__ | ||
|
||
#include <core/device.h> | ||
#include <core/subdev.h> | ||
|
||
enum nouveau_therm_fan_mode { | ||
FAN_CONTROL_NONE = 0, | ||
FAN_CONTROL_MANUAL = 1, | ||
FAN_CONTROL_NR, | ||
}; | ||
|
||
enum nouveau_therm_attr_type { | ||
NOUVEAU_THERM_ATTR_FAN_MIN_DUTY = 0, | ||
NOUVEAU_THERM_ATTR_FAN_MAX_DUTY = 1, | ||
NOUVEAU_THERM_ATTR_FAN_MODE = 2, | ||
|
||
NOUVEAU_THERM_ATTR_THRS_FAN_BOOST = 10, | ||
NOUVEAU_THERM_ATTR_THRS_FAN_BOOST_HYST = 11, | ||
NOUVEAU_THERM_ATTR_THRS_DOWN_CLK = 12, | ||
NOUVEAU_THERM_ATTR_THRS_DOWN_CLK_HYST = 13, | ||
NOUVEAU_THERM_ATTR_THRS_CRITICAL = 14, | ||
NOUVEAU_THERM_ATTR_THRS_CRITICAL_HYST = 15, | ||
NOUVEAU_THERM_ATTR_THRS_SHUTDOWN = 16, | ||
NOUVEAU_THERM_ATTR_THRS_SHUTDOWN_HYST = 17, | ||
}; | ||
|
||
struct nouveau_therm { | ||
struct nouveau_subdev base; | ||
|
||
int (*fan_get)(struct nouveau_therm *); | ||
int (*fan_set)(struct nouveau_therm *, int); | ||
int (*fan_sense)(struct nouveau_therm *); | ||
|
||
int (*temp_get)(struct nouveau_therm *); | ||
|
||
int (*attr_get)(struct nouveau_therm *, enum nouveau_therm_attr_type); | ||
int (*attr_set)(struct nouveau_therm *, | ||
enum nouveau_therm_attr_type, int); | ||
}; | ||
|
||
static inline struct nouveau_therm * | ||
nouveau_therm(void *obj) | ||
{ | ||
return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_THERM]; | ||
} | ||
|
||
#define nouveau_therm_create(p,e,o,d) \ | ||
nouveau_subdev_create((p), (e), (o), 0, "THERM", "therm", d) | ||
#define nouveau_therm_destroy(p) \ | ||
nouveau_subdev_destroy(&(p)->base) | ||
|
||
#define _nouveau_therm_dtor _nouveau_subdev_dtor | ||
|
||
extern struct nouveau_oclass nv40_therm_oclass; | ||
extern struct nouveau_oclass nv50_therm_oclass; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.