Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
9cbcd337
Commit
9cbcd337
authored
Dec 04, 2012
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nvd0/therm: add support for hardware fan tachometer
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
7b49bd68
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
drivers/gpu/drm/nouveau/core/subdev/therm/nva3.c
drivers/gpu/drm/nouveau/core/subdev/therm/nva3.c
+1
-1
drivers/gpu/drm/nouveau/core/subdev/therm/nvd0.c
drivers/gpu/drm/nouveau/core/subdev/therm/nvd0.c
+24
-1
drivers/gpu/drm/nouveau/core/subdev/therm/priv.h
drivers/gpu/drm/nouveau/core/subdev/therm/priv.h
+2
-0
No files found.
drivers/gpu/drm/nouveau/core/subdev/therm/nva3.c
View file @
9cbcd337
...
...
@@ -30,7 +30,7 @@ struct nva3_therm_priv {
struct
nouveau_therm_priv
base
;
};
static
int
int
nva3_therm_fan_sense
(
struct
nouveau_therm
*
therm
)
{
u32
tach
=
nv_rd32
(
therm
,
0x00e728
)
&
0x0000ffff
;
...
...
drivers/gpu/drm/nouveau/core/subdev/therm/nvd0.c
View file @
9cbcd337
...
...
@@ -75,6 +75,28 @@ nvd0_fan_pwm_clock(struct nouveau_therm *therm)
return
(
nv_device
(
therm
)
->
crystal
*
1000
)
/
20
;
}
static
int
nvd0_therm_init
(
struct
nouveau_object
*
object
)
{
struct
nvd0_therm_priv
*
priv
=
(
void
*
)
object
;
int
ret
;
ret
=
nouveau_therm_init
(
&
priv
->
base
.
base
);
if
(
ret
)
return
ret
;
/* enable fan tach, count revolutions per-second */
nv_mask
(
priv
,
0x00e720
,
0x00000003
,
0x00000002
);
if
(
priv
->
base
.
fan
.
tach
.
func
!=
DCB_GPIO_UNUSED
)
{
nv_mask
(
priv
,
0x00d79c
,
0x000000ff
,
priv
->
base
.
fan
.
tach
.
line
);
nv_wr32
(
priv
,
0x00e724
,
nv_device
(
priv
)
->
crystal
*
1000
);
nv_mask
(
priv
,
0x00e720
,
0x00000001
,
0x00000001
);
}
nv_mask
(
priv
,
0x00e720
,
0x00000002
,
0x00000000
);
return
0
;
}
static
int
nvd0_therm_ctor
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
...
...
@@ -93,6 +115,7 @@ nvd0_therm_ctor(struct nouveau_object *parent,
priv
->
base
.
fan
.
pwm_set
=
nvd0_fan_pwm_set
;
priv
->
base
.
fan
.
pwm_clock
=
nvd0_fan_pwm_clock
;
priv
->
base
.
base
.
temp_get
=
nv50_temp_get
;
priv
->
base
.
base
.
fan_sense
=
nva3_therm_fan_sense
;
return
0
;
}
...
...
@@ -102,7 +125,7 @@ nvd0_therm_oclass = {
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
ctor
=
nvd0_therm_ctor
,
.
dtor
=
_nouveau_therm_dtor
,
.
init
=
_nouveau
_therm_init
,
.
init
=
nvd0
_therm_init
,
.
fini
=
_nouveau_therm_fini
,
},
};
drivers/gpu/drm/nouveau/core/subdev/therm/priv.h
View file @
9cbcd337
...
...
@@ -80,4 +80,6 @@ int nv50_fan_pwm_set(struct nouveau_therm *, int, u32, u32);
int
nv50_fan_pwm_clock
(
struct
nouveau_therm
*
);
int
nv50_temp_get
(
struct
nouveau_therm
*
therm
);
int
nva3_therm_fan_sense
(
struct
nouveau_therm
*
);
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment