Lines Matching full:isp

3  * isp.c
5 * TI OMAP3 ISP - Core
68 #include "isp.h"
82 static void isp_save_ctx(struct isp_device *isp);
84 static void isp_restore_ctx(struct isp_device *isp);
129 /* Structure for saving/restoring ISP module registers */
139 * @isp: OMAP3 ISP device
147 void omap3isp_flush(struct isp_device *isp) in omap3isp_flush() argument
149 isp_reg_writel(isp, 0, OMAP3_ISP_IOMEM_MAIN, ISP_REVISION); in omap3isp_flush()
150 isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_REVISION); in omap3isp_flush()
163 isp_reg_clr_set(xclk->isp, OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_CTRL, in isp_xclk_update()
168 isp_reg_clr_set(xclk->isp, OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_CTRL, in isp_xclk_update()
179 omap3isp_get(xclk->isp); in isp_xclk_prepare()
188 omap3isp_put(xclk->isp); in isp_xclk_unprepare()
267 dev_dbg(xclk->isp->dev, "%s: cam_xclk%c set to %lu Hz (div %u)\n", in isp_xclk_set_rate()
287 struct isp_device *isp = data; in isp_xclk_src_get() local
289 if (idx >= ARRAY_SIZE(isp->xclks)) in isp_xclk_src_get()
292 return isp->xclks[idx].clk; in isp_xclk_src_get()
295 static int isp_xclk_init(struct isp_device *isp) in isp_xclk_init() argument
297 struct device_node *np = isp->dev->of_node; in isp_xclk_init()
301 for (i = 0; i < ARRAY_SIZE(isp->xclks); ++i) in isp_xclk_init()
302 isp->xclks[i].clk = ERR_PTR(-EINVAL); in isp_xclk_init()
304 for (i = 0; i < ARRAY_SIZE(isp->xclks); ++i) { in isp_xclk_init()
305 struct isp_xclk *xclk = &isp->xclks[i]; in isp_xclk_init()
307 xclk->isp = isp; in isp_xclk_init()
330 of_clk_add_provider(np, isp_xclk_src_get, isp); in isp_xclk_init()
335 static void isp_xclk_cleanup(struct isp_device *isp) in isp_xclk_cleanup() argument
337 struct device_node *np = isp->dev->of_node; in isp_xclk_cleanup()
343 for (i = 0; i < ARRAY_SIZE(isp->xclks); ++i) { in isp_xclk_cleanup()
344 struct isp_xclk *xclk = &isp->xclks[i]; in isp_xclk_cleanup()
356 * isp_enable_interrupts - Enable ISP interrupts.
357 * @isp: OMAP3 ISP device
359 static void isp_enable_interrupts(struct isp_device *isp) in isp_enable_interrupts() argument
374 isp_reg_writel(isp, irq, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS); in isp_enable_interrupts()
375 isp_reg_writel(isp, irq, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE); in isp_enable_interrupts()
379 * isp_disable_interrupts - Disable ISP interrupts.
380 * @isp: OMAP3 ISP device
382 static void isp_disable_interrupts(struct isp_device *isp) in isp_disable_interrupts() argument
384 isp_reg_writel(isp, 0, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE); in isp_disable_interrupts()
388 * isp_core_init - ISP core settings
389 * @isp: OMAP3 ISP device
392 * Set the power settings for the ISP and SBL bus and configure the HS/VS
396 * enabled, as the sensor might be free-running and the ISP default setting
399 static void isp_core_init(struct isp_device *isp, int idle) in isp_core_init() argument
401 isp_reg_writel(isp, in isp_core_init()
405 ((isp->revision == ISP_REVISION_15_0) ? in isp_core_init()
409 isp_reg_writel(isp, in isp_core_init()
410 (isp->autoidle ? ISPCTRL_SBL_AUTOIDLE : 0) | in isp_core_init()
424 * and the ISP platform data.
426 void omap3isp_configure_bridge(struct isp_device *isp, in omap3isp_configure_bridge() argument
433 ispctrl_val = isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL); in omap3isp_configure_bridge()
465 isp_reg_writel(isp, ispctrl_val, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL); in omap3isp_configure_bridge()
468 void omap3isp_hist_dma_done(struct isp_device *isp) in omap3isp_hist_dma_done() argument
470 if (omap3isp_ccdc_busy(&isp->isp_ccdc) || in omap3isp_hist_dma_done()
471 omap3isp_stat_pcr_busy(&isp->isp_hist)) { in omap3isp_hist_dma_done()
473 atomic_set(&isp->isp_hist.buf_err, 1); in omap3isp_hist_dma_done()
474 dev_dbg(isp->dev, in omap3isp_hist_dma_done()
479 static inline void __maybe_unused isp_isr_dbg(struct isp_device *isp, in isp_isr_dbg() argument
518 dev_dbg(isp->dev, "ISP IRQ: "); in isp_isr_dbg()
527 static void isp_isr_sbl(struct isp_device *isp) in isp_isr_sbl() argument
529 struct device *dev = isp->dev; in isp_isr_sbl()
537 sbl_pcr = isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_PCR); in isp_isr_sbl()
538 isp_reg_writel(isp, sbl_pcr, OMAP3_ISP_IOMEM_SBL, ISPSBL_PCR); in isp_isr_sbl()
545 pipe = to_isp_pipeline(&isp->isp_ccp2.subdev.entity); in isp_isr_sbl()
551 pipe = to_isp_pipeline(&isp->isp_csi2a.subdev.entity); in isp_isr_sbl()
557 pipe = to_isp_pipeline(&isp->isp_ccdc.subdev.entity); in isp_isr_sbl()
563 pipe = to_isp_pipeline(&isp->isp_prev.subdev.entity); in isp_isr_sbl()
572 pipe = to_isp_pipeline(&isp->isp_res.subdev.entity); in isp_isr_sbl()
578 omap3isp_stat_sbl_overflow(&isp->isp_af); in isp_isr_sbl()
581 omap3isp_stat_sbl_overflow(&isp->isp_aewb); in isp_isr_sbl()
585 * isp_isr - Interrupt Service Routine for Camera ISP module.
587 * @_isp: Pointer to the OMAP3 ISP device
598 struct isp_device *isp = _isp; in isp_isr() local
601 irqstatus = isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS); in isp_isr()
602 isp_reg_writel(isp, irqstatus, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS); in isp_isr()
604 isp_isr_sbl(isp); in isp_isr()
607 omap3isp_csi2_isr(&isp->isp_csi2a); in isp_isr()
610 omap3isp_ccp2_isr(&isp->isp_ccp2); in isp_isr()
613 if (isp->isp_ccdc.output & CCDC_OUTPUT_PREVIEW) in isp_isr()
614 omap3isp_preview_isr_frame_sync(&isp->isp_prev); in isp_isr()
615 if (isp->isp_ccdc.output & CCDC_OUTPUT_RESIZER) in isp_isr()
616 omap3isp_resizer_isr_frame_sync(&isp->isp_res); in isp_isr()
617 omap3isp_stat_isr_frame_sync(&isp->isp_aewb); in isp_isr()
618 omap3isp_stat_isr_frame_sync(&isp->isp_af); in isp_isr()
619 omap3isp_stat_isr_frame_sync(&isp->isp_hist); in isp_isr()
623 omap3isp_ccdc_isr(&isp->isp_ccdc, irqstatus & ccdc_events); in isp_isr()
626 if (isp->isp_prev.output & PREVIEW_OUTPUT_RESIZER) in isp_isr()
627 omap3isp_resizer_isr_frame_sync(&isp->isp_res); in isp_isr()
628 omap3isp_preview_isr(&isp->isp_prev); in isp_isr()
632 omap3isp_resizer_isr(&isp->isp_res); in isp_isr()
635 omap3isp_stat_isr(&isp->isp_aewb); in isp_isr()
638 omap3isp_stat_isr(&isp->isp_af); in isp_isr()
641 omap3isp_stat_isr(&isp->isp_hist); in isp_isr()
643 omap3isp_flush(isp); in isp_isr()
646 isp_isr_dbg(isp, irqstatus); in isp_isr()
662 * @pipe: ISP pipeline
674 struct isp_device *isp = pipe->output->isp; in isp_pipeline_enable() local
686 if (media_entity_enum_intersects(&pipe->ent_enum, &isp->crashed)) in isp_pipeline_enable()
695 mutex_lock(&isp->media_dev.graph_mutex); in isp_pipeline_enable()
712 mutex_unlock(&isp->media_dev.graph_mutex); in isp_pipeline_enable()
716 if (subdev == &isp->isp_ccdc.subdev) { in isp_pipeline_enable()
717 v4l2_subdev_call(&isp->isp_aewb.subdev, video, in isp_pipeline_enable()
719 v4l2_subdev_call(&isp->isp_af.subdev, video, in isp_pipeline_enable()
721 v4l2_subdev_call(&isp->isp_hist.subdev, video, in isp_pipeline_enable()
727 if (subdev->dev != isp->dev) in isp_pipeline_enable()
731 mutex_unlock(&isp->media_dev.graph_mutex); in isp_pipeline_enable()
736 static int isp_pipeline_wait_resizer(struct isp_device *isp) in isp_pipeline_wait_resizer() argument
738 return omap3isp_resizer_busy(&isp->isp_res); in isp_pipeline_wait_resizer()
741 static int isp_pipeline_wait_preview(struct isp_device *isp) in isp_pipeline_wait_preview() argument
743 return omap3isp_preview_busy(&isp->isp_prev); in isp_pipeline_wait_preview()
746 static int isp_pipeline_wait_ccdc(struct isp_device *isp) in isp_pipeline_wait_ccdc() argument
748 return omap3isp_stat_busy(&isp->isp_af) in isp_pipeline_wait_ccdc()
749 || omap3isp_stat_busy(&isp->isp_aewb) in isp_pipeline_wait_ccdc()
750 || omap3isp_stat_busy(&isp->isp_hist) in isp_pipeline_wait_ccdc()
751 || omap3isp_ccdc_busy(&isp->isp_ccdc); in isp_pipeline_wait_ccdc()
756 static int isp_pipeline_wait(struct isp_device *isp, in isp_pipeline_wait() argument
757 int(*busy)(struct isp_device *isp)) in isp_pipeline_wait() argument
762 if (!busy(isp)) in isp_pipeline_wait()
771 * @pipe: ISP pipeline
778 * can't be stopped (in which case a software reset of the ISP is probably
783 struct isp_device *isp = pipe->output->isp; in isp_pipeline_disable() local
807 if (subdev == &isp->isp_ccdc.subdev) { in isp_pipeline_disable()
808 v4l2_subdev_call(&isp->isp_aewb.subdev, in isp_pipeline_disable()
810 v4l2_subdev_call(&isp->isp_af.subdev, in isp_pipeline_disable()
812 v4l2_subdev_call(&isp->isp_hist.subdev, in isp_pipeline_disable()
819 if (subdev->dev != isp->dev) in isp_pipeline_disable()
822 if (subdev == &isp->isp_res.subdev) in isp_pipeline_disable()
823 ret |= isp_pipeline_wait(isp, isp_pipeline_wait_resizer); in isp_pipeline_disable()
824 else if (subdev == &isp->isp_prev.subdev) in isp_pipeline_disable()
825 ret |= isp_pipeline_wait(isp, isp_pipeline_wait_preview); in isp_pipeline_disable()
826 else if (subdev == &isp->isp_ccdc.subdev) in isp_pipeline_disable()
827 ret |= isp_pipeline_wait(isp, isp_pipeline_wait_ccdc); in isp_pipeline_disable()
831 * to trigger an ISP reset the next time the device is released, in isp_pipeline_disable()
842 dev_info(isp->dev, "Unable to stop %s\n", subdev->name); in isp_pipeline_disable()
843 isp->stop_failure = true; in isp_pipeline_disable()
844 if (subdev == &isp->isp_prev.subdev) in isp_pipeline_disable()
845 media_entity_enum_set(&isp->crashed, in isp_pipeline_disable()
856 * @pipe: ISP pipeline
884 * @pipe: ISP pipeline
901 * @pipe: ISP pipeline
917 * @pipe: ISP pipeline
929 * @me: ISP module's media entity
949 * @me: ISP module's media entity
963 * @me: ISP module's media entity
976 * isp_suspend_modules - Suspend ISP submodules.
977 * @isp: OMAP3 ISP device
982 static int __maybe_unused isp_suspend_modules(struct isp_device *isp) in isp_suspend_modules() argument
986 omap3isp_stat_suspend(&isp->isp_aewb); in isp_suspend_modules()
987 omap3isp_stat_suspend(&isp->isp_af); in isp_suspend_modules()
988 omap3isp_stat_suspend(&isp->isp_hist); in isp_suspend_modules()
989 isp_suspend_module_pipeline(&isp->isp_res.subdev.entity); in isp_suspend_modules()
990 isp_suspend_module_pipeline(&isp->isp_prev.subdev.entity); in isp_suspend_modules()
991 isp_suspend_module_pipeline(&isp->isp_ccdc.subdev.entity); in isp_suspend_modules()
992 isp_suspend_module_pipeline(&isp->isp_csi2a.subdev.entity); in isp_suspend_modules()
993 isp_suspend_module_pipeline(&isp->isp_ccp2.subdev.entity); in isp_suspend_modules()
996 while (omap3isp_stat_busy(&isp->isp_af) in isp_suspend_modules()
997 || omap3isp_stat_busy(&isp->isp_aewb) in isp_suspend_modules()
998 || omap3isp_stat_busy(&isp->isp_hist) in isp_suspend_modules()
999 || omap3isp_preview_busy(&isp->isp_prev) in isp_suspend_modules()
1000 || omap3isp_resizer_busy(&isp->isp_res) in isp_suspend_modules()
1001 || omap3isp_ccdc_busy(&isp->isp_ccdc)) { in isp_suspend_modules()
1003 dev_info(isp->dev, "can't stop modules.\n"); in isp_suspend_modules()
1013 * isp_resume_modules - Resume ISP submodules.
1014 * @isp: OMAP3 ISP device
1016 static void __maybe_unused isp_resume_modules(struct isp_device *isp) in isp_resume_modules() argument
1018 omap3isp_stat_resume(&isp->isp_aewb); in isp_resume_modules()
1019 omap3isp_stat_resume(&isp->isp_af); in isp_resume_modules()
1020 omap3isp_stat_resume(&isp->isp_hist); in isp_resume_modules()
1021 isp_resume_module_pipeline(&isp->isp_res.subdev.entity); in isp_resume_modules()
1022 isp_resume_module_pipeline(&isp->isp_prev.subdev.entity); in isp_resume_modules()
1023 isp_resume_module_pipeline(&isp->isp_ccdc.subdev.entity); in isp_resume_modules()
1024 isp_resume_module_pipeline(&isp->isp_csi2a.subdev.entity); in isp_resume_modules()
1025 isp_resume_module_pipeline(&isp->isp_ccp2.subdev.entity); in isp_resume_modules()
1029 * isp_reset - Reset ISP with a timeout wait for idle.
1030 * @isp: OMAP3 ISP device
1032 static int isp_reset(struct isp_device *isp) in isp_reset() argument
1036 isp_reg_writel(isp, in isp_reset()
1037 isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_SYSCONFIG) in isp_reset()
1040 while (!(isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, in isp_reset()
1043 dev_alert(isp->dev, "cannot reset ISP\n"); in isp_reset()
1049 isp->stop_failure = false; in isp_reset()
1050 media_entity_enum_zero(&isp->crashed); in isp_reset()
1055 * isp_save_context - Saves the values of the ISP module registers.
1056 * @isp: OMAP3 ISP device
1061 isp_save_context(struct isp_device *isp, struct isp_reg *reg_list) in isp_save_context() argument
1066 next->val = isp_reg_readl(isp, next->mmio_range, next->reg); in isp_save_context()
1070 * isp_restore_context - Restores the values of the ISP module registers.
1071 * @isp: OMAP3 ISP device
1076 isp_restore_context(struct isp_device *isp, struct isp_reg *reg_list) in isp_restore_context() argument
1081 isp_reg_writel(isp, next->val, next->mmio_range, next->reg); in isp_restore_context()
1085 * isp_save_ctx - Saves ISP, CCDC, HIST, H3A, PREV, RESZ & MMU context.
1086 * @isp: OMAP3 ISP device
1088 * Routine for saving the context of each module in the ISP.
1091 static void isp_save_ctx(struct isp_device *isp) in isp_save_ctx() argument
1093 isp_save_context(isp, isp_reg_list); in isp_save_ctx()
1094 omap_iommu_save_ctx(isp->dev); in isp_save_ctx()
1098 * isp_restore_ctx - Restores ISP, CCDC, HIST, H3A, PREV, RESZ & MMU context.
1099 * @isp: OMAP3 ISP device
1101 * Routine for restoring the context of each module in the ISP.
1104 static void isp_restore_ctx(struct isp_device *isp) in isp_restore_ctx() argument
1106 isp_restore_context(isp, isp_reg_list); in isp_restore_ctx()
1107 omap_iommu_restore_ctx(isp->dev); in isp_restore_ctx()
1108 omap3isp_ccdc_restore_context(isp); in isp_restore_ctx()
1109 omap3isp_preview_restore_context(isp); in isp_restore_ctx()
1125 void omap3isp_sbl_enable(struct isp_device *isp, enum isp_sbl_resource res) in omap3isp_sbl_enable() argument
1129 isp->sbl_resources |= res; in omap3isp_sbl_enable()
1131 if (isp->sbl_resources & OMAP3_ISP_SBL_CSI1_READ) in omap3isp_sbl_enable()
1134 if (isp->sbl_resources & OMAP3_ISP_SBL_CCDC_LSC_READ) in omap3isp_sbl_enable()
1137 if (isp->sbl_resources & OMAP3_ISP_SBL_CSI2C_WRITE) in omap3isp_sbl_enable()
1140 if (isp->sbl_resources & OMAP3_ISP_SBL_RESIZER_WRITE) in omap3isp_sbl_enable()
1143 if (isp->sbl_resources & OMAP3_ISP_SBL_WRITE) in omap3isp_sbl_enable()
1146 if (isp->sbl_resources & OMAP3_ISP_SBL_READ) in omap3isp_sbl_enable()
1149 isp_reg_set(isp, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL, sbl); in omap3isp_sbl_enable()
1152 void omap3isp_sbl_disable(struct isp_device *isp, enum isp_sbl_resource res) in omap3isp_sbl_disable() argument
1156 isp->sbl_resources &= ~res; in omap3isp_sbl_disable()
1158 if (!(isp->sbl_resources & OMAP3_ISP_SBL_CSI1_READ)) in omap3isp_sbl_disable()
1161 if (!(isp->sbl_resources & OMAP3_ISP_SBL_CCDC_LSC_READ)) in omap3isp_sbl_disable()
1164 if (!(isp->sbl_resources & OMAP3_ISP_SBL_CSI2C_WRITE)) in omap3isp_sbl_disable()
1167 if (!(isp->sbl_resources & OMAP3_ISP_SBL_RESIZER_WRITE)) in omap3isp_sbl_disable()
1170 if (!(isp->sbl_resources & OMAP3_ISP_SBL_WRITE)) in omap3isp_sbl_disable()
1173 if (!(isp->sbl_resources & OMAP3_ISP_SBL_READ)) in omap3isp_sbl_disable()
1176 isp_reg_clr(isp, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL, sbl); in omap3isp_sbl_disable()
1181 * @me: ISP submodule's media entity
1182 * @wait: ISP submodule's wait queue for streamoff/interrupt synchronization
1185 * This function checks if ISP submodule needs to wait for next interrupt. If
1238 * @wait: ISP submodule's wait queue for streamoff/interrupt synchronization
1241 * This function checks if ISP submodule was stopping. In case of yes, it
1266 static void __isp_subclk_update(struct isp_device *isp) in __isp_subclk_update() argument
1271 if (isp->subclk_resources & in __isp_subclk_update()
1275 if (isp->subclk_resources & OMAP3_ISP_SUBCLK_HIST) in __isp_subclk_update()
1278 if (isp->subclk_resources & OMAP3_ISP_SUBCLK_RESIZER) in __isp_subclk_update()
1284 if (isp->subclk_resources & OMAP3_ISP_SUBCLK_CCDC) in __isp_subclk_update()
1287 if (isp->subclk_resources & OMAP3_ISP_SUBCLK_PREVIEW) in __isp_subclk_update()
1290 isp_reg_clr_set(isp, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL, in __isp_subclk_update()
1294 void omap3isp_subclk_enable(struct isp_device *isp, in omap3isp_subclk_enable() argument
1297 isp->subclk_resources |= res; in omap3isp_subclk_enable()
1299 __isp_subclk_update(isp); in omap3isp_subclk_enable()
1302 void omap3isp_subclk_disable(struct isp_device *isp, in omap3isp_subclk_disable() argument
1305 isp->subclk_resources &= ~res; in omap3isp_subclk_disable()
1307 __isp_subclk_update(isp); in omap3isp_subclk_disable()
1311 * isp_enable_clocks - Enable ISP clocks
1312 * @isp: OMAP3 ISP device
1317 static int isp_enable_clocks(struct isp_device *isp) in isp_enable_clocks() argument
1322 r = clk_prepare_enable(isp->clock[ISP_CLK_CAM_ICK]); in isp_enable_clocks()
1324 dev_err(isp->dev, "failed to enable cam_ick clock\n"); in isp_enable_clocks()
1327 r = clk_set_rate(isp->clock[ISP_CLK_CAM_MCLK], CM_CAM_MCLK_HZ); in isp_enable_clocks()
1329 dev_err(isp->dev, "clk_set_rate for cam_mclk failed\n"); in isp_enable_clocks()
1332 r = clk_prepare_enable(isp->clock[ISP_CLK_CAM_MCLK]); in isp_enable_clocks()
1334 dev_err(isp->dev, "failed to enable cam_mclk clock\n"); in isp_enable_clocks()
1337 rate = clk_get_rate(isp->clock[ISP_CLK_CAM_MCLK]); in isp_enable_clocks()
1339 dev_warn(isp->dev, "unexpected cam_mclk rate:\n" in isp_enable_clocks()
1342 r = clk_prepare_enable(isp->clock[ISP_CLK_CSI2_FCK]); in isp_enable_clocks()
1344 dev_err(isp->dev, "failed to enable csi2_fck clock\n"); in isp_enable_clocks()
1350 clk_disable_unprepare(isp->clock[ISP_CLK_CAM_MCLK]); in isp_enable_clocks()
1352 clk_disable_unprepare(isp->clock[ISP_CLK_CAM_ICK]); in isp_enable_clocks()
1358 * isp_disable_clocks - Disable ISP clocks
1359 * @isp: OMAP3 ISP device
1361 static void isp_disable_clocks(struct isp_device *isp) in isp_disable_clocks() argument
1363 clk_disable_unprepare(isp->clock[ISP_CLK_CAM_ICK]); in isp_disable_clocks()
1364 clk_disable_unprepare(isp->clock[ISP_CLK_CAM_MCLK]); in isp_disable_clocks()
1365 clk_disable_unprepare(isp->clock[ISP_CLK_CSI2_FCK]); in isp_disable_clocks()
1375 static int isp_get_clocks(struct isp_device *isp) in isp_get_clocks() argument
1381 clk = devm_clk_get(isp->dev, isp_clocks[i]); in isp_get_clocks()
1383 dev_err(isp->dev, "clk_get %s failed\n", isp_clocks[i]); in isp_get_clocks()
1387 isp->clock[i] = clk; in isp_get_clocks()
1394 * omap3isp_get - Acquire the ISP resource.
1398 * Increment the reference count on the ISP. If the first reference is taken,
1401 * Return a pointer to the ISP device structure, or NULL if an error occurred.
1403 static struct isp_device *__omap3isp_get(struct isp_device *isp, bool irq) in __omap3isp_get() argument
1405 struct isp_device *__isp = isp; in __omap3isp_get()
1407 if (isp == NULL) in __omap3isp_get()
1410 mutex_lock(&isp->isp_mutex); in __omap3isp_get()
1411 if (isp->ref_count > 0) in __omap3isp_get()
1414 if (isp_enable_clocks(isp) < 0) { in __omap3isp_get()
1420 if (isp->has_context) in __omap3isp_get()
1421 isp_restore_ctx(isp); in __omap3isp_get()
1424 isp_enable_interrupts(isp); in __omap3isp_get()
1428 isp->ref_count++; in __omap3isp_get()
1429 mutex_unlock(&isp->isp_mutex); in __omap3isp_get()
1434 struct isp_device *omap3isp_get(struct isp_device *isp) in omap3isp_get() argument
1436 return __omap3isp_get(isp, true); in omap3isp_get()
1440 * omap3isp_put - Release the ISP
1442 * Decrement the reference count on the ISP. If the last reference is released,
1445 static void __omap3isp_put(struct isp_device *isp, bool save_ctx) in __omap3isp_put() argument
1447 if (isp == NULL) in __omap3isp_put()
1450 mutex_lock(&isp->isp_mutex); in __omap3isp_put()
1451 BUG_ON(isp->ref_count == 0); in __omap3isp_put()
1452 if (--isp->ref_count == 0) { in __omap3isp_put()
1453 isp_disable_interrupts(isp); in __omap3isp_put()
1455 isp_save_ctx(isp); in __omap3isp_put()
1456 isp->has_context = 1; in __omap3isp_put()
1458 /* Reset the ISP if an entity has failed to stop. This is the in __omap3isp_put()
1461 if (!media_entity_enum_empty(&isp->crashed) || in __omap3isp_put()
1462 isp->stop_failure) in __omap3isp_put()
1463 isp_reset(isp); in __omap3isp_put()
1464 isp_disable_clocks(isp); in __omap3isp_put()
1466 mutex_unlock(&isp->isp_mutex); in __omap3isp_put()
1469 void omap3isp_put(struct isp_device *isp) in omap3isp_put() argument
1471 __omap3isp_put(isp, true); in omap3isp_put()
1479 * omap3isp_print_status - Prints the values of the ISP Control Module registers
1480 * @isp: OMAP3 ISP device
1482 #define ISP_PRINT_REGISTER(isp, name)\ argument
1483 dev_dbg(isp->dev, "###ISP " #name "=0x%08x\n", \
1484 isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_##name))
1485 #define SBL_PRINT_REGISTER(isp, name)\ argument
1486 dev_dbg(isp->dev, "###SBL " #name "=0x%08x\n", \
1487 isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_##name))
1489 void omap3isp_print_status(struct isp_device *isp) in omap3isp_print_status() argument
1491 dev_dbg(isp->dev, "-------------ISP Register dump--------------\n"); in omap3isp_print_status()
1493 ISP_PRINT_REGISTER(isp, SYSCONFIG); in omap3isp_print_status()
1494 ISP_PRINT_REGISTER(isp, SYSSTATUS); in omap3isp_print_status()
1495 ISP_PRINT_REGISTER(isp, IRQ0ENABLE); in omap3isp_print_status()
1496 ISP_PRINT_REGISTER(isp, IRQ0STATUS); in omap3isp_print_status()
1497 ISP_PRINT_REGISTER(isp, TCTRL_GRESET_LENGTH); in omap3isp_print_status()
1498 ISP_PRINT_REGISTER(isp, TCTRL_PSTRB_REPLAY); in omap3isp_print_status()
1499 ISP_PRINT_REGISTER(isp, CTRL); in omap3isp_print_status()
1500 ISP_PRINT_REGISTER(isp, TCTRL_CTRL); in omap3isp_print_status()
1501 ISP_PRINT_REGISTER(isp, TCTRL_FRAME); in omap3isp_print_status()
1502 ISP_PRINT_REGISTER(isp, TCTRL_PSTRB_DELAY); in omap3isp_print_status()
1503 ISP_PRINT_REGISTER(isp, TCTRL_STRB_DELAY); in omap3isp_print_status()
1504 ISP_PRINT_REGISTER(isp, TCTRL_SHUT_DELAY); in omap3isp_print_status()
1505 ISP_PRINT_REGISTER(isp, TCTRL_PSTRB_LENGTH); in omap3isp_print_status()
1506 ISP_PRINT_REGISTER(isp, TCTRL_STRB_LENGTH); in omap3isp_print_status()
1507 ISP_PRINT_REGISTER(isp, TCTRL_SHUT_LENGTH); in omap3isp_print_status()
1509 SBL_PRINT_REGISTER(isp, PCR); in omap3isp_print_status()
1510 SBL_PRINT_REGISTER(isp, SDR_REQ_EXP); in omap3isp_print_status()
1512 dev_dbg(isp->dev, "--------------------------------------------\n"); in omap3isp_print_status()
1520 * As the ISP can't properly handle an input video stream interruption on a non
1521 * frame boundary, the ISP pipelines need to be stopped before sensors get
1523 * which can be provided by the ISP, the ISP can't be completely suspended
1528 * ISP clocks get disabled in suspend(). Similarly, the clocks are re-enabled in
1531 * TODO: PM dependencies between the ISP and sensors are not modelled explicitly
1536 struct isp_device *isp = dev_get_drvdata(dev); in isp_pm_prepare() local
1539 WARN_ON(mutex_is_locked(&isp->isp_mutex)); in isp_pm_prepare()
1541 if (isp->ref_count == 0) in isp_pm_prepare()
1544 reset = isp_suspend_modules(isp); in isp_pm_prepare()
1545 isp_disable_interrupts(isp); in isp_pm_prepare()
1546 isp_save_ctx(isp); in isp_pm_prepare()
1548 isp_reset(isp); in isp_pm_prepare()
1555 struct isp_device *isp = dev_get_drvdata(dev); in isp_pm_suspend() local
1557 WARN_ON(mutex_is_locked(&isp->isp_mutex)); in isp_pm_suspend()
1559 if (isp->ref_count) in isp_pm_suspend()
1560 isp_disable_clocks(isp); in isp_pm_suspend()
1567 struct isp_device *isp = dev_get_drvdata(dev); in isp_pm_resume() local
1569 if (isp->ref_count == 0) in isp_pm_resume()
1572 return isp_enable_clocks(isp); in isp_pm_resume()
1577 struct isp_device *isp = dev_get_drvdata(dev); in isp_pm_complete() local
1579 if (isp->ref_count == 0) in isp_pm_complete()
1582 isp_restore_ctx(isp); in isp_pm_complete()
1583 isp_enable_interrupts(isp); in isp_pm_complete()
1584 isp_resume_modules(isp); in isp_pm_complete()
1596 static void isp_unregister_entities(struct isp_device *isp) in isp_unregister_entities() argument
1598 media_device_unregister(&isp->media_dev); in isp_unregister_entities()
1600 omap3isp_csi2_unregister_entities(&isp->isp_csi2a); in isp_unregister_entities()
1601 omap3isp_ccp2_unregister_entities(&isp->isp_ccp2); in isp_unregister_entities()
1602 omap3isp_ccdc_unregister_entities(&isp->isp_ccdc); in isp_unregister_entities()
1603 omap3isp_preview_unregister_entities(&isp->isp_prev); in isp_unregister_entities()
1604 omap3isp_resizer_unregister_entities(&isp->isp_res); in isp_unregister_entities()
1605 omap3isp_stat_unregister_entities(&isp->isp_aewb); in isp_unregister_entities()
1606 omap3isp_stat_unregister_entities(&isp->isp_af); in isp_unregister_entities()
1607 omap3isp_stat_unregister_entities(&isp->isp_hist); in isp_unregister_entities()
1609 v4l2_device_unregister(&isp->v4l2_dev); in isp_unregister_entities()
1610 media_device_cleanup(&isp->media_dev); in isp_unregister_entities()
1614 struct isp_device *isp, struct media_entity *entity, in isp_link_entity() argument
1629 input = &isp->isp_ccdc.subdev.entity; in isp_link_entity()
1635 input = &isp->isp_csi2a.subdev.entity; in isp_link_entity()
1642 input = &isp->isp_ccp2.subdev.entity; in isp_link_entity()
1648 input = &isp->isp_csi2c.subdev.entity; in isp_link_entity()
1654 dev_err(isp->dev, "%s: invalid interface type %u\n", __func__, in isp_link_entity()
1661 * ISP. The sub-devices of those interfaces aren't initialised in isp_link_entity()
1666 dev_err(isp->dev, "%s: invalid input %u\n", entity->name, in isp_link_entity()
1676 dev_err(isp->dev, "%s: no source pad in external entity %s\n", in isp_link_entity()
1684 static int isp_register_entities(struct isp_device *isp) in isp_register_entities() argument
1688 isp->media_dev.dev = isp->dev; in isp_register_entities()
1689 strscpy(isp->media_dev.model, "TI OMAP3 ISP", in isp_register_entities()
1690 sizeof(isp->media_dev.model)); in isp_register_entities()
1691 isp->media_dev.hw_revision = isp->revision; in isp_register_entities()
1692 isp->media_dev.ops = &isp_media_ops; in isp_register_entities()
1693 media_device_init(&isp->media_dev); in isp_register_entities()
1695 isp->v4l2_dev.mdev = &isp->media_dev; in isp_register_entities()
1696 ret = v4l2_device_register(isp->dev, &isp->v4l2_dev); in isp_register_entities()
1698 dev_err(isp->dev, "%s: V4L2 device registration failed (%d)\n", in isp_register_entities()
1704 ret = omap3isp_ccp2_register_entities(&isp->isp_ccp2, &isp->v4l2_dev); in isp_register_entities()
1708 ret = omap3isp_csi2_register_entities(&isp->isp_csi2a, &isp->v4l2_dev); in isp_register_entities()
1712 ret = omap3isp_ccdc_register_entities(&isp->isp_ccdc, &isp->v4l2_dev); in isp_register_entities()
1716 ret = omap3isp_preview_register_entities(&isp->isp_prev, in isp_register_entities()
1717 &isp->v4l2_dev); in isp_register_entities()
1721 ret = omap3isp_resizer_register_entities(&isp->isp_res, &isp->v4l2_dev); in isp_register_entities()
1725 ret = omap3isp_stat_register_entities(&isp->isp_aewb, &isp->v4l2_dev); in isp_register_entities()
1729 ret = omap3isp_stat_register_entities(&isp->isp_af, &isp->v4l2_dev); in isp_register_entities()
1733 ret = omap3isp_stat_register_entities(&isp->isp_hist, &isp->v4l2_dev); in isp_register_entities()
1739 isp_unregister_entities(isp); in isp_register_entities()
1745 * isp_create_links() - Create links for internal and external ISP entities
1746 * @isp : Pointer to ISP device
1748 * This function creates all links between ISP internal and external entities.
1753 static int isp_create_links(struct isp_device *isp) in isp_create_links() argument
1759 &isp->isp_csi2a.subdev.entity, CSI2_PAD_SOURCE, in isp_create_links()
1760 &isp->isp_csi2a.video_out.video.entity, 0, 0); in isp_create_links()
1765 &isp->isp_ccp2.video_in.video.entity, 0, in isp_create_links()
1766 &isp->isp_ccp2.subdev.entity, CCP2_PAD_SINK, 0); in isp_create_links()
1771 &isp->isp_ccdc.subdev.entity, CCDC_PAD_SOURCE_OF, in isp_create_links()
1772 &isp->isp_ccdc.video_out.video.entity, 0, 0); in isp_create_links()
1777 &isp->isp_prev.video_in.video.entity, 0, in isp_create_links()
1778 &isp->isp_prev.subdev.entity, PREV_PAD_SINK, 0); in isp_create_links()
1783 &isp->isp_prev.subdev.entity, PREV_PAD_SOURCE, in isp_create_links()
1784 &isp->isp_prev.video_out.video.entity, 0, 0); in isp_create_links()
1789 &isp->isp_res.video_in.video.entity, 0, in isp_create_links()
1790 &isp->isp_res.subdev.entity, RESZ_PAD_SINK, 0); in isp_create_links()
1795 &isp->isp_res.subdev.entity, RESZ_PAD_SOURCE, in isp_create_links()
1796 &isp->isp_res.video_out.video.entity, 0, 0); in isp_create_links()
1803 &isp->isp_csi2a.subdev.entity, CSI2_PAD_SOURCE, in isp_create_links()
1804 &isp->isp_ccdc.subdev.entity, CCDC_PAD_SINK, 0); in isp_create_links()
1809 &isp->isp_ccp2.subdev.entity, CCP2_PAD_SOURCE, in isp_create_links()
1810 &isp->isp_ccdc.subdev.entity, CCDC_PAD_SINK, 0); in isp_create_links()
1815 &isp->isp_ccdc.subdev.entity, CCDC_PAD_SOURCE_VP, in isp_create_links()
1816 &isp->isp_prev.subdev.entity, PREV_PAD_SINK, 0); in isp_create_links()
1821 &isp->isp_ccdc.subdev.entity, CCDC_PAD_SOURCE_OF, in isp_create_links()
1822 &isp->isp_res.subdev.entity, RESZ_PAD_SINK, 0); in isp_create_links()
1827 &isp->isp_prev.subdev.entity, PREV_PAD_SOURCE, in isp_create_links()
1828 &isp->isp_res.subdev.entity, RESZ_PAD_SINK, 0); in isp_create_links()
1833 &isp->isp_ccdc.subdev.entity, CCDC_PAD_SOURCE_VP, in isp_create_links()
1834 &isp->isp_aewb.subdev.entity, 0, in isp_create_links()
1840 &isp->isp_ccdc.subdev.entity, CCDC_PAD_SOURCE_VP, in isp_create_links()
1841 &isp->isp_af.subdev.entity, 0, in isp_create_links()
1847 &isp->isp_ccdc.subdev.entity, CCDC_PAD_SOURCE_VP, in isp_create_links()
1848 &isp->isp_hist.subdev.entity, 0, in isp_create_links()
1856 static void isp_cleanup_modules(struct isp_device *isp) in isp_cleanup_modules() argument
1858 omap3isp_h3a_aewb_cleanup(isp); in isp_cleanup_modules()
1859 omap3isp_h3a_af_cleanup(isp); in isp_cleanup_modules()
1860 omap3isp_hist_cleanup(isp); in isp_cleanup_modules()
1861 omap3isp_resizer_cleanup(isp); in isp_cleanup_modules()
1862 omap3isp_preview_cleanup(isp); in isp_cleanup_modules()
1863 omap3isp_ccdc_cleanup(isp); in isp_cleanup_modules()
1864 omap3isp_ccp2_cleanup(isp); in isp_cleanup_modules()
1865 omap3isp_csi2_cleanup(isp); in isp_cleanup_modules()
1866 omap3isp_csiphy_cleanup(isp); in isp_cleanup_modules()
1869 static int isp_initialize_modules(struct isp_device *isp) in isp_initialize_modules() argument
1873 ret = omap3isp_csiphy_init(isp); in isp_initialize_modules()
1875 dev_err(isp->dev, "CSI PHY initialization failed\n"); in isp_initialize_modules()
1879 ret = omap3isp_csi2_init(isp); in isp_initialize_modules()
1881 dev_err(isp->dev, "CSI2 initialization failed\n"); in isp_initialize_modules()
1885 ret = omap3isp_ccp2_init(isp); in isp_initialize_modules()
1888 dev_err(isp->dev, "CCP2 initialization failed\n"); in isp_initialize_modules()
1892 ret = omap3isp_ccdc_init(isp); in isp_initialize_modules()
1894 dev_err(isp->dev, "CCDC initialization failed\n"); in isp_initialize_modules()
1898 ret = omap3isp_preview_init(isp); in isp_initialize_modules()
1900 dev_err(isp->dev, "Preview initialization failed\n"); in isp_initialize_modules()
1904 ret = omap3isp_resizer_init(isp); in isp_initialize_modules()
1906 dev_err(isp->dev, "Resizer initialization failed\n"); in isp_initialize_modules()
1910 ret = omap3isp_hist_init(isp); in isp_initialize_modules()
1912 dev_err(isp->dev, "Histogram initialization failed\n"); in isp_initialize_modules()
1916 ret = omap3isp_h3a_aewb_init(isp); in isp_initialize_modules()
1918 dev_err(isp->dev, "H3A AEWB initialization failed\n"); in isp_initialize_modules()
1922 ret = omap3isp_h3a_af_init(isp); in isp_initialize_modules()
1924 dev_err(isp->dev, "H3A AF initialization failed\n"); in isp_initialize_modules()
1931 omap3isp_h3a_aewb_cleanup(isp); in isp_initialize_modules()
1933 omap3isp_hist_cleanup(isp); in isp_initialize_modules()
1935 omap3isp_resizer_cleanup(isp); in isp_initialize_modules()
1937 omap3isp_preview_cleanup(isp); in isp_initialize_modules()
1939 omap3isp_ccdc_cleanup(isp); in isp_initialize_modules()
1941 omap3isp_ccp2_cleanup(isp); in isp_initialize_modules()
1943 omap3isp_csi2_cleanup(isp); in isp_initialize_modules()
1945 omap3isp_csiphy_cleanup(isp); in isp_initialize_modules()
1950 static void isp_detach_iommu(struct isp_device *isp) in isp_detach_iommu() argument
1953 arm_iommu_detach_device(isp->dev); in isp_detach_iommu()
1954 arm_iommu_release_mapping(isp->mapping); in isp_detach_iommu()
1955 isp->mapping = NULL; in isp_detach_iommu()
1959 static int isp_attach_iommu(struct isp_device *isp) in isp_attach_iommu() argument
1971 dev_err(isp->dev, "failed to create ARM IOMMU mapping\n"); in isp_attach_iommu()
1975 isp->mapping = mapping; in isp_attach_iommu()
1978 ret = arm_iommu_attach_device(isp->dev, mapping); in isp_attach_iommu()
1980 dev_err(isp->dev, "failed to attach device to VA mapping\n"); in isp_attach_iommu()
1987 arm_iommu_release_mapping(isp->mapping); in isp_attach_iommu()
1988 isp->mapping = NULL; in isp_attach_iommu()
1996 * isp_remove - Remove ISP platform device
1997 * @pdev: Pointer to ISP platform device
2003 struct isp_device *isp = platform_get_drvdata(pdev); in isp_remove() local
2005 v4l2_async_nf_unregister(&isp->notifier); in isp_remove()
2006 isp_unregister_entities(isp); in isp_remove()
2007 isp_cleanup_modules(isp); in isp_remove()
2008 isp_xclk_cleanup(isp); in isp_remove()
2010 __omap3isp_get(isp, false); in isp_remove()
2011 isp_detach_iommu(isp); in isp_remove()
2012 __omap3isp_put(isp, false); in isp_remove()
2014 media_entity_enum_cleanup(&isp->crashed); in isp_remove()
2015 v4l2_async_nf_cleanup(&isp->notifier); in isp_remove()
2017 kfree(isp); in isp_remove()
2030 struct isp_device *isp = container_of(async, struct isp_device, in isp_subdev_notifier_complete() local
2032 struct v4l2_device *v4l2_dev = &isp->v4l2_dev; in isp_subdev_notifier_complete()
2036 mutex_lock(&isp->media_dev.graph_mutex); in isp_subdev_notifier_complete()
2038 ret = media_entity_enum_init(&isp->crashed, &isp->media_dev); in isp_subdev_notifier_complete()
2040 mutex_unlock(&isp->media_dev.graph_mutex); in isp_subdev_notifier_complete()
2045 if (sd->notifier != &isp->notifier) in isp_subdev_notifier_complete()
2048 ret = isp_link_entity(isp, &sd->entity, in isp_subdev_notifier_complete()
2051 mutex_unlock(&isp->media_dev.graph_mutex); in isp_subdev_notifier_complete()
2056 mutex_unlock(&isp->media_dev.graph_mutex); in isp_subdev_notifier_complete()
2058 ret = v4l2_device_register_subdev_nodes(&isp->v4l2_dev); in isp_subdev_notifier_complete()
2062 return media_device_register(&isp->media_dev); in isp_subdev_notifier_complete()
2153 static int isp_parse_of_endpoints(struct isp_device *isp) in isp_parse_of_endpoints() argument
2160 dev_fwnode(isp->dev), ISP_OF_PHY_PARALLEL, 0, in isp_parse_of_endpoints()
2169 dev_dbg(isp->dev, "parsing parallel interface\n"); in isp_parse_of_endpoints()
2174 isd = v4l2_async_nf_add_fwnode_remote(&isp->notifier, in isp_parse_of_endpoints()
2178 isp_parse_of_parallel_endpoint(isp->dev, &vep, &isd->bus); in isp_parse_of_endpoints()
2191 dev_fwnode(isp->dev), isp_bus_interfaces[i].phy, 0, in isp_parse_of_endpoints()
2197 dev_dbg(isp->dev, "parsing serial interface %u, node %pOF\n", i, in isp_parse_of_endpoints()
2214 isd = v4l2_async_nf_add_fwnode_remote(&isp->notifier, in isp_parse_of_endpoints()
2224 isp_parse_of_csi2_endpoint(isp->dev, &vep, &isd->bus); in isp_parse_of_endpoints()
2230 isp_parse_of_csi1_endpoint(isp->dev, &vep, in isp_parse_of_endpoints()
2250 * isp_probe - Probe ISP platform device
2251 * @pdev: Pointer to ISP platform device
2262 struct isp_device *isp; in isp_probe() local
2267 isp = kzalloc(sizeof(*isp), GFP_KERNEL); in isp_probe()
2268 if (!isp) { in isp_probe()
2274 "ti,phy-type", &isp->phy_type); in isp_probe()
2278 isp->syscon = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, in isp_probe()
2280 if (IS_ERR(isp->syscon)) { in isp_probe()
2281 ret = PTR_ERR(isp->syscon); in isp_probe()
2286 "syscon", 1, &isp->syscon_offset); in isp_probe()
2290 isp->autoidle = autoidle; in isp_probe()
2292 mutex_init(&isp->isp_mutex); in isp_probe()
2293 spin_lock_init(&isp->stat_lock); in isp_probe()
2294 v4l2_async_nf_init(&isp->notifier); in isp_probe()
2295 isp->dev = &pdev->dev; in isp_probe()
2297 ret = isp_parse_of_endpoints(isp); in isp_probe()
2301 isp->ref_count = 0; in isp_probe()
2303 ret = dma_coerce_mask_and_coherent(isp->dev, DMA_BIT_MASK(32)); in isp_probe()
2307 platform_set_drvdata(pdev, isp); in isp_probe()
2310 isp->isp_csiphy1.vdd = devm_regulator_get(&pdev->dev, "vdd-csiphy1"); in isp_probe()
2311 isp->isp_csiphy2.vdd = devm_regulator_get(&pdev->dev, "vdd-csiphy2"); in isp_probe()
2315 * The ISP clock tree is revision-dependent. We thus need to enable ICLK in isp_probe()
2318 * Start by mapping the ISP MMIO area, which is in two pieces. in isp_probe()
2319 * The ISP IOMMU is in between. Map both now, and fill in the in isp_probe()
2320 * ISP revision specific portions a little later in the in isp_probe()
2327 isp->mmio_base[map_idx] = in isp_probe()
2328 devm_ioremap_resource(isp->dev, mem); in isp_probe()
2329 if (IS_ERR(isp->mmio_base[map_idx])) { in isp_probe()
2330 ret = PTR_ERR(isp->mmio_base[map_idx]); in isp_probe()
2335 ret = isp_get_clocks(isp); in isp_probe()
2339 ret = clk_enable(isp->clock[ISP_CLK_CAM_ICK]); in isp_probe()
2343 isp->revision = isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_REVISION); in isp_probe()
2344 dev_info(isp->dev, "Revision %d.%d found\n", in isp_probe()
2345 (isp->revision & 0xf0) >> 4, isp->revision & 0x0f); in isp_probe()
2347 clk_disable(isp->clock[ISP_CLK_CAM_ICK]); in isp_probe()
2349 if (__omap3isp_get(isp, false) == NULL) { in isp_probe()
2354 ret = isp_reset(isp); in isp_probe()
2358 ret = isp_xclk_init(isp); in isp_probe()
2364 if (isp->revision == isp_res_maps[m].isp_rev) in isp_probe()
2368 dev_err(isp->dev, "No resource map found for ISP rev %d.%d\n", in isp_probe()
2369 (isp->revision & 0xf0) >> 4, isp->revision & 0xf); in isp_probe()
2375 isp->mmio_base[i] = in isp_probe()
2376 isp->mmio_base[0] + isp_res_maps[m].offset[i]; in isp_probe()
2379 isp->mmio_base[i] = in isp_probe()
2380 isp->mmio_base[OMAP3_ISP_IOMEM_CSI2A_REGS1] in isp_probe()
2383 isp->mmio_hist_base_phys = in isp_probe()
2387 ret = isp_attach_iommu(isp); in isp_probe()
2399 isp->irq_num = ret; in isp_probe()
2401 if (devm_request_irq(isp->dev, isp->irq_num, isp_isr, IRQF_SHARED, in isp_probe()
2402 "OMAP3 ISP", isp)) { in isp_probe()
2403 dev_err(isp->dev, "Unable to request IRQ\n"); in isp_probe()
2409 ret = isp_initialize_modules(isp); in isp_probe()
2413 ret = isp_register_entities(isp); in isp_probe()
2417 ret = isp_create_links(isp); in isp_probe()
2421 isp->notifier.ops = &isp_subdev_notifier_ops; in isp_probe()
2423 ret = v4l2_async_nf_register(&isp->v4l2_dev, &isp->notifier); in isp_probe()
2427 isp_core_init(isp, 1); in isp_probe()
2428 omap3isp_put(isp); in isp_probe()
2433 isp_unregister_entities(isp); in isp_probe()
2435 isp_cleanup_modules(isp); in isp_probe()
2437 isp_detach_iommu(isp); in isp_probe()
2439 isp_xclk_cleanup(isp); in isp_probe()
2440 __omap3isp_put(isp, false); in isp_probe()
2442 v4l2_async_nf_cleanup(&isp->notifier); in isp_probe()
2443 mutex_destroy(&isp->isp_mutex); in isp_probe()
2445 kfree(isp); in isp_probe()
2464 { .compatible = "ti,omap3-isp" },
2483 MODULE_DESCRIPTION("TI OMAP3 ISP driver");