diff options
author | Antonio Ospite <ospite@studenti.unina.it> | 2010-03-01 06:53:34 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-17 23:46:56 -0400 |
commit | 18cf8c91ad558f8d2d0177656df493f81949cfe6 (patch) | |
tree | 92f98683a2c911f1656e239ad20f89a8ab9d29be /drivers/media | |
parent | f2938822523739e99a39fd634943865a432e9c00 (diff) |
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: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/gspca/ov534.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/video/gspca/ov534.c b/drivers/media/video/gspca/ov534.c index 2d8965003077..4fda0980be04 100644 --- a/drivers/media/video/gspca/ov534.c +++ b/drivers/media/video/gspca/ov534.c | |||
@@ -686,6 +686,15 @@ static void setexposure(struct gspca_dev *gspca_dev) | |||
686 | struct sd *sd = (struct sd *) gspca_dev; | 686 | struct sd *sd = (struct sd *) gspca_dev; |
687 | u8 val; | 687 | u8 val; |
688 | 688 | ||
689 | if (sd->aec) | ||
690 | return; | ||
691 | |||
692 | /* 'val' is one byte and represents half of the exposure value we are | ||
693 | * going to set into registers, a two bytes value: | ||
694 | * | ||
695 | * MSB: ((u16) val << 1) >> 8 == val >> 7 | ||
696 | * LSB: ((u16) val << 1) & 0xff == val << 1 | ||
697 | */ | ||
689 | val = sd->exposure; | 698 | val = sd->exposure; |
690 | sccb_reg_write(gspca_dev, 0x08, val >> 7); | 699 | sccb_reg_write(gspca_dev, 0x08, val >> 7); |
691 | sccb_reg_write(gspca_dev, 0x10, val << 1); | 700 | sccb_reg_write(gspca_dev, 0x10, val << 1); |