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
04de6a04
Commit
04de6a04
authored
Jul 28, 2011
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nv41/pm: implement a second type of fanspeed pwm
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
9232969e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
0 deletions
+36
-0
drivers/gpu/drm/nouveau/nouveau_pm.h
drivers/gpu/drm/nouveau/nouveau_pm.h
+2
-0
drivers/gpu/drm/nouveau/nouveau_state.c
drivers/gpu/drm/nouveau/nouveau_state.c
+7
-0
drivers/gpu/drm/nouveau/nv40_pm.c
drivers/gpu/drm/nouveau/nv40_pm.c
+27
-0
No files found.
drivers/gpu/drm/nouveau/nouveau_pm.h
View file @
04de6a04
...
...
@@ -58,6 +58,8 @@ void *nv40_pm_clocks_pre(struct drm_device *, struct nouveau_pm_level *);
void
nv40_pm_clocks_set
(
struct
drm_device
*
,
void
*
);
int
nv40_pm_fanspeed_get
(
struct
drm_device
*
);
int
nv40_pm_fanspeed_set
(
struct
drm_device
*
,
int
percent
);
int
nv41_pm_fanspeed_get
(
struct
drm_device
*
);
int
nv41_pm_fanspeed_set
(
struct
drm_device
*
,
int
percent
);
/* nv50_pm.c */
int
nv50_pm_clock_get
(
struct
drm_device
*
,
u32
id
);
...
...
drivers/gpu/drm/nouveau/nouveau_state.c
View file @
04de6a04
...
...
@@ -298,6 +298,13 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
engine
->
pm
.
fanspeed_get
=
nv40_pm_fanspeed_get
;
engine
->
pm
.
fanspeed_set
=
nv40_pm_fanspeed_set
;
break
;
case
0x42
:
case
0x43
:
case
0x47
:
case
0x4b
:
engine
->
pm
.
fanspeed_get
=
nv41_pm_fanspeed_get
;
engine
->
pm
.
fanspeed_set
=
nv41_pm_fanspeed_set
;
break
;
default:
break
;
}
...
...
drivers/gpu/drm/nouveau/nv40_pm.c
View file @
04de6a04
...
...
@@ -372,3 +372,30 @@ nv40_pm_fanspeed_set(struct drm_device *dev, int percent)
nv_wr32
(
dev
,
0x0010f0
,
0x80000000
|
(
duty
<<
16
)
|
divs
);
return
0
;
}
int
nv41_pm_fanspeed_get
(
struct
drm_device
*
dev
)
{
u32
reg
=
nv_rd32
(
dev
,
0x0015f4
);
if
(
reg
&
0x80000000
)
{
u32
divs
=
nv_rd32
(
dev
,
0x0015f8
);
u32
duty
=
(
reg
&
0x7fffffff
);
if
(
divs
&&
divs
>=
duty
)
return
((
divs
-
duty
)
*
100
)
/
divs
;
}
return
100
;
}
int
nv41_pm_fanspeed_set
(
struct
drm_device
*
dev
,
int
percent
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_pm_engine
*
pm
=
&
dev_priv
->
engine
.
pm
;
u32
divs
=
pm
->
pwm_divisor
;
u32
duty
=
((
100
-
percent
)
*
divs
)
/
100
;
nv_wr32
(
dev
,
0x0015f8
,
divs
);
nv_wr32
(
dev
,
0x0015f4
,
duty
|
0x80000000
);
return
0
;
}
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