[media] gspca - zc3xx: Fix bad sensor values when changing autogain

The setexposure added in commit 590f216806 works only for the sensor hv7131r,
but it is called for all sensors when changing the autogain.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Jean-François Moine 2012-02-27 08:37:37 -03:00 committed by Mauro Carvalho Chehab
parent 0b74e2c460
commit 6028c32684
1 changed files with 4 additions and 0 deletions

View File

@ -5884,6 +5884,8 @@ static void getexposure(struct gspca_dev *gspca_dev)
{ {
struct sd *sd = (struct sd *) gspca_dev; struct sd *sd = (struct sd *) gspca_dev;
if (sd->sensor != SENSOR_HV7131R)
return;
sd->ctrls[EXPOSURE].val = (i2c_read(gspca_dev, 0x25) << 9) sd->ctrls[EXPOSURE].val = (i2c_read(gspca_dev, 0x25) << 9)
| (i2c_read(gspca_dev, 0x26) << 1) | (i2c_read(gspca_dev, 0x26) << 1)
| (i2c_read(gspca_dev, 0x27) >> 7); | (i2c_read(gspca_dev, 0x27) >> 7);
@ -5894,6 +5896,8 @@ static void setexposure(struct gspca_dev *gspca_dev)
struct sd *sd = (struct sd *) gspca_dev; struct sd *sd = (struct sd *) gspca_dev;
int val; int val;
if (sd->sensor != SENSOR_HV7131R)
return;
val = sd->ctrls[EXPOSURE].val; val = sd->ctrls[EXPOSURE].val;
i2c_write(gspca_dev, 0x25, val >> 9, 0x00); i2c_write(gspca_dev, 0x25, val >> 9, 0x00);
i2c_write(gspca_dev, 0x26, val >> 1, 0x00); i2c_write(gspca_dev, 0x26, val >> 1, 0x00);