diff options
Diffstat (limited to 'drivers/gpu/nvgpu/volt/volt_policy.c')
-rw-r--r-- | drivers/gpu/nvgpu/volt/volt_policy.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/drivers/gpu/nvgpu/volt/volt_policy.c b/drivers/gpu/nvgpu/volt/volt_policy.c index 4c8737d3..e4b081a1 100644 --- a/drivers/gpu/nvgpu/volt/volt_policy.c +++ b/drivers/gpu/nvgpu/volt/volt_policy.c | |||
@@ -30,17 +30,17 @@ | |||
30 | 30 | ||
31 | #include "volt.h" | 31 | #include "volt.h" |
32 | 32 | ||
33 | static u32 volt_policy_pmu_data_init_super(struct gk20a *g, | 33 | static int volt_policy_pmu_data_init_super(struct gk20a *g, |
34 | struct boardobj *pboardobj, struct nv_pmu_boardobj *ppmudata) | 34 | struct boardobj *pboardobj, struct nv_pmu_boardobj *ppmudata) |
35 | { | 35 | { |
36 | return boardobj_pmudatainit_super(g, pboardobj, ppmudata); | 36 | return boardobj_pmudatainit_super(g, pboardobj, ppmudata); |
37 | } | 37 | } |
38 | 38 | ||
39 | static u32 construct_volt_policy(struct gk20a *g, | 39 | static int construct_volt_policy(struct gk20a *g, |
40 | struct boardobj **ppboardobj, u16 size, void *pArgs) | 40 | struct boardobj **ppboardobj, u16 size, void *pArgs) |
41 | { | 41 | { |
42 | struct voltage_policy *pvolt_policy = NULL; | 42 | struct voltage_policy *pvolt_policy = NULL; |
43 | u32 status = 0; | 43 | int status = 0; |
44 | 44 | ||
45 | status = boardobj_construct_super(g, ppboardobj, size, pArgs); | 45 | status = boardobj_construct_super(g, ppboardobj, size, pArgs); |
46 | if (status) { | 46 | if (status) { |
@@ -54,13 +54,13 @@ static u32 construct_volt_policy(struct gk20a *g, | |||
54 | return status; | 54 | return status; |
55 | } | 55 | } |
56 | 56 | ||
57 | static u32 construct_volt_policy_split_rail(struct gk20a *g, | 57 | static int construct_volt_policy_split_rail(struct gk20a *g, |
58 | struct boardobj **ppboardobj, u16 size, void *pArgs) | 58 | struct boardobj **ppboardobj, u16 size, void *pArgs) |
59 | { | 59 | { |
60 | struct voltage_policy_split_rail *ptmp_policy = | 60 | struct voltage_policy_split_rail *ptmp_policy = |
61 | (struct voltage_policy_split_rail *)pArgs; | 61 | (struct voltage_policy_split_rail *)pArgs; |
62 | struct voltage_policy_split_rail *pvolt_policy = NULL; | 62 | struct voltage_policy_split_rail *pvolt_policy = NULL; |
63 | u32 status = 0; | 63 | int status = 0; |
64 | 64 | ||
65 | status = construct_volt_policy(g, ppboardobj, size, pArgs); | 65 | status = construct_volt_policy(g, ppboardobj, size, pArgs); |
66 | if (status) { | 66 | if (status) { |
@@ -79,13 +79,13 @@ static u32 construct_volt_policy_split_rail(struct gk20a *g, | |||
79 | return status; | 79 | return status; |
80 | } | 80 | } |
81 | 81 | ||
82 | static u32 construct_volt_policy_single_rail(struct gk20a *g, | 82 | static int construct_volt_policy_single_rail(struct gk20a *g, |
83 | struct boardobj **ppboardobj, u16 size, void *pArgs) | 83 | struct boardobj **ppboardobj, u16 size, void *pArgs) |
84 | { | 84 | { |
85 | struct voltage_policy_single_rail *ptmp_policy = | 85 | struct voltage_policy_single_rail *ptmp_policy = |
86 | (struct voltage_policy_single_rail *)pArgs; | 86 | (struct voltage_policy_single_rail *)pArgs; |
87 | struct voltage_policy_single_rail *pvolt_policy = NULL; | 87 | struct voltage_policy_single_rail *pvolt_policy = NULL; |
88 | u32 status = 0; | 88 | int status = 0; |
89 | 89 | ||
90 | status = construct_volt_policy(g, ppboardobj, size, pArgs); | 90 | status = construct_volt_policy(g, ppboardobj, size, pArgs); |
91 | if (status) { | 91 | if (status) { |
@@ -99,10 +99,10 @@ static u32 construct_volt_policy_single_rail(struct gk20a *g, | |||
99 | return status; | 99 | return status; |
100 | } | 100 | } |
101 | 101 | ||
102 | static u32 volt_policy_pmu_data_init_single_rail(struct gk20a *g, | 102 | static int volt_policy_pmu_data_init_single_rail(struct gk20a *g, |
103 | struct boardobj *pboardobj, struct nv_pmu_boardobj *ppmudata) | 103 | struct boardobj *pboardobj, struct nv_pmu_boardobj *ppmudata) |
104 | { | 104 | { |
105 | u32 status = 0; | 105 | int status = 0; |
106 | struct voltage_policy_single_rail *ppolicy; | 106 | struct voltage_policy_single_rail *ppolicy; |
107 | struct nv_pmu_volt_volt_policy_sr_boardobj_set *pset; | 107 | struct nv_pmu_volt_volt_policy_sr_boardobj_set *pset; |
108 | 108 | ||
@@ -120,10 +120,10 @@ done: | |||
120 | return status; | 120 | return status; |
121 | } | 121 | } |
122 | 122 | ||
123 | static u32 volt_policy_pmu_data_init_sr_multi_step(struct gk20a *g, | 123 | static int volt_policy_pmu_data_init_sr_multi_step(struct gk20a *g, |
124 | struct boardobj *pboardobj, struct nv_pmu_boardobj *ppmudata) | 124 | struct boardobj *pboardobj, struct nv_pmu_boardobj *ppmudata) |
125 | { | 125 | { |
126 | u32 status = 0; | 126 | int status = 0; |
127 | struct voltage_policy_single_rail_multi_step *ppolicy; | 127 | struct voltage_policy_single_rail_multi_step *ppolicy; |
128 | struct nv_pmu_volt_volt_policy_sr_multi_step_boardobj_set *pset; | 128 | struct nv_pmu_volt_volt_policy_sr_multi_step_boardobj_set *pset; |
129 | 129 | ||
@@ -144,14 +144,14 @@ done: | |||
144 | return status; | 144 | return status; |
145 | } | 145 | } |
146 | 146 | ||
147 | static u32 volt_construct_volt_policy_single_rail_multi_step(struct gk20a *g, | 147 | static int volt_construct_volt_policy_single_rail_multi_step(struct gk20a *g, |
148 | struct boardobj **ppboardobj, u16 size, void *pargs) | 148 | struct boardobj **ppboardobj, u16 size, void *pargs) |
149 | { | 149 | { |
150 | struct boardobj *pboardobj = NULL; | 150 | struct boardobj *pboardobj = NULL; |
151 | struct voltage_policy_single_rail_multi_step *p_volt_policy = NULL; | 151 | struct voltage_policy_single_rail_multi_step *p_volt_policy = NULL; |
152 | struct voltage_policy_single_rail_multi_step *tmp_policy = | 152 | struct voltage_policy_single_rail_multi_step *tmp_policy = |
153 | (struct voltage_policy_single_rail_multi_step *)pargs; | 153 | (struct voltage_policy_single_rail_multi_step *)pargs; |
154 | u32 status = 0; | 154 | int status = 0; |
155 | 155 | ||
156 | status = construct_volt_policy_single_rail(g, ppboardobj, size, pargs); | 156 | status = construct_volt_policy_single_rail(g, ppboardobj, size, pargs); |
157 | if (status) { | 157 | if (status) { |
@@ -174,10 +174,10 @@ static u32 volt_construct_volt_policy_single_rail_multi_step(struct gk20a *g, | |||
174 | return status; | 174 | return status; |
175 | } | 175 | } |
176 | 176 | ||
177 | static u32 volt_policy_pmu_data_init_split_rail(struct gk20a *g, | 177 | static int volt_policy_pmu_data_init_split_rail(struct gk20a *g, |
178 | struct boardobj *pboardobj, struct nv_pmu_boardobj *ppmudata) | 178 | struct boardobj *pboardobj, struct nv_pmu_boardobj *ppmudata) |
179 | { | 179 | { |
180 | u32 status = 0; | 180 | int status = 0; |
181 | struct voltage_policy_split_rail *ppolicy; | 181 | struct voltage_policy_split_rail *ppolicy; |
182 | struct nv_pmu_volt_volt_policy_splt_r_boardobj_set *pset; | 182 | struct nv_pmu_volt_volt_policy_splt_r_boardobj_set *pset; |
183 | 183 | ||
@@ -201,11 +201,11 @@ done: | |||
201 | return status; | 201 | return status; |
202 | } | 202 | } |
203 | 203 | ||
204 | static u32 volt_construct_volt_policy_split_rail_single_step(struct gk20a *g, | 204 | static int volt_construct_volt_policy_split_rail_single_step(struct gk20a *g, |
205 | struct boardobj **ppboardobj, u16 size, void *pargs) | 205 | struct boardobj **ppboardobj, u16 size, void *pargs) |
206 | { | 206 | { |
207 | struct boardobj *pboardobj = NULL; | 207 | struct boardobj *pboardobj = NULL; |
208 | u32 status = 0; | 208 | int status = 0; |
209 | 209 | ||
210 | status = construct_volt_policy_split_rail(g, ppboardobj, size, pargs); | 210 | status = construct_volt_policy_split_rail(g, ppboardobj, size, pargs); |
211 | if (status) { | 211 | if (status) { |
@@ -221,7 +221,7 @@ static u32 volt_construct_volt_policy_split_rail_single_step(struct gk20a *g, | |||
221 | static struct voltage_policy *volt_volt_policy_construct(struct gk20a *g, void *pargs) | 221 | static struct voltage_policy *volt_volt_policy_construct(struct gk20a *g, void *pargs) |
222 | { | 222 | { |
223 | struct boardobj *pboard_obj = NULL; | 223 | struct boardobj *pboard_obj = NULL; |
224 | u32 status = 0; | 224 | int status = 0; |
225 | 225 | ||
226 | switch (BOARDOBJ_GET_TYPE(pargs)) { | 226 | switch (BOARDOBJ_GET_TYPE(pargs)) { |
227 | case CTRL_VOLT_POLICY_TYPE_SR_SINGLE_STEP: | 227 | case CTRL_VOLT_POLICY_TYPE_SR_SINGLE_STEP: |
@@ -269,10 +269,10 @@ static u8 volt_policy_type_convert(u8 vbios_type) | |||
269 | return CTRL_VOLT_POLICY_TYPE_INVALID; | 269 | return CTRL_VOLT_POLICY_TYPE_INVALID; |
270 | } | 270 | } |
271 | 271 | ||
272 | static u32 volt_get_volt_policy_table(struct gk20a *g, | 272 | static int volt_get_volt_policy_table(struct gk20a *g, |
273 | struct voltage_policy_metadata *pvolt_policy_metadata) | 273 | struct voltage_policy_metadata *pvolt_policy_metadata) |
274 | { | 274 | { |
275 | u32 status = 0; | 275 | int status = 0; |
276 | u8 *voltage_policy_table_ptr = NULL; | 276 | u8 *voltage_policy_table_ptr = NULL; |
277 | struct voltage_policy *ppolicy = NULL; | 277 | struct voltage_policy *ppolicy = NULL; |
278 | struct vbios_voltage_policy_table_1x_header header = { 0 }; | 278 | struct vbios_voltage_policy_table_1x_header header = { 0 }; |
@@ -370,7 +370,7 @@ static u32 volt_get_volt_policy_table(struct gk20a *g, | |||
370 | done: | 370 | done: |
371 | return status; | 371 | return status; |
372 | } | 372 | } |
373 | static u32 _volt_policy_devgrp_pmudata_instget(struct gk20a *g, | 373 | static int _volt_policy_devgrp_pmudata_instget(struct gk20a *g, |
374 | struct nv_pmu_boardobjgrp *pmuboardobjgrp, | 374 | struct nv_pmu_boardobjgrp *pmuboardobjgrp, |
375 | struct nv_pmu_boardobj **ppboardobjpmudata, u8 idx) | 375 | struct nv_pmu_boardobj **ppboardobjpmudata, u8 idx) |
376 | { | 376 | { |
@@ -392,7 +392,7 @@ static u32 _volt_policy_devgrp_pmudata_instget(struct gk20a *g, | |||
392 | return 0; | 392 | return 0; |
393 | } | 393 | } |
394 | 394 | ||
395 | static u32 _volt_policy_devgrp_pmustatus_instget(struct gk20a *g, | 395 | static int _volt_policy_devgrp_pmustatus_instget(struct gk20a *g, |
396 | void *pboardobjgrppmu, | 396 | void *pboardobjgrppmu, |
397 | struct nv_pmu_boardobj_query **ppboardobjpmustatus, u8 idx) | 397 | struct nv_pmu_boardobj_query **ppboardobjpmustatus, u8 idx) |
398 | { | 398 | { |
@@ -411,7 +411,7 @@ static u32 _volt_policy_devgrp_pmustatus_instget(struct gk20a *g, | |||
411 | return 0; | 411 | return 0; |
412 | } | 412 | } |
413 | 413 | ||
414 | static u32 _volt_policy_grp_pmudatainit_super(struct gk20a *g, | 414 | static int _volt_policy_grp_pmudatainit_super(struct gk20a *g, |
415 | struct boardobjgrp *pboardobjgrp, | 415 | struct boardobjgrp *pboardobjgrp, |
416 | struct nv_pmu_boardobjgrp_super *pboardobjgrppmu) | 416 | struct nv_pmu_boardobjgrp_super *pboardobjgrppmu) |
417 | { | 417 | { |
@@ -419,7 +419,7 @@ static u32 _volt_policy_grp_pmudatainit_super(struct gk20a *g, | |||
419 | (struct nv_pmu_volt_volt_policy_boardobjgrp_set_header *) | 419 | (struct nv_pmu_volt_volt_policy_boardobjgrp_set_header *) |
420 | pboardobjgrppmu; | 420 | pboardobjgrppmu; |
421 | struct obj_volt *volt = (struct obj_volt *)pboardobjgrp; | 421 | struct obj_volt *volt = (struct obj_volt *)pboardobjgrp; |
422 | u32 status = 0; | 422 | int status = 0; |
423 | 423 | ||
424 | status = boardobjgrp_pmudatainit_e32(g, pboardobjgrp, pboardobjgrppmu); | 424 | status = boardobjgrp_pmudatainit_e32(g, pboardobjgrp, pboardobjgrppmu); |
425 | if (status) { | 425 | if (status) { |
@@ -435,9 +435,9 @@ done: | |||
435 | return status; | 435 | return status; |
436 | } | 436 | } |
437 | 437 | ||
438 | u32 volt_policy_pmu_setup(struct gk20a *g) | 438 | int volt_policy_pmu_setup(struct gk20a *g) |
439 | { | 439 | { |
440 | u32 status; | 440 | int status; |
441 | struct boardobjgrp *pboardobjgrp = NULL; | 441 | struct boardobjgrp *pboardobjgrp = NULL; |
442 | 442 | ||
443 | nvgpu_log_info(g, " "); | 443 | nvgpu_log_info(g, " "); |
@@ -455,9 +455,9 @@ u32 volt_policy_pmu_setup(struct gk20a *g) | |||
455 | return status; | 455 | return status; |
456 | } | 456 | } |
457 | 457 | ||
458 | u32 volt_policy_sw_setup(struct gk20a *g) | 458 | int volt_policy_sw_setup(struct gk20a *g) |
459 | { | 459 | { |
460 | u32 status = 0; | 460 | int status = 0; |
461 | struct boardobjgrp *pboardobjgrp = NULL; | 461 | struct boardobjgrp *pboardobjgrp = NULL; |
462 | 462 | ||
463 | nvgpu_log_info(g, " "); | 463 | nvgpu_log_info(g, " "); |