summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorLihui Cui <lcui@nvidia.com>2013-04-12 03:43:17 +0900
committerJohn Sasinowski <jsasinowski@nvidia.com>2013-04-22 14:02:38 -0700
commit1dfd11ef9be7e6e1ca5a01fc71a02f433575e055 (patch)
treed2358c9a5f0157bceef7ab564f25789d780f0837 /drivers/media
parent4b35deff807ed8d1ed214edabd33db5d95d51f6a (diff)
media:video:tegra: aohdr implementation for ov5693.
For bug 1236935. Change-Id: I9cfb94685d47375ad8ef9106980be18bde51156c Signed-off-by: Lihui Cui <lcui@nvidia.com> Reviewed-on: http://git-master/r/218626 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Philip Breczinski <pbreczinski@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Jon Mayo <jmayo@nvidia.com> Reviewed-by: John Sasinowski <jsasinowski@nvidia.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/tegra/ov5693.c287
1 files changed, 150 insertions, 137 deletions
diff --git a/drivers/media/video/tegra/ov5693.c b/drivers/media/video/tegra/ov5693.c
index 27e852bed07b..898ba402839b 100644
--- a/drivers/media/video/tegra/ov5693.c
+++ b/drivers/media/video/tegra/ov5693.c
@@ -106,8 +106,9 @@ static struct nvc_imager_static_nvc ov5693_dflt_sdata = {
.res_chg_wait_time = OV5693_RES_CHG_WAIT_TIME_MS,
};
-static const struct ov5693_reg ov5693_2592x1944_i2c[] = {
+static const struct ov5693_reg ov5693_2592x1944_hdr_i2c[] = {
{OV5693_TABLE_RESET, 0},/* Including sw reset */
+
{0x3001, 0x0a},
{0x3002, 0x80},
{0x3006, 0x00},
@@ -124,10 +125,6 @@ static const struct ov5693_reg ov5693_2592x1944_i2c[] = {
{0x3021, 0x00},
{0x3022, 0x01},
{0x3028, 0x44},
- {0x3090, 0x02},
- {0x3091, 0x0e},
- {0x3092, 0x00},
- {0x3093, 0x00},
{0x3098, 0x03},
{0x3099, 0x1e},
{0x309a, 0x02},
@@ -136,7 +133,7 @@ static const struct ov5693_reg ov5693_2592x1944_i2c[] = {
{0x30a0, 0xd2},
{0x30a2, 0x01},
{0x30b2, 0x00},
- {0x30b3, 0x68},
+ {0x30b3, 0x64},
{0x30b4, 0x03},
{0x30b5, 0x04},
{0x30b6, 0x01},
@@ -150,19 +147,19 @@ static const struct ov5693_reg ov5693_2592x1944_i2c[] = {
{0x3405, 0x00},
{0x3406, 0x01},
{0x3500, 0x00},
- {0x3501, 0x7b},
- {0x3502, 0x00},
+ {0x3501, 0x9a},
+ {0x3502, 0x80},
{0x3503, 0x07},
{0x3504, 0x00},
{0x3505, 0x00},
{0x3506, 0x00},
- {0x3507, 0x02},
- {0x3508, 0x00},
- {0x3509, 0x08},
+ {0x3507, 0x01},
+ {0x3508, 0x80},
+ {0x3509, 0x10},
{0x350a, 0x00},
{0x350b, 0x40},
{0x3601, 0x0a},
- {0x3602, 0x18},
+ {0x3602, 0x38},
{0x3612, 0x80},
{0x3620, 0x54},
{0x3621, 0xc7},
@@ -205,6 +202,7 @@ static const struct ov5693_reg ov5693_2592x1944_i2c[] = {
{0x371e, 0xa1},
{0x371f, 0x0c},
{0x3721, 0x00},
+ {0x3724, 0x10},
{0x3726, 0x00},
{0x372a, 0x01},
{0x3730, 0x10},
@@ -231,6 +229,7 @@ static const struct ov5693_reg ov5693_2592x1944_i2c[] = {
{0x3759, 0x0f},
{0x376b, 0x44},
{0x375c, 0x04},
+ {0x3774, 0x10},
{0x3776, 0x00},
{0x377f, 0x08},
{0x3780, 0x22},
@@ -267,10 +266,10 @@ static const struct ov5693_reg ov5693_2592x1944_i2c[] = {
{0x3809, 0x20},
{0x380a, 0x07},
{0x380b, 0x98},
- {0x380c, 0x0a},
- {0x380d, 0x80},
- {0x380e, 0x07},
- {0x380f, 0xc0},
+ {0x380c, 0x0e},
+ {0x380d, 0x40},
+ {0x380e, 0x09},
+ {0x380f, 0xb4},
{0x3810, 0x00},
{0x3811, 0x02},
{0x3812, 0x00},
@@ -278,15 +277,15 @@ static const struct ov5693_reg ov5693_2592x1944_i2c[] = {
{0x3814, 0x11},
{0x3815, 0x11},
{0x3820, 0x00},
- {0x3821, 0x1e},
+ {0x3821, 0x9e},
{0x3823, 0x00},
{0x3824, 0x00},
{0x3825, 0x00},
{0x3826, 0x00},
{0x3827, 0x00},
{0x382a, 0x04},
- {0x3a04, 0x06},
- {0x3a05, 0x14},
+ {0x3a04, 0x09},
+ {0x3a05, 0xa9},
{0x3a06, 0x00},
{0x3a07, 0xfe},
{0x3b00, 0x00},
@@ -294,25 +293,6 @@ static const struct ov5693_reg ov5693_2592x1944_i2c[] = {
{0x3b03, 0x00},
{0x3b04, 0x00},
{0x3b05, 0x00},
- {0x3d00, 0x00},
- {0x3d01, 0x00},
- {0x3d02, 0x00},
- {0x3d03, 0x00},
- {0x3d04, 0x00},
- {0x3d05, 0x00},
- {0x3d06, 0x00},
- {0x3d07, 0x00},
- {0x3d08, 0x00},
- {0x3d09, 0x00},
- {0x3d0a, 0x00},
- {0x3d0b, 0x00},
- {0x3d0c, 0x00},
- {0x3d0d, 0x00},
- {0x3d0e, 0x00},
- {0x3d0f, 0x00},
- {0x3d80, 0x00},
- {0x3d81, 0x00},
- {0x3d84, 0x00},
{0x3e07, 0x20},
{0x4000, 0x08},
{0x4001, 0x04},
@@ -321,10 +301,13 @@ static const struct ov5693_reg ov5693_2592x1944_i2c[] = {
{0x4005, 0x18},
{0x4006, 0x20},
{0x4008, 0x24},
- {0x4009, 0x10},
+ {0x4009, 0x40},
{0x400c, 0x00},
{0x400d, 0x00},
{0x4058, 0x00},
+ {0x404e, 0x37},
+ {0x404f, 0x8f},
+ {0x4058, 0x00},
{0x4101, 0xb2},
{0x4303, 0x00},
{0x4304, 0x08},
@@ -344,7 +327,7 @@ static const struct ov5693_reg ov5693_2592x1944_i2c[] = {
{0x4d03, 0xf5},
{0x4d04, 0x0c},
{0x4d05, 0xcc},
- {0x4837, 0x09},
+ {0x4837, 0x0a},
{0x5000, 0x06},
{0x5001, 0x01},
{0x5002, 0x00},
@@ -378,9 +361,9 @@ static const struct ov5693_reg ov5693_2592x1944_i2c[] = {
{OV5693_TABLE_END, 0x0000}
};
-static const struct ov5693_reg ov5693_1296x972_i2c[] = {
+static const struct ov5693_reg ov5693_1296x972_hdr_i2c[] = {
{OV5693_TABLE_RESET, 0},/* Including sw reset */
- {0x0103, 0x01},
+
{0x3001, 0x0a},
{0x3002, 0x80},
{0x3006, 0x00},
@@ -419,15 +402,15 @@ static const struct ov5693_reg ov5693_1296x972_i2c[] = {
{0x3405, 0x00},
{0x3406, 0x01},
{0x3500, 0x00},
- {0x3501, 0x7b},
+ {0x3501, 0x72},
{0x3502, 0x00},
{0x3503, 0x07},
{0x3504, 0x00},
{0x3505, 0x00},
{0x3506, 0x00},
- {0x3507, 0x02},
- {0x3508, 0x00},
- {0x3509, 0x08},
+ {0x3507, 0x01},
+ {0x3508, 0x80},
+ {0x3509, 0x10},
{0x350a, 0x00},
{0x350b, 0x40},
{0x3601, 0x0a},
@@ -459,7 +442,7 @@ static const struct ov5693_reg ov5693_1296x972_i2c[] = {
{0x3703, 0xd8},
{0x3704, 0x78},
{0x3705, 0x02},
- {0x3708, 0xe6},
+ {0x3708, 0xe2},
{0x3709, 0xc3},
{0x370a, 0x00},
{0x370b, 0x20},
@@ -526,38 +509,38 @@ static const struct ov5693_reg ov5693_1296x972_i2c[] = {
{0x37cb, 0x00},
{0x37de, 0x00},
{0x37df, 0x00},
- {0x3800, 0x00},
- {0x3801, 0x00},
- {0x3802, 0x00},
- {0x3803, 0x00},
- {0x3804, 0x0a},
- {0x3805, 0x3f},
- {0x3806, 0x07},
- {0x3807, 0xa3},
+ {0x3800, 0x02},
+ {0x3801, 0xa0},
+ {0x3802, 0x01},
+ {0x3803, 0xe8},
+ {0x3804, 0x07},
+ {0x3805, 0xb7},
+ {0x3806, 0x05},
+ {0x3807, 0xb9},
{0x3808, 0x05},
{0x3809, 0x10},
{0x380a, 0x03},
{0x380b, 0xcc},
- {0x380c, 0x0a},
- {0x380d, 0x80},
+ {0x380c, 0x0b},
+ {0x380d, 0x40},
{0x380e, 0x07},
- {0x380f, 0xc0},
+ {0x380f, 0x3a},
{0x3810, 0x00},
{0x3811, 0x02},
{0x3812, 0x00},
{0x3813, 0x02},
- {0x3814, 0x31},
- {0x3815, 0x31},
- {0x3820, 0x01},
- {0x3821, 0x1f},
+ {0x3814, 0x11},
+ {0x3815, 0x11},
+ {0x3820, 0x00},
+ {0x3821, 0x9e},
{0x3823, 0x00},
{0x3824, 0x00},
{0x3825, 0x00},
{0x3826, 0x00},
{0x3827, 0x00},
{0x382a, 0x04},
- {0x3a04, 0x06},
- {0x3a05, 0x14},
+ {0x3a04, 0x09},
+ {0x3a05, 0xa9},
{0x3a06, 0x00},
{0x3a07, 0xfe},
{0x3b00, 0x00},
@@ -629,11 +612,13 @@ static const struct ov5693_reg ov5693_1296x972_i2c[] = {
{0x5e00, 0x00},
{0x5e10, 0x0c},
{0x0100, 0x01},
+
{OV5693_TABLE_END, 0x0000}
};
-static const struct ov5693_reg ov5693_1920x1080_i2c[] = {
+static const struct ov5693_reg ov5693_1920x1080_hdr_i2c[] = {
{OV5693_TABLE_RESET, 0x0},/*, 0xIncluding, 0xsw, 0xreset, 0x*/
+
{0x3001, 0x0a},
{0x3002, 0x80},
{0x3006, 0x00},
@@ -672,15 +657,15 @@ static const struct ov5693_reg ov5693_1920x1080_i2c[] = {
{0x3405, 0x00},
{0x3406, 0x01},
{0x3500, 0x00},
- {0x3501, 0x7b},
+ {0x3501, 0x72},
{0x3502, 0x00},
{0x3503, 0x07},
{0x3504, 0x00},
{0x3505, 0x00},
{0x3506, 0x00},
- {0x3507, 0x02},
- {0x3508, 0x00},
- {0x3509, 0x08},
+ {0x3507, 0x01},
+ {0x3508, 0x80},
+ {0x3509, 0x10},
{0x350a, 0x00},
{0x350b, 0x40},
{0x3601, 0x0a},
@@ -779,22 +764,22 @@ static const struct ov5693_reg ov5693_1920x1080_i2c[] = {
{0x37cb, 0x00},
{0x37de, 0x00},
{0x37df, 0x00},
- {0x3800, 0x00},
- {0x3801, 0x00},
- {0x3802, 0x00},
- {0x3803, 0xf8},
- {0x3804, 0x0a},
- {0x3805, 0x3f},
- {0x3806, 0x06},
- {0x3807, 0xab},
+ {0x3800, 0x01},
+ {0x3801, 0x70},
+ {0x3802, 0x01},
+ {0x3803, 0xbc},
+ {0x3804, 0x09},
+ {0x3805, 0x0f},
+ {0x3806, 0x05},
+ {0x3807, 0xff},
{0x3808, 0x07},
{0x3809, 0x80},
{0x380a, 0x04},
{0x380b, 0x38},
- {0x380c, 0x0a},
- {0x380d, 0x80},
+ {0x380c, 0x0b},
+ {0x380d, 0x40},
{0x380e, 0x07},
- {0x380f, 0xc0},
+ {0x380f, 0x3a},
{0x3810, 0x00},
{0x3811, 0x02},
{0x3812, 0x00},
@@ -802,15 +787,15 @@ static const struct ov5693_reg ov5693_1920x1080_i2c[] = {
{0x3814, 0x11},
{0x3815, 0x11},
{0x3820, 0x00},
- {0x3821, 0x1e},
+ {0x3821, 0x9e},
{0x3823, 0x00},
{0x3824, 0x00},
{0x3825, 0x00},
{0x3826, 0x00},
{0x3827, 0x00},
{0x382a, 0x04},
- {0x3a04, 0x06},
- {0x3a05, 0x14},
+ {0x3a04, 0x09},
+ {0x3a05, 0xa9},
{0x3a06, 0x00},
{0x3a07, 0xfe},
{0x3b00, 0x00},
@@ -855,7 +840,7 @@ static const struct ov5693_reg ov5693_1920x1080_i2c[] = {
{0x4837, 0x0a},
{0x5000, 0x06},
{0x5001, 0x01},
- {0x5002, 0x80},
+ {0x5002, 0x00},
{0x5003, 0x20},
{0x5046, 0x0a},
{0x5013, 0x00},
@@ -886,8 +871,9 @@ static const struct ov5693_reg ov5693_1920x1080_i2c[] = {
};
-static const struct ov5693_reg ov5693_1280x720_120fps_i2c[] = {
+static const struct ov5693_reg ov5693_1280x720_hdr_i2c[] = {
{OV5693_TABLE_RESET, 0},/* Including sw reset */
+
{0x3001, 0x0a},
{0x3002, 0x80},
{0x3006, 0x00},
@@ -926,15 +912,15 @@ static const struct ov5693_reg ov5693_1280x720_120fps_i2c[] = {
{0x3405, 0x00},
{0x3406, 0x01},
{0x3500, 0x00},
- {0x3501, 0x2e},
- {0x3502, 0x80},
+ {0x3501, 0x39},
+ {0x3502, 0x00},
{0x3503, 0x07},
{0x3504, 0x00},
{0x3505, 0x00},
{0x3506, 0x00},
- {0x3507, 0x02},
- {0x3508, 0x00},
- {0x3509, 0x08},
+ {0x3507, 0x01},
+ {0x3508, 0x80},
+ {0x3509, 0x10},
{0x350a, 0x00},
{0x350b, 0x40},
{0x3601, 0x0a},
@@ -966,8 +952,8 @@ static const struct ov5693_reg ov5693_1280x720_120fps_i2c[] = {
{0x3703, 0xd8},
{0x3704, 0x78},
{0x3705, 0x02},
- {0x3708, 0xe6},
- {0x3709, 0xc7},
+ {0x3708, 0xe2},
+ {0x3709, 0xc3},
{0x370a, 0x00},
{0x370b, 0x20},
{0x370c, 0x0c},
@@ -1033,38 +1019,38 @@ static const struct ov5693_reg ov5693_1280x720_120fps_i2c[] = {
{0x37cb, 0x00},
{0x37de, 0x00},
{0x37df, 0x00},
- {0x3800, 0x00},
- {0x3801, 0x00},
- {0x3802, 0x00},
- {0x3803, 0xf4},
- {0x3804, 0x0a},
- {0x3805, 0x3f},
- {0x3806, 0x06},
- {0x3807, 0xab},
+ {0x3800, 0x02},
+ {0x3801, 0xa8},
+ {0x3802, 0x02},
+ {0x3803, 0x68},
+ {0x3804, 0x07},
+ {0x3805, 0xb7},
+ {0x3806, 0x05},
+ {0x3807, 0x3b},
{0x3808, 0x05},
{0x3809, 0x00},
{0x380a, 0x02},
{0x380b, 0xd0},
- {0x380c, 0x06},
- {0x380d, 0xd8},
- {0x380e, 0x02},
- {0x380f, 0xf8},
+ {0x380c, 0x0b},
+ {0x380d, 0x40},
+ {0x380e, 0x03},
+ {0x380f, 0x9e},
{0x3810, 0x00},
{0x3811, 0x02},
{0x3812, 0x00},
{0x3813, 0x02},
- {0x3814, 0x31},
- {0x3815, 0x31},
- {0x3820, 0x04},
- {0x3821, 0x1f},
+ {0x3814, 0x11},
+ {0x3815, 0x11},
+ {0x3820, 0x00},
+ {0x3821, 0x9e},
{0x3823, 0x00},
{0x3824, 0x00},
{0x3825, 0x00},
{0x3826, 0x00},
{0x3827, 0x00},
{0x382a, 0x04},
- {0x3a04, 0x06},
- {0x3a05, 0x14},
+ {0x3a04, 0x09},
+ {0x3a05, 0xa9},
{0x3a06, 0x00},
{0x3a07, 0xfe},
{0x3b00, 0x00},
@@ -1136,22 +1122,22 @@ static const struct ov5693_reg ov5693_1280x720_120fps_i2c[] = {
{0x5e00, 0x00},
{0x5e10, 0x0c},
{0x0100, 0x01},
- {0x350b, 0xF8},
+
{OV5693_TABLE_END, 0x0000}
};
enum {
- OV5693_MODE_2592x1944 = 0,
- OV5693_MODE_1920x1080,
- OV5693_MODE_1296x972,
- OV5693_MODE_1280x720_120FPS,
+ OV5693_MODE_2592x1944_HDR = 0,
+ OV5693_MODE_1920x1080_HDR,
+ OV5693_MODE_1296x972_HDR,
+ OV5693_MODE_1280x720_HDR,
};
static const struct ov5693_reg *mode_table[] = {
- [OV5693_MODE_2592x1944] = ov5693_2592x1944_i2c,
- [OV5693_MODE_1920x1080] = ov5693_1920x1080_i2c,
- [OV5693_MODE_1296x972] = ov5693_1296x972_i2c,
- [OV5693_MODE_1280x720_120FPS] = ov5693_1280x720_120fps_i2c,
+ [OV5693_MODE_2592x1944_HDR] = ov5693_2592x1944_hdr_i2c,
+ [OV5693_MODE_1920x1080_HDR] = ov5693_1920x1080_hdr_i2c,
+ [OV5693_MODE_1296x972_HDR] = ov5693_1296x972_hdr_i2c,
+ [OV5693_MODE_1280x720_HDR] = ov5693_1280x720_hdr_i2c,
};
static int ov5693_i2c_rd8(struct ov5693_info *info, u16 reg, u8 *val)
@@ -1237,8 +1223,9 @@ static inline int ov5693_frame_length_reg(struct ov5693_reg *regs,
}
static inline int ov5693_coarse_time_reg(struct ov5693_reg *regs,
- u32 coarse_time)
+ u32 coarse_time, u32 coarse_time_short)
{
+ int ret = 0;
regs->addr = 0x3500;
regs->val = (coarse_time >> 12) & 0xff;
(regs + 1)->addr = 0x3501;
@@ -1246,7 +1233,20 @@ static inline int ov5693_coarse_time_reg(struct ov5693_reg *regs,
(regs + 2)->addr = 0x3502;
(regs + 2)->val = (coarse_time & 0xf) << 4;
- return 3;
+ ret += 3;
+
+ if (coarse_time_short != OV5693_INVALID_COARSE_TIME) {
+ regs->addr = 0x3506;
+ regs->val = (coarse_time_short >> 12) & 0xff;
+ (regs + 1)->addr = 0x3507;
+ (regs + 1)->val = (coarse_time_short >> 4) & 0xff;
+ (regs + 2)->addr = 0x3508;
+ (regs + 2)->val = (coarse_time_short & 0xf) << 4;
+
+ ret += 3;
+ }
+
+ return ret;
}
#define OV5693_ENTER_GROUP_HOLD(group_hold) \
@@ -1290,14 +1290,17 @@ static int ov5693_set_frame_length(struct ov5693_info *info,
}
static int ov5693_set_coarse_time(struct ov5693_info *info,
- u32 coarse_time, bool group_hold)
+ u32 coarse_time, u32 coarse_time_short,
+ bool group_hold)
{
struct ov5693_reg reg_list[16];
int err = 0;
int offset = 0;
OV5693_ENTER_GROUP_HOLD(group_hold);
- offset += ov5693_coarse_time_reg(reg_list + offset, coarse_time);
+ offset += ov5693_coarse_time_reg(reg_list + offset,
+ coarse_time,
+ coarse_time_short);
OV5693_LEAVE_GROUP_HOLD(group_hold);
reg_list[offset].addr = OV5693_TABLE_END;
@@ -1339,7 +1342,9 @@ static int ov5693_exposure_wr(struct ov5693_info *info,
bool group_hold = true; /* To use GROUP_HOLD macros */
OV5693_ENTER_GROUP_HOLD(group_hold);
- offset += ov5693_coarse_time_reg(reg_list + offset, mode->coarse_time);
+ offset += ov5693_coarse_time_reg(reg_list + offset,
+ mode->coarse_time,
+ mode->coarse_time_short);
offset += ov5693_gain_reg(reg_list + offset, mode->gain);
OV5693_LEAVE_GROUP_HOLD(group_hold);
@@ -1385,7 +1390,7 @@ static int ov5693_set_group_hold(struct ov5693_info *info,
ae->frame_length);
if (ae->coarse_time_enable)
offset += ov5693_coarse_time_reg(reg_list + offset,
- ae->coarse_time);
+ ae->coarse_time, OV5693_INVALID_COARSE_TIME);
OV5693_LEAVE_GROUP_HOLD(group_hold);
reg_list[offset].addr = OV5693_TABLE_END;
@@ -1402,7 +1407,7 @@ static int ov5693_gpio_rd(struct ov5693_info *info,
if (info->gpio[type].gpio) {
val = gpio_get_value_cansleep(info->gpio[type].gpio);
dev_dbg(&info->i2c_client->dev, "%s %u %d\n", __func__,
- info->gpio[type].gpio, val);
+ info->gpio[type].gpio, val);
if (!info->gpio[type].active_high)
val = !val;
val &= 1;
@@ -1423,7 +1428,7 @@ static int ov5693_gpio_wr(struct ov5693_info *info,
err = val;
gpio_set_value_cansleep(info->gpio[type].gpio, val);
dev_dbg(&info->i2c_client->dev, "%s %u %d\n", __func__,
- info->gpio[type].gpio, val);
+ info->gpio[type].gpio, val);
}
return err; /* return value written or error */
}
@@ -1708,23 +1713,19 @@ static int ov5693_set_mode(struct ov5693_info *info,
}
if (mode->res_x == 2592 && mode->res_y == 1944)
- mode_index = OV5693_MODE_2592x1944;
+ mode_index = OV5693_MODE_2592x1944_HDR;
else if (mode->res_x == 1296 && mode->res_y == 972)
- mode_index = OV5693_MODE_1296x972;
+ mode_index = OV5693_MODE_1296x972_HDR;
else if (mode->res_x == 1920 && mode->res_y == 1080)
- mode_index = OV5693_MODE_1920x1080;
+ mode_index = OV5693_MODE_1920x1080_HDR;
else if (mode->res_x == 1280 && mode->res_y == 720)
- mode_index = OV5693_MODE_1280x720_120FPS;
+ mode_index = OV5693_MODE_1280x720_HDR;
if (!info->mode_valid || (info->mode_index != mode_index))
err = ov5693_mode_wr_full(info, mode_index);
else
dev_dbg(&info->i2c_client->dev, "%s short mode\n", __func__);
- dev_dbg(&info->i2c_client->dev, "%s: mode #: %d\n",
- __func__, mode_index);
- dev_dbg(&info->i2c_client->dev, "%s: AE: %d, %d, %d\n",
- __func__, mode->frame_length,
- mode->coarse_time, mode->gain);
+
err |= ov5693_exposure_wr(info, mode);
if (err < 0) {
info->mode_valid = false;
@@ -1797,7 +1798,19 @@ static long ov5693_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
return ov5693_set_frame_length(info, (u32)arg, true);
case OV5693_IOCTL_SET_COARSE_TIME:
- return ov5693_set_coarse_time(info, (u32)arg, true);
+ return ov5693_set_coarse_time(info, (u32)arg,
+ OV5693_INVALID_COARSE_TIME, true);
+
+ case OV5693_IOCTL_SET_HDR_COARSE_TIME:
+ {
+ struct ov5693_hdr *hdrcoarse = (struct ov5693_hdr *)arg;
+ int ret = ov5693_set_coarse_time(info,
+ hdrcoarse->coarse_time_long,
+ hdrcoarse->coarse_time_short,
+ false);
+ return ret;
+ }
+
case OV5693_IOCTL_SET_GAIN:
return ov5693_set_gain(info, (u32)arg, true);