aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/pac207.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/gspca/pac207.c')
-rw-r--r--drivers/media/video/gspca/pac207.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/media/video/gspca/pac207.c b/drivers/media/video/gspca/pac207.c
index 57d48f51e3a0..482ef4a6afc0 100644
--- a/drivers/media/video/gspca/pac207.c
+++ b/drivers/media/video/gspca/pac207.c
@@ -27,8 +27,8 @@
27 27
28#include "gspca.h" 28#include "gspca.h"
29 29
30#define DRIVER_VERSION_NUMBER KERNEL_VERSION(0, 1, 1) 30#define DRIVER_VERSION_NUMBER KERNEL_VERSION(0, 2, 15)
31static const char version[] = "0.1.1"; 31static const char version[] = "0.2.15";
32 32
33MODULE_AUTHOR("Hans de Goede <j.w.r.degoede@hhs.nl>"); 33MODULE_AUTHOR("Hans de Goede <j.w.r.degoede@hhs.nl>");
34MODULE_DESCRIPTION("Pixart PAC207"); 34MODULE_DESCRIPTION("Pixart PAC207");
@@ -188,7 +188,8 @@ static const __u8 pac207_sensor_init[][8] = {
188 /* 48 reg_72 Rate Control end BalSize_4a =0x36 */ 188 /* 48 reg_72 Rate Control end BalSize_4a =0x36 */
189static const __u8 PacReg72[] = { 0x00, 0x00, 0x36, 0x00 }; 189static const __u8 PacReg72[] = { 0x00, 0x00, 0x36, 0x00 };
190 190
191static const char pac207_sof_marker[5] = { 0xff, 0xff, 0x00, 0xff, 0x96 }; 191static const unsigned char pac207_sof_marker[5] =
192 { 0xff, 0xff, 0x00, 0xff, 0x96 };
192 193
193int pac207_write_regs(struct gspca_dev *gspca_dev, u16 index, 194int pac207_write_regs(struct gspca_dev *gspca_dev, u16 index,
194 const u8 *buffer, u16 length) 195 const u8 *buffer, u16 length)
@@ -327,11 +328,12 @@ static void sd_start(struct gspca_dev *gspca_dev)
327 pac207_write_reg(gspca_dev, 0x02, sd->exposure); /* PXCK = 12MHz /n */ 328 pac207_write_reg(gspca_dev, 0x02, sd->exposure); /* PXCK = 12MHz /n */
328 329
329 mode = 0x02; /* Image Format (Bit 0), LED (1), Compr. test mode (2) */ 330 mode = 0x02; /* Image Format (Bit 0), LED (1), Compr. test mode (2) */
330 if (gspca_dev->width == 176) { /* 176x144 */ 331 if (gspca_dev->width == 176) { /* 176x144 */
331 mode |= 0x01; 332 mode |= 0x01;
332 PDEBUG(D_STREAM, "pac207_start mode 176x144"); 333 PDEBUG(D_STREAM, "pac207_start mode 176x144");
333 } else/* 352x288 */ 334 } else { /* 352x288 */
334 PDEBUG(D_STREAM, "pac207_start mode 352x288"); 335 PDEBUG(D_STREAM, "pac207_start mode 352x288");
336 }
335 pac207_write_reg(gspca_dev, 0x41, mode); 337 pac207_write_reg(gspca_dev, 0x41, mode);
336 338
337 pac207_write_reg(gspca_dev, 0x13, 0x01); /* Bit 0, auto clear */ 339 pac207_write_reg(gspca_dev, 0x13, 0x01); /* Bit 0, auto clear */
@@ -425,7 +427,7 @@ void init_pixart_decoder(void)
425} 427}
426 428
427/* auto gain and exposure algorithm based on the knee algorithm described here: 429/* auto gain and exposure algorithm based on the knee algorithm described here:
428 http://ytse.tricolour.net/docs/LowLightOptimization.html */ 430 * <http://ytse.tricolour.net/docs/LowLightOptimization.html> */
429static void pac207_do_auto_gain(struct gspca_dev *gspca_dev) 431static void pac207_do_auto_gain(struct gspca_dev *gspca_dev)
430{ 432{
431 struct sd *sd = (struct sd *) gspca_dev; 433 struct sd *sd = (struct sd *) gspca_dev;
@@ -508,8 +510,9 @@ static unsigned char *pac207_find_sof(struct gspca_dev *gspca_dev,
508 sd->sof_read = 0; 510 sd->sof_read = 0;
509 return m + i + 1; 511 return m + i + 1;
510 } 512 }
511 } else 513 } else {
512 sd->sof_read = 0; 514 sd->sof_read = 0;
515 }
513 } 516 }
514 517
515 return NULL; 518 return NULL;
@@ -556,9 +559,9 @@ static int pac207_decompress_row(struct gspca_dev *gspca_dev,
556 decoder_state->line_read++; 559 decoder_state->line_read++;
557 decoder_state->get_abs = 0; 560 decoder_state->get_abs = 0;
558 } else { 561 } else {
559 if (table[code].is_abs) 562 if (table[code].is_abs) {
560 decoder_state->get_abs = 1; 563 decoder_state->get_abs = 1;
561 else { 564 } else {
562 /* relative to left pixel */ 565 /* relative to left pixel */
563 val = outp[-2] + 566 val = outp[-2] +
564 table[code].val; 567 table[code].val;
@@ -894,13 +897,13 @@ static struct sd_desc sd_desc = {
894#define DVNM(name) .driver_info = (kernel_ulong_t) name 897#define DVNM(name) .driver_info = (kernel_ulong_t) name
895static __devinitdata struct usb_device_id device_table[] = { 898static __devinitdata struct usb_device_id device_table[] = {
896 {USB_DEVICE(0x041e, 0x4028), DVNM("Creative Webcam Vista Plus")}, 899 {USB_DEVICE(0x041e, 0x4028), DVNM("Creative Webcam Vista Plus")},
897 {USB_DEVICE(0x093a, 0x2460), DVNM("PAC207 Qtec Webcam 100")}, 900 {USB_DEVICE(0x093a, 0x2460), DVNM("Q-Tec Webcam 100")},
898 {USB_DEVICE(0x093a, 0x2463), DVNM("Philips spc200nc pac207")}, 901 {USB_DEVICE(0x093a, 0x2463), DVNM("Philips spc200nc pac207")},
899 {USB_DEVICE(0x093a, 0x2464), DVNM("Labtec Webcam 1200")}, 902 {USB_DEVICE(0x093a, 0x2464), DVNM("Labtec Webcam 1200")},
900 {USB_DEVICE(0x093a, 0x2468), DVNM("PAC207")}, 903 {USB_DEVICE(0x093a, 0x2468), DVNM("PAC207")},
901 {USB_DEVICE(0x093a, 0x2470), DVNM("Genius GF112")}, 904 {USB_DEVICE(0x093a, 0x2470), DVNM("Genius GF112")},
902 {USB_DEVICE(0x093a, 0x2471), DVNM("PAC207 Genius VideoCam ge111")}, 905 {USB_DEVICE(0x093a, 0x2471), DVNM("Genius VideoCam GE111")},
903 {USB_DEVICE(0x093a, 0x2472), DVNM("PAC207 Genius VideoCam ge110")}, 906 {USB_DEVICE(0x093a, 0x2472), DVNM("Genius VideoCam GE110")},
904 {USB_DEVICE(0x2001, 0xf115), DVNM("D-Link DSB-C120")}, 907 {USB_DEVICE(0x2001, 0xf115), DVNM("D-Link DSB-C120")},
905 {} 908 {}
906}; 909};
@@ -910,8 +913,8 @@ MODULE_DEVICE_TABLE(usb, device_table);
910static int sd_probe(struct usb_interface *intf, 913static int sd_probe(struct usb_interface *intf,
911 const struct usb_device_id *id) 914 const struct usb_device_id *id)
912{ 915{
913 PDEBUG(D_PROBE, "camera probe"); 916 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
914 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd)); 917 THIS_MODULE);
915} 918}
916 919
917static struct usb_driver sd_driver = { 920static struct usb_driver sd_driver = {