.. | .. |
---|
7 | 7 | * V0.0X01.0X01 first version |
---|
8 | 8 | */ |
---|
9 | 9 | |
---|
10 | | -//#define DEBUG |
---|
| 10 | +// #define DEBUG |
---|
11 | 11 | #include <linux/clk.h> |
---|
12 | 12 | #include <linux/device.h> |
---|
13 | 13 | #include <linux/delay.h> |
---|
.. | .. |
---|
192 | 192 | {0x3301, 0x09}, |
---|
193 | 193 | {0x3302, 0xff}, |
---|
194 | 194 | {0x3303, 0x10}, |
---|
195 | | - {0x3306, 0x60}, |
---|
| 195 | + {0x3306, 0x68}, |
---|
196 | 196 | {0x3307, 0x02}, |
---|
197 | 197 | {0x330a, 0x01}, |
---|
198 | | - {0x330b, 0x10}, |
---|
| 198 | + {0x330b, 0x18}, |
---|
199 | 199 | {0x330c, 0x16}, |
---|
200 | 200 | {0x330d, 0xff}, |
---|
201 | 201 | {0x3318, 0x02}, |
---|
.. | .. |
---|
219 | 219 | {0x33b1, 0x80}, |
---|
220 | 220 | {0x33b2, 0x68}, |
---|
221 | 221 | {0x33b3, 0x42}, |
---|
222 | | - {0x33f9, 0x70}, |
---|
223 | | - {0x33fb, 0xd0}, |
---|
| 222 | + {0x33f9, 0x78}, |
---|
| 223 | + {0x33fb, 0xe0}, |
---|
224 | 224 | {0x33fc, 0x0f}, |
---|
225 | 225 | {0x33fd, 0x1f}, |
---|
226 | 226 | {0x349f, 0x03}, |
---|
.. | .. |
---|
229 | 229 | {0x34a8, 0x42}, |
---|
230 | 230 | {0x34a9, 0x06}, |
---|
231 | 231 | {0x34aa, 0x01}, |
---|
232 | | - {0x34ab, 0x23}, |
---|
| 232 | + {0x34ab, 0x28}, |
---|
233 | 233 | {0x34ac, 0x01}, |
---|
234 | | - {0x34ad, 0x84}, |
---|
| 234 | + {0x34ad, 0x90}, |
---|
235 | 235 | {0x3630, 0xf4}, |
---|
236 | 236 | {0x3633, 0x22}, |
---|
237 | 237 | {0x3639, 0xf4}, |
---|
.. | .. |
---|
242 | 242 | {0x3676, 0xed}, |
---|
243 | 243 | {0x367c, 0x09}, |
---|
244 | 244 | {0x367d, 0x0f}, |
---|
245 | | - {0x3690, 0x33}, |
---|
246 | | - {0x3691, 0x33}, |
---|
247 | | - {0x3692, 0x43}, |
---|
| 245 | + {0x3690, 0x22}, |
---|
| 246 | + {0x3691, 0x22}, |
---|
| 247 | + {0x3692, 0x22}, |
---|
248 | 248 | {0x3698, 0x89}, |
---|
249 | 249 | {0x3699, 0x96}, |
---|
250 | 250 | {0x369a, 0xd0}, |
---|
.. | .. |
---|
452 | 452 | coarse_dgain = 0x00; |
---|
453 | 453 | fine_dgain = gain_factor * 128 / 1000; |
---|
454 | 454 | } else if (gain_factor < 1000 * 4) { /*2x ~ 4x gain*/ |
---|
455 | | - coarse_again = 0x01; |
---|
| 455 | + coarse_again = 0x08; |
---|
456 | 456 | coarse_dgain = 0x00; |
---|
457 | 457 | fine_dgain = gain_factor * 128 / 1000 / 2; |
---|
458 | 458 | } else if (gain_factor < 1000 * 8) { /*4x ~ 8x gain*/ |
---|
459 | | - coarse_again = 0x03; |
---|
| 459 | + coarse_again = 0x09; |
---|
460 | 460 | coarse_dgain = 0x00; |
---|
461 | 461 | fine_dgain = gain_factor * 128 / 1000 / 4; |
---|
462 | 462 | } else if (gain_factor < 1000 * 16) { /*8x ~ 16x gain*/ |
---|
463 | | - coarse_again = 0x07; |
---|
| 463 | + coarse_again = 0x0b; |
---|
464 | 464 | coarse_dgain = 0x00; |
---|
465 | 465 | fine_dgain = gain_factor * 128 / 1000 / 8; |
---|
466 | 466 | } else if (gain_factor < 1000 * 32) { /*16x ~ 32x gain*/ |
---|
.. | .. |
---|
481 | 481 | coarse_dgain = 0x03; |
---|
482 | 482 | fine_dgain = 0x80; |
---|
483 | 483 | } |
---|
| 484 | + fine_dgain = fine_dgain / 4 * 4; |
---|
484 | 485 | dev_dbg(&sc2336->client->dev, |
---|
485 | 486 | "total_gain: 0x%x, d_gain: 0x%x, d_fine_gain: 0x%x, c_gain: 0x%x\n", |
---|
486 | 487 | gain, coarse_dgain, fine_dgain, coarse_again); |
---|
.. | .. |
---|
1159 | 1160 | switch (ctrl->id) { |
---|
1160 | 1161 | case V4L2_CID_VBLANK: |
---|
1161 | 1162 | /* Update max exposure while meeting expected vblanking */ |
---|
1162 | | - max = sc2336->cur_mode->height + ctrl->val - 8; |
---|
| 1163 | + max = sc2336->cur_mode->height + ctrl->val - 6; |
---|
1163 | 1164 | __v4l2_ctrl_modify_range(sc2336->exposure, |
---|
1164 | 1165 | sc2336->exposure->minimum, max, |
---|
1165 | 1166 | sc2336->exposure->step, |
---|
.. | .. |
---|
1282 | 1283 | V4L2_CID_VBLANK, vblank_def, |
---|
1283 | 1284 | SC2336_VTS_MAX - mode->height, |
---|
1284 | 1285 | 1, vblank_def); |
---|
1285 | | - exposure_max = mode->vts_def - 8; |
---|
| 1286 | + exposure_max = mode->vts_def - 6; |
---|
1286 | 1287 | sc2336->exposure = v4l2_ctrl_new_std(handler, &sc2336_ctrl_ops, |
---|
1287 | 1288 | V4L2_CID_EXPOSURE, SC2336_EXPOSURE_MIN, |
---|
1288 | 1289 | exposure_max, SC2336_EXPOSURE_STEP, |
---|