summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/core/include
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2012-12-05 16:21:59 +1000
committerBen Skeggs <bskeggs@redhat.com>2013-02-20 16:00:18 +1000
commit9c3bd3a53129639f10e129b007862340dba16a09 (patch)
tree3da9e2dcca8215bc87168912b6645fe08abe4bd3 /drivers/gpu/drm/nouveau/core/include
parent68197b4ba0a3c90190795b97248b840a3e506545 (diff)
downloadop-kernel-dev-9c3bd3a53129639f10e129b007862340dba16a09.zip
op-kernel-dev-9c3bd3a53129639f10e129b007862340dba16a09.tar.gz
drm/nouveau/therm: cleanly separate pwm control logic from therm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Martin Peres <martin.peres@labri.fr>
Diffstat (limited to 'drivers/gpu/drm/nouveau/core/include')
-rw-r--r--drivers/gpu/drm/nouveau/core/include/subdev/therm.h22
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/therm.h b/drivers/gpu/drm/nouveau/core/include/subdev/therm.h
index a96d43a..ad3aea0 100644
--- a/drivers/gpu/drm/nouveau/core/include/subdev/therm.h
+++ b/drivers/gpu/drm/nouveau/core/include/subdev/therm.h
@@ -28,6 +28,11 @@ enum nouveau_therm_attr_type {
struct nouveau_therm {
struct nouveau_subdev base;
+ int (*pwm_ctrl)(struct nouveau_therm *, int line, bool);
+ int (*pwm_get)(struct nouveau_therm *, int line, u32 *, u32 *);
+ int (*pwm_set)(struct nouveau_therm *, int line, u32, u32);
+ int (*pwm_clock)(struct nouveau_therm *);
+
int (*fan_get)(struct nouveau_therm *);
int (*fan_set)(struct nouveau_therm *, int);
int (*fan_sense)(struct nouveau_therm *);
@@ -47,8 +52,10 @@ nouveau_therm(void *obj)
#define nouveau_therm_create(p,e,o,d) \
nouveau_therm_create_((p), (e), (o), sizeof(**d), (void **)d)
-#define nouveau_therm_destroy(p) \
- nouveau_subdev_destroy(&(p)->base)
+#define nouveau_therm_destroy(p) ({ \
+ struct nouveau_therm *therm = (p); \
+ _nouveau_therm_dtor(nv_object(therm)); \
+})
#define nouveau_therm_init(p) ({ \
struct nouveau_therm *therm = (p); \
_nouveau_therm_init(nv_object(therm)); \
@@ -58,12 +65,11 @@ nouveau_therm(void *obj)
_nouveau_therm_init(nv_object(therm), (s)); \
})
-int nouveau_therm_create_(struct nouveau_object *, struct nouveau_object *,
- struct nouveau_oclass *, int, void **);
-
-#define _nouveau_therm_dtor _nouveau_subdev_dtor
-int _nouveau_therm_init(struct nouveau_object *);
-int _nouveau_therm_fini(struct nouveau_object *, bool);
+int nouveau_therm_create_(struct nouveau_object *, struct nouveau_object *,
+ struct nouveau_oclass *, int, void **);
+void _nouveau_therm_dtor(struct nouveau_object *);
+int _nouveau_therm_init(struct nouveau_object *);
+int _nouveau_therm_fini(struct nouveau_object *, bool);
extern struct nouveau_oclass nv40_therm_oclass;
extern struct nouveau_oclass nv50_therm_oclass;
OpenPOWER on IntegriCloud