Skip to content

Commit

Permalink
S5PC11X: CAMERA: add s/w reset routine for recovering module in ESD s…
Browse files Browse the repository at this point in the history
…tate

In ESD state, camera module can be disabled. So add recovering routine.

Change-Id: I1e845161d531c0946b49bde76086494aec283f94
Signed-off-by: kyoungho.yun <kyoungho.yun@samsung.com>
  • Loading branch information
kyoungho.yun authored and swetland committed Nov 15, 2010
1 parent 1d62a8d commit 2750d4e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion drivers/media/video/samsung/fimc/fimc_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 2750d4e

Please sign in to comment.