summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2009-01-24 19:42:50 +0100
committerJean-Francois Moine <moinejf@free.fr>2009-01-24 19:42:50 +0100
commit4f88214011b62804c9a7ddb4de27f4a9c798cbea (patch)
tree19dd59fa2b78fd0b948c4893c84c5fc9407f9841 /linux
parente30891c22cbad9f8099004481b43588f84905801 (diff)
downloadmediapointer-dvb-s2-4f88214011b62804c9a7ddb4de27f4a9c798cbea.tar.gz
mediapointer-dvb-s2-4f88214011b62804c9a7ddb4de27f4a9c798cbea.tar.bz2
gspca - spca505: Move some sequences from probe to streamon.
From: Jean-Francois Moine <moinejf@free.fr> The webcams worked only one time after connection. Priority: normal Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/gspca/spca505.c49
1 files changed, 24 insertions, 25 deletions
diff --git a/linux/drivers/media/video/gspca/spca505.c b/linux/drivers/media/video/gspca/spca505.c
index b9139b1ed..4fc54d8b8 100644
--- a/linux/drivers/media/video/gspca/spca505.c
+++ b/linux/drivers/media/video/gspca/spca505.c
@@ -650,31 +650,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
/* 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;
- int ret;
-
- if (sd->subtype == Nxultra)
- write_vector(gspca_dev, spca505b_open_data_ccd);
- else
- write_vector(gspca_dev, spca505_open_data_ccd);
- ret = reg_read(gspca_dev, 0x06, 0x16);
-
- if (ret < 0) {
- PDEBUG(D_ERR|D_CONF,
- "register read failed err: %d",
- ret);
- return ret;
- }
- if (ret != 0x0101) {
- PDEBUG(D_ERR|D_CONF,
- "After vector read returns 0x%04x should be 0x0101",
- ret);
- }
-
- ret = reg_write(gspca_dev->dev, 0x06, 0x16, 0x0a);
- if (ret < 0)
- return ret;
- reg_write(gspca_dev->dev, 0x05, 0xc2, 0x12);
return 0;
}
@@ -689,6 +664,7 @@ static void setbrightness(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 ret, mode;
static u8 mode_tb[][3] = {
@@ -700,6 +676,29 @@ static int sd_start(struct gspca_dev *gspca_dev)
{0x05, 0x40, 0x40} /* 160x120 */
};
+ if (sd->subtype == Nxultra)
+ write_vector(gspca_dev, spca505b_open_data_ccd);
+ else
+ write_vector(gspca_dev, spca505_open_data_ccd);
+ ret = reg_read(gspca_dev, 0x06, 0x16);
+
+ if (ret < 0) {
+ PDEBUG(D_ERR|D_CONF,
+ "register read failed err: %d",
+ ret);
+ return ret;
+ }
+ if (ret != 0x0101) {
+ PDEBUG(D_ERR|D_CONF,
+ "After vector read returns 0x%04x should be 0x0101",
+ ret);
+ }
+
+ ret = reg_write(gspca_dev->dev, 0x06, 0x16, 0x0a);
+ if (ret < 0)
+ return ret;
+ reg_write(gspca_dev->dev, 0x05, 0xc2, 0x12);
+
/* necessary because without it we can see stream
* only once after loading module */
/* stopping usb registers Tomasz change */