]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00224964-2 IPU: Capture: change csi disable sequence
authorSheng Nan <b38800@freescale.com>
Mon, 15 Oct 2012 10:00:10 +0000 (18:00 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:34 +0000 (08:35 +0200)
The recommended sequence for disable csi is,
disable csi as soon as we get IDMAC eof interrupt.

- add wait for eof when disable csi.
- don't wait for eof when disable CSI-->MEM channel.

Signed-off-by: Sheng Nan <b38800@freescale.com>
drivers/mxc/ipu3/ipu_common.c

index 877f2e5a2a9fc7de53adb83c3fda011ead867d7b..92703f34b6aac3b27e501fa22dd6e6ebc1cfabc8 100644 (file)
@@ -2179,10 +2179,7 @@ int32_t ipu_disable_channel(struct ipu_soc *ipu, ipu_channel_t channel, bool wai
                                }
                        }
                }
-       } else if ((channel == CSI_MEM0) || (channel == CSI_MEM1) ||
-                       (channel == CSI_MEM2) || (channel == CSI_MEM3))
-               _ipu_csi_wait4eof(ipu, channel);
-       else if (wait_for_stop) {
+       } else if (wait_for_stop && !_ipu_is_smfc_chan(out_dma)) {
                while (idma_is_set(ipu, IDMAC_CHA_BUSY, in_dma) ||
                       idma_is_set(ipu, IDMAC_CHA_BUSY, out_dma) ||
                        (ipu->sec_chan_en[IPU_CHAN_ID(channel)] &&
@@ -2361,6 +2358,7 @@ int32_t ipu_disable_csi(struct ipu_soc *ipu, uint32_t csi)
        mutex_lock(&ipu->mutex_lock);
        ipu->csi_use_count[csi]--;
        if (ipu->csi_use_count[csi] == 0) {
+               _ipu_csi_wait4eof(ipu, ipu->csi_channel[csi]);
                reg = ipu_cm_read(ipu, IPU_CONF);
                if (csi == 0)
                        ipu_cm_write(ipu, reg & ~IPU_CONF_CSI0_EN, IPU_CONF);