diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2009-01-24 13:42:50 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:42:34 -0400 |
commit | 1de1ddf35752485fd1b7774385b72f0f618058fd (patch) | |
tree | b7276b8703e41ce8cf220de7d6c1ccc509044ecc /drivers/media/video/gspca/spca505.c | |
parent | a5df5c14335988317da4ba9aec64b7eb971a6ffc (diff) |
V4L/DVB (10387): gspca - spca505: Move some sequences from probe to streamon.
The webcams worked only one time after connection.
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/spca505.c')
-rw-r--r-- | drivers/media/video/gspca/spca505.c | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/drivers/media/video/gspca/spca505.c b/drivers/media/video/gspca/spca505.c index b9139b1edac9..4fc54d8b84aa 100644 --- a/drivers/media/video/gspca/spca505.c +++ b/drivers/media/video/gspca/spca505.c | |||
@@ -650,31 +650,6 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
650 | /* this function is called at probe and resume time */ | 650 | /* this function is called at probe and resume time */ |
651 | static int sd_init(struct gspca_dev *gspca_dev) | 651 | static int sd_init(struct gspca_dev *gspca_dev) |
652 | { | 652 | { |
653 | struct sd *sd = (struct sd *) gspca_dev; | ||
654 | int ret; | ||
655 | |||
656 | if (sd->subtype == Nxultra) | ||
657 | write_vector(gspca_dev, spca505b_open_data_ccd); | ||
658 | else | ||
659 | write_vector(gspca_dev, spca505_open_data_ccd); | ||
660 | ret = reg_read(gspca_dev, 0x06, 0x16); | ||
661 | |||
662 | if (ret < 0) { | ||
663 | PDEBUG(D_ERR|D_CONF, | ||
664 | "register read failed err: %d", | ||
665 | ret); | ||
666 | return ret; | ||
667 | } | ||
668 | if (ret != 0x0101) { | ||
669 | PDEBUG(D_ERR|D_CONF, | ||
670 | "After vector read returns 0x%04x should be 0x0101", | ||
671 | ret); | ||
672 | } | ||
673 | |||
674 | ret = reg_write(gspca_dev->dev, 0x06, 0x16, 0x0a); | ||
675 | if (ret < 0) | ||
676 | return ret; | ||
677 | reg_write(gspca_dev->dev, 0x05, 0xc2, 0x12); | ||
678 | return 0; | 653 | return 0; |
679 | } | 654 | } |
680 | 655 | ||
@@ -689,6 +664,7 @@ static void setbrightness(struct gspca_dev *gspca_dev) | |||
689 | 664 | ||
690 | static int sd_start(struct gspca_dev *gspca_dev) | 665 | static int sd_start(struct gspca_dev *gspca_dev) |
691 | { | 666 | { |
667 | struct sd *sd = (struct sd *) gspca_dev; | ||
692 | struct usb_device *dev = gspca_dev->dev; | 668 | struct usb_device *dev = gspca_dev->dev; |
693 | int ret, mode; | 669 | int ret, mode; |
694 | static u8 mode_tb[][3] = { | 670 | static u8 mode_tb[][3] = { |
@@ -700,6 +676,29 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
700 | {0x05, 0x40, 0x40} /* 160x120 */ | 676 | {0x05, 0x40, 0x40} /* 160x120 */ |
701 | }; | 677 | }; |
702 | 678 | ||
679 | if (sd->subtype == Nxultra) | ||
680 | write_vector(gspca_dev, spca505b_open_data_ccd); | ||
681 | else | ||
682 | write_vector(gspca_dev, spca505_open_data_ccd); | ||
683 | ret = reg_read(gspca_dev, 0x06, 0x16); | ||
684 | |||
685 | if (ret < 0) { | ||
686 | PDEBUG(D_ERR|D_CONF, | ||
687 | "register read failed err: %d", | ||
688 | ret); | ||
689 | return ret; | ||
690 | } | ||
691 | if (ret != 0x0101) { | ||
692 | PDEBUG(D_ERR|D_CONF, | ||
693 | "After vector read returns 0x%04x should be 0x0101", | ||
694 | ret); | ||
695 | } | ||
696 | |||
697 | ret = reg_write(gspca_dev->dev, 0x06, 0x16, 0x0a); | ||
698 | if (ret < 0) | ||
699 | return ret; | ||
700 | reg_write(gspca_dev->dev, 0x05, 0xc2, 0x12); | ||
701 | |||
703 | /* necessary because without it we can see stream | 702 | /* necessary because without it we can see stream |
704 | * only once after loading module */ | 703 | * only once after loading module */ |
705 | /* stopping usb registers Tomasz change */ | 704 | /* stopping usb registers Tomasz change */ |