aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/spca501.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2008-11-17 12:52:56 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-29 14:53:38 -0500
commitcc043428e5869a629252665d3ecc86ee4c14db3d (patch)
treeac6aa8930a5eaf33bbdbe56ccd1820c63d508013 /drivers/media/video/gspca/spca501.c
parentdff369aad6407e7b123e239e9ea2f552299cf74c (diff)
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 e29954c1c38c..1fdaf8605b08 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,
1930 sd->contrast = sd_ctrls[MY_CONTRAST].qctrl.default_value; 1930 sd->contrast = sd_ctrls[MY_CONTRAST].qctrl.default_value;
1931 sd->colors = sd_ctrls[MY_COLOR].qctrl.default_value; 1931 sd->colors = sd_ctrls[MY_COLOR].qctrl.default_value;
1932 1932
1933 return 0;
1934}
1935
1936/* this function is called at probe and resume time */
1937static int sd_init(struct gspca_dev *gspca_dev)
1938{
1939 struct sd *sd = (struct sd *) gspca_dev;
1940
1933 switch (sd->subtype) { 1941 switch (sd->subtype) {
1934 case Arowana300KCMOSCamera: 1942 case Arowana300KCMOSCamera:
1935 case SmileIntlCamera: 1943 case SmileIntlCamera:
@@ -1948,15 +1956,17 @@ static int sd_config(struct gspca_dev *gspca_dev,
1948 goto error; 1956 goto error;
1949 break; 1957 break;
1950 } 1958 }
1959 PDEBUG(D_STREAM, "Initializing SPCA501 finished");
1951 return 0; 1960 return 0;
1952error: 1961error:
1953 return -EINVAL; 1962 return -EINVAL;
1954} 1963}
1955 1964
1956/* this function is called at probe and resume time */ 1965static int sd_start(struct gspca_dev *gspca_dev)
1957static int sd_init(struct gspca_dev *gspca_dev)
1958{ 1966{
1959 struct sd *sd = (struct sd *) gspca_dev; 1967 struct sd *sd = (struct sd *) gspca_dev;
1968 struct usb_device *dev = gspca_dev->dev;
1969 int mode;
1960 1970
1961 switch (sd->subtype) { 1971 switch (sd->subtype) {
1962 case ThreeComHomeConnectLite: 1972 case ThreeComHomeConnectLite:
@@ -1976,14 +1986,6 @@ static int sd_init(struct gspca_dev *gspca_dev)
1976 /* Generic 501 open data */ 1986 /* Generic 501 open data */
1977 write_vector(gspca_dev, spca501_open_data); 1987 write_vector(gspca_dev, spca501_open_data);
1978 } 1988 }
1979 PDEBUG(D_STREAM, "Initializing SPCA501 finished");
1980 return 0;
1981}
1982
1983static int sd_start(struct gspca_dev *gspca_dev)
1984{
1985 struct usb_device *dev = gspca_dev->dev;
1986 int mode;
1987 1989
1988 /* memorize the wanted pixel format */ 1990 /* memorize the wanted pixel format */
1989 mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; 1991 mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;