aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/spca501.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2008-11-17 14:52:56 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-29 17:53:38 -0200
commitcc043428e5869a629252665d3ecc86ee4c14db3d (patch)
treeac6aa8930a5eaf33bbdbe56ccd1820c63d508013 /drivers/media/video/gspca/spca501.c
parentdff369aad6407e7b123e239e9ea2f552299cf74c (diff)
downloadkernel_samsung_smdk4412-cc043428e5869a629252665d3ecc86ee4c14db3d.zip
kernel_samsung_smdk4412-cc043428e5869a629252665d3ecc86ee4c14db3d.tar.gz
kernel_samsung_smdk4412-cc043428e5869a629252665d3ecc86ee4c14db3d.tar.bz2
V4L/DVB (9685): gspca: Correct restart of webcams in spca501.
Currently the spca501 driver only works the first time used, then the cam needs to be unplugged or the driver reloaded, this is because currently the data which should be send each time the stream is started is send only once. Likewise currently the data to initialize the cam is send from the probe function, and thus will not get send after a suspend/resume. This patch fixes this by sending both at the right time. 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/gspca/spca501.c')
-rw-r--r--drivers/media/video/gspca/spca501.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/media/video/gspca/spca501.c b/drivers/media/video/gspca/spca501.c
index e29954c..1fdaf86 100644
--- a/drivers/media/video/gspca/spca501.c
+++ b/drivers/media/video/gspca/spca501.c
@@ -1930,6 +1930,14 @@ static int sd_config(struct gspca_dev *gspca_dev,
sd->contrast = sd_ctrls[MY_CONTRAST].qctrl.default_value;
sd->colors = sd_ctrls[MY_COLOR].qctrl.default_value;
+ return 0;
+}
+
+/* this function is called at probe and resume time */
+static int sd_init(struct gspca_dev *gspca_dev)
+{
+ struct sd *sd = (struct sd *) gspca_dev;
+
switch (sd->subtype) {
case Arowana300KCMOSCamera:
case SmileIntlCamera:
@@ -1948,15 +1956,17 @@ static int sd_config(struct gspca_dev *gspca_dev,
goto error;
break;
}
+ PDEBUG(D_STREAM, "Initializing SPCA501 finished");
return 0;
error:
return -EINVAL;
}
-/* this function is called at probe and resume time */
-static int sd_init(struct gspca_dev *gspca_dev)
+static int sd_start(struct gspca_dev *gspca_dev)
{
struct sd *sd = (struct sd *) gspca_dev;
+ struct usb_device *dev = gspca_dev->dev;
+ int mode;
switch (sd->subtype) {
case ThreeComHomeConnectLite:
@@ -1976,14 +1986,6 @@ static int sd_init(struct gspca_dev *gspca_dev)
/* Generic 501 open data */
write_vector(gspca_dev, spca501_open_data);
}
- PDEBUG(D_STREAM, "Initializing SPCA501 finished");
- return 0;
-}
-
-static int sd_start(struct gspca_dev *gspca_dev)
-{
- struct usb_device *dev = gspca_dev->dev;
- int mode;
/* memorize the wanted pixel format */
mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;