summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2008-08-14 19:53:33 +0200
committerJean-Francois Moine <moinejf@free.fr>2008-08-14 19:53:33 +0200
commitcad1a4391a036c6ae2a7b43fcd990560d0729ac8 (patch)
tree8fc799ba0e959e6e373b60db038fca0814b4622b /linux/drivers/media
parent57f9357fee29ada455f248e63cdb6b272fb670ce (diff)
downloadmediapointer-dvb-s2-cad1a4391a036c6ae2a7b43fcd990560d0729ac8.tar.gz
mediapointer-dvb-s2-cad1a4391a036c6ae2a7b43fcd990560d0729ac8.tar.bz2
gspca: Adjust some control limits in spca561.
From: Jean-Francois Moine <moinejf@free.fr> Priority: high Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/gspca/spca561.c35
1 files changed, 8 insertions, 27 deletions
diff --git a/linux/drivers/media/video/gspca/spca561.c b/linux/drivers/media/video/gspca/spca561.c
index c1fb1d60b..86fc55bf9 100644
--- a/linux/drivers/media/video/gspca/spca561.c
+++ b/linux/drivers/media/video/gspca/spca561.c
@@ -38,9 +38,9 @@ struct sd {
#define CONTRAST_MAX 0x3fff
__u16 exposure; /* rev12a only */
-#define EXPOSURE_MIN 0x2001
-#define EXPOSURE_DEF 0x20ae
-#define EXPOSURE_MAX 0x421d
+#define EXPOSURE_MIN 0
+#define EXPOSURE_DEF 200
+#define EXPOSURE_MAX 762
__u8 brightness; /* rev72a only */
#define BRIGHTNESS_MIN 0
@@ -48,7 +48,7 @@ struct sd {
#define BRIGHTNESS_MAX 63
__u8 white; /* rev12a only */
-#define WHITE_MIN 0
+#define WHITE_MIN 1
#define WHITE_DEF 0x40
#define WHITE_MAX 0x7f
@@ -604,28 +604,11 @@ static void setcontrast(struct gspca_dev *gspca_dev)
break;
default: {
/* case Rev012A: { */
-#if 1
static const __u8 Reg8391[] =
{ 0x92, 0x30, 0x20, 0x00, 0x0c, 0x00, 0x00, 0x00 };
reg_w_buf(gspca_dev, 0x8391, Reg8391, 8);
reg_w_buf(gspca_dev, 0x8390, Reg8391, 8);
-#else
- int expotimes;
- __u8 Reg8391[] =
- { 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00 };
-
-/*fixme: does not work..*/
- /* Write camera sensor settings */
- expotimes = sd->contrast >> 5;
- /* exposure is in 8309 2b, range 0120 - 5720 */
- Reg8391[0] = expotimes; /* exposure */
- Reg8391[1] = 0x18 | (expotimes >> 8);
- Reg8391[2] = sd->brightness; /* gain */
- /* gain in 8335, 2b range 0000 - 2400 */
- reg_w_buf(gspca_dev, 0x8391, Reg8391, 8);
- reg_w_buf(gspca_dev, 0x8390, Reg8391, 8);
-#endif
break;
}
}
@@ -639,10 +622,6 @@ static void setwhite(struct gspca_dev *gspca_dev)
__u8 reg8614, reg8616;
white = sd->white;
- if (sd->white == 0) {
- PDEBUG(D_CONF, "Discarding null whiteness");
- return;
- }
/* try to emulate MS-win as possible */
reg8616 = 0x90 - white * 5 / 8;
reg_w_val(gspca_dev->dev, 0x8616, reg8616);
@@ -654,10 +633,12 @@ static void setwhite(struct gspca_dev *gspca_dev)
static void setexposure(struct gspca_dev *gspca_dev)
{
struct sd *sd = (struct sd *) gspca_dev;
+ int expo;
__u8 data[2];
- data[0] = sd->exposure;
- data[1] = sd->exposure >> 8;
+ expo = sd->exposure + 0x20a8; /* from test */
+ data[0] = expo;
+ data[1] = expo >> 8;
reg_w_buf(gspca_dev, 0x8309, data, 2);
}