diff options
Diffstat (limited to 'drivers/media/video/gspca/spca501.c')
-rw-r--r-- | drivers/media/video/gspca/spca501.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/media/video/gspca/spca501.c b/drivers/media/video/gspca/spca501.c index 2064dc008af1..8cee6748d38f 100644 --- a/drivers/media/video/gspca/spca501.c +++ b/drivers/media/video/gspca/spca501.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/SPCA501 USB Camera Driver"); | 30 | MODULE_DESCRIPTION("GSPCA/SPCA501 USB Camera Driver"); |
@@ -1826,28 +1826,27 @@ static int reg_write(struct usb_device *dev, | |||
1826 | } | 1826 | } |
1827 | 1827 | ||
1828 | /* returns: negative is error, pos or zero is data */ | 1828 | /* returns: negative is error, pos or zero is data */ |
1829 | static int reg_read(struct usb_device *dev, | 1829 | static int reg_read(struct gspca_dev *gspca_dev, |
1830 | __u16 req, /* bRequest */ | 1830 | __u16 req, /* bRequest */ |
1831 | __u16 index, /* wIndex */ | 1831 | __u16 index, /* wIndex */ |
1832 | __u16 length) /* wLength (1 or 2 only) */ | 1832 | __u16 length) /* wLength (1 or 2 only) */ |
1833 | { | 1833 | { |
1834 | int ret; | 1834 | int ret; |
1835 | __u8 buf[2]; | ||
1836 | 1835 | ||
1837 | buf[1] = 0; | 1836 | gspca_dev->usb_buf[1] = 0; |
1838 | ret = usb_control_msg(dev, | 1837 | ret = usb_control_msg(gspca_dev->dev, |
1839 | usb_rcvctrlpipe(dev, 0), | 1838 | usb_rcvctrlpipe(gspca_dev->dev, 0), |
1840 | req, | 1839 | req, |
1841 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 1840 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
1842 | 0, /* value */ | 1841 | 0, /* value */ |
1843 | index, | 1842 | index, |
1844 | buf, length, | 1843 | gspca_dev->usb_buf, length, |
1845 | 500); /* timeout */ | 1844 | 500); /* timeout */ |
1846 | if (ret < 0) { | 1845 | if (ret < 0) { |
1847 | PDEBUG(D_ERR, "reg_read err %d", ret); | 1846 | PDEBUG(D_ERR, "reg_read err %d", ret); |
1848 | return -1; | 1847 | return -1; |
1849 | } | 1848 | } |
1850 | return (buf[1] << 8) + buf[0]; | 1849 | return (gspca_dev->usb_buf[1] << 8) + gspca_dev->usb_buf[0]; |
1851 | } | 1850 | } |
1852 | 1851 | ||
1853 | static int write_vector(struct gspca_dev *gspca_dev, | 1852 | static int write_vector(struct gspca_dev *gspca_dev, |
@@ -1883,7 +1882,7 @@ static void getbrightness(struct gspca_dev *gspca_dev) | |||
1883 | struct sd *sd = (struct sd *) gspca_dev; | 1882 | struct sd *sd = (struct sd *) gspca_dev; |
1884 | __u16 brightness; | 1883 | __u16 brightness; |
1885 | 1884 | ||
1886 | brightness = reg_read(gspca_dev->dev, SPCA501_REG_CCDSP, 0x11, 2); | 1885 | brightness = reg_read(gspca_dev, SPCA501_REG_CCDSP, 0x11, 2); |
1887 | sd->brightness = brightness << 1; | 1886 | sd->brightness = brightness << 1; |
1888 | } | 1887 | } |
1889 | 1888 | ||
@@ -1913,8 +1912,8 @@ static void getcolors(struct gspca_dev *gspca_dev) | |||
1913 | { | 1912 | { |
1914 | struct sd *sd = (struct sd *) gspca_dev; | 1913 | struct sd *sd = (struct sd *) gspca_dev; |
1915 | 1914 | ||
1916 | sd->colors = reg_read(gspca_dev->dev, SPCA501_REG_CCDSP, 0x0c, 2); | 1915 | sd->colors = reg_read(gspca_dev, SPCA501_REG_CCDSP, 0x0c, 2); |
1917 | /* sd->hue = (reg_read(gspca_dev->dev, SPCA501_REG_CCDSP, 0x13, */ | 1916 | /* sd->hue = (reg_read(gspca_dev, SPCA501_REG_CCDSP, 0x13, */ |
1918 | /* 2) & 0xFF) << 8; */ | 1917 | /* 2) & 0xFF) << 8; */ |
1919 | } | 1918 | } |
1920 | 1919 | ||