isp11: rockchip: v0.3.0

Set VTS with exposure time and gain

Change-Id: Id45593654b0cec25acf0c3c721c0b653138b22b7
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
This commit is contained in:
Hu Kejun
2017-11-14 10:15:29 +08:00
committed by Tao Huang
parent e160ab0a06
commit 6193899b8e
5 changed files with 18 additions and 5 deletions

View File

@@ -5566,7 +5566,6 @@ static void cif_isp11_vs_work(struct work_struct *work)
struct cif_isp11_device *dev = vs_wk->dev;
unsigned int v_frame_id;
switch (vs_wk->cmd) {
case CIF_ISP11_VS_EXP: {
struct cif_isp11_img_src_exp *exp =
@@ -6478,7 +6477,7 @@ int cif_isp11_s_exp(
struct cif_isp11_img_src_ctrl *ctrl_exp_t = NULL, *ctrl_exp_g = NULL;
struct cif_isp11_img_src_exp *exp = NULL, *exp_t = NULL, *exp_g = NULL;
unsigned long lock_flags;
int retval, i;
int retval, i, exp_cnt;
if (!dev->vs_wq)
return -ENODEV;
@@ -6501,7 +6500,7 @@ int cif_isp11_s_exp(
retval = -ENOMEM;
goto failed;
}
ctrl_exp_t = kmalloc(sizeof(struct cif_isp11_img_src_ctrl), GFP_KERNEL);
ctrl_exp_t = kmalloc(sizeof(struct cif_isp11_img_src_ctrl) * 2, GFP_KERNEL);
if (!ctrl_exp_t) {
retval = -ENOMEM;
goto failed;
@@ -6518,9 +6517,15 @@ int cif_isp11_s_exp(
goto failed;
}
exp_cnt = 0;
for (i = 0; i < exp_ctrl->cnt; i++) {
if (exp_ctrl->ctrls[i].id == V4L2_CID_EXPOSURE) {
*ctrl_exp_t = exp_ctrl->ctrls[i];
exp_cnt++;
}
if (exp_ctrl->ctrls[i].id == RK_V4L2_CID_VTS) {
*(ctrl_exp_t + 1) = exp_ctrl->ctrls[i];
exp_cnt++;
}
if (exp_ctrl->ctrls[i].id == V4L2_CID_GAIN) {
*ctrl_exp_g = exp_ctrl->ctrls[i];
@@ -6532,7 +6537,7 @@ int cif_isp11_s_exp(
kfree(exp_ctrl->ctrls);
exp_ctrl->ctrls = NULL;
exp_t->exp.cnt = 1;
exp_t->exp.cnt = exp_cnt;
exp_t->exp.class = exp_ctrl->class;
exp_t->exp.ctrls = ctrl_exp_t;
exp_g->exp.cnt = 2;

View File

@@ -129,6 +129,7 @@ enum cif_isp11_cid {
CIF_ISP11_CID_VBLANKING = 17,
CIF_ISP11_CID_ISO_SENSITIVITY = 18,
CIF_ISP11_CID_BAND_STOP_FILTER = 19,
CIF_ISP11_CID_VTS = 20,
};
/* correspond to bit field values */

View File

@@ -245,6 +245,8 @@ static int cif_isp11_v4l2_cid2v4l2_cid(u32 cif_isp11_cid)
return V4L2_CID_VFLIP;
case CIF_ISP11_CID_BAND_STOP_FILTER:
return V4L2_CID_BAND_STOP_FILTER;
case CIF_ISP11_CID_VTS:
return RK_V4L2_CID_VTS;
default:
cif_isp11_pltfrm_pr_err(NULL,
"unknown/unsupported CIF ISP20 ID %d\n",

View File

@@ -275,6 +275,8 @@ static int cif_isp11_v4l2_cid2cif_isp11_cid(u32 v4l2_cid)
return CIF_ISP11_CID_ISO_SENSITIVITY;
case RK_V4L2_CID_AUTO_FPS:
return CIF_ISP11_CID_AUTO_FPS;
case RK_V4L2_CID_VTS:
return CIF_ISP11_CID_VTS;
case V4L2_CID_BAND_STOP_FILTER:
return CIF_ISP11_CID_BAND_STOP_FILTER;
default:

View File

@@ -147,9 +147,12 @@
*v0.2.f:
*1. Add support for dvfs;
*
*v0.3.0:
*1. Set vts with exposure time and gain;
*
*/
#define CONFIG_CIFISP11_DRIVER_VERSION KERNEL_VERSION(0, 2, 0xf)
#define CONFIG_CIFISP11_DRIVER_VERSION KERNEL_VERSION(0, 3, 0x0)
#endif