aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorHeungJun Kim <riverful.kim@samsung.com>2011-12-03 09:18:57 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-12-30 11:35:43 -0500
commit92e93a1fd065c8dfa592b01d3cb681e83bfc98eb (patch)
tree36275be31aee4291b9953e7b468a3a1a45d4dd96 /drivers/media/video
parent0f2ee1dd4907e1daae3c4bf00467417aba04c53e (diff)
[media] m5mols: Optimize the capture set up sequence
Improve the single frame capture set up sequence. Since there is no need to re-enable the interrupts in each capture sequence, unmask the required interrupts once at the device initialization time. Signed-off-by: HeungJun Kim <riverful.kim@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/m5mols/m5mols_capture.c34
-rw-r--r--drivers/media/video/m5mols/m5mols_core.c3
2 files changed, 12 insertions, 25 deletions
diff --git a/drivers/media/video/m5mols/m5mols_capture.c b/drivers/media/video/m5mols/m5mols_capture.c
index 090e50afbc9f..417689999817 100644
--- a/drivers/media/video/m5mols/m5mols_capture.c
+++ b/drivers/media/video/m5mols/m5mols_capture.c
@@ -108,48 +108,34 @@ int m5mols_start_capture(struct m5mols_info *info)
108 int ret; 108 int ret;
109 109
110 /* 110 /*
111 * Preparing capture. Setting control & interrupt before entering 111 * Synchronize the controls, set the capture frame resolution and color
112 * capture mode 112 * format. The frame capture is initiated during switching from Monitor
113 * 113 * to Capture mode.
114 * 1) change to MONITOR mode for operating control & interrupt
115 * 2) set controls (considering v4l2_control value & lock 3A)
116 * 3) set interrupt
117 * 4) change to CAPTURE mode
118 */ 114 */
119 ret = m5mols_mode(info, REG_MONITOR); 115 ret = m5mols_mode(info, REG_MONITOR);
120 if (!ret) 116 if (!ret)
121 ret = m5mols_sync_controls(info); 117 ret = m5mols_sync_controls(info);
122 if (!ret) 118 if (!ret)
123 ret = m5mols_lock_3a(info, true); 119 ret = m5mols_write(sd, CAPP_YUVOUT_MAIN, REG_JPEG);
120 if (!ret)
121 ret = m5mols_write(sd, CAPP_MAIN_IMAGE_SIZE, resolution);
124 if (!ret) 122 if (!ret)
125 ret = m5mols_enable_interrupt(sd, REG_INT_CAPTURE); 123 ret = m5mols_lock_3a(info, true);
126 if (!ret) 124 if (!ret)
127 ret = m5mols_mode(info, REG_CAPTURE); 125 ret = m5mols_mode(info, REG_CAPTURE);
128 if (!ret) 126 if (!ret)
129 /* Wait for capture interrupt, after changing capture mode */ 127 /* Wait until a frame is captured to ISP internal memory */
130 ret = m5mols_wait_interrupt(sd, REG_INT_CAPTURE, 2000); 128 ret = m5mols_wait_interrupt(sd, REG_INT_CAPTURE, 2000);
131 if (!ret) 129 if (!ret)
132 ret = m5mols_lock_3a(info, false); 130 ret = m5mols_lock_3a(info, false);
133 if (ret) 131 if (ret)
134 return ret; 132 return ret;
133
135 /* 134 /*
136 * Starting capture. Setting capture frame count and resolution and 135 * Initiate the captured data transfer to a MIPI-CSI receiver.
137 * the format(available format: JPEG, Bayer RAW, YUV).
138 *
139 * 1) select single or multi(enable to 25), format, size
140 * 2) set interrupt
141 * 3) start capture(for main image, now)
142 * 4) get information
143 * 5) notify file size to v4l2 device(e.g, to s5p-fimc v4l2 device)
144 */ 136 */
145 ret = m5mols_write(sd, CAPC_SEL_FRAME, 1); 137 ret = m5mols_write(sd, CAPC_SEL_FRAME, 1);
146 if (!ret) 138 if (!ret)
147 ret = m5mols_write(sd, CAPP_YUVOUT_MAIN, REG_JPEG);
148 if (!ret)
149 ret = m5mols_write(sd, CAPP_MAIN_IMAGE_SIZE, resolution);
150 if (!ret)
151 ret = m5mols_enable_interrupt(sd, REG_INT_CAPTURE);
152 if (!ret)
153 ret = m5mols_write(sd, CAPC_START, REG_CAP_START_MAIN); 139 ret = m5mols_write(sd, CAPC_START, REG_CAP_START_MAIN);
154 if (!ret) { 140 if (!ret) {
155 /* Wait for the capture completion interrupt */ 141 /* Wait for the capture completion interrupt */
diff --git a/drivers/media/video/m5mols/m5mols_core.c b/drivers/media/video/m5mols/m5mols_core.c
index 3c7556f40221..049b8ee1138d 100644
--- a/drivers/media/video/m5mols/m5mols_core.c
+++ b/drivers/media/video/m5mols/m5mols_core.c
@@ -788,7 +788,8 @@ static int m5mols_fw_start(struct v4l2_subdev *sd)
788 788
789 ret = m5mols_write(sd, PARM_INTERFACE, REG_INTERFACE_MIPI); 789 ret = m5mols_write(sd, PARM_INTERFACE, REG_INTERFACE_MIPI);
790 if (!ret) 790 if (!ret)
791 ret = m5mols_enable_interrupt(sd, REG_INT_AF); 791 ret = m5mols_enable_interrupt(sd,
792 REG_INT_AF | REG_INT_CAPTURE);
792 793
793 return ret; 794 return ret;
794} 795}