diff options
author | Hans de Goede <hdegoede@redhat.com> | 2012-05-16 12:14:54 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-07-30 23:18:50 +0200 |
commit | 8b3a19b1b3ab95fbc40acb653ca7559f32318301 (patch) | |
tree | c3c9ca6227bf017feabd9ac33157f18d5e308619 /drivers/media/video/gspca/sonixb.c | |
parent | [media] gscpa_sonixb: Convert to the control framework (diff) | |
download | linux-8b3a19b1b3ab95fbc40acb653ca7559f32318301.tar.xz linux-8b3a19b1b3ab95fbc40acb653ca7559f32318301.zip |
[media] gspca_sonixb: Fix OV7630 gain control
The ov7630's gain is weird, at 32 the gain drops to the same level as at 16,
so skip 32-47 (of the 0-63 scale).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/sonixb.c')
-rw-r--r-- | drivers/media/video/gspca/sonixb.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/sonixb.c b/drivers/media/video/gspca/sonixb.c index 1bfe5f8947b7..dfc70771c1f1 100644 --- a/drivers/media/video/gspca/sonixb.c +++ b/drivers/media/video/gspca/sonixb.c @@ -630,6 +630,13 @@ static void setgain(struct gspca_dev *gspca_dev) case SENSOR_OV7630: { __u8 i2c[] = {0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10}; + /* + * The ov7630's gain is weird, at 32 the gain drops to the + * same level as at 16, so skip 32-47 (of the 0-63 scale). + */ + if (sd->sensor == SENSOR_OV7630 && gain >= 32) + gain += 16; + i2c[1] = sensor_data[sd->sensor].sensor_addr; i2c[3] = gain; i2c_w(gspca_dev, i2c); @@ -1017,9 +1024,12 @@ static int sd_init_controls(struct gspca_dev *gspca_dev) gspca_dev->gain = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, V4L2_CID_GAIN, 0, 31, 1, 15); break; - case SENSOR_HV7131D: case SENSOR_OV7630: gspca_dev->gain = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, + V4L2_CID_GAIN, 0, 47, 1, 31); + break; + case SENSOR_HV7131D: + gspca_dev->gain = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, V4L2_CID_GAIN, 0, 63, 1, 31); break; case SENSOR_TAS5110C: |