diff options
author | kyoungho.yun <kyoungho.yun@samsung.com> | 2010-10-15 15:02:42 -0700 |
---|---|---|
committer | Arve Hjønnevåg <arve@android.com> | 2011-11-17 17:52:05 -0800 |
commit | 98a262cc88668c4868ea7d09c8a6c08193af66a8 (patch) | |
tree | 62d934470904faa27a821a2536c7dd674b2101c6 /drivers/media | |
parent | 41cedb27b1d09f66b30c06607b99b69bea17ae96 (diff) | |
download | kernel_samsung_aries-98a262cc88668c4868ea7d09c8a6c08193af66a8.zip kernel_samsung_aries-98a262cc88668c4868ea7d09c8a6c08193af66a8.tar.gz kernel_samsung_aries-98a262cc88668c4868ea7d09c8a6c08193af66a8.tar.bz2 |
S5PC11X: CAMERA: add s/w reset routine for recovering module in ESD state
In ESD state, camera module can be disabled. So add recovering routine.
Change-Id: I1e845161d531c0946b49bde76086494aec283f94
Signed-off-by: kyoungho.yun <kyoungho.yun@samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/samsung/fimc/fimc_dev.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/media/video/samsung/fimc/fimc_dev.c b/drivers/media/video/samsung/fimc/fimc_dev.c index f9d74cf..1441367 100644 --- a/drivers/media/video/samsung/fimc/fimc_dev.c +++ b/drivers/media/video/samsung/fimc/fimc_dev.c @@ -33,6 +33,8 @@ #include <mach/media.h> #include <plat/fimc.h> #include <linux/videodev2_samsung.h> +#include <linux/delay.h> +#include <plat/regs-fimc.h> #include "fimc.h" @@ -390,9 +392,20 @@ static inline void fimc_irq_cap(struct fimc_control *ctrl) { struct fimc_capinfo *cap = ctrl->cap; int pp; + u32 cfg; fimc_hwset_clear_irq(ctrl); - fimc_hwget_overflow_state(ctrl); + if (fimc_hwget_overflow_state(ctrl)) { + /* s/w reset -- added for recovering module in ESD state*/ + cfg = readl(ctrl->regs + S3C_CIGCTRL); + cfg |= (S3C_CIGCTRL_SWRST); + writel(cfg, ctrl->regs + S3C_CIGCTRL); + msleep(1); + + cfg = readl(ctrl->regs + S3C_CIGCTRL); + cfg &= ~S3C_CIGCTRL_SWRST; + writel(cfg, ctrl->regs + S3C_CIGCTRL); + } pp = ((fimc_hwget_frame_count(ctrl) + 2) % 4); if (cap->fmt.field == V4L2_FIELD_INTERLACED_TB) { /* odd value of pp means one frame is made with top/bottom */ |