From b607a50c0b4865aa58898a163630d4fe9f4413ea Mon Sep 17 00:00:00 2001 From: Jean-Francois Moine Date: Wed, 31 Dec 2008 12:13:46 +0100 Subject: gspca - main and many subdrivers: Remove the epaddr variable. From: Jean-Francois Moine The transfer endpoint address is now automatically chosen. Priority: normal Signed-off-by: Jean-Francois Moine --- linux/drivers/media/video/gspca/spca500.c | 1 - 1 file changed, 1 deletion(-) (limited to 'linux/drivers/media/video/gspca/spca500.c') diff --git a/linux/drivers/media/video/gspca/spca500.c b/linux/drivers/media/video/gspca/spca500.c index 6b4865280..9a3e8d9c6 100644 --- a/linux/drivers/media/video/gspca/spca500.c +++ b/linux/drivers/media/video/gspca/spca500.c @@ -646,7 +646,6 @@ static int sd_config(struct gspca_dev *gspca_dev, struct cam *cam; cam = &gspca_dev->cam; - cam->epaddr = 0x01; sd->subtype = id->driver_info; if (sd->subtype != LogitechClickSmart310) { cam->cam_mode = vga_mode; -- cgit v1.2.3 From 9afdb51d6cd6f5d7d5ad2841fbd24db72f8e0a41 Mon Sep 17 00:00:00 2001 From: Jean-Francois Moine Date: Thu, 1 Jan 2009 17:02:07 +0100 Subject: gspca - all subdrivers: Fix CodingStyle in sd_mod_init function. From: Alexey Klimov Introduce int ret and check it value after call to usb_register(). Priority: normal Signed-off-by: Alexey Klimov Signed-off-by: Jean-Francois Moine --- linux/drivers/media/video/gspca/spca500.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'linux/drivers/media/video/gspca/spca500.c') diff --git a/linux/drivers/media/video/gspca/spca500.c b/linux/drivers/media/video/gspca/spca500.c index 9a3e8d9c6..e107775d7 100644 --- a/linux/drivers/media/video/gspca/spca500.c +++ b/linux/drivers/media/video/gspca/spca500.c @@ -1109,7 +1109,9 @@ static struct usb_driver sd_driver = { /* -- module insert / remove -- */ static int __init sd_mod_init(void) { - if (usb_register(&sd_driver) < 0) + int ret; + ret = usb_register(&sd_driver); + if (ret < 0) return -1; PDEBUG(D_PROBE, "registered"); return 0; -- cgit v1.2.3 From 8295b6940120a069aa0078103ba943997fad6fd1 Mon Sep 17 00:00:00 2001 From: Jean-Francois Moine Date: Thu, 1 Jan 2009 17:04:58 +0100 Subject: gspca - all subdrivers: Return ret instead of -1 in sd_mod_init. From: Alexey Klimov Priority: normal Signed-off-by: Alexey Klimov Signed-off-by: Jean-Francois Moine --- linux/drivers/media/video/gspca/spca500.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux/drivers/media/video/gspca/spca500.c') diff --git a/linux/drivers/media/video/gspca/spca500.c b/linux/drivers/media/video/gspca/spca500.c index e107775d7..8054c5f62 100644 --- a/linux/drivers/media/video/gspca/spca500.c +++ b/linux/drivers/media/video/gspca/spca500.c @@ -1112,7 +1112,7 @@ static int __init sd_mod_init(void) int ret; ret = usb_register(&sd_driver); if (ret < 0) - return -1; + return ret; PDEBUG(D_PROBE, "registered"); return 0; } -- cgit v1.2.3 From 708897dcfe69ded8bd4e9cf6283bb1f44d7727b9 Mon Sep 17 00:00:00 2001 From: Jean-Francois Moine Date: Wed, 7 Jan 2009 20:49:57 +0100 Subject: gspca - jpeg subdrivers: One quantization table per subdriver. From: Jean-Francois Moine Priority: normal Signed-off-by: Jean-Francois Moine --- linux/drivers/media/video/gspca/spca500.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'linux/drivers/media/video/gspca/spca500.c') diff --git a/linux/drivers/media/video/gspca/spca500.c b/linux/drivers/media/video/gspca/spca500.c index 8054c5f62..0f91c5173 100644 --- a/linux/drivers/media/video/gspca/spca500.c +++ b/linux/drivers/media/video/gspca/spca500.c @@ -22,6 +22,7 @@ #define MODULE_NAME "spca500" #include "gspca.h" +#define QUANT_VAL 5 /* quantization table */ #include "jpeg.h" MODULE_AUTHOR("Michel Xhaard "); @@ -39,7 +40,6 @@ struct sd { unsigned char contrast; unsigned char colors; - char qindex; char subtype; #define AgfaCl20 0 #define AiptekPocketDV 1 @@ -654,7 +654,6 @@ static int sd_config(struct gspca_dev *gspca_dev, cam->cam_mode = sif_mode; cam->nmodes = ARRAY_SIZE(sif_mode); } - sd->qindex = 5; sd->brightness = BRIGHTNESS_DEF; sd->contrast = CONTRAST_DEF; sd->colors = COLOR_DEF; @@ -917,7 +916,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, ffd9, 2); /* put the JPEG header in the new frame */ - jpeg_put_header(gspca_dev, frame, sd->qindex, 0x22); + jpeg_put_header(gspca_dev, frame, 0x22); data += SPCA500_OFFSET_DATA; len -= SPCA500_OFFSET_DATA; -- cgit v1.2.3 From 090f6baf5cf3eea5a88f5c48269bd8b2918c72a2 Mon Sep 17 00:00:00 2001 From: Jean-Francois Moine Date: Sat, 10 Jan 2009 20:11:25 +0100 Subject: gspca - some subdrivers: Don't get the control values from the webcam. From: Jean-Francois Moine Priority: normal Signed-off-by: Jean-Francois Moine --- linux/drivers/media/video/gspca/spca500.c | 33 ------------------------------- 1 file changed, 33 deletions(-) (limited to 'linux/drivers/media/video/gspca/spca500.c') diff --git a/linux/drivers/media/video/gspca/spca500.c b/linux/drivers/media/video/gspca/spca500.c index 0f91c5173..61b127022 100644 --- a/linux/drivers/media/video/gspca/spca500.c +++ b/linux/drivers/media/video/gspca/spca500.c @@ -952,16 +952,6 @@ static void setbrightness(struct gspca_dev *gspca_dev) (__u8) (sd->brightness - 128)); } -static void getbrightness(struct gspca_dev *gspca_dev) -{ - struct sd *sd = (struct sd *) gspca_dev; - int ret; - - ret = reg_r_12(gspca_dev, 0x00, 0x8167, 1); - if (ret >= 0) - sd->brightness = ret + 128; -} - static void setcontrast(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; @@ -969,16 +959,6 @@ static void setcontrast(struct gspca_dev *gspca_dev) reg_w(gspca_dev, 0x00, 0x8168, sd->contrast); } -static void getcontrast(struct gspca_dev *gspca_dev) -{ - struct sd *sd = (struct sd *) gspca_dev; - int ret; - - ret = reg_r_12(gspca_dev, 0x0, 0x8168, 1); - if (ret >= 0) - sd->contrast = ret; -} - static void setcolors(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; @@ -986,16 +966,6 @@ static void setcolors(struct gspca_dev *gspca_dev) reg_w(gspca_dev, 0x00, 0x8169, sd->colors); } -static void getcolors(struct gspca_dev *gspca_dev) -{ - struct sd *sd = (struct sd *) gspca_dev; - int ret; - - ret = reg_r_12(gspca_dev, 0x0, 0x8169, 1); - if (ret >= 0) - sd->colors = ret; -} - static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val) { struct sd *sd = (struct sd *) gspca_dev; @@ -1010,7 +980,6 @@ static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val) { struct sd *sd = (struct sd *) gspca_dev; - getbrightness(gspca_dev); *val = sd->brightness; return 0; } @@ -1029,7 +998,6 @@ static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val) { struct sd *sd = (struct sd *) gspca_dev; - getcontrast(gspca_dev); *val = sd->contrast; return 0; } @@ -1048,7 +1016,6 @@ static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val) { struct sd *sd = (struct sd *) gspca_dev; - getcolors(gspca_dev); *val = sd->colors; return 0; } -- cgit v1.2.3 From 473e801c172a3223775ab624c4fb22441f5abab8 Mon Sep 17 00:00:00 2001 From: Jean-Francois Moine Date: Thu, 15 Jan 2009 13:34:55 +0100 Subject: gspca - spca500: Abnormal error message when starting ClickSmart310. From: Jean-Francois Moine Priority: normal Signed-off-by: Jean-Francois Moine --- linux/drivers/media/video/gspca/spca500.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'linux/drivers/media/video/gspca/spca500.c') diff --git a/linux/drivers/media/video/gspca/spca500.c b/linux/drivers/media/video/gspca/spca500.c index 61b127022..94caba63b 100644 --- a/linux/drivers/media/video/gspca/spca500.c +++ b/linux/drivers/media/video/gspca/spca500.c @@ -728,7 +728,8 @@ static int sd_start(struct gspca_dev *gspca_dev) write_vector(gspca_dev, spca500_visual_defaults); spca500_setmode(gspca_dev, xmult, ymult); /* enable drop packet */ - reg_w(gspca_dev, 0x00, 0x850a, 0x0001); + err = reg_w(gspca_dev, 0x00, 0x850a, 0x0001); + if (err < 0) PDEBUG(D_ERR, "failed to enable drop packet"); reg_w(gspca_dev, 0x00, 0x8880, 3); err = spca50x_setup_qtable(gspca_dev, -- cgit v1.2.3