diff options
author | Jean-François Moine <moinejf@free.fr> | 2011-02-10 05:49:32 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-21 19:32:06 -0400 |
commit | 222036765ccbdb1ff4feef22d8e2fc687a9cdcfd (patch) | |
tree | a19bf4a5aedb40390fea373963f59d87bc6573bb /drivers/media/video/gspca/sonixj.c | |
parent | 804632201f2d749b7cb35fce42fc28552ad595c1 (diff) |
[media] gspca - sonixj: Adjust autogain for sensor mt9v111
The gain/expo adjustment was too long.
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/sonixj.c')
-rw-r--r-- | drivers/media/video/gspca/sonixj.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c index 01ee39be2c75..b7a7e96d3bd8 100644 --- a/drivers/media/video/gspca/sonixj.c +++ b/drivers/media/video/gspca/sonixj.c | |||
@@ -1939,10 +1939,10 @@ static u32 setexposure(struct gspca_dev *gspca_dev, | |||
1939 | u8 expo_c1[] = | 1939 | u8 expo_c1[] = |
1940 | { 0xb1, 0x5c, 0x09, 0x00, 0x00, 0x00, 0x00, 0x10 }; | 1940 | { 0xb1, 0x5c, 0x09, 0x00, 0x00, 0x00, 0x00, 0x10 }; |
1941 | 1941 | ||
1942 | if (expo > 0x0280) | 1942 | if (expo > 0x0390) |
1943 | expo = 0x0280; | 1943 | expo = 0x0390; |
1944 | else if (expo < 0x0040) | 1944 | else if (expo < 0x0060) |
1945 | expo = 0x0040; | 1945 | expo = 0x0060; |
1946 | expo_c1[3] = expo >> 8; | 1946 | expo_c1[3] = expo >> 8; |
1947 | expo_c1[4] = expo; | 1947 | expo_c1[4] = expo; |
1948 | i2c_w8(gspca_dev, expo_c1); | 1948 | i2c_w8(gspca_dev, expo_c1); |
@@ -1999,10 +1999,13 @@ static void setbrightness(struct gspca_dev *gspca_dev) | |||
1999 | sd->exposure = setexposure(gspca_dev, expo); | 1999 | sd->exposure = setexposure(gspca_dev, expo); |
2000 | break; | 2000 | break; |
2001 | case SENSOR_GC0307: | 2001 | case SENSOR_GC0307: |
2002 | case SENSOR_MT9V111: | ||
2003 | expo = brightness; | 2002 | expo = brightness; |
2004 | sd->exposure = setexposure(gspca_dev, expo); | 2003 | sd->exposure = setexposure(gspca_dev, expo); |
2005 | return; /* don't set the Y offset */ | 2004 | return; /* don't set the Y offset */ |
2005 | case SENSOR_MT9V111: | ||
2006 | expo = brightness << 2; | ||
2007 | sd->exposure = setexposure(gspca_dev, expo); | ||
2008 | return; /* don't set the Y offset */ | ||
2006 | case SENSOR_OM6802: | 2009 | case SENSOR_OM6802: |
2007 | expo = brightness << 2; | 2010 | expo = brightness << 2; |
2008 | sd->exposure = setexposure(gspca_dev, expo); | 2011 | sd->exposure = setexposure(gspca_dev, expo); |
@@ -2750,6 +2753,7 @@ static void do_autogain(struct gspca_dev *gspca_dev) | |||
2750 | (unsigned int) (expotimes << 8)); | 2753 | (unsigned int) (expotimes << 8)); |
2751 | break; | 2754 | break; |
2752 | case SENSOR_OM6802: | 2755 | case SENSOR_OM6802: |
2756 | case SENSOR_MT9V111: | ||
2753 | expotimes = sd->exposure; | 2757 | expotimes = sd->exposure; |
2754 | expotimes += (luma_mean - delta) >> 2; | 2758 | expotimes += (luma_mean - delta) >> 2; |
2755 | if (expotimes < 0) | 2759 | if (expotimes < 0) |
@@ -2762,7 +2766,6 @@ static void do_autogain(struct gspca_dev *gspca_dev) | |||
2762 | /* case SENSOR_MO4000: */ | 2766 | /* case SENSOR_MO4000: */ |
2763 | /* case SENSOR_MI0360: */ | 2767 | /* case SENSOR_MI0360: */ |
2764 | /* case SENSOR_MI0360B: */ | 2768 | /* case SENSOR_MI0360B: */ |
2765 | /* case SENSOR_MT9V111: */ | ||
2766 | expotimes = sd->exposure; | 2769 | expotimes = sd->exposure; |
2767 | expotimes += (luma_mean - delta) >> 6; | 2770 | expotimes += (luma_mean - delta) >> 6; |
2768 | if (expotimes < 0) | 2771 | if (expotimes < 0) |