Lines Matching refs:pmu
29 nvkm_pmu_pgob(struct nvkm_pmu *pmu, bool enable) in nvkm_pmu_pgob() argument
31 if (pmu && pmu->func->pgob) in nvkm_pmu_pgob()
32 pmu->func->pgob(pmu, enable); in nvkm_pmu_pgob()
36 nvkm_pmu_send(struct nvkm_pmu *pmu, u32 reply[2], in nvkm_pmu_send() argument
39 struct nvkm_subdev *subdev = &pmu->subdev; in nvkm_pmu_send()
58 pmu->recv.message = message; in nvkm_pmu_send()
59 pmu->recv.process = process; in nvkm_pmu_send()
69 pmu->send.base)); in nvkm_pmu_send()
81 wait_event(pmu->recv.wait, (pmu->recv.process == 0)); in nvkm_pmu_send()
82 reply[0] = pmu->recv.data[0]; in nvkm_pmu_send()
83 reply[1] = pmu->recv.data[1]; in nvkm_pmu_send()
93 struct nvkm_pmu *pmu = container_of(work, struct nvkm_pmu, recv.work); in nvkm_pmu_recv() local
94 struct nvkm_subdev *subdev = &pmu->subdev; in nvkm_pmu_recv()
110 pmu->recv.base)); in nvkm_pmu_recv()
121 if (pmu->recv.process) { in nvkm_pmu_recv()
122 if (process == pmu->recv.process && in nvkm_pmu_recv()
123 message == pmu->recv.message) { in nvkm_pmu_recv()
124 pmu->recv.data[0] = data0; in nvkm_pmu_recv()
125 pmu->recv.data[1] = data1; in nvkm_pmu_recv()
126 pmu->recv.process = 0; in nvkm_pmu_recv()
127 wake_up(&pmu->recv.wait); in nvkm_pmu_recv()
146 struct nvkm_pmu *pmu = nvkm_pmu(subdev); in nvkm_pmu_intr() local
147 struct nvkm_device *device = pmu->subdev.device; in nvkm_pmu_intr()
163 schedule_work(&pmu->recv.work); in nvkm_pmu_intr()
185 struct nvkm_pmu *pmu = nvkm_pmu(subdev); in nvkm_pmu_fini() local
186 struct nvkm_device *device = pmu->subdev.device; in nvkm_pmu_fini()
189 flush_work(&pmu->recv.work); in nvkm_pmu_fini()
196 struct nvkm_pmu *pmu = nvkm_pmu(subdev); in nvkm_pmu_init() local
197 struct nvkm_device *device = pmu->subdev.device; in nvkm_pmu_init()
216 for (i = 0; i < pmu->func->data.size / 4; i++) in nvkm_pmu_init()
217 nvkm_wr32(device, 0x10a1c4, pmu->func->data.data[i]); in nvkm_pmu_init()
221 for (i = 0; i < pmu->func->code.size / 4; i++) { in nvkm_pmu_init()
224 nvkm_wr32(device, 0x10a184, pmu->func->code.data[i]); in nvkm_pmu_init()
238 pmu->send.base = nvkm_rd32(device, 0x10a4d0) & 0x0000ffff; in nvkm_pmu_init()
239 pmu->send.size = nvkm_rd32(device, 0x10a4d0) >> 16; in nvkm_pmu_init()
247 pmu->recv.base = nvkm_rd32(device, 0x10a4dc) & 0x0000ffff; in nvkm_pmu_init()
248 pmu->recv.size = nvkm_rd32(device, 0x10a4dc) >> 16; in nvkm_pmu_init()
272 struct nvkm_pmu *pmu; in nvkm_pmu_new_() local
273 if (!(pmu = *ppmu = kzalloc(sizeof(*pmu), GFP_KERNEL))) in nvkm_pmu_new_()
275 nvkm_subdev_ctor(&nvkm_pmu, device, index, 0, &pmu->subdev); in nvkm_pmu_new_()
276 pmu->func = func; in nvkm_pmu_new_()
277 INIT_WORK(&pmu->recv.work, nvkm_pmu_recv); in nvkm_pmu_new_()
278 init_waitqueue_head(&pmu->recv.wait); in nvkm_pmu_new_()