Skip to content

Commit

Permalink
camera:v.3.0x19:disable cif irq when capture_en disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Rockchip committed Jun 4, 2014
1 parent 65777ac commit e5aaa4d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drivers/media/video/rk30_camera_oneframe.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,11 @@ module_param(debug, int, S_IRUGO|S_IWUSR);
* 1. fix access cif register in rk_camera_remove_device, it may be happen before clock turn on;
*v0.3.0x17:
* 1. fix display bug when the moment switch awb mode;add rk_camera_skip_frames function;
*v0.3.0x19:
1. disable cif irq when capture_en disabled,fix unexpected infinite interrups comming
*/

#define RK_CAM_VERSION_CODE KERNEL_VERSION(0, 3, 0x17)
#define RK_CAM_VERSION_CODE KERNEL_VERSION(0, 3, 0x19)
static int version = RK_CAM_VERSION_CODE;
module_param(version, int, S_IRUGO);

Expand Down Expand Up @@ -1652,7 +1654,7 @@ static int rk_camera_activate(struct rk_camera_dev *pcdev, struct soc_camera_dev
* [email protected] : Cif clk control in rk_sensor_power which in rk_camera.c
*/
write_cif_reg(pcdev->base,CIF_CIF_CTRL,AXI_BURST_16|MODE_ONEFRAME|DISABLE_CAPTURE); /* [email protected] : vip ahb burst 16 */
write_cif_reg(pcdev->base,CIF_CIF_INTEN, 0x01); //capture complete interrupt enable
// write_cif_reg(pcdev->base,CIF_CIF_INTEN, 0x01); //capture complete interrupt enable
return 0;
}

Expand Down Expand Up @@ -2041,7 +2043,7 @@ static void rk_camera_setup_format(struct soc_camera_device *icd, __u32 host_pix
rk_camera_cif_reset(pcdev,true);

write_cif_reg(pcdev->base,CIF_CIF_CTRL,AXI_BURST_16|MODE_ONEFRAME|DISABLE_CAPTURE); /* [email protected] : vip ahb burst 16 */
write_cif_reg(pcdev->base,CIF_CIF_INTEN, 0x01|0x200); //capture complete interrupt enable
// write_cif_reg(pcdev->base,CIF_CIF_INTEN, 0x01|0x200); //capture complete interrupt enable

write_cif_reg(pcdev->base,CIF_CIF_FOR,cif_fmt_val); /* [email protected]: VIP capture mode and capture format must be set before FS register set */

Expand Down Expand Up @@ -2944,7 +2946,8 @@ static int rk_camera_s_stream(struct soc_camera_device *icd, int enable)
pcdev->irqinfo.cifirq_normal_idx = 0;
pcdev->irqinfo.cifirq_abnormal_idx = 0;
pcdev->irqinfo.dmairq_idx = 0;


write_cif_reg(pcdev->base,CIF_CIF_INTEN, 0x01|0x200);
cif_ctrl_val |= ENABLE_CAPTURE;
write_cif_reg(pcdev->base,CIF_CIF_CTRL, cif_ctrl_val);
spin_unlock_irqrestore(&pcdev->lock,flags);
Expand All @@ -2961,6 +2964,7 @@ static int rk_camera_s_stream(struct soc_camera_device *icd, int enable)
spin_lock_irqsave(&pcdev->lock, flags);
write_cif_reg(pcdev->base,CIF_CIF_CTRL, cif_ctrl_val);
atomic_set(&pcdev->stop_cif,true);
write_cif_reg(pcdev->base,CIF_CIF_INTEN, 0x0);
spin_unlock_irqrestore(&pcdev->lock, flags);
flush_workqueue((pcdev->camera_wq));
}
Expand Down

0 comments on commit e5aaa4d

Please sign in to comment.