mirror of
https://github.com/torvalds/linux.git
synced 2024-12-01 00:21:32 +00:00
[media] soc-camera: mt9m111: Fix auto-exposure control
Commitf9bd584365
changed V4L2_CID_EXPOSURE_AUTO from boolean to enum, and commitaf8425c54b
changed the creation of this control into a menu for the mt9m111. However, mt9m111_set_autoexposure() is still interpreting the value set for this control as a boolean, which also conflicts with the default value of this control set to V4L2_EXPOSURE_AUTO (0). This patch makes mt9m111_set_autoexposure() interpret the value set for V4L2_CID_EXPOSURE_AUTO as defined by enum v4l2_exposure_auto_type. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Tested-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
d65fcbb000
commit
cbaa5c54cb
@ -701,11 +701,11 @@ static int mt9m111_set_global_gain(struct mt9m111 *mt9m111, int gain)
|
||||
return reg_write(GLOBAL_GAIN, val);
|
||||
}
|
||||
|
||||
static int mt9m111_set_autoexposure(struct mt9m111 *mt9m111, int on)
|
||||
static int mt9m111_set_autoexposure(struct mt9m111 *mt9m111, int val)
|
||||
{
|
||||
struct i2c_client *client = v4l2_get_subdevdata(&mt9m111->subdev);
|
||||
|
||||
if (on)
|
||||
if (val == V4L2_EXPOSURE_AUTO)
|
||||
return reg_set(OPER_MODE_CTRL, MT9M111_OPMODE_AUTOEXPO_EN);
|
||||
return reg_clear(OPER_MODE_CTRL, MT9M111_OPMODE_AUTOEXPO_EN);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user