Lines Matching refs:vp

41 void camif_hw_clear_pending_irq(struct camif_vp *vp)  in camif_hw_clear_pending_irq()  argument
43 u32 cfg = camif_read(vp->camif, S3C_CAMIF_REG_CIGCTRL); in camif_hw_clear_pending_irq()
44 cfg |= CIGCTRL_IRQ_CLR(vp->id); in camif_hw_clear_pending_irq()
45 camif_write(vp->camif, S3C_CAMIF_REG_CIGCTRL, cfg); in camif_hw_clear_pending_irq()
82 cfg = camif_read(camif, S3C_CAMIF_REG_CIIMGEFF(camif->vp->offset)); in camif_hw_set_effect()
95 camif_write(camif, S3C_CAMIF_REG_CIIMGEFF(camif->vp->offset), cfg); in camif_hw_set_effect()
154 void camif_hw_clear_fifo_overflow(struct camif_vp *vp) in camif_hw_clear_fifo_overflow() argument
156 struct camif_dev *camif = vp->camif; in camif_hw_clear_fifo_overflow()
160 if (vp->id == 0) in camif_hw_clear_fifo_overflow()
203 void camif_hw_set_output_addr(struct camif_vp *vp, in camif_hw_set_output_addr() argument
206 struct camif_dev *camif = vp->camif; in camif_hw_set_output_addr()
208 camif_write(camif, S3C_CAMIF_REG_CIYSA(vp->id, i), paddr->y); in camif_hw_set_output_addr()
210 || vp->id == VP_CODEC) { in camif_hw_set_output_addr()
211 camif_write(camif, S3C_CAMIF_REG_CICBSA(vp->id, i), in camif_hw_set_output_addr()
213 camif_write(camif, S3C_CAMIF_REG_CICRSA(vp->id, i), in camif_hw_set_output_addr()
221 static void camif_hw_set_out_dma_size(struct camif_vp *vp) in camif_hw_set_out_dma_size() argument
223 struct camif_frame *frame = &vp->out_frame; in camif_hw_set_out_dma_size()
226 cfg = camif_read(vp->camif, S3C_CAMIF_REG_CITRGFMT(vp->id, vp->offset)); in camif_hw_set_out_dma_size()
229 camif_write(vp->camif, S3C_CAMIF_REG_CITRGFMT(vp->id, vp->offset), cfg); in camif_hw_set_out_dma_size()
258 void camif_hw_set_output_dma(struct camif_vp *vp) in camif_hw_set_output_dma() argument
260 struct camif_dev *camif = vp->camif; in camif_hw_set_output_dma()
261 struct camif_frame *frame = &vp->out_frame; in camif_hw_set_output_dma()
262 const struct camif_fmt *fmt = vp->out_fmt; in camif_hw_set_output_dma()
266 camif_hw_set_out_dma_size(vp); in camif_hw_set_output_dma()
273 camif_write(camif, S3C_CAMIF_REG_CISSY(vp->id), cfg); in camif_hw_set_output_dma()
274 camif_write(camif, S3C_CAMIF_REG_CISSCB(vp->id), cfg); in camif_hw_set_output_dma()
275 camif_write(camif, S3C_CAMIF_REG_CISSCR(vp->id), cfg); in camif_hw_set_output_dma()
281 cfg = camif_read(camif, S3C_CAMIF_REG_CICTRL(vp->id, vp->offset)); in camif_hw_set_output_dma()
287 camif_write(camif, S3C_CAMIF_REG_CICTRL(vp->id, vp->offset), cfg); in camif_hw_set_output_dma()
292 void camif_hw_set_input_path(struct camif_vp *vp) in camif_hw_set_input_path() argument
294 u32 cfg = camif_read(vp->camif, S3C_CAMIF_REG_MSCTRL(vp->id)); in camif_hw_set_input_path()
296 camif_write(vp->camif, S3C_CAMIF_REG_MSCTRL(vp->id), cfg); in camif_hw_set_input_path()
299 void camif_hw_set_target_format(struct camif_vp *vp) in camif_hw_set_target_format() argument
301 struct camif_dev *camif = vp->camif; in camif_hw_set_target_format()
302 struct camif_frame *frame = &vp->out_frame; in camif_hw_set_target_format()
306 frame->f_height, vp->out_fmt->color); in camif_hw_set_target_format()
308 cfg = camif_read(camif, S3C_CAMIF_REG_CITRGFMT(vp->id, vp->offset)); in camif_hw_set_target_format()
315 if (vp->out_fmt->color == IMG_FMT_YCBCR422P) in camif_hw_set_target_format()
319 switch (vp->out_fmt->color) { in camif_hw_set_target_format()
336 if (vp->rotation == 90 || vp->rotation == 270) in camif_hw_set_target_format()
340 camif_write(camif, S3C_CAMIF_REG_CITRGFMT(vp->id, vp->offset), cfg); in camif_hw_set_target_format()
343 cfg = camif_read(camif, S3C_CAMIF_REG_CITAREA(vp->id, vp->offset)); in camif_hw_set_target_format()
346 camif_write(camif, S3C_CAMIF_REG_CITAREA(vp->id, vp->offset), cfg); in camif_hw_set_target_format()
349 void camif_hw_set_flip(struct camif_vp *vp) in camif_hw_set_flip() argument
351 u32 cfg = camif_read(vp->camif, in camif_hw_set_flip()
352 S3C_CAMIF_REG_CITRGFMT(vp->id, vp->offset)); in camif_hw_set_flip()
356 if (vp->hflip) in camif_hw_set_flip()
358 if (vp->vflip) in camif_hw_set_flip()
361 camif_write(vp->camif, S3C_CAMIF_REG_CITRGFMT(vp->id, vp->offset), cfg); in camif_hw_set_flip()
364 static void camif_hw_set_prescaler(struct camif_vp *vp) in camif_hw_set_prescaler() argument
366 struct camif_dev *camif = vp->camif; in camif_hw_set_prescaler()
367 struct camif_scaler *sc = &vp->scaler; in camif_hw_set_prescaler()
370 addr = S3C_CAMIF_REG_CISCPRERATIO(vp->id, vp->offset); in camif_hw_set_prescaler()
379 camif_write(camif, S3C_CAMIF_REG_CISCPREDST(vp->id, vp->offset), cfg); in camif_hw_set_prescaler()
382 static void camif_s3c244x_hw_set_scaler(struct camif_vp *vp) in camif_s3c244x_hw_set_scaler() argument
384 struct camif_dev *camif = vp->camif; in camif_s3c244x_hw_set_scaler()
385 struct camif_scaler *scaler = &vp->scaler; in camif_s3c244x_hw_set_scaler()
386 unsigned int color = vp->out_fmt->color; in camif_s3c244x_hw_set_scaler()
389 camif_hw_set_prescaler(vp); in camif_s3c244x_hw_set_scaler()
391 cfg = camif_read(camif, S3C_CAMIF_REG_CISCCTRL(vp->id, vp->offset)); in camif_s3c244x_hw_set_scaler()
398 if (vp->id == VP_CODEC) in camif_s3c244x_hw_set_scaler()
404 if (vp->id == VP_CODEC) in camif_s3c244x_hw_set_scaler()
410 if (vp->id == VP_CODEC) in camif_s3c244x_hw_set_scaler()
417 if (vp->id == VP_PREVIEW) { in camif_s3c244x_hw_set_scaler()
423 camif_write(camif, S3C_CAMIF_REG_CISCCTRL(vp->id, vp->offset), cfg); in camif_s3c244x_hw_set_scaler()
429 static void camif_s3c64xx_hw_set_scaler(struct camif_vp *vp) in camif_s3c64xx_hw_set_scaler() argument
431 struct camif_dev *camif = vp->camif; in camif_s3c64xx_hw_set_scaler()
432 struct camif_scaler *scaler = &vp->scaler; in camif_s3c64xx_hw_set_scaler()
433 unsigned int color = vp->out_fmt->color; in camif_s3c64xx_hw_set_scaler()
436 camif_hw_set_prescaler(vp); in camif_s3c64xx_hw_set_scaler()
438 cfg = camif_read(camif, S3C_CAMIF_REG_CISCCTRL(vp->id, vp->offset)); in camif_s3c64xx_hw_set_scaler()
472 camif_write(camif, S3C_CAMIF_REG_CISCCTRL(vp->id, vp->offset), cfg); in camif_s3c64xx_hw_set_scaler()
478 void camif_hw_set_scaler(struct camif_vp *vp) in camif_hw_set_scaler() argument
480 unsigned int ip_rev = vp->camif->variant->ip_revision; in camif_hw_set_scaler()
483 camif_s3c244x_hw_set_scaler(vp); in camif_hw_set_scaler()
485 camif_s3c64xx_hw_set_scaler(vp); in camif_hw_set_scaler()
488 void camif_hw_enable_scaler(struct camif_vp *vp, bool on) in camif_hw_enable_scaler() argument
490 u32 addr = S3C_CAMIF_REG_CISCCTRL(vp->id, vp->offset); in camif_hw_enable_scaler()
493 cfg = camif_read(vp->camif, addr); in camif_hw_enable_scaler()
498 camif_write(vp->camif, addr, cfg); in camif_hw_enable_scaler()
501 void camif_hw_set_lastirq(struct camif_vp *vp, int enable) in camif_hw_set_lastirq() argument
503 u32 addr = S3C_CAMIF_REG_CICTRL(vp->id, vp->offset); in camif_hw_set_lastirq()
506 cfg = camif_read(vp->camif, addr); in camif_hw_set_lastirq()
511 camif_write(vp->camif, addr, cfg); in camif_hw_set_lastirq()
514 void camif_hw_enable_capture(struct camif_vp *vp) in camif_hw_enable_capture() argument
516 struct camif_dev *camif = vp->camif; in camif_hw_enable_capture()
519 cfg = camif_read(camif, S3C_CAMIF_REG_CIIMGCPT(vp->offset)); in camif_hw_enable_capture()
523 cfg |= CIIMGCPT_CPT_FREN_ENABLE(vp->id); in camif_hw_enable_capture()
525 if (vp->scaler.enable) in camif_hw_enable_capture()
526 cfg |= CIIMGCPT_IMGCPTEN_SC(vp->id); in camif_hw_enable_capture()
531 camif_write(camif, S3C_CAMIF_REG_CIIMGCPT(vp->offset), cfg); in camif_hw_enable_capture()
537 void camif_hw_disable_capture(struct camif_vp *vp) in camif_hw_disable_capture() argument
539 struct camif_dev *camif = vp->camif; in camif_hw_disable_capture()
542 cfg = camif_read(camif, S3C_CAMIF_REG_CIIMGCPT(vp->offset)); in camif_hw_disable_capture()
543 cfg &= ~CIIMGCPT_IMGCPTEN_SC(vp->id); in camif_hw_disable_capture()
554 camif_write(camif, S3C_CAMIF_REG_CIIMGCPT(vp->offset), cfg); in camif_hw_disable_capture()