提交 18cf8c91 编写于 作者: A Antonio Ospite 提交者: Mauro Carvalho Chehab

V4L/DVB: gspca - ov534: Fix and document setting manual exposure

Document that even if the state is a u8 value, both MSB and LSB are set
as sd->exposure represents half of the value we are going to set into
registers.

Skip setting exposure when AEC is enabled.
Signed-off-by: NAntonio Ospite <ospite@studenti.unina.it>
Signed-off-by: NJean-François Moine <moinejf@free.fr>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 f2938822
...@@ -686,6 +686,15 @@ static void setexposure(struct gspca_dev *gspca_dev) ...@@ -686,6 +686,15 @@ static void setexposure(struct gspca_dev *gspca_dev)
struct sd *sd = (struct sd *) gspca_dev; struct sd *sd = (struct sd *) gspca_dev;
u8 val; u8 val;
if (sd->aec)
return;
/* 'val' is one byte and represents half of the exposure value we are
* going to set into registers, a two bytes value:
*
* MSB: ((u16) val << 1) >> 8 == val >> 7
* LSB: ((u16) val << 1) & 0xff == val << 1
*/
val = sd->exposure; val = sd->exposure;
sccb_reg_write(gspca_dev, 0x08, val >> 7); sccb_reg_write(gspca_dev, 0x08, val >> 7);
sccb_reg_write(gspca_dev, 0x10, val << 1); sccb_reg_write(gspca_dev, 0x10, val << 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册