Lines Matching full:isp

5  * TI OMAP3 ISP - CSI2 module
18 #include "isp.h"
27 static void csi2_if_enable(struct isp_device *isp, in csi2_if_enable() argument
32 isp_reg_clr_set(isp, csi2->regs1, ISPCSI2_CTRL, ISPCSI2_CTRL_IF_EN, in csi2_if_enable()
43 static void csi2_recv_config(struct isp_device *isp, in csi2_recv_config() argument
49 reg = isp_reg_readl(isp, csi2->regs1, ISPCSI2_CTRL); in csi2_recv_config()
74 isp_reg_writel(isp, reg, csi2->regs1, ISPCSI2_CTRL); in csi2_recv_config()
94 * - 2 isp revisions (certain format must be handled differently on OMAP3630)
161 * @csi2: ISP CSI2 device
202 is_3630 = csi2->isp->revision == ISP_REVISION_15_0; in csi2_ctx_map_format()
209 * @csi2: Pointer to ISP CSI2a device.
210 * @addr: ISP MMU Mapped 32-bit memory address aligned on 32 byte boundary.
219 struct isp_device *isp = csi2->isp; in csi2_set_outaddr() local
224 isp_reg_writel(isp, ctx->ping_addr, in csi2_set_outaddr()
226 isp_reg_writel(isp, ctx->pong_addr, in csi2_set_outaddr()
247 static void csi2_ctx_enable(struct isp_device *isp, in csi2_ctx_enable() argument
254 reg = isp_reg_readl(isp, csi2->regs1, ISPCSI2_CTX_CTRL1(ctxnum)); in csi2_ctx_enable()
270 isp_reg_writel(isp, reg, csi2->regs1, ISPCSI2_CTX_CTRL1(ctxnum)); in csi2_ctx_enable()
279 static void csi2_ctx_config(struct isp_device *isp, in csi2_ctx_config() argument
286 reg = isp_reg_readl(isp, csi2->regs1, ISPCSI2_CTX_CTRL1(ctx->ctxnum)); in csi2_ctx_config()
303 isp_reg_writel(isp, reg, csi2->regs1, ISPCSI2_CTX_CTRL1(ctx->ctxnum)); in csi2_ctx_config()
306 reg = isp_reg_readl(isp, csi2->regs1, ISPCSI2_CTX_CTRL2(ctx->ctxnum)); in csi2_ctx_config()
326 isp_reg_writel(isp, reg, csi2->regs1, ISPCSI2_CTX_CTRL2(ctx->ctxnum)); in csi2_ctx_config()
329 reg = isp_reg_readl(isp, csi2->regs1, ISPCSI2_CTX_CTRL3(ctx->ctxnum)); in csi2_ctx_config()
333 isp_reg_writel(isp, reg, csi2->regs1, ISPCSI2_CTX_CTRL3(ctx->ctxnum)); in csi2_ctx_config()
336 reg = isp_reg_readl(isp, csi2->regs1, in csi2_ctx_config()
340 isp_reg_writel(isp, reg, csi2->regs1, in csi2_ctx_config()
343 isp_reg_writel(isp, ctx->ping_addr, in csi2_ctx_config()
346 isp_reg_writel(isp, ctx->pong_addr, in csi2_ctx_config()
354 static void csi2_timing_config(struct isp_device *isp, in csi2_timing_config() argument
360 reg = isp_reg_readl(isp, csi2->regs1, ISPCSI2_TIMING); in csi2_timing_config()
381 isp_reg_writel(isp, reg, csi2->regs1, ISPCSI2_TIMING); in csi2_timing_config()
388 static void csi2_irq_ctx_set(struct isp_device *isp, in csi2_irq_ctx_set() argument
394 isp_reg_writel(isp, ISPCSI2_CTX_IRQSTATUS_FE_IRQ, csi2->regs1, in csi2_irq_ctx_set()
397 isp_reg_set(isp, csi2->regs1, ISPCSI2_CTX_IRQENABLE(i), in csi2_irq_ctx_set()
400 isp_reg_clr(isp, csi2->regs1, ISPCSI2_CTX_IRQENABLE(i), in csi2_irq_ctx_set()
409 static void csi2_irq_complexio1_set(struct isp_device *isp, in csi2_irq_complexio1_set() argument
440 isp_reg_writel(isp, reg, csi2->regs1, ISPCSI2_PHY_IRQSTATUS); in csi2_irq_complexio1_set()
442 reg |= isp_reg_readl(isp, csi2->regs1, ISPCSI2_PHY_IRQENABLE); in csi2_irq_complexio1_set()
445 isp_reg_writel(isp, reg, csi2->regs1, ISPCSI2_PHY_IRQENABLE); in csi2_irq_complexio1_set()
452 static void csi2_irq_status_set(struct isp_device *isp, in csi2_irq_status_set() argument
464 isp_reg_writel(isp, reg, csi2->regs1, ISPCSI2_IRQSTATUS); in csi2_irq_status_set()
466 reg |= isp_reg_readl(isp, csi2->regs1, ISPCSI2_IRQENABLE); in csi2_irq_status_set()
470 isp_reg_writel(isp, reg, csi2->regs1, ISPCSI2_IRQENABLE); in csi2_irq_status_set()
482 struct isp_device *isp = csi2->isp; in omap3isp_csi2_reset() local
493 isp_reg_set(isp, csi2->regs1, ISPCSI2_SYSCONFIG, in omap3isp_csi2_reset()
497 reg = isp_reg_readl(isp, csi2->regs1, ISPCSI2_SYSSTATUS) & in omap3isp_csi2_reset()
507 dev_err(isp->dev, "CSI2: Soft reset try count exceeded!\n"); in omap3isp_csi2_reset()
511 if (isp->revision == ISP_REVISION_15_0) in omap3isp_csi2_reset()
512 isp_reg_set(isp, csi2->regs1, ISPCSI2_PHY_CFG, in omap3isp_csi2_reset()
517 reg = isp_reg_readl(isp, csi2->phy->phy_regs, ISPCSIPHY_REG1) in omap3isp_csi2_reset()
525 dev_err(isp->dev, in omap3isp_csi2_reset()
530 if (isp->autoidle) in omap3isp_csi2_reset()
531 isp_reg_clr_set(isp, csi2->regs1, ISPCSI2_SYSCONFIG, in omap3isp_csi2_reset()
535 ((isp->revision == ISP_REVISION_15_0) ? in omap3isp_csi2_reset()
538 isp_reg_clr_set(isp, csi2->regs1, ISPCSI2_SYSCONFIG, in omap3isp_csi2_reset()
550 struct isp_device *isp = csi2->isp; in csi2_configure() local
576 dev_dbg(isp->dev, "%s: l3_ick %lu, external_rate %u, vp_out_ctrl %u\n", in csi2_configure()
616 csi2_irq_complexio1_set(isp, csi2, 1); in csi2_configure()
617 csi2_irq_ctx_set(isp, csi2, 1); in csi2_configure()
618 csi2_irq_status_set(isp, csi2, 1); in csi2_configure()
621 csi2_timing_config(isp, csi2, timing); in csi2_configure()
622 csi2_recv_config(isp, csi2, &csi2->ctrl); in csi2_configure()
623 csi2_ctx_config(isp, csi2, &csi2->contexts[0]); in csi2_configure()
631 #define CSI2_PRINT_REGISTER(isp, regs, name)\ argument
632 dev_dbg(isp->dev, "###CSI2 " #name "=0x%08x\n", \
633 isp_reg_readl(isp, regs, ISPCSI2_##name))
637 struct isp_device *isp = csi2->isp; in csi2_print_status() local
642 dev_dbg(isp->dev, "-------------CSI2 Register dump-------------\n"); in csi2_print_status()
644 CSI2_PRINT_REGISTER(isp, csi2->regs1, SYSCONFIG); in csi2_print_status()
645 CSI2_PRINT_REGISTER(isp, csi2->regs1, SYSSTATUS); in csi2_print_status()
646 CSI2_PRINT_REGISTER(isp, csi2->regs1, IRQENABLE); in csi2_print_status()
647 CSI2_PRINT_REGISTER(isp, csi2->regs1, IRQSTATUS); in csi2_print_status()
648 CSI2_PRINT_REGISTER(isp, csi2->regs1, CTRL); in csi2_print_status()
649 CSI2_PRINT_REGISTER(isp, csi2->regs1, DBG_H); in csi2_print_status()
650 CSI2_PRINT_REGISTER(isp, csi2->regs1, GNQ); in csi2_print_status()
651 CSI2_PRINT_REGISTER(isp, csi2->regs1, PHY_CFG); in csi2_print_status()
652 CSI2_PRINT_REGISTER(isp, csi2->regs1, PHY_IRQSTATUS); in csi2_print_status()
653 CSI2_PRINT_REGISTER(isp, csi2->regs1, SHORT_PACKET); in csi2_print_status()
654 CSI2_PRINT_REGISTER(isp, csi2->regs1, PHY_IRQENABLE); in csi2_print_status()
655 CSI2_PRINT_REGISTER(isp, csi2->regs1, DBG_P); in csi2_print_status()
656 CSI2_PRINT_REGISTER(isp, csi2->regs1, TIMING); in csi2_print_status()
657 CSI2_PRINT_REGISTER(isp, csi2->regs1, CTX_CTRL1(0)); in csi2_print_status()
658 CSI2_PRINT_REGISTER(isp, csi2->regs1, CTX_CTRL2(0)); in csi2_print_status()
659 CSI2_PRINT_REGISTER(isp, csi2->regs1, CTX_DAT_OFST(0)); in csi2_print_status()
660 CSI2_PRINT_REGISTER(isp, csi2->regs1, CTX_DAT_PING_ADDR(0)); in csi2_print_status()
661 CSI2_PRINT_REGISTER(isp, csi2->regs1, CTX_DAT_PONG_ADDR(0)); in csi2_print_status()
662 CSI2_PRINT_REGISTER(isp, csi2->regs1, CTX_IRQENABLE(0)); in csi2_print_status()
663 CSI2_PRINT_REGISTER(isp, csi2->regs1, CTX_IRQSTATUS(0)); in csi2_print_status()
664 CSI2_PRINT_REGISTER(isp, csi2->regs1, CTX_CTRL3(0)); in csi2_print_status()
666 dev_dbg(isp->dev, "--------------------------------------------\n"); in csi2_print_status()
679 struct isp_device *isp = csi2->isp; in csi2_isr_buffer() local
682 csi2_ctx_enable(isp, csi2, 0, 0); in csi2_isr_buffer()
694 csi2_ctx_enable(isp, csi2, 0, 1); in csi2_isr_buffer()
700 struct isp_device *isp = csi2->isp; in csi2_isr_ctx() local
704 status = isp_reg_readl(isp, csi2->regs1, ISPCSI2_CTX_IRQSTATUS(n)); in csi2_isr_ctx()
705 isp_reg_writel(isp, status, csi2->regs1, ISPCSI2_CTX_IRQSTATUS(n)); in csi2_isr_ctx()
724 csi2_ctx_config(isp, csi2, ctx); in csi2_isr_ctx()
725 csi2_ctx_enable(isp, csi2, n, 1); in csi2_isr_ctx()
741 struct isp_device *isp = csi2->isp; in omap3isp_csi2_isr() local
746 csi2_irqstatus = isp_reg_readl(isp, csi2->regs1, ISPCSI2_IRQSTATUS); in omap3isp_csi2_isr()
747 isp_reg_writel(isp, csi2_irqstatus, csi2->regs1, ISPCSI2_IRQSTATUS); in omap3isp_csi2_isr()
751 cpxio1_irqstatus = isp_reg_readl(isp, csi2->regs1, in omap3isp_csi2_isr()
753 isp_reg_writel(isp, cpxio1_irqstatus, in omap3isp_csi2_isr()
755 dev_dbg(isp->dev, "CSI2: ComplexIO Error IRQ %x\n", in omap3isp_csi2_isr()
765 dev_dbg(isp->dev, in omap3isp_csi2_isr()
788 dev_dbg(isp->dev, "CSI2: ECC correction done\n"); in omap3isp_csi2_isr()
792 * ISP video operations
802 struct isp_device *isp = video->isp; in csi2_queue() local
803 struct isp_csi2_device *csi2 = &isp->isp_csi2a; in csi2_queue()
815 csi2_if_enable(isp, csi2, 1); in csi2_queue()
816 csi2_ctx_enable(isp, csi2, 0, 1); in csi2_queue()
1024 * @sd: ISP CSI2 V4L2 subdevice
1048 * @sd: ISP CSI2 V4L2 subdevice
1049 * @enable: ISP pipeline stream state
1056 struct isp_device *isp = csi2->isp; in csi2_set_stream() local
1064 omap3isp_sbl_enable(isp, OMAP3_ISP_SBL_CSI2A_WRITE); in csi2_set_stream()
1079 csi2_ctx_enable(isp, csi2, 0, 1); in csi2_set_stream()
1080 csi2_if_enable(isp, csi2, 1); in csi2_set_stream()
1089 dev_dbg(isp->dev, "%s: module stop timeout.\n", in csi2_set_stream()
1091 csi2_ctx_enable(isp, csi2, 0, 0); in csi2_set_stream()
1092 csi2_if_enable(isp, csi2, 0); in csi2_set_stream()
1093 csi2_irq_ctx_set(isp, csi2, 0); in csi2_set_stream()
1096 omap3isp_sbl_disable(isp, OMAP3_ISP_SBL_CSI2A_WRITE); in csi2_set_stream()
1150 * The ISP core doesn't support pipelines with multiple video outputs. in csi2_link_setup()
1226 * ISP CSI2 initialisation and cleanup
1243 strscpy(sd->name, "OMAP3 ISP CSI2a", sizeof(sd->name)); in csi2_init_entities()
1245 sd->grp_id = 1 << 16; /* group ID for isp subdevs */ in csi2_init_entities()
1266 csi2->video_out.isp = csi2->isp; in csi2_init_entities()
1283 int omap3isp_csi2_init(struct isp_device *isp) in omap3isp_csi2_init() argument
1285 struct isp_csi2_device *csi2a = &isp->isp_csi2a; in omap3isp_csi2_init()
1286 struct isp_csi2_device *csi2c = &isp->isp_csi2c; in omap3isp_csi2_init()
1289 csi2a->isp = isp; in omap3isp_csi2_init()
1293 csi2a->phy = &isp->isp_csiphy2; in omap3isp_csi2_init()
1301 if (isp->revision == ISP_REVISION_15_0) { in omap3isp_csi2_init()
1302 csi2c->isp = isp; in omap3isp_csi2_init()
1306 csi2c->phy = &isp->isp_csiphy1; in omap3isp_csi2_init()
1317 void omap3isp_csi2_cleanup(struct isp_device *isp) in omap3isp_csi2_cleanup() argument
1319 struct isp_csi2_device *csi2a = &isp->isp_csi2a; in omap3isp_csi2_cleanup()