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
7e24c114
Commit
7e24c114
authored
Aug 20, 2015
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/fuse: remove object accessor functions
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
7f5f518f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
11 deletions
+27
-11
drivers/gpu/drm/nouveau/include/nvkm/subdev/fuse.h
drivers/gpu/drm/nouveau/include/nvkm/subdev/fuse.h
+5
-0
drivers/gpu/drm/nouveau/nvkm/subdev/fuse/gf100.c
drivers/gpu/drm/nouveau/nvkm/subdev/fuse/gf100.c
+7
-3
drivers/gpu/drm/nouveau/nvkm/subdev/fuse/gm107.c
drivers/gpu/drm/nouveau/nvkm/subdev/fuse/gm107.c
+6
-3
drivers/gpu/drm/nouveau/nvkm/subdev/fuse/nv50.c
drivers/gpu/drm/nouveau/nvkm/subdev/fuse/nv50.c
+7
-3
drivers/gpu/drm/nouveau/nvkm/subdev/therm/g84.c
drivers/gpu/drm/nouveau/nvkm/subdev/therm/g84.c
+2
-2
No files found.
drivers/gpu/drm/nouveau/include/nvkm/subdev/fuse.h
View file @
7e24c114
...
...
@@ -5,6 +5,11 @@
struct
nvkm_fuse
{
struct
nvkm_subdev
subdev
;
const
struct
nvkm_fuse_func
*
func
;
};
struct
nvkm_fuse_func
{
u32
(
*
read
)(
struct
nvkm_fuse
*
,
u32
addr
);
};
static
inline
struct
nvkm_fuse
*
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/fuse/gf100.c
View file @
7e24c114
...
...
@@ -30,9 +30,9 @@ struct gf100_fuse {
};
static
u32
gf100_fuse_r
d32
(
struct
nvkm_object
*
object
,
u64
addr
)
gf100_fuse_r
ead
(
struct
nvkm_fuse
*
obj
,
u32
addr
)
{
struct
gf100_fuse
*
fuse
=
(
void
*
)
object
;
struct
gf100_fuse
*
fuse
=
container_of
(
obj
,
typeof
(
*
fuse
),
base
)
;
struct
nvkm_device
*
device
=
fuse
->
base
.
subdev
.
device
;
unsigned
long
flags
;
u32
fuse_enable
,
unk
,
val
;
...
...
@@ -48,6 +48,10 @@ gf100_fuse_rd32(struct nvkm_object *object, u64 addr)
return
val
;
}
static
const
struct
nvkm_fuse_func
gf100_fuse_func
=
{
.
read
=
gf100_fuse_read
,
};
static
int
gf100_fuse_ctor
(
struct
nvkm_object
*
parent
,
struct
nvkm_object
*
engine
,
...
...
@@ -63,6 +67,7 @@ gf100_fuse_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
return
ret
;
spin_lock_init
(
&
fuse
->
fuse_enable_lock
);
fuse
->
base
.
func
=
&
gf100_fuse_func
;
return
0
;
}
...
...
@@ -74,6 +79,5 @@ gf100_fuse_oclass = {
.
dtor
=
_nvkm_fuse_dtor
,
.
init
=
_nvkm_fuse_init
,
.
fini
=
_nvkm_fuse_fini
,
.
rd32
=
gf100_fuse_rd32
,
},
};
drivers/gpu/drm/nouveau/nvkm/subdev/fuse/gm107.c
View file @
7e24c114
...
...
@@ -24,13 +24,16 @@
#include "priv.h"
static
u32
gm107_fuse_r
d32
(
struct
nvkm_object
*
object
,
u64
addr
)
gm107_fuse_r
ead
(
struct
nvkm_fuse
*
fuse
,
u32
addr
)
{
struct
nvkm_fuse
*
fuse
=
(
void
*
)
object
;
struct
nvkm_device
*
device
=
fuse
->
subdev
.
device
;
return
nvkm_rd32
(
device
,
0x21100
+
addr
);
}
static
const
struct
nvkm_fuse_func
gm107_fuse_func
=
{
.
read
=
gm107_fuse_read
,
};
static
int
gm107_fuse_ctor
(
struct
nvkm_object
*
parent
,
struct
nvkm_object
*
engine
,
...
...
@@ -43,6 +46,7 @@ gm107_fuse_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
ret
=
nvkm_fuse_create
(
parent
,
engine
,
oclass
,
&
fuse
);
*
pobject
=
nv_object
(
fuse
);
fuse
->
func
=
&
gm107_fuse_func
;
return
ret
;
}
...
...
@@ -54,6 +58,5 @@ gm107_fuse_oclass = {
.
dtor
=
_nvkm_fuse_dtor
,
.
init
=
_nvkm_fuse_init
,
.
fini
=
_nvkm_fuse_fini
,
.
rd32
=
gm107_fuse_rd32
,
},
};
drivers/gpu/drm/nouveau/nvkm/subdev/fuse/nv50.c
View file @
7e24c114
...
...
@@ -30,9 +30,9 @@ struct nv50_fuse {
};
static
u32
nv50_fuse_r
d32
(
struct
nvkm_object
*
object
,
u64
addr
)
nv50_fuse_r
ead
(
struct
nvkm_fuse
*
obj
,
u32
addr
)
{
struct
nv50_fuse
*
fuse
=
(
void
*
)
object
;
struct
nv50_fuse
*
fuse
=
container_of
(
obj
,
typeof
(
*
fuse
),
base
)
;
struct
nvkm_device
*
device
=
fuse
->
base
.
subdev
.
device
;
unsigned
long
flags
;
u32
fuse_enable
,
val
;
...
...
@@ -46,6 +46,10 @@ nv50_fuse_rd32(struct nvkm_object *object, u64 addr)
return
val
;
}
static
const
struct
nvkm_fuse_func
nv50_fuse_func
=
{
.
read
=
&
nv50_fuse_read
,
};
static
int
nv50_fuse_ctor
(
struct
nvkm_object
*
parent
,
struct
nvkm_object
*
engine
,
...
...
@@ -61,6 +65,7 @@ nv50_fuse_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
return
ret
;
spin_lock_init
(
&
fuse
->
fuse_enable_lock
);
fuse
->
base
.
func
=
&
nv50_fuse_func
;
return
0
;
}
...
...
@@ -72,6 +77,5 @@ nv50_fuse_oclass = {
.
dtor
=
_nvkm_fuse_dtor
,
.
init
=
_nvkm_fuse_init
,
.
fini
=
_nvkm_fuse_fini
,
.
rd32
=
nv50_fuse_rd32
,
},
};
drivers/gpu/drm/nouveau/nvkm/subdev/therm/g84.c
View file @
7e24c114
...
...
@@ -32,7 +32,7 @@ g84_temp_get(struct nvkm_therm *therm)
struct
nvkm_device
*
device
=
therm
->
subdev
.
device
;
struct
nvkm_fuse
*
fuse
=
nvkm_fuse
(
therm
);
if
(
nv_ro32
(
fuse
,
0x1a8
)
==
1
)
if
(
fuse
->
func
->
read
(
fuse
,
0x1a8
)
==
1
)
return
nvkm_rd32
(
device
,
0x20400
);
else
return
-
ENODEV
;
...
...
@@ -45,7 +45,7 @@ g84_sensor_setup(struct nvkm_therm *therm)
struct
nvkm_fuse
*
fuse
=
nvkm_fuse
(
therm
);
/* enable temperature reading for cards with insane defaults */
if
(
nv_ro32
(
fuse
,
0x1a8
)
==
1
)
{
if
(
fuse
->
func
->
read
(
fuse
,
0x1a8
)
==
1
)
{
nvkm_mask
(
device
,
0x20008
,
0x80008000
,
0x80000000
);
nvkm_mask
(
device
,
0x2000c
,
0x80000003
,
0x00000000
);
mdelay
(
20
);
/* wait for the temperature to stabilize */
...
...
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