Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

The setexposure added in commit 590f21680616 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>

authored by

Jean-François Moine and committed by
Mauro Carvalho Chehab
6028c326 0b74e2c4

+4
+4
drivers/media/video/gspca/zc3xx.c
··· 5884 5884 { 5885 5885 struct sd *sd = (struct sd *) gspca_dev; 5886 5886 5887 + if (sd->sensor != SENSOR_HV7131R) 5888 + return; 5887 5889 sd->ctrls[EXPOSURE].val = (i2c_read(gspca_dev, 0x25) << 9) 5888 5890 | (i2c_read(gspca_dev, 0x26) << 1) 5889 5891 | (i2c_read(gspca_dev, 0x27) >> 7); ··· 5896 5894 struct sd *sd = (struct sd *) gspca_dev; 5897 5895 int val; 5898 5896 5897 + if (sd->sensor != SENSOR_HV7131R) 5898 + return; 5899 5899 val = sd->ctrls[EXPOSURE].val; 5900 5900 i2c_write(gspca_dev, 0x25, val >> 9, 0x00); 5901 5901 i2c_write(gspca_dev, 0x26, val >> 1, 0x00);