Lines Matching refs:ccdc

169 static inline u32 vpfe_reg_read(struct vpfe_ccdc *ccdc, u32 offset)  in vpfe_reg_read()  argument
171 return ioread32(ccdc->ccdc_cfg.base_addr + offset); in vpfe_reg_read()
174 static inline void vpfe_reg_write(struct vpfe_ccdc *ccdc, u32 val, u32 offset) in vpfe_reg_write() argument
176 iowrite32(val, ccdc->ccdc_cfg.base_addr + offset); in vpfe_reg_write()
179 static inline struct vpfe_device *to_vpfe(struct vpfe_ccdc *ccdc) in to_vpfe() argument
181 return container_of(ccdc, struct vpfe_device, ccdc); in to_vpfe()
190 static inline void vpfe_pcr_enable(struct vpfe_ccdc *ccdc, int flag) in vpfe_pcr_enable() argument
192 vpfe_reg_write(ccdc, !!flag, VPFE_PCR); in vpfe_pcr_enable()
195 static void vpfe_config_enable(struct vpfe_ccdc *ccdc, int flag) in vpfe_config_enable() argument
200 cfg = vpfe_reg_read(ccdc, VPFE_CONFIG); in vpfe_config_enable()
206 vpfe_reg_write(ccdc, cfg, VPFE_CONFIG); in vpfe_config_enable()
209 static void vpfe_ccdc_setwin(struct vpfe_ccdc *ccdc, in vpfe_ccdc_setwin() argument
225 vpfe_reg_write(ccdc, (horz_start << VPFE_HORZ_INFO_SPH_SHIFT) | in vpfe_ccdc_setwin()
246 vpfe_reg_write(ccdc, val, VPFE_VDINT); in vpfe_ccdc_setwin()
248 vpfe_reg_write(ccdc, (vert_start << VPFE_VERT_START_SLV0_SHIFT) | in vpfe_ccdc_setwin()
250 vpfe_reg_write(ccdc, vert_nr_lines, VPFE_VERT_LINES); in vpfe_ccdc_setwin()
253 static void vpfe_reg_dump(struct vpfe_ccdc *ccdc) in vpfe_reg_dump() argument
255 struct vpfe_device *vpfe = to_vpfe(ccdc); in vpfe_reg_dump()
257 vpfe_dbg(3, vpfe, "ALAW: 0x%x\n", vpfe_reg_read(ccdc, VPFE_ALAW)); in vpfe_reg_dump()
258 vpfe_dbg(3, vpfe, "CLAMP: 0x%x\n", vpfe_reg_read(ccdc, VPFE_CLAMP)); in vpfe_reg_dump()
259 vpfe_dbg(3, vpfe, "DCSUB: 0x%x\n", vpfe_reg_read(ccdc, VPFE_DCSUB)); in vpfe_reg_dump()
260 vpfe_dbg(3, vpfe, "BLKCMP: 0x%x\n", vpfe_reg_read(ccdc, VPFE_BLKCMP)); in vpfe_reg_dump()
261 vpfe_dbg(3, vpfe, "COLPTN: 0x%x\n", vpfe_reg_read(ccdc, VPFE_COLPTN)); in vpfe_reg_dump()
262 vpfe_dbg(3, vpfe, "SDOFST: 0x%x\n", vpfe_reg_read(ccdc, VPFE_SDOFST)); in vpfe_reg_dump()
264 vpfe_reg_read(ccdc, VPFE_SYNMODE)); in vpfe_reg_dump()
266 vpfe_reg_read(ccdc, VPFE_HSIZE_OFF)); in vpfe_reg_dump()
268 vpfe_reg_read(ccdc, VPFE_HORZ_INFO)); in vpfe_reg_dump()
270 vpfe_reg_read(ccdc, VPFE_VERT_START)); in vpfe_reg_dump()
272 vpfe_reg_read(ccdc, VPFE_VERT_LINES)); in vpfe_reg_dump()
276 vpfe_ccdc_validate_param(struct vpfe_ccdc *ccdc, in vpfe_ccdc_validate_param() argument
279 struct vpfe_device *vpfe = to_vpfe(ccdc); in vpfe_ccdc_validate_param()
299 vpfe_ccdc_update_raw_params(struct vpfe_ccdc *ccdc, in vpfe_ccdc_update_raw_params() argument
303 &ccdc->ccdc_cfg.bayer.config_params; in vpfe_ccdc_update_raw_params()
312 static void vpfe_ccdc_restore_defaults(struct vpfe_ccdc *ccdc) in vpfe_ccdc_restore_defaults() argument
317 vpfe_pcr_enable(ccdc, 0); in vpfe_ccdc_restore_defaults()
321 vpfe_reg_write(ccdc, 0, i); in vpfe_ccdc_restore_defaults()
323 vpfe_reg_write(ccdc, VPFE_NO_CULLING, VPFE_CULLING); in vpfe_ccdc_restore_defaults()
324 vpfe_reg_write(ccdc, VPFE_CCDC_GAMMA_BITS_11_2, VPFE_ALAW); in vpfe_ccdc_restore_defaults()
327 static int vpfe_ccdc_close(struct vpfe_ccdc *ccdc, struct device *dev) in vpfe_ccdc_close() argument
329 struct vpfe_device *vpfe = to_vpfe(ccdc); in vpfe_ccdc_close()
332 pcr = vpfe_reg_read(ccdc, VPFE_PCR); in vpfe_ccdc_close()
336 dma_cntl = vpfe_reg_read(ccdc, VPFE_DMA_CNTL); in vpfe_ccdc_close()
342 vpfe_ccdc_restore_defaults(ccdc); in vpfe_ccdc_close()
345 vpfe_config_enable(ccdc, 0); in vpfe_ccdc_close()
351 static int vpfe_ccdc_set_params(struct vpfe_ccdc *ccdc, void __user *params) in vpfe_ccdc_set_params() argument
353 struct vpfe_device *vpfe = to_vpfe(ccdc); in vpfe_ccdc_set_params()
357 if (ccdc->ccdc_cfg.if_type != VPFE_RAW_BAYER) in vpfe_ccdc_set_params()
368 if (!vpfe_ccdc_validate_param(ccdc, &raw_params)) { in vpfe_ccdc_set_params()
369 vpfe_ccdc_update_raw_params(ccdc, &raw_params); in vpfe_ccdc_set_params()
380 static void vpfe_ccdc_config_ycbcr(struct vpfe_ccdc *ccdc) in vpfe_ccdc_config_ycbcr() argument
382 struct ccdc_params_ycbcr *params = &ccdc->ccdc_cfg.ycbcr; in vpfe_ccdc_config_ycbcr()
390 vpfe_ccdc_restore_defaults(ccdc); in vpfe_ccdc_config_ycbcr()
405 vpfe_reg_write(ccdc, VPFE_REC656IF_BT656_EN, VPFE_REC656IF); in vpfe_ccdc_config_ycbcr()
412 if (ccdc->ccdc_cfg.if_type == VPFE_BT656_10BIT) in vpfe_ccdc_config_ycbcr()
425 vpfe_reg_write(ccdc, syn_mode, VPFE_SYNMODE); in vpfe_ccdc_config_ycbcr()
428 vpfe_ccdc_setwin(ccdc, &params->win, in vpfe_ccdc_config_ycbcr()
435 if (ccdc->ccdc_cfg.if_type == VPFE_BT656_10BIT) in vpfe_ccdc_config_ycbcr()
436 vpfe_reg_write(ccdc, in vpfe_ccdc_config_ycbcr()
441 vpfe_reg_write(ccdc, in vpfe_ccdc_config_ycbcr()
449 vpfe_reg_write(ccdc, params->bytesperline, VPFE_HSIZE_OFF); in vpfe_ccdc_config_ycbcr()
454 vpfe_reg_write(ccdc, VPFE_SDOFST_FIELD_INTERLEAVED, in vpfe_ccdc_config_ycbcr()
459 vpfe_ccdc_config_black_clamp(struct vpfe_ccdc *ccdc, in vpfe_ccdc_config_black_clamp() argument
467 vpfe_reg_write(ccdc, val, VPFE_DCSUB); in vpfe_ccdc_config_black_clamp()
468 vpfe_reg_write(ccdc, VPFE_CLAMP_DEFAULT_VAL, VPFE_CLAMP); in vpfe_ccdc_config_black_clamp()
482 vpfe_reg_write(ccdc, val, VPFE_CLAMP); in vpfe_ccdc_config_black_clamp()
484 vpfe_reg_write(ccdc, VPFE_DCSUB_DEFAULT_VAL, VPFE_DCSUB); in vpfe_ccdc_config_black_clamp()
488 vpfe_ccdc_config_black_compense(struct vpfe_ccdc *ccdc, in vpfe_ccdc_config_black_compense() argument
500 vpfe_reg_write(ccdc, val, VPFE_BLKCMP); in vpfe_ccdc_config_black_compense()
507 static void vpfe_ccdc_config_raw(struct vpfe_ccdc *ccdc) in vpfe_ccdc_config_raw() argument
509 struct vpfe_device *vpfe = to_vpfe(ccdc); in vpfe_ccdc_config_raw()
511 &ccdc->ccdc_cfg.bayer.config_params; in vpfe_ccdc_config_raw()
512 struct ccdc_params_raw *params = &ccdc->ccdc_cfg.bayer; in vpfe_ccdc_config_raw()
517 vpfe_ccdc_restore_defaults(ccdc); in vpfe_ccdc_config_raw()
520 vpfe_reg_write(ccdc, VPFE_LATCH_ON_VSYNC_DISABLE, VPFE_CCDCFG); in vpfe_ccdc_config_raw()
543 vpfe_reg_write(ccdc, val, VPFE_ALAW); in vpfe_ccdc_config_raw()
548 vpfe_ccdc_setwin(ccdc, &params->win, params->frm_fmt, in vpfe_ccdc_config_raw()
552 vpfe_ccdc_config_black_clamp(ccdc, &config_params->blk_clamp); in vpfe_ccdc_config_raw()
555 vpfe_ccdc_config_black_compense(ccdc, &config_params->blk_comp); in vpfe_ccdc_config_raw()
566 vpfe_reg_write(ccdc, params->bytesperline, VPFE_HSIZE_OFF); in vpfe_ccdc_config_raw()
575 vpfe_reg_write(ccdc, VPFE_INTERLACED_IMAGE_INVERT, in vpfe_ccdc_config_raw()
579 vpfe_reg_write(ccdc, VPFE_INTERLACED_NO_IMAGE_INVERT, in vpfe_ccdc_config_raw()
583 vpfe_reg_write(ccdc, VPFE_PROGRESSIVE_NO_IMAGE_INVERT, in vpfe_ccdc_config_raw()
587 vpfe_reg_write(ccdc, syn_mode, VPFE_SYNMODE); in vpfe_ccdc_config_raw()
589 vpfe_reg_dump(ccdc); in vpfe_ccdc_config_raw()
593 vpfe_ccdc_set_buftype(struct vpfe_ccdc *ccdc, in vpfe_ccdc_set_buftype() argument
596 if (ccdc->ccdc_cfg.if_type == VPFE_RAW_BAYER) in vpfe_ccdc_set_buftype()
597 ccdc->ccdc_cfg.bayer.buf_type = buf_type; in vpfe_ccdc_set_buftype()
599 ccdc->ccdc_cfg.ycbcr.buf_type = buf_type; in vpfe_ccdc_set_buftype()
604 static inline enum ccdc_buftype vpfe_ccdc_get_buftype(struct vpfe_ccdc *ccdc) in vpfe_ccdc_get_buftype() argument
606 if (ccdc->ccdc_cfg.if_type == VPFE_RAW_BAYER) in vpfe_ccdc_get_buftype()
607 return ccdc->ccdc_cfg.bayer.buf_type; in vpfe_ccdc_get_buftype()
609 return ccdc->ccdc_cfg.ycbcr.buf_type; in vpfe_ccdc_get_buftype()
612 static int vpfe_ccdc_set_pixel_format(struct vpfe_ccdc *ccdc, u32 pixfmt) in vpfe_ccdc_set_pixel_format() argument
614 struct vpfe_device *vpfe = to_vpfe(ccdc); in vpfe_ccdc_set_pixel_format()
617 __func__, ccdc->ccdc_cfg.if_type, print_fourcc(pixfmt)); in vpfe_ccdc_set_pixel_format()
619 if (ccdc->ccdc_cfg.if_type == VPFE_RAW_BAYER) { in vpfe_ccdc_set_pixel_format()
620 ccdc->ccdc_cfg.bayer.pix_fmt = CCDC_PIXFMT_RAW; in vpfe_ccdc_set_pixel_format()
625 ccdc->ccdc_cfg.bayer.config_params.alaw.enable = 0; in vpfe_ccdc_set_pixel_format()
629 ccdc->ccdc_cfg.bayer.config_params.alaw.enable = 1; in vpfe_ccdc_set_pixel_format()
646 ccdc->ccdc_cfg.ycbcr.pix_order = CCDC_PIXORDER_YCBYCR; in vpfe_ccdc_set_pixel_format()
650 ccdc->ccdc_cfg.ycbcr.pix_order = CCDC_PIXORDER_CBYCRY; in vpfe_ccdc_set_pixel_format()
661 static u32 vpfe_ccdc_get_pixel_format(struct vpfe_ccdc *ccdc) in vpfe_ccdc_get_pixel_format() argument
665 if (ccdc->ccdc_cfg.if_type == VPFE_RAW_BAYER) { in vpfe_ccdc_get_pixel_format()
668 if (ccdc->ccdc_cfg.ycbcr.pix_order == CCDC_PIXORDER_YCBYCR) in vpfe_ccdc_get_pixel_format()
678 vpfe_ccdc_set_image_window(struct vpfe_ccdc *ccdc, in vpfe_ccdc_set_image_window() argument
681 if (ccdc->ccdc_cfg.if_type == VPFE_RAW_BAYER) { in vpfe_ccdc_set_image_window()
682 ccdc->ccdc_cfg.bayer.win = *win; in vpfe_ccdc_set_image_window()
683 ccdc->ccdc_cfg.bayer.bytesperpixel = bpp; in vpfe_ccdc_set_image_window()
684 ccdc->ccdc_cfg.bayer.bytesperline = ALIGN(win->width * bpp, 32); in vpfe_ccdc_set_image_window()
686 ccdc->ccdc_cfg.ycbcr.win = *win; in vpfe_ccdc_set_image_window()
687 ccdc->ccdc_cfg.ycbcr.bytesperpixel = bpp; in vpfe_ccdc_set_image_window()
688 ccdc->ccdc_cfg.ycbcr.bytesperline = ALIGN(win->width * bpp, 32); in vpfe_ccdc_set_image_window()
695 vpfe_ccdc_get_image_window(struct vpfe_ccdc *ccdc, in vpfe_ccdc_get_image_window() argument
698 if (ccdc->ccdc_cfg.if_type == VPFE_RAW_BAYER) in vpfe_ccdc_get_image_window()
699 *win = ccdc->ccdc_cfg.bayer.win; in vpfe_ccdc_get_image_window()
701 *win = ccdc->ccdc_cfg.ycbcr.win; in vpfe_ccdc_get_image_window()
704 static inline unsigned int vpfe_ccdc_get_line_length(struct vpfe_ccdc *ccdc) in vpfe_ccdc_get_line_length() argument
706 if (ccdc->ccdc_cfg.if_type == VPFE_RAW_BAYER) in vpfe_ccdc_get_line_length()
707 return ccdc->ccdc_cfg.bayer.bytesperline; in vpfe_ccdc_get_line_length()
709 return ccdc->ccdc_cfg.ycbcr.bytesperline; in vpfe_ccdc_get_line_length()
713 vpfe_ccdc_set_frame_format(struct vpfe_ccdc *ccdc, in vpfe_ccdc_set_frame_format() argument
716 if (ccdc->ccdc_cfg.if_type == VPFE_RAW_BAYER) in vpfe_ccdc_set_frame_format()
717 ccdc->ccdc_cfg.bayer.frm_fmt = frm_fmt; in vpfe_ccdc_set_frame_format()
719 ccdc->ccdc_cfg.ycbcr.frm_fmt = frm_fmt; in vpfe_ccdc_set_frame_format()
725 vpfe_ccdc_get_frame_format(struct vpfe_ccdc *ccdc) in vpfe_ccdc_get_frame_format() argument
727 if (ccdc->ccdc_cfg.if_type == VPFE_RAW_BAYER) in vpfe_ccdc_get_frame_format()
728 return ccdc->ccdc_cfg.bayer.frm_fmt; in vpfe_ccdc_get_frame_format()
730 return ccdc->ccdc_cfg.ycbcr.frm_fmt; in vpfe_ccdc_get_frame_format()
733 static inline int vpfe_ccdc_getfid(struct vpfe_ccdc *ccdc) in vpfe_ccdc_getfid() argument
735 return (vpfe_reg_read(ccdc, VPFE_SYNMODE) >> 15) & 1; in vpfe_ccdc_getfid()
738 static inline void vpfe_set_sdr_addr(struct vpfe_ccdc *ccdc, unsigned long addr) in vpfe_set_sdr_addr() argument
740 vpfe_reg_write(ccdc, addr & 0xffffffe0, VPFE_SDR_ADDR); in vpfe_set_sdr_addr()
743 static int vpfe_ccdc_set_hw_if_params(struct vpfe_ccdc *ccdc, in vpfe_ccdc_set_hw_if_params() argument
746 struct vpfe_device *vpfe = to_vpfe(ccdc); in vpfe_ccdc_set_hw_if_params()
748 ccdc->ccdc_cfg.if_type = params->if_type; in vpfe_ccdc_set_hw_if_params()
755 ccdc->ccdc_cfg.ycbcr.vd_pol = params->vdpol; in vpfe_ccdc_set_hw_if_params()
756 ccdc->ccdc_cfg.ycbcr.hd_pol = params->hdpol; in vpfe_ccdc_set_hw_if_params()
760 ccdc->ccdc_cfg.bayer.vd_pol = params->vdpol; in vpfe_ccdc_set_hw_if_params()
761 ccdc->ccdc_cfg.bayer.hd_pol = params->hdpol; in vpfe_ccdc_set_hw_if_params()
763 ccdc->ccdc_cfg.bayer.config_params.data_sz = in vpfe_ccdc_set_hw_if_params()
766 ccdc->ccdc_cfg.bayer.config_params.data_sz = in vpfe_ccdc_set_hw_if_params()
771 ccdc->ccdc_cfg.bayer.config_params.data_sz); in vpfe_ccdc_set_hw_if_params()
781 static void vpfe_clear_intr(struct vpfe_ccdc *ccdc, int vdint) in vpfe_clear_intr() argument
785 vpfe_int_status = vpfe_reg_read(ccdc, VPFE_IRQ_STS); in vpfe_clear_intr()
817 vpfe_reg_write(ccdc, vpfe_int_status, VPFE_IRQ_STS); in vpfe_clear_intr()
819 vpfe_int_status = vpfe_reg_read(ccdc, VPFE_IRQ_STS); in vpfe_clear_intr()
822 vpfe_reg_write(ccdc, 1, VPFE_IRQ_EOI); in vpfe_clear_intr()
825 static void vpfe_ccdc_config_defaults(struct vpfe_ccdc *ccdc) in vpfe_ccdc_config_defaults() argument
827 ccdc->ccdc_cfg.if_type = VPFE_RAW_BAYER; in vpfe_ccdc_config_defaults()
829 ccdc->ccdc_cfg.ycbcr.pix_fmt = CCDC_PIXFMT_YCBCR_8BIT; in vpfe_ccdc_config_defaults()
830 ccdc->ccdc_cfg.ycbcr.frm_fmt = CCDC_FRMFMT_INTERLACED; in vpfe_ccdc_config_defaults()
831 ccdc->ccdc_cfg.ycbcr.fid_pol = VPFE_PINPOL_POSITIVE; in vpfe_ccdc_config_defaults()
832 ccdc->ccdc_cfg.ycbcr.vd_pol = VPFE_PINPOL_POSITIVE; in vpfe_ccdc_config_defaults()
833 ccdc->ccdc_cfg.ycbcr.hd_pol = VPFE_PINPOL_POSITIVE; in vpfe_ccdc_config_defaults()
834 ccdc->ccdc_cfg.ycbcr.pix_order = CCDC_PIXORDER_CBYCRY; in vpfe_ccdc_config_defaults()
835 ccdc->ccdc_cfg.ycbcr.buf_type = CCDC_BUFTYPE_FLD_INTERLEAVED; in vpfe_ccdc_config_defaults()
837 ccdc->ccdc_cfg.ycbcr.win.left = 0; in vpfe_ccdc_config_defaults()
838 ccdc->ccdc_cfg.ycbcr.win.top = 0; in vpfe_ccdc_config_defaults()
839 ccdc->ccdc_cfg.ycbcr.win.width = 720; in vpfe_ccdc_config_defaults()
840 ccdc->ccdc_cfg.ycbcr.win.height = 576; in vpfe_ccdc_config_defaults()
841 ccdc->ccdc_cfg.ycbcr.bt656_enable = 1; in vpfe_ccdc_config_defaults()
843 ccdc->ccdc_cfg.bayer.pix_fmt = CCDC_PIXFMT_RAW; in vpfe_ccdc_config_defaults()
844 ccdc->ccdc_cfg.bayer.frm_fmt = CCDC_FRMFMT_PROGRESSIVE; in vpfe_ccdc_config_defaults()
845 ccdc->ccdc_cfg.bayer.fid_pol = VPFE_PINPOL_POSITIVE; in vpfe_ccdc_config_defaults()
846 ccdc->ccdc_cfg.bayer.vd_pol = VPFE_PINPOL_POSITIVE; in vpfe_ccdc_config_defaults()
847 ccdc->ccdc_cfg.bayer.hd_pol = VPFE_PINPOL_POSITIVE; in vpfe_ccdc_config_defaults()
849 ccdc->ccdc_cfg.bayer.win.left = 0; in vpfe_ccdc_config_defaults()
850 ccdc->ccdc_cfg.bayer.win.top = 0; in vpfe_ccdc_config_defaults()
851 ccdc->ccdc_cfg.bayer.win.width = 800; in vpfe_ccdc_config_defaults()
852 ccdc->ccdc_cfg.bayer.win.height = 600; in vpfe_ccdc_config_defaults()
853 ccdc->ccdc_cfg.bayer.config_params.data_sz = VPFE_CCDC_DATA_8BITS; in vpfe_ccdc_config_defaults()
854 ccdc->ccdc_cfg.bayer.config_params.alaw.gamma_wd = in vpfe_ccdc_config_defaults()
870 vpfe_ccdc_get_image_window(&vpfe->ccdc, &image_win); in vpfe_get_ccdc_image_format()
873 f->fmt.pix.bytesperline = vpfe_ccdc_get_line_length(&vpfe->ccdc); in vpfe_get_ccdc_image_format()
876 buf_type = vpfe_ccdc_get_buftype(&vpfe->ccdc); in vpfe_get_ccdc_image_format()
877 f->fmt.pix.pixelformat = vpfe_ccdc_get_pixel_format(&vpfe->ccdc); in vpfe_get_ccdc_image_format()
878 frm_fmt = vpfe_ccdc_get_frame_format(&vpfe->ccdc); in vpfe_get_ccdc_image_format()
907 if (vpfe_ccdc_set_pixel_format(&vpfe->ccdc, in vpfe_config_ccdc_image_format()
915 vpfe_ccdc_set_image_window(&vpfe->ccdc, &vpfe->crop, bpp); in vpfe_config_ccdc_image_format()
921 &vpfe->ccdc, in vpfe_config_ccdc_image_format()
932 &vpfe->ccdc, in vpfe_config_ccdc_image_format()
943 return vpfe_ccdc_set_frame_format(&vpfe->ccdc, frm_fmt); in vpfe_config_ccdc_image_format()
1028 vpfe_config_enable(&vpfe->ccdc, 1); in vpfe_initialize_device()
1030 vpfe_ccdc_restore_defaults(&vpfe->ccdc); in vpfe_initialize_device()
1033 vpfe_clear_intr(&vpfe->ccdc, -1); in vpfe_initialize_device()
1063 vpfe_ccdc_close(&vpfe->ccdc, vpfe->pdev); in vpfe_release()
1125 vpfe_set_sdr_addr(&vpfe->ccdc, addr); in vpfe_schedule_next_buffer()
1135 vpfe_set_sdr_addr(&vpfe->ccdc, addr); in vpfe_schedule_bottom_field()
1163 fid = vpfe_ccdc_getfid(&vpfe->ccdc); in vpfe_handle_interlaced_irq()
1221 intr_status = vpfe_reg_read(&vpfe->ccdc, VPFE_IRQ_STS); in vpfe_isr()
1242 vpfe_clear_intr(&vpfe->ccdc, intr_status); in vpfe_isr()
1252 frame_format = vpfe_ccdc_get_frame_format(&vpfe->ccdc); in vpfe_detach_irq()
1256 vpfe_reg_write(&vpfe->ccdc, intr, VPFE_IRQ_EN_CLR); in vpfe_detach_irq()
1264 frame_format = vpfe_ccdc_get_frame_format(&vpfe->ccdc); in vpfe_attach_irq()
1268 vpfe_reg_write(&vpfe->ccdc, intr, VPFE_IRQ_EN_SET); in vpfe_attach_irq()
1666 ret = vpfe_ccdc_set_hw_if_params(&vpfe->ccdc, &sdinfo->vpfe_param); in vpfe_set_input()
1753 vpfe_ccdc_get_image_window(&vpfe->ccdc, &image_win); in vpfe_calculate_offsets()
1885 if (vpfe->ccdc.ccdc_cfg.if_type == VPFE_RAW_BAYER) in vpfe_start_streaming()
1886 vpfe_ccdc_config_raw(&vpfe->ccdc); in vpfe_start_streaming()
1888 vpfe_ccdc_config_ycbcr(&vpfe->ccdc); in vpfe_start_streaming()
1900 vpfe_set_sdr_addr(&vpfe->ccdc, (unsigned long)(addr)); in vpfe_start_streaming()
1902 vpfe_pcr_enable(&vpfe->ccdc, 1); in vpfe_start_streaming()
1914 vpfe_pcr_enable(&vpfe->ccdc, 0); in vpfe_start_streaming()
1931 vpfe_pcr_enable(&vpfe->ccdc, 0); in vpfe_stop_streaming()
2025 vpfe_ccdc_set_image_window(&vpfe->ccdc, &r, bpp); in vpfe_s_selection()
2029 vpfe_ccdc_get_line_length(&vpfe->ccdc); in vpfe_s_selection()
2058 ret = vpfe_ccdc_set_params(&vpfe->ccdc, (void __user *)param); in vpfe_ioctl_default()
2392 struct vpfe_ccdc *ccdc; in vpfe_probe() local
2415 ccdc = &vpfe->ccdc; in vpfe_probe()
2417 ccdc->ccdc_cfg.base_addr = devm_platform_ioremap_resource(pdev, 0); in vpfe_probe()
2418 if (IS_ERR(ccdc->ccdc_cfg.base_addr)) { in vpfe_probe()
2419 ret = PTR_ERR(ccdc->ccdc_cfg.base_addr); in vpfe_probe()
2448 vpfe_ccdc_config_defaults(ccdc); in vpfe_probe()
2494 static void vpfe_save_context(struct vpfe_ccdc *ccdc) in vpfe_save_context() argument
2496 ccdc->ccdc_ctx[VPFE_PCR >> 2] = vpfe_reg_read(ccdc, VPFE_PCR); in vpfe_save_context()
2497 ccdc->ccdc_ctx[VPFE_SYNMODE >> 2] = vpfe_reg_read(ccdc, VPFE_SYNMODE); in vpfe_save_context()
2498 ccdc->ccdc_ctx[VPFE_SDOFST >> 2] = vpfe_reg_read(ccdc, VPFE_SDOFST); in vpfe_save_context()
2499 ccdc->ccdc_ctx[VPFE_SDR_ADDR >> 2] = vpfe_reg_read(ccdc, VPFE_SDR_ADDR); in vpfe_save_context()
2500 ccdc->ccdc_ctx[VPFE_CLAMP >> 2] = vpfe_reg_read(ccdc, VPFE_CLAMP); in vpfe_save_context()
2501 ccdc->ccdc_ctx[VPFE_DCSUB >> 2] = vpfe_reg_read(ccdc, VPFE_DCSUB); in vpfe_save_context()
2502 ccdc->ccdc_ctx[VPFE_COLPTN >> 2] = vpfe_reg_read(ccdc, VPFE_COLPTN); in vpfe_save_context()
2503 ccdc->ccdc_ctx[VPFE_BLKCMP >> 2] = vpfe_reg_read(ccdc, VPFE_BLKCMP); in vpfe_save_context()
2504 ccdc->ccdc_ctx[VPFE_VDINT >> 2] = vpfe_reg_read(ccdc, VPFE_VDINT); in vpfe_save_context()
2505 ccdc->ccdc_ctx[VPFE_ALAW >> 2] = vpfe_reg_read(ccdc, VPFE_ALAW); in vpfe_save_context()
2506 ccdc->ccdc_ctx[VPFE_REC656IF >> 2] = vpfe_reg_read(ccdc, VPFE_REC656IF); in vpfe_save_context()
2507 ccdc->ccdc_ctx[VPFE_CCDCFG >> 2] = vpfe_reg_read(ccdc, VPFE_CCDCFG); in vpfe_save_context()
2508 ccdc->ccdc_ctx[VPFE_CULLING >> 2] = vpfe_reg_read(ccdc, VPFE_CULLING); in vpfe_save_context()
2509 ccdc->ccdc_ctx[VPFE_HD_VD_WID >> 2] = vpfe_reg_read(ccdc, in vpfe_save_context()
2511 ccdc->ccdc_ctx[VPFE_PIX_LINES >> 2] = vpfe_reg_read(ccdc, in vpfe_save_context()
2513 ccdc->ccdc_ctx[VPFE_HORZ_INFO >> 2] = vpfe_reg_read(ccdc, in vpfe_save_context()
2515 ccdc->ccdc_ctx[VPFE_VERT_START >> 2] = vpfe_reg_read(ccdc, in vpfe_save_context()
2517 ccdc->ccdc_ctx[VPFE_VERT_LINES >> 2] = vpfe_reg_read(ccdc, in vpfe_save_context()
2519 ccdc->ccdc_ctx[VPFE_HSIZE_OFF >> 2] = vpfe_reg_read(ccdc, in vpfe_save_context()
2526 struct vpfe_ccdc *ccdc = &vpfe->ccdc; in vpfe_suspend() local
2536 vpfe_config_enable(ccdc, 1); in vpfe_suspend()
2539 vpfe_save_context(ccdc); in vpfe_suspend()
2542 vpfe_pcr_enable(ccdc, 0); in vpfe_suspend()
2543 vpfe_config_enable(ccdc, 0); in vpfe_suspend()
2555 static void vpfe_restore_context(struct vpfe_ccdc *ccdc) in vpfe_restore_context() argument
2557 vpfe_reg_write(ccdc, ccdc->ccdc_ctx[VPFE_SYNMODE >> 2], VPFE_SYNMODE); in vpfe_restore_context()
2558 vpfe_reg_write(ccdc, ccdc->ccdc_ctx[VPFE_CULLING >> 2], VPFE_CULLING); in vpfe_restore_context()
2559 vpfe_reg_write(ccdc, ccdc->ccdc_ctx[VPFE_SDOFST >> 2], VPFE_SDOFST); in vpfe_restore_context()
2560 vpfe_reg_write(ccdc, ccdc->ccdc_ctx[VPFE_SDR_ADDR >> 2], VPFE_SDR_ADDR); in vpfe_restore_context()
2561 vpfe_reg_write(ccdc, ccdc->ccdc_ctx[VPFE_CLAMP >> 2], VPFE_CLAMP); in vpfe_restore_context()
2562 vpfe_reg_write(ccdc, ccdc->ccdc_ctx[VPFE_DCSUB >> 2], VPFE_DCSUB); in vpfe_restore_context()
2563 vpfe_reg_write(ccdc, ccdc->ccdc_ctx[VPFE_COLPTN >> 2], VPFE_COLPTN); in vpfe_restore_context()
2564 vpfe_reg_write(ccdc, ccdc->ccdc_ctx[VPFE_BLKCMP >> 2], VPFE_BLKCMP); in vpfe_restore_context()
2565 vpfe_reg_write(ccdc, ccdc->ccdc_ctx[VPFE_VDINT >> 2], VPFE_VDINT); in vpfe_restore_context()
2566 vpfe_reg_write(ccdc, ccdc->ccdc_ctx[VPFE_ALAW >> 2], VPFE_ALAW); in vpfe_restore_context()
2567 vpfe_reg_write(ccdc, ccdc->ccdc_ctx[VPFE_REC656IF >> 2], VPFE_REC656IF); in vpfe_restore_context()
2568 vpfe_reg_write(ccdc, ccdc->ccdc_ctx[VPFE_CCDCFG >> 2], VPFE_CCDCFG); in vpfe_restore_context()
2569 vpfe_reg_write(ccdc, ccdc->ccdc_ctx[VPFE_PCR >> 2], VPFE_PCR); in vpfe_restore_context()
2570 vpfe_reg_write(ccdc, ccdc->ccdc_ctx[VPFE_HD_VD_WID >> 2], in vpfe_restore_context()
2572 vpfe_reg_write(ccdc, ccdc->ccdc_ctx[VPFE_PIX_LINES >> 2], in vpfe_restore_context()
2574 vpfe_reg_write(ccdc, ccdc->ccdc_ctx[VPFE_HORZ_INFO >> 2], in vpfe_restore_context()
2576 vpfe_reg_write(ccdc, ccdc->ccdc_ctx[VPFE_VERT_START >> 2], in vpfe_restore_context()
2578 vpfe_reg_write(ccdc, ccdc->ccdc_ctx[VPFE_VERT_LINES >> 2], in vpfe_restore_context()
2580 vpfe_reg_write(ccdc, ccdc->ccdc_ctx[VPFE_HSIZE_OFF >> 2], in vpfe_restore_context()
2587 struct vpfe_ccdc *ccdc = &vpfe->ccdc; in vpfe_resume() local
2593 vpfe_config_enable(ccdc, 1); in vpfe_resume()
2596 vpfe_restore_context(ccdc); in vpfe_resume()
2598 vpfe_config_enable(ccdc, 0); in vpfe_resume()