Lines Matching refs:cstate
79 nvkm_cstate_valid(struct nvkm_clk *clk, struct nvkm_cstate *cstate, in nvkm_cstate_valid() argument
88 u32 freq = cstate->domain[domain->name]; in nvkm_cstate_valid()
105 voltage = nvkm_volt_map(volt, cstate->voltage, temp); in nvkm_cstate_valid()
113 struct nvkm_cstate *cstate) in nvkm_cstate_find_best() argument
119 if (!pstate || !cstate) in nvkm_cstate_find_best()
123 return cstate; in nvkm_cstate_find_best()
136 list_for_each_entry_from_reverse(cstate, &pstate->list, head) { in nvkm_cstate_find_best()
137 if (nvkm_cstate_valid(clk, cstate, max_volt, clk->temp)) in nvkm_cstate_find_best()
138 return cstate; in nvkm_cstate_find_best()
147 struct nvkm_cstate *cstate; in nvkm_cstate_get() local
149 return list_last_entry(&pstate->list, typeof(*cstate), head); in nvkm_cstate_get()
151 list_for_each_entry(cstate, &pstate->list, head) { in nvkm_cstate_get()
152 if (cstate->id == cstatei) in nvkm_cstate_get()
153 return cstate; in nvkm_cstate_get()
166 struct nvkm_cstate *cstate; in nvkm_cstate_prog() local
170 cstate = nvkm_cstate_get(clk, pstate, cstatei); in nvkm_cstate_prog()
171 cstate = nvkm_cstate_find_best(clk, pstate, cstate); in nvkm_cstate_prog()
172 if (!cstate) in nvkm_cstate_prog()
175 cstate = &pstate->base; in nvkm_cstate_prog()
187 ret = nvkm_volt_set_id(volt, cstate->voltage, in nvkm_cstate_prog()
195 ret = clk->func->calc(clk, cstate); in nvkm_cstate_prog()
202 ret = nvkm_volt_set_id(volt, cstate->voltage, in nvkm_cstate_prog()
218 nvkm_cstate_del(struct nvkm_cstate *cstate) in nvkm_cstate_del() argument
220 list_del(&cstate->head); in nvkm_cstate_del()
221 kfree(cstate); in nvkm_cstate_del()
230 struct nvkm_cstate *cstate = NULL; in nvkm_cstate_new() local
242 cstate = kzalloc(sizeof(*cstate), GFP_KERNEL); in nvkm_cstate_new()
243 if (!cstate) in nvkm_cstate_new()
246 *cstate = pstate->base; in nvkm_cstate_new()
247 cstate->voltage = cstepX.voltage; in nvkm_cstate_new()
248 cstate->id = idx; in nvkm_cstate_new()
254 cstate->domain[domain->name] = freq; in nvkm_cstate_new()
259 list_add(&cstate->head, &pstate->list); in nvkm_cstate_new()
349 struct nvkm_cstate *cstate; in nvkm_pstate_info() local
365 list_for_each_entry(cstate, &pstate->list, head) { in nvkm_pstate_info()
366 u32 freq = cstate->domain[clock->name]; in nvkm_pstate_info()
391 struct nvkm_cstate *cstate, *temp; in nvkm_pstate_del() local
393 list_for_each_entry_safe(cstate, temp, &pstate->list, head) { in nvkm_pstate_del()
394 nvkm_cstate_del(cstate); in nvkm_pstate_del()
407 struct nvkm_cstate *cstate; in nvkm_pstate_new() local
420 cstate = &pstate->base; in nvkm_pstate_new()
430 cstate->voltage = perfE.voltage; in nvkm_pstate_new()
431 cstate->domain[nv_clk_src_core] = perfE.core; in nvkm_pstate_new()
432 cstate->domain[nv_clk_src_shader] = perfE.shader; in nvkm_pstate_new()
433 cstate->domain[nv_clk_src_mem] = perfE.memory; in nvkm_pstate_new()
434 cstate->domain[nv_clk_src_vdec] = perfE.vdec; in nvkm_pstate_new()
435 cstate->domain[nv_clk_src_dom6] = perfE.disp; in nvkm_pstate_new()
452 cstate->domain[domain->name] = perfS.v40.freq; in nvkm_pstate_new()