diff options
Diffstat (limited to 'drivers/media/video/gspca/spca505.c')
-rw-r--r-- | drivers/media/video/gspca/spca505.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/media/video/gspca/spca505.c b/drivers/media/video/gspca/spca505.c index 5d28d23b8375..ddea6e140aa8 100644 --- a/drivers/media/video/gspca/spca505.c +++ b/drivers/media/video/gspca/spca505.c | |||
@@ -23,8 +23,8 @@ | |||
23 | 23 | ||
24 | #include "gspca.h" | 24 | #include "gspca.h" |
25 | 25 | ||
26 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 5) | 26 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) |
27 | static const char version[] = "2.1.5"; | 27 | static const char version[] = "2.1.7"; |
28 | 28 | ||
29 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); | 29 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); |
30 | MODULE_DESCRIPTION("GSPCA/SPCA505 USB Camera Driver"); | 30 | MODULE_DESCRIPTION("GSPCA/SPCA505 USB Camera Driver"); |
@@ -593,29 +593,27 @@ static int reg_write(struct usb_device *dev, | |||
593 | } | 593 | } |
594 | 594 | ||
595 | /* returns: negative is error, pos or zero is data */ | 595 | /* returns: negative is error, pos or zero is data */ |
596 | static int reg_read(struct usb_device *dev, | 596 | static int reg_read(struct gspca_dev *gspca_dev, |
597 | __u16 reg, /* bRequest */ | 597 | __u16 reg, /* bRequest */ |
598 | __u16 index, /* wIndex */ | 598 | __u16 index, /* wIndex */ |
599 | __u16 length) /* wLength (1 or 2 only) */ | 599 | __u16 length) /* wLength (1 or 2 only) */ |
600 | { | 600 | { |
601 | int ret; | 601 | int ret; |
602 | __u8 buf[4]; | ||
603 | 602 | ||
604 | buf[1] = 0; | 603 | gspca_dev->usb_buf[1] = 0; |
605 | ret = usb_control_msg(dev, | 604 | ret = usb_control_msg(gspca_dev->dev, |
606 | usb_rcvctrlpipe(dev, 0), | 605 | usb_rcvctrlpipe(gspca_dev->dev, 0), |
607 | reg, | 606 | reg, |
608 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 607 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
609 | (__u16) 0, /* value */ | 608 | (__u16) 0, /* value */ |
610 | (__u16) index, | 609 | (__u16) index, |
611 | buf, | 610 | gspca_dev->usb_buf, length, |
612 | length, | ||
613 | 500); /* timeout */ | 611 | 500); /* timeout */ |
614 | if (ret < 0) { | 612 | if (ret < 0) { |
615 | PDEBUG(D_ERR, "reg_read err %d", ret); | 613 | PDEBUG(D_ERR, "reg_read err %d", ret); |
616 | return -1; | 614 | return -1; |
617 | } | 615 | } |
618 | return (buf[1] << 8) + buf[0]; | 616 | return (gspca_dev->usb_buf[1] << 8) + gspca_dev->usb_buf[0]; |
619 | } | 617 | } |
620 | 618 | ||
621 | static int write_vector(struct gspca_dev *gspca_dev, | 619 | static int write_vector(struct gspca_dev *gspca_dev, |
@@ -697,7 +695,7 @@ static int sd_open(struct gspca_dev *gspca_dev) | |||
697 | write_vector(gspca_dev, spca505b_open_data_ccd); | 695 | write_vector(gspca_dev, spca505b_open_data_ccd); |
698 | else | 696 | else |
699 | write_vector(gspca_dev, spca505_open_data_ccd); | 697 | write_vector(gspca_dev, spca505_open_data_ccd); |
700 | ret = reg_read(gspca_dev->dev, 6, 0x16, 2); | 698 | ret = reg_read(gspca_dev, 6, 0x16, 2); |
701 | 699 | ||
702 | if (ret < 0) { | 700 | if (ret < 0) { |
703 | PDEBUG(D_ERR|D_STREAM, | 701 | PDEBUG(D_ERR|D_STREAM, |
@@ -874,8 +872,8 @@ static void getbrightness(struct gspca_dev *gspca_dev) | |||
874 | struct sd *sd = (struct sd *) gspca_dev; | 872 | struct sd *sd = (struct sd *) gspca_dev; |
875 | 873 | ||
876 | sd->brightness = 255 | 874 | sd->brightness = 255 |
877 | - ((reg_read(gspca_dev->dev, 5, 0x01, 1) >> 2) | 875 | - ((reg_read(gspca_dev, 5, 0x01, 1) >> 2) |
878 | + (reg_read(gspca_dev->dev, 5, 0x0, 1) << 6)); | 876 | + (reg_read(gspca_dev, 5, 0x0, 1) << 6)); |
879 | } | 877 | } |
880 | 878 | ||
881 | static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val) | 879 | static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val) |