diff options
author | Sheng Nan <b38800@freescale.com> | 2012-10-15 20:01:32 +0800 |
---|---|---|
committer | Sheng Nan <b38800@freescale.com> | 2012-10-16 15:57:39 +0800 |
commit | 8d06743e323da3a65c7a488315ca33c7901f9bc8 (patch) | |
tree | 161ccfae8ef0174cb291ce4f9ee7617412048aea /drivers/media/video | |
parent | 4ddc27dff9b806d8c21dbcf7a57a3608c422d1a4 (diff) | |
download | linux-8d06743e323da3a65c7a488315ca33c7901f9bc8.tar.gz |
ENGR00224964-4 mxc_v4l2_capture: change capture stream off sequence
Change v4l2 capture stream off sequence.
Both CSI MEM and CSI IC MEM channel wait for idmac eof and
disable csi firstly.
The disable sequence is:
- wait for idmac channel EOF, disable csi
- disable idmac channel
- disable smfc (CSI-->MEM channel)
Signed-off-by: Sheng Nan <b38800@freescale.com>
Diffstat (limited to 'drivers/media/video')
7 files changed, 43 insertions, 33 deletions
diff --git a/drivers/media/video/mxc/capture/ipu_bg_overlay_sdc.c b/drivers/media/video/mxc/capture/ipu_bg_overlay_sdc.c index 6823e00f71ef..704b7d751b5f 100644 --- a/drivers/media/video/mxc/capture/ipu_bg_overlay_sdc.c +++ b/drivers/media/video/mxc/capture/ipu_bg_overlay_sdc.c @@ -390,8 +390,6 @@ static int bg_overlay_stop(void *private) if (cam->overlay_active == false) return 0; - ipu_free_irq(cam->ipu, IPU_IRQ_CSI0_OUT_EOF, cam); - err = ipu_disable_channel(cam->ipu, CSI_MEM, true); ipu_uninit_channel(cam->ipu, CSI_MEM); @@ -473,6 +471,11 @@ static int bg_overlay_disable_csi(void *private) { cam_data *cam = (cam_data *) private; + /* free csi eof irq firstly. + * when disable csi, wait for idmac eof. + * it requests eof irq again */ + ipu_free_irq(cam->ipu, IPU_IRQ_CSI0_OUT_EOF, cam); + return ipu_disable_csi(cam->ipu, cam->csi); } diff --git a/drivers/media/video/mxc/capture/ipu_csi_enc.c b/drivers/media/video/mxc/capture/ipu_csi_enc.c index 80ef8128debc..872598bd102d 100644 --- a/drivers/media/video/mxc/capture/ipu_csi_enc.c +++ b/drivers/media/video/mxc/capture/ipu_csi_enc.c @@ -280,8 +280,6 @@ static int csi_enc_disabling_tasks(void *private) int csi_id; #endif - ipu_free_irq(cam->ipu, IPU_IRQ_CSI0_OUT_EOF, cam); - err = ipu_disable_channel(cam->ipu, CSI_MEM, true); ipu_uninit_channel(cam->ipu, CSI_MEM); @@ -337,6 +335,11 @@ static int csi_enc_disable_csi(void *private) { cam_data *cam = (cam_data *) private; + /* free csi eof irq firstly. + * when disable csi, wait for idmac eof. + * it requests eof irq again */ + ipu_free_irq(cam->ipu, IPU_IRQ_CSI0_OUT_EOF, cam); + return ipu_disable_csi(cam->ipu, cam->csi); } diff --git a/drivers/media/video/mxc/capture/ipu_fg_overlay_sdc.c b/drivers/media/video/mxc/capture/ipu_fg_overlay_sdc.c index 4f91311de497..f324f4eac489 100644 --- a/drivers/media/video/mxc/capture/ipu_fg_overlay_sdc.c +++ b/drivers/media/video/mxc/capture/ipu_fg_overlay_sdc.c @@ -454,8 +454,6 @@ static int foreground_stop(void *private) if (cam->overlay_active == false) return 0; - ipu_free_irq(cam->ipu, IPU_IRQ_CSI0_OUT_EOF, cam); - err = ipu_disable_channel(cam->ipu, CSI_MEM, true); ipu_uninit_channel(cam->ipu, CSI_MEM); @@ -551,6 +549,11 @@ static int foreground_disable_csi(void *private) { cam_data *cam = (cam_data *) private; + /* free csi eof irq firstly. + * when disable csi, wait for idmac eof. + * it requests eof irq again */ + ipu_free_irq(cam->ipu, IPU_IRQ_CSI0_OUT_EOF, cam); + return ipu_disable_csi(cam->ipu, cam->csi); } diff --git a/drivers/media/video/mxc/capture/ipu_prp_enc.c b/drivers/media/video/mxc/capture/ipu_prp_enc.c index 576442f1155a..def416570de3 100644 --- a/drivers/media/video/mxc/capture/ipu_prp_enc.c +++ b/drivers/media/video/mxc/capture/ipu_prp_enc.c @@ -430,11 +430,6 @@ static int prp_enc_disabling_tasks(void *private) if (cam->rotation >= IPU_ROTATE_90_RIGHT) { ipu_free_irq(cam->ipu, IPU_IRQ_PRP_ENC_ROT_OUT_EOF, cam); - } else { - ipu_free_irq(cam->ipu, IPU_IRQ_PRP_ENC_OUT_EOF, cam); - } - - if (cam->rotation >= IPU_ROTATE_90_RIGHT) { ipu_unlink_channels(cam->ipu, CSI_PRP_ENC_MEM, MEM_ROT_ENC_MEM); } @@ -499,6 +494,12 @@ static int prp_enc_disable_csi(void *private) { cam_data *cam = (cam_data *) private; + /* free csi eof irq firstly. + * when disable csi, wait for idmac eof. + * it requests eof irq again */ + if (cam->rotation < IPU_ROTATE_90_RIGHT) + ipu_free_irq(cam->ipu, IPU_IRQ_PRP_ENC_OUT_EOF, cam); + return ipu_disable_csi(cam->ipu, cam->csi); } diff --git a/drivers/media/video/mxc/capture/ipu_prp_vf_sdc.c b/drivers/media/video/mxc/capture/ipu_prp_vf_sdc.c index 305c4471ed6b..a8015349cca2 100644 --- a/drivers/media/video/mxc/capture/ipu_prp_vf_sdc.c +++ b/drivers/media/video/mxc/capture/ipu_prp_vf_sdc.c @@ -411,8 +411,6 @@ static int prpvf_stop(void *private) if (cam->vf_rotation >= IPU_ROTATE_VERT_FLIP) { ipu_unlink_channels(cam->ipu, CSI_PRP_VF_MEM, MEM_ROT_VF_MEM); ipu_free_irq(cam->ipu, IPU_IRQ_PRP_VF_ROT_OUT_EOF, cam); - } else { - ipu_free_irq(cam->ipu, IPU_IRQ_PRP_VF_OUT_EOF, cam); } buffer_num = 0; @@ -495,6 +493,12 @@ static int prp_vf_disable_csi(void *private) { cam_data *cam = (cam_data *) private; + /* free csi eof irq firstly. + * when disable csi, wait for idmac eof. + * it requests eof irq again */ + if (cam->vf_rotation < IPU_ROTATE_VERT_FLIP) + ipu_free_irq(cam->ipu, IPU_IRQ_PRP_VF_OUT_EOF, cam); + return ipu_disable_csi(cam->ipu, cam->csi); } diff --git a/drivers/media/video/mxc/capture/ipu_prp_vf_sdc_bg.c b/drivers/media/video/mxc/capture/ipu_prp_vf_sdc_bg.c index 0df46618f33f..72c71faf7fdb 100644 --- a/drivers/media/video/mxc/capture/ipu_prp_vf_sdc_bg.c +++ b/drivers/media/video/mxc/capture/ipu_prp_vf_sdc_bg.c @@ -360,8 +360,6 @@ static int prpvf_stop(void *private) ipu_free_irq(disp_ipu, IPU_IRQ_BG_SF_END, cam); - ipu_free_irq(cam->ipu, IPU_IRQ_PRP_VF_OUT_EOF, cam); - ipu_disable_channel(cam->ipu, CSI_PRP_VF_MEM, true); ipu_disable_channel(cam->ipu, MEM_ROT_VF_MEM, true); ipu_uninit_channel(cam->ipu, CSI_PRP_VF_MEM); @@ -441,6 +439,11 @@ static int prp_vf_disable_csi(void *private) { cam_data *cam = (cam_data *) private; + /* free csi eof irq firstly. + * when disable csi, wait for idmac eof. + * it requests eof irq again */ + ipu_free_irq(cam->ipu, IPU_IRQ_PRP_VF_OUT_EOF, cam); + return ipu_disable_csi(cam->ipu, cam->csi); } diff --git a/drivers/media/video/mxc/capture/mxc_v4l2_capture.c b/drivers/media/video/mxc/capture/mxc_v4l2_capture.c index 0e82820cfdee..4fd89b0335bf 100644 --- a/drivers/media/video/mxc/capture/mxc_v4l2_capture.c +++ b/drivers/media/video/mxc/capture/mxc_v4l2_capture.c @@ -474,8 +474,13 @@ static int mxc_streamoff(cam_data *cam) if (cam->capture_on == false) return 0; - if (strcmp(mxc_capture_inputs[cam->current_input].name, - "CSI MEM") == 0) { + /* For both CSI--MEM and CSI--IC--MEM + * 1. wait for idmac eof + * 2. disable csi first + * 3. disable idmac + * 4. disable smfc (CSI--MEM channel) + */ + if (mxc_capture_inputs[cam->current_input].name != NULL) { if (cam->enc_disable_csi) { err = cam->enc_disable_csi(cam); if (err != 0) @@ -486,18 +491,6 @@ static int mxc_streamoff(cam_data *cam) if (err != 0) return err; } - } else if (strcmp(mxc_capture_inputs[cam->current_input].name, - "CSI IC MEM") == 0) { - if (cam->enc_disable) { - err = cam->enc_disable(cam); - if (err != 0) - return err; - } - if (cam->enc_disable_csi) { - err = cam->enc_disable_csi(cam); - if (err != 0) - return err; - } } mxc_free_frames(cam); @@ -703,14 +696,14 @@ static int stop_preview(cam_data *cam) { int err = 0; - if (cam->vf_stop_sdc) { - err = cam->vf_stop_sdc(cam); + if (cam->vf_disable_csi) { + err = cam->vf_disable_csi(cam); if (err != 0) return err; } - if (cam->vf_disable_csi) { - err = cam->vf_disable_csi(cam); + if (cam->vf_stop_sdc) { + err = cam->vf_stop_sdc(cam); if (err != 0) return err; } |