OSDN Git Service

msm: camera: isp: enable/disable hvx only if the state changed
authorSenthil Kumar Rajagopal <skrajago@codeaurora.org>
Tue, 21 Feb 2017 14:07:35 +0000 (19:37 +0530)
committerGerrit - the friendly Code Review server <code-review@localhost>
Tue, 28 Feb 2017 11:25:18 +0000 (03:25 -0800)
Save the previous satates of HVX . enable or disable
hvx only if the previous state is different from current state.

Change-Id: I24081d1fccff17a0da26ff213df056c7a1cb6388
Signed-off-by: Senthil Kumar Rajagopal <skrajago@codeaurora.org>
drivers/media/platform/msm/camera_v2/isp/msm_isp.h
drivers/media/platform/msm/camera_v2/isp/msm_isp47.c

index f6fabc6..ec87370 100644 (file)
@@ -792,6 +792,7 @@ struct vfe_device {
        struct msm_vfe_error_info error_info;
        struct msm_vfe_fetch_engine_info fetch_engine_info;
        enum msm_vfe_hvx_streaming_cmd hvx_cmd;
+       uint8_t cur_hvx_state;
 
        /* State variables */
        uint32_t vfe_hw_version;
index c7f3b97..5d2abf9 100644 (file)
@@ -1494,6 +1494,10 @@ void msm_vfe47_configure_hvx(struct vfe_device *vfe_dev,
        uint32_t val;
        int rc = 0;
 
+       if (is_stream_on == vfe_dev->cur_hvx_state) {
+               ISP_DBG("already in same hvx state\n");
+               return;
+       }
        if (vfe_dev->buf_mgr->secure_enable == SECURE_MODE) {
                pr_err("%s: Cannot configure hvx, secure_mode: %d\n",
                        __func__,
@@ -1527,6 +1531,7 @@ void msm_vfe47_configure_hvx(struct vfe_device *vfe_dev,
                val &= 0xFFFFFFF7;
                msm_camera_io_w_mb(val, vfe_dev->vfe_base + 0x50);
        }
+       vfe_dev->cur_hvx_state = is_stream_on;
 }
 
 void msm_vfe47_update_camif_state(struct vfe_device *vfe_dev,