Skip to content

Commit

Permalink
V4L/DVB (9842): gspca: Center the brightness in sonixj.
Browse files Browse the repository at this point in the history
The brightness jumped from max to min at the middle of the control values.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Jean-Francois Moine authored and Mauro Carvalho Chehab committed Dec 30, 2008
1 parent abf485f commit b1b056a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/media/video/gspca/sonixj.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static struct ctrl sd_ctrls[] = {
#define BRIGHTNESS_MAX 0xffff
.maximum = BRIGHTNESS_MAX,
.step = 1,
#define BRIGHTNESS_DEF 0x7fff
#define BRIGHTNESS_DEF 0x8000
.default_value = BRIGHTNESS_DEF,
},
.set = sd_setbrightness,
Expand Down Expand Up @@ -1129,7 +1129,7 @@ static void setbrightness(struct gspca_dev *gspca_dev)
unsigned int expo;
__u8 k2;

k2 = sd->brightness >> 10;
k2 = ((int) sd->brightness - 0x8000) >> 10;
switch (sd->sensor) {
case SENSOR_HV7131R:
expo = sd->brightness << 4;
Expand All @@ -1147,7 +1147,7 @@ static void setbrightness(struct gspca_dev *gspca_dev)
case SENSOR_OM6802:
expo = sd->brightness >> 6;
sd->exposure = setexposure(gspca_dev, expo);
k2 >>= 1;
k2 = sd->brightness >> 11;
break;
}

Expand Down

0 comments on commit b1b056a

Please sign in to comment.