Commit 6387e2cb authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/therm: add hook for clk to suggest fanspeed to therm

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 547807b8
...@@ -35,8 +35,8 @@ enum nv_subdev_type { ...@@ -35,8 +35,8 @@ enum nv_subdev_type {
NVDEV_SUBDEV_BAR, NVDEV_SUBDEV_BAR,
NVDEV_SUBDEV_PWR, NVDEV_SUBDEV_PWR,
NVDEV_SUBDEV_VOLT, NVDEV_SUBDEV_VOLT,
NVDEV_SUBDEV_CLOCK,
NVDEV_SUBDEV_THERM, NVDEV_SUBDEV_THERM,
NVDEV_SUBDEV_CLOCK,
NVDEV_ENGINE_DMAOBJ, NVDEV_ENGINE_DMAOBJ,
NVDEV_ENGINE_FIFO, NVDEV_ENGINE_FIFO,
......
...@@ -71,6 +71,8 @@ void _nouveau_therm_dtor(struct nouveau_object *); ...@@ -71,6 +71,8 @@ void _nouveau_therm_dtor(struct nouveau_object *);
int _nouveau_therm_init(struct nouveau_object *); int _nouveau_therm_init(struct nouveau_object *);
int _nouveau_therm_fini(struct nouveau_object *, bool); int _nouveau_therm_fini(struct nouveau_object *, bool);
int nouveau_therm_cstate(struct nouveau_therm *, int, int);
extern struct nouveau_oclass nv40_therm_oclass; extern struct nouveau_oclass nv40_therm_oclass;
extern struct nouveau_oclass nv50_therm_oclass; extern struct nouveau_oclass nv50_therm_oclass;
extern struct nouveau_oclass nv84_therm_oclass; extern struct nouveau_oclass nv84_therm_oclass;
......
...@@ -127,6 +127,19 @@ nouveau_therm_update(struct nouveau_therm *therm, int mode) ...@@ -127,6 +127,19 @@ nouveau_therm_update(struct nouveau_therm *therm, int mode)
spin_unlock_irqrestore(&priv->lock, flags); spin_unlock_irqrestore(&priv->lock, flags);
} }
int
nouveau_therm_cstate(struct nouveau_therm *ptherm, int fan, int dir)
{
struct nouveau_therm_priv *priv = (void *)ptherm;
if (!dir || (dir < 0 && fan < priv->cstate) ||
(dir > 0 && fan > priv->cstate)) {
nv_debug(ptherm, "default fan speed -> %d%%\n", fan);
priv->cstate = fan;
nouveau_therm_update(ptherm, -1);
}
return 0;
}
static void static void
nouveau_therm_alarm(struct nouveau_alarm *alarm) nouveau_therm_alarm(struct nouveau_alarm *alarm)
{ {
......
...@@ -76,6 +76,7 @@ struct nouveau_therm_priv { ...@@ -76,6 +76,7 @@ struct nouveau_therm_priv {
spinlock_t lock; spinlock_t lock;
struct nouveau_therm_trip_point *last_trip; struct nouveau_therm_trip_point *last_trip;
int mode; int mode;
int cstate;
int suspend; int suspend;
/* bios */ /* bios */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment