Lines Matching refs:vp
38 void camif_hw_clear_pending_irq(struct camif_vp *vp)
40 u32 cfg = camif_read(vp->camif, S3C_CAMIF_REG_CIGCTRL);
41 cfg |= CIGCTRL_IRQ_CLR(vp->id);
42 camif_write(vp->camif, S3C_CAMIF_REG_CIGCTRL, cfg);
79 cfg = camif_read(camif, S3C_CAMIF_REG_CIIMGEFF(camif->vp->offset));
92 camif_write(camif, S3C_CAMIF_REG_CIIMGEFF(camif->vp->offset), cfg);
151 void camif_hw_clear_fifo_overflow(struct camif_vp *vp)
153 struct camif_dev *camif = vp->camif;
157 if (vp->id == 0)
200 void camif_hw_set_output_addr(struct camif_vp *vp,
203 struct camif_dev *camif = vp->camif;
205 camif_write(camif, S3C_CAMIF_REG_CIYSA(vp->id, i), paddr->y);
207 || vp->id == VP_CODEC) {
208 camif_write(camif, S3C_CAMIF_REG_CICBSA(vp->id, i),
210 camif_write(camif, S3C_CAMIF_REG_CICRSA(vp->id, i),
218 static void camif_hw_set_out_dma_size(struct camif_vp *vp)
220 struct camif_frame *frame = &vp->out_frame;
223 cfg = camif_read(vp->camif, S3C_CAMIF_REG_CITRGFMT(vp->id, vp->offset));
226 camif_write(vp->camif, S3C_CAMIF_REG_CITRGFMT(vp->id, vp->offset), cfg);
255 void camif_hw_set_output_dma(struct camif_vp *vp)
257 struct camif_dev *camif = vp->camif;
258 struct camif_frame *frame = &vp->out_frame;
259 const struct camif_fmt *fmt = vp->out_fmt;
263 camif_hw_set_out_dma_size(vp);
270 camif_write(camif, S3C_CAMIF_REG_CISSY(vp->id), cfg);
271 camif_write(camif, S3C_CAMIF_REG_CISSCB(vp->id), cfg);
272 camif_write(camif, S3C_CAMIF_REG_CISSCR(vp->id), cfg);
278 cfg = camif_read(camif, S3C_CAMIF_REG_CICTRL(vp->id, vp->offset));
284 camif_write(camif, S3C_CAMIF_REG_CICTRL(vp->id, vp->offset), cfg);
289 void camif_hw_set_input_path(struct camif_vp *vp)
291 u32 cfg = camif_read(vp->camif, S3C_CAMIF_REG_MSCTRL(vp->id));
293 camif_write(vp->camif, S3C_CAMIF_REG_MSCTRL(vp->id), cfg);
296 void camif_hw_set_target_format(struct camif_vp *vp)
298 struct camif_dev *camif = vp->camif;
299 struct camif_frame *frame = &vp->out_frame;
303 frame->f_height, vp->out_fmt->color);
305 cfg = camif_read(camif, S3C_CAMIF_REG_CITRGFMT(vp->id, vp->offset));
312 if (vp->out_fmt->color == IMG_FMT_YCBCR422P)
316 switch (vp->out_fmt->color) {
333 if (vp->rotation == 90 || vp->rotation == 270)
337 camif_write(camif, S3C_CAMIF_REG_CITRGFMT(vp->id, vp->offset), cfg);
340 cfg = camif_read(camif, S3C_CAMIF_REG_CITAREA(vp->id, vp->offset));
343 camif_write(camif, S3C_CAMIF_REG_CITAREA(vp->id, vp->offset), cfg);
346 void camif_hw_set_flip(struct camif_vp *vp)
348 u32 cfg = camif_read(vp->camif,
349 S3C_CAMIF_REG_CITRGFMT(vp->id, vp->offset));
353 if (vp->hflip)
355 if (vp->vflip)
358 camif_write(vp->camif, S3C_CAMIF_REG_CITRGFMT(vp->id, vp->offset), cfg);
361 static void camif_hw_set_prescaler(struct camif_vp *vp)
363 struct camif_dev *camif = vp->camif;
364 struct camif_scaler *sc = &vp->scaler;
367 addr = S3C_CAMIF_REG_CISCPRERATIO(vp->id, vp->offset);
376 camif_write(camif, S3C_CAMIF_REG_CISCPREDST(vp->id, vp->offset), cfg);
379 static void camif_s3c244x_hw_set_scaler(struct camif_vp *vp)
381 struct camif_dev *camif = vp->camif;
382 struct camif_scaler *scaler = &vp->scaler;
383 unsigned int color = vp->out_fmt->color;
386 camif_hw_set_prescaler(vp);
388 cfg = camif_read(camif, S3C_CAMIF_REG_CISCCTRL(vp->id, vp->offset));
395 if (vp->id == VP_CODEC)
401 if (vp->id == VP_CODEC)
407 if (vp->id == VP_CODEC)
414 if (vp->id == VP_PREVIEW) {
420 camif_write(camif, S3C_CAMIF_REG_CISCCTRL(vp->id, vp->offset), cfg);
426 static void camif_s3c64xx_hw_set_scaler(struct camif_vp *vp)
428 struct camif_dev *camif = vp->camif;
429 struct camif_scaler *scaler = &vp->scaler;
430 unsigned int color = vp->out_fmt->color;
433 camif_hw_set_prescaler(vp);
435 cfg = camif_read(camif, S3C_CAMIF_REG_CISCCTRL(vp->id, vp->offset));
469 camif_write(camif, S3C_CAMIF_REG_CISCCTRL(vp->id, vp->offset), cfg);
475 void camif_hw_set_scaler(struct camif_vp *vp)
477 unsigned int ip_rev = vp->camif->variant->ip_revision;
480 camif_s3c244x_hw_set_scaler(vp);
482 camif_s3c64xx_hw_set_scaler(vp);
485 void camif_hw_enable_scaler(struct camif_vp *vp, bool on)
487 u32 addr = S3C_CAMIF_REG_CISCCTRL(vp->id, vp->offset);
490 cfg = camif_read(vp->camif, addr);
495 camif_write(vp->camif, addr, cfg);
498 void camif_hw_set_lastirq(struct camif_vp *vp, int enable)
500 u32 addr = S3C_CAMIF_REG_CICTRL(vp->id, vp->offset);
503 cfg = camif_read(vp->camif, addr);
508 camif_write(vp->camif, addr, cfg);
511 void camif_hw_enable_capture(struct camif_vp *vp)
513 struct camif_dev *camif = vp->camif;
516 cfg = camif_read(camif, S3C_CAMIF_REG_CIIMGCPT(vp->offset));
520 cfg |= CIIMGCPT_CPT_FREN_ENABLE(vp->id);
522 if (vp->scaler.enable)
523 cfg |= CIIMGCPT_IMGCPTEN_SC(vp->id);
528 camif_write(camif, S3C_CAMIF_REG_CIIMGCPT(vp->offset), cfg);
534 void camif_hw_disable_capture(struct camif_vp *vp)
536 struct camif_dev *camif = vp->camif;
539 cfg = camif_read(camif, S3C_CAMIF_REG_CIIMGCPT(vp->offset));
540 cfg &= ~CIIMGCPT_IMGCPTEN_SC(vp->id);
551 camif_write(camif, S3C_CAMIF_REG_CIIMGCPT(vp->offset), cfg);