diff options
author | Hans de Goede <hdegoede@redhat.com> | 2008-11-17 12:56:41 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-29 14:53:38 -0500 |
commit | bd131f38aae2f354c4919790712f8ce89896f839 (patch) | |
tree | 3ec94b1c4d4f8762b658c0aaafb43a538eabcdc8 /drivers/media/video | |
parent | cc043428e5869a629252665d3ecc86ee4c14db3d (diff) |
V4L/DVB (9686): gspca: Don't return the control values from the webcams in spca501.
The bridge takes some time to update after a write, so apps doing a quick
write/read can get the old value back.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/gspca/spca501.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/drivers/media/video/gspca/spca501.c b/drivers/media/video/gspca/spca501.c index 1fdaf8605b08..b4a3c3cb42e1 100644 --- a/drivers/media/video/gspca/spca501.c +++ b/drivers/media/video/gspca/spca501.c | |||
@@ -1822,29 +1822,6 @@ static int reg_write(struct usb_device *dev, | |||
1822 | return ret; | 1822 | return ret; |
1823 | } | 1823 | } |
1824 | 1824 | ||
1825 | /* returns: negative is error, pos or zero is data */ | ||
1826 | static int reg_read(struct gspca_dev *gspca_dev, | ||
1827 | __u16 req, /* bRequest */ | ||
1828 | __u16 index, /* wIndex */ | ||
1829 | __u16 length) /* wLength (1 or 2 only) */ | ||
1830 | { | ||
1831 | int ret; | ||
1832 | |||
1833 | gspca_dev->usb_buf[1] = 0; | ||
1834 | ret = usb_control_msg(gspca_dev->dev, | ||
1835 | usb_rcvctrlpipe(gspca_dev->dev, 0), | ||
1836 | req, | ||
1837 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | ||
1838 | 0, /* value */ | ||
1839 | index, | ||
1840 | gspca_dev->usb_buf, length, | ||
1841 | 500); /* timeout */ | ||
1842 | if (ret < 0) { | ||
1843 | PDEBUG(D_ERR, "reg_read err %d", ret); | ||
1844 | return -1; | ||
1845 | } | ||
1846 | return (gspca_dev->usb_buf[1] << 8) + gspca_dev->usb_buf[0]; | ||
1847 | } | ||
1848 | 1825 | ||
1849 | static int write_vector(struct gspca_dev *gspca_dev, | 1826 | static int write_vector(struct gspca_dev *gspca_dev, |
1850 | const __u16 data[][3]) | 1827 | const __u16 data[][3]) |
@@ -1876,11 +1853,6 @@ static void setbrightness(struct gspca_dev *gspca_dev) | |||
1876 | 1853 | ||
1877 | static void getbrightness(struct gspca_dev *gspca_dev) | 1854 | static void getbrightness(struct gspca_dev *gspca_dev) |
1878 | { | 1855 | { |
1879 | struct sd *sd = (struct sd *) gspca_dev; | ||
1880 | __u16 brightness; | ||
1881 | |||
1882 | brightness = reg_read(gspca_dev, SPCA501_REG_CCDSP, 0x11, 2); | ||
1883 | sd->brightness = brightness << 1; | ||
1884 | } | 1856 | } |
1885 | 1857 | ||
1886 | static void setcontrast(struct gspca_dev *gspca_dev) | 1858 | static void setcontrast(struct gspca_dev *gspca_dev) |
@@ -1895,7 +1867,6 @@ static void setcontrast(struct gspca_dev *gspca_dev) | |||
1895 | 1867 | ||
1896 | static void getcontrast(struct gspca_dev *gspca_dev) | 1868 | static void getcontrast(struct gspca_dev *gspca_dev) |
1897 | { | 1869 | { |
1898 | /* spca50x->contrast = 0xaa01; */ | ||
1899 | } | 1870 | } |
1900 | 1871 | ||
1901 | static void setcolors(struct gspca_dev *gspca_dev) | 1872 | static void setcolors(struct gspca_dev *gspca_dev) |
@@ -1907,11 +1878,6 @@ static void setcolors(struct gspca_dev *gspca_dev) | |||
1907 | 1878 | ||
1908 | static void getcolors(struct gspca_dev *gspca_dev) | 1879 | static void getcolors(struct gspca_dev *gspca_dev) |
1909 | { | 1880 | { |
1910 | struct sd *sd = (struct sd *) gspca_dev; | ||
1911 | |||
1912 | sd->colors = reg_read(gspca_dev, SPCA501_REG_CCDSP, 0x0c, 2); | ||
1913 | /* sd->hue = (reg_read(gspca_dev, SPCA501_REG_CCDSP, 0x13, */ | ||
1914 | /* 2) & 0xFF) << 8; */ | ||
1915 | } | 1881 | } |
1916 | 1882 | ||
1917 | /* this function is called at probe time */ | 1883 | /* this function is called at probe time */ |