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
Kirill Smelkov
linux
Commits
185eda33
Commit
185eda33
authored
Aug 20, 2015
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/volt: switch to subdev printk macros
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
9d7b9d9f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
15 deletions
+22
-15
drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c
drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c
+9
-6
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c
+10
-7
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c
+3
-2
No files found.
drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c
View file @
185eda33
...
@@ -46,12 +46,13 @@ nvkm_volt_get(struct nvkm_volt *volt)
...
@@ -46,12 +46,13 @@ nvkm_volt_get(struct nvkm_volt *volt)
static
int
static
int
nvkm_volt_set
(
struct
nvkm_volt
*
volt
,
u32
uv
)
nvkm_volt_set
(
struct
nvkm_volt
*
volt
,
u32
uv
)
{
{
struct
nvkm_subdev
*
subdev
=
&
volt
->
subdev
;
if
(
volt
->
vid_set
)
{
if
(
volt
->
vid_set
)
{
int
i
,
ret
=
-
EINVAL
;
int
i
,
ret
=
-
EINVAL
;
for
(
i
=
0
;
i
<
volt
->
vid_nr
;
i
++
)
{
for
(
i
=
0
;
i
<
volt
->
vid_nr
;
i
++
)
{
if
(
volt
->
vid
[
i
].
uv
==
uv
)
{
if
(
volt
->
vid
[
i
].
uv
==
uv
)
{
ret
=
volt
->
vid_set
(
volt
,
volt
->
vid
[
i
].
vid
);
ret
=
volt
->
vid_set
(
volt
,
volt
->
vid
[
i
].
vid
);
nv
_debug
(
volt
,
"set %duv: %d
\n
"
,
uv
,
ret
);
nv
km_debug
(
subdev
,
"set %duv: %d
\n
"
,
uv
,
ret
);
break
;
break
;
}
}
}
}
...
@@ -138,6 +139,7 @@ int
...
@@ -138,6 +139,7 @@ int
_nvkm_volt_init
(
struct
nvkm_object
*
object
)
_nvkm_volt_init
(
struct
nvkm_object
*
object
)
{
{
struct
nvkm_volt
*
volt
=
(
void
*
)
object
;
struct
nvkm_volt
*
volt
=
(
void
*
)
object
;
struct
nvkm_subdev
*
subdev
=
&
volt
->
subdev
;
int
ret
;
int
ret
;
ret
=
nvkm_subdev_init
(
&
volt
->
subdev
);
ret
=
nvkm_subdev_init
(
&
volt
->
subdev
);
...
@@ -147,11 +149,11 @@ _nvkm_volt_init(struct nvkm_object *object)
...
@@ -147,11 +149,11 @@ _nvkm_volt_init(struct nvkm_object *object)
ret
=
volt
->
get
(
volt
);
ret
=
volt
->
get
(
volt
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
if
(
ret
!=
-
ENODEV
)
if
(
ret
!=
-
ENODEV
)
nv
_debug
(
volt
,
"current voltage unknown
\n
"
);
nv
km_debug
(
subdev
,
"current voltage unknown
\n
"
);
return
0
;
return
0
;
}
}
nv
_info
(
volt
,
"GPU
voltage: %duv
\n
"
,
ret
);
nv
km_debug
(
subdev
,
"current
voltage: %duv
\n
"
,
ret
);
return
0
;
return
0
;
}
}
...
@@ -166,7 +168,8 @@ int
...
@@ -166,7 +168,8 @@ int
nvkm_volt_create_
(
struct
nvkm_object
*
parent
,
struct
nvkm_object
*
engine
,
nvkm_volt_create_
(
struct
nvkm_object
*
parent
,
struct
nvkm_object
*
engine
,
struct
nvkm_oclass
*
oclass
,
int
length
,
void
**
pobject
)
struct
nvkm_oclass
*
oclass
,
int
length
,
void
**
pobject
)
{
{
struct
nvkm_bios
*
bios
=
nvkm_bios
(
parent
);
struct
nvkm_device
*
device
=
(
void
*
)
parent
;
struct
nvkm_bios
*
bios
=
device
->
bios
;
struct
nvkm_volt
*
volt
;
struct
nvkm_volt
*
volt
;
int
ret
,
i
;
int
ret
,
i
;
...
@@ -186,8 +189,8 @@ nvkm_volt_create_(struct nvkm_object *parent, struct nvkm_object *engine,
...
@@ -186,8 +189,8 @@ nvkm_volt_create_(struct nvkm_object *parent, struct nvkm_object *engine,
if
(
volt
->
vid_nr
)
{
if
(
volt
->
vid_nr
)
{
for
(
i
=
0
;
i
<
volt
->
vid_nr
;
i
++
)
{
for
(
i
=
0
;
i
<
volt
->
vid_nr
;
i
++
)
{
nv
_debug
(
volt
,
"VID %02x: %duv
\n
"
,
nv
km_debug
(
&
volt
->
subdev
,
"VID %02x: %duv
\n
"
,
volt
->
vid
[
i
].
vid
,
volt
->
vid
[
i
].
uv
);
volt
->
vid
[
i
].
vid
,
volt
->
vid
[
i
].
uv
);
}
}
/*XXX: this is an assumption.. there probably exists boards
/*XXX: this is an assumption.. there probably exists boards
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c
View file @
185eda33
...
@@ -119,8 +119,9 @@ static int
...
@@ -119,8 +119,9 @@ static int
gk20a_volt_vid_set
(
struct
nvkm_volt
*
obj
,
u8
vid
)
gk20a_volt_vid_set
(
struct
nvkm_volt
*
obj
,
u8
vid
)
{
{
struct
gk20a_volt
*
volt
=
container_of
(
obj
,
typeof
(
*
volt
),
base
);
struct
gk20a_volt
*
volt
=
container_of
(
obj
,
typeof
(
*
volt
),
base
);
struct
nvkm_subdev
*
subdev
=
&
volt
->
base
.
subdev
;
nv
_debug
(
volt
,
"set voltage as %duv
\n
"
,
volt
->
base
.
vid
[
vid
].
uv
);
nv
km_debug
(
subdev
,
"set voltage as %duv
\n
"
,
volt
->
base
.
vid
[
vid
].
uv
);
return
regulator_set_voltage
(
volt
->
vdd
,
volt
->
base
.
vid
[
vid
].
uv
,
1200000
);
return
regulator_set_voltage
(
volt
->
vdd
,
volt
->
base
.
vid
[
vid
].
uv
,
1200000
);
}
}
...
@@ -128,12 +129,13 @@ static int
...
@@ -128,12 +129,13 @@ static int
gk20a_volt_set_id
(
struct
nvkm_volt
*
obj
,
u8
id
,
int
condition
)
gk20a_volt_set_id
(
struct
nvkm_volt
*
obj
,
u8
id
,
int
condition
)
{
{
struct
gk20a_volt
*
volt
=
container_of
(
obj
,
typeof
(
*
volt
),
base
);
struct
gk20a_volt
*
volt
=
container_of
(
obj
,
typeof
(
*
volt
),
base
);
struct
nvkm_subdev
*
subdev
=
&
volt
->
base
.
subdev
;
int
prev_uv
=
regulator_get_voltage
(
volt
->
vdd
);
int
prev_uv
=
regulator_get_voltage
(
volt
->
vdd
);
int
target_uv
=
volt
->
base
.
vid
[
id
].
uv
;
int
target_uv
=
volt
->
base
.
vid
[
id
].
uv
;
int
ret
;
int
ret
;
nv
_debug
(
volt
,
"prev=%d, target=%d, condition=%d
\n
"
,
nv
km_debug
(
subdev
,
"prev=%d, target=%d, condition=%d
\n
"
,
prev_uv
,
target_uv
,
condition
);
prev_uv
,
target_uv
,
condition
);
if
(
!
condition
||
if
(
!
condition
||
(
condition
<
0
&&
target_uv
<
prev_uv
)
||
(
condition
<
0
&&
target_uv
<
prev_uv
)
||
(
condition
>
0
&&
target_uv
>
prev_uv
))
{
(
condition
>
0
&&
target_uv
>
prev_uv
))
{
...
@@ -162,7 +164,7 @@ gk20a_volt_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
...
@@ -162,7 +164,7 @@ gk20a_volt_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
plat
=
nv_device_to_platform
(
nv_device
(
parent
));
plat
=
nv_device_to_platform
(
nv_device
(
parent
));
uv
=
regulator_get_voltage
(
plat
->
gpu
->
vdd
);
uv
=
regulator_get_voltage
(
plat
->
gpu
->
vdd
);
nv
_info
(
volt
,
"The default voltage is %duV
\n
"
,
uv
);
nv
km_info
(
&
volt
->
base
.
subdev
,
"The default voltage is %duV
\n
"
,
uv
);
volt
->
vdd
=
plat
->
gpu
->
vdd
;
volt
->
vdd
=
plat
->
gpu
->
vdd
;
volt
->
base
.
vid_get
=
gk20a_volt_vid_get
;
volt
->
base
.
vid_get
=
gk20a_volt_vid_get
;
...
@@ -170,14 +172,15 @@ gk20a_volt_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
...
@@ -170,14 +172,15 @@ gk20a_volt_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
volt
->
base
.
set_id
=
gk20a_volt_set_id
;
volt
->
base
.
set_id
=
gk20a_volt_set_id
;
volt
->
base
.
vid_nr
=
ARRAY_SIZE
(
gk20a_cvb_coef
);
volt
->
base
.
vid_nr
=
ARRAY_SIZE
(
gk20a_cvb_coef
);
nv_debug
(
volt
,
"%s - vid_nr = %d
\n
"
,
__func__
,
volt
->
base
.
vid_nr
);
nvkm_debug
(
&
volt
->
base
.
subdev
,
"%s - vid_nr = %d
\n
"
,
__func__
,
volt
->
base
.
vid_nr
);
for
(
i
=
0
;
i
<
volt
->
base
.
vid_nr
;
i
++
)
{
for
(
i
=
0
;
i
<
volt
->
base
.
vid_nr
;
i
++
)
{
volt
->
base
.
vid
[
i
].
vid
=
i
;
volt
->
base
.
vid
[
i
].
vid
=
i
;
volt
->
base
.
vid
[
i
].
uv
=
volt
->
base
.
vid
[
i
].
uv
=
gk20a_volt_calc_voltage
(
&
gk20a_cvb_coef
[
i
],
gk20a_volt_calc_voltage
(
&
gk20a_cvb_coef
[
i
],
plat
->
gpu_speedo
);
plat
->
gpu_speedo
);
nv
_debug
(
volt
,
"%2d: vid=%d, uv=%d
\n
"
,
i
,
nv
km_debug
(
&
volt
->
base
.
subdev
,
"%2d: vid=%d, uv=%d
\n
"
,
i
,
volt
->
base
.
vid
[
i
].
vid
,
volt
->
base
.
vid
[
i
].
uv
);
volt
->
base
.
vid
[
i
].
vid
,
volt
->
base
.
vid
[
i
].
uv
);
}
}
return
0
;
return
0
;
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c
View file @
185eda33
...
@@ -70,7 +70,8 @@ nvkm_voltgpio_set(struct nvkm_volt *volt, u8 vid)
...
@@ -70,7 +70,8 @@ nvkm_voltgpio_set(struct nvkm_volt *volt, u8 vid)
int
int
nvkm_voltgpio_init
(
struct
nvkm_volt
*
volt
)
nvkm_voltgpio_init
(
struct
nvkm_volt
*
volt
)
{
{
struct
nvkm_gpio
*
gpio
=
nvkm_gpio
(
volt
);
struct
nvkm_subdev
*
subdev
=
&
volt
->
subdev
;
struct
nvkm_gpio
*
gpio
=
subdev
->
device
->
gpio
;
struct
dcb_gpio_func
func
;
struct
dcb_gpio_func
func
;
int
i
;
int
i
;
...
@@ -86,7 +87,7 @@ nvkm_voltgpio_init(struct nvkm_volt *volt)
...
@@ -86,7 +87,7 @@ nvkm_voltgpio_init(struct nvkm_volt *volt)
if
(
ret
)
{
if
(
ret
)
{
if
(
ret
!=
-
ENOENT
)
if
(
ret
!=
-
ENOENT
)
return
ret
;
return
ret
;
nv
_debug
(
volt
,
"VID bit %d has no GPIO
\n
"
,
i
);
nv
km_debug
(
subdev
,
"VID bit %d has no GPIO
\n
"
,
i
);
volt
->
vid_mask
&=
~
(
1
<<
i
);
volt
->
vid_mask
&=
~
(
1
<<
i
);
}
}
}
}
...
...
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