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()
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, "pp %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_hard_reset_poll(struct lima_ip *ip) in lima_pp_hard_reset_poll() argument
177 static int lima_pp_hard_reset(struct lima_ip *ip) in lima_pp_hard_reset() argument
179 struct lima_device *dev = ip->dev; in lima_pp_hard_reset()
185 ret = lima_poll_timeout(ip, lima_pp_hard_reset_poll, 10, 100); in lima_pp_hard_reset()
197 static void lima_pp_print_version(struct lima_ip *ip) in lima_pp_print_version() argument
222 dev_info(ip->dev->dev, "%s - %s version major %d minor %d\n", in lima_pp_print_version()
223 lima_ip_name(ip), name, major, minor); in lima_pp_print_version()
226 static int lima_pp_hw_init(struct lima_ip *ip) in lima_pp_hw_init() argument
228 ip->data.async_reset = false; in lima_pp_hw_init()
229 lima_pp_soft_reset_async(ip); in lima_pp_hw_init()
230 return lima_pp_soft_reset_async_wait(ip); in lima_pp_hw_init()
233 int lima_pp_resume(struct lima_ip *ip) in lima_pp_resume() argument
235 return lima_pp_hw_init(ip); in lima_pp_resume()
238 void lima_pp_suspend(struct lima_ip *ip) in lima_pp_suspend() argument
243 int lima_pp_init(struct lima_ip *ip) in lima_pp_init() argument
245 struct lima_device *dev = ip->dev; in lima_pp_init()
248 lima_pp_print_version(ip); in lima_pp_init()
250 err = lima_pp_hw_init(ip); in lima_pp_init()
254 err = devm_request_irq(dev->dev, ip->irq, lima_pp_irq_handler, in lima_pp_init()
255 IRQF_SHARED, lima_ip_name(ip), ip); in lima_pp_init()
258 lima_ip_name(ip)); in lima_pp_init()
267 void lima_pp_fini(struct lima_ip *ip) in lima_pp_fini() argument
272 int lima_pp_bcast_resume(struct lima_ip *ip) in lima_pp_bcast_resume() argument
275 ip->data.async_reset = false; in lima_pp_bcast_resume()
279 void lima_pp_bcast_suspend(struct lima_ip *ip) in lima_pp_bcast_suspend() argument
284 int lima_pp_bcast_init(struct lima_ip *ip) in lima_pp_bcast_init() argument
286 struct lima_device *dev = ip->dev; in lima_pp_bcast_init()
289 err = devm_request_irq(dev->dev, ip->irq, lima_pp_bcast_irq_handler, in lima_pp_bcast_init()
290 IRQF_SHARED, lima_ip_name(ip), ip); in lima_pp_bcast_init()
293 lima_ip_name(ip)); in lima_pp_bcast_init()
300 void lima_pp_bcast_fini(struct lima_ip *ip) in lima_pp_bcast_fini() argument
335 struct lima_ip *ip = pipe->bcast_processor; in lima_pp_task_run() local
345 lima_dlbu_set_reg(dev->ip + lima_ip_dlbu, frame->dlbu_regs); in lima_pp_task_run()
351 lima_pp_soft_reset_async_wait(ip); in lima_pp_task_run()
353 lima_pp_write_frame(ip, frame->frame, frame->wb); in lima_pp_task_run()
356 struct lima_ip *ip = pipe->processor[i]; in lima_pp_task_run() local
371 struct lima_ip *ip = pipe->processor[i]; in lima_pp_task_run() local
378 lima_pp_soft_reset_async_wait(ip); in lima_pp_task_run()
380 lima_pp_write_frame(ip, frame->frame, frame->wb); in lima_pp_task_run()
404 struct lima_ip *ip = pipe->processor[i]; in lima_pp_task_error() local
406 dev_err(ip->dev->dev, "pp task error %d int_state=%x status=%x\n", in lima_pp_task_error()
409 lima_pp_hard_reset(ip); in lima_pp_task_error()