Lines Matching refs:ip

18 #define pp_write(reg, data) writel(data, ip->iomem + reg)
19 #define pp_read(reg) readl(ip->iomem + reg)
21 static void lima_pp_handle_irq(struct lima_ip *ip, u32 state) in lima_pp_handle_irq() argument
23 struct lima_device *dev = ip->dev; in lima_pp_handle_irq()
30 lima_ip_name(ip), state, status); in lima_pp_handle_irq()
43 struct lima_ip *ip = data; in lima_pp_irq_handler() local
44 struct lima_device *dev = ip->dev; in lima_pp_irq_handler()
52 lima_pp_handle_irq(ip, state); in lima_pp_irq_handler()
76 struct lima_ip *ip = pipe->processor[i]; in lima_pp_bcast_irq_handler() local
89 lima_pp_handle_irq(ip, state); in lima_pp_bcast_irq_handler()
104 static void lima_pp_soft_reset_async(struct lima_ip *ip) in lima_pp_soft_reset_async() argument
106 if (ip->data.async_reset) in lima_pp_soft_reset_async()
112 ip->data.async_reset = true; in lima_pp_soft_reset_async()
115 static int lima_pp_soft_reset_poll(struct lima_ip *ip) in lima_pp_soft_reset_poll() argument
121 static int lima_pp_soft_reset_async_wait_one(struct lima_ip *ip) in lima_pp_soft_reset_async_wait_one() argument
123 struct lima_device *dev = ip->dev; in lima_pp_soft_reset_async_wait_one()
126 ret = lima_poll_timeout(ip, lima_pp_soft_reset_poll, 0, 100); in lima_pp_soft_reset_async_wait_one()
128 dev_err(dev->dev, "%s reset time out\n", lima_ip_name(ip)); in lima_pp_soft_reset_async_wait_one()
137 static int lima_pp_soft_reset_async_wait(struct lima_ip *ip) in lima_pp_soft_reset_async_wait() argument
141 if (!ip->data.async_reset) in lima_pp_soft_reset_async_wait()
144 if (ip->id == lima_ip_pp_bcast) { in lima_pp_soft_reset_async_wait()
145 struct lima_device *dev = ip->dev; in lima_pp_soft_reset_async_wait()
152 err = lima_pp_soft_reset_async_wait_one(ip); in lima_pp_soft_reset_async_wait()
154 ip->data.async_reset = false; in lima_pp_soft_reset_async_wait()
158 static void lima_pp_write_frame(struct lima_ip *ip, u32 *frame, u32 *wb) in lima_pp_write_frame() argument
163 writel(frame[i], ip->iomem + LIMA_PP_FRAME + i * 4); in lima_pp_write_frame()
167 writel(wb[n++], ip->iomem + LIMA_PP_WB(i) + j * 4); in lima_pp_write_frame()
171 static int lima_pp_bus_stop_poll(struct lima_ip *ip) in lima_pp_bus_stop_poll() argument
176 static int lima_pp_hard_reset_poll(struct lima_ip *ip) in lima_pp_hard_reset_poll() argument
182 static int lima_pp_hard_reset(struct lima_ip *ip) in lima_pp_hard_reset() argument
184 struct lima_device *dev = ip->dev; in lima_pp_hard_reset()
191 ret = lima_poll_timeout(ip, lima_pp_bus_stop_poll, 10, 100); in lima_pp_hard_reset()
193 dev_err(dev->dev, "%s bus stop timeout\n", lima_ip_name(ip)); in lima_pp_hard_reset()
198 ret = lima_poll_timeout(ip, lima_pp_hard_reset_poll, 10, 100); in lima_pp_hard_reset()
200 dev_err(dev->dev, "%s hard reset timeout\n", lima_ip_name(ip)); in lima_pp_hard_reset()
212 ip->data.async_reset = false; in lima_pp_hard_reset()
217 static void lima_pp_print_version(struct lima_ip *ip) in lima_pp_print_version() argument
242 dev_info(ip->dev->dev, "%s - %s version major %d minor %d\n", in lima_pp_print_version()
243 lima_ip_name(ip), name, major, minor); in lima_pp_print_version()
246 static int lima_pp_hw_init(struct lima_ip *ip) in lima_pp_hw_init() argument
248 ip->data.async_reset = false; in lima_pp_hw_init()
249 lima_pp_soft_reset_async(ip); in lima_pp_hw_init()
250 return lima_pp_soft_reset_async_wait(ip); in lima_pp_hw_init()
253 int lima_pp_resume(struct lima_ip *ip) in lima_pp_resume() argument
255 return lima_pp_hw_init(ip); in lima_pp_resume()
258 void lima_pp_suspend(struct lima_ip *ip) in lima_pp_suspend() argument
263 int lima_pp_init(struct lima_ip *ip) in lima_pp_init() argument
265 struct lima_device *dev = ip->dev; in lima_pp_init()
268 lima_pp_print_version(ip); in lima_pp_init()
270 err = lima_pp_hw_init(ip); in lima_pp_init()
274 err = devm_request_irq(dev->dev, ip->irq, lima_pp_irq_handler, in lima_pp_init()
275 IRQF_SHARED, lima_ip_name(ip), ip); in lima_pp_init()
278 lima_ip_name(ip)); in lima_pp_init()
287 void lima_pp_fini(struct lima_ip *ip) in lima_pp_fini() argument
289 struct lima_device *dev = ip->dev; in lima_pp_fini()
291 devm_free_irq(dev->dev, ip->irq, ip); in lima_pp_fini()
294 int lima_pp_bcast_resume(struct lima_ip *ip) in lima_pp_bcast_resume() argument
297 ip->data.async_reset = false; in lima_pp_bcast_resume()
301 void lima_pp_bcast_suspend(struct lima_ip *ip) in lima_pp_bcast_suspend() argument
306 int lima_pp_bcast_init(struct lima_ip *ip) in lima_pp_bcast_init() argument
308 struct lima_device *dev = ip->dev; in lima_pp_bcast_init()
311 err = devm_request_irq(dev->dev, ip->irq, lima_pp_bcast_irq_handler, in lima_pp_bcast_init()
312 IRQF_SHARED, lima_ip_name(ip), ip); in lima_pp_bcast_init()
315 lima_ip_name(ip)); in lima_pp_bcast_init()
322 void lima_pp_bcast_fini(struct lima_ip *ip) in lima_pp_bcast_fini() argument
324 struct lima_device *dev = ip->dev; in lima_pp_bcast_fini()
326 devm_free_irq(dev->dev, ip->irq, ip); in lima_pp_bcast_fini()
359 struct lima_ip *ip = pipe->bcast_processor; in lima_pp_task_run() local
369 lima_dlbu_set_reg(dev->ip + lima_ip_dlbu, frame->dlbu_regs); in lima_pp_task_run()
375 lima_pp_soft_reset_async_wait(ip); in lima_pp_task_run()
377 lima_pp_write_frame(ip, frame->frame, frame->wb); in lima_pp_task_run()
380 struct lima_ip *ip = pipe->processor[i]; in lima_pp_task_run() local
395 struct lima_ip *ip = pipe->processor[i]; in lima_pp_task_run() local
402 lima_pp_soft_reset_async_wait(ip); in lima_pp_task_run()
404 lima_pp_write_frame(ip, frame->frame, frame->wb); in lima_pp_task_run()
428 struct lima_ip *ip = pipe->processor[i]; in lima_pp_task_error() local
430 dev_err(ip->dev->dev, "%s task error %d int_state=%x status=%x\n", in lima_pp_task_error()
431 lima_ip_name(ip), i, pp_read(LIMA_PP_INT_STATUS), in lima_pp_task_error()
434 lima_pp_hard_reset(ip); in lima_pp_task_error()
452 struct lima_ip *ip = pipe->processor[i]; in lima_pp_task_mask_irq() local