diff options
Diffstat (limited to 'drivers/media/video')
22 files changed, 89 insertions, 298 deletions
diff --git a/drivers/media/video/gspca/conex.c b/drivers/media/video/gspca/conex.c index 739ef557c434..3db5c1e3283a 100644 --- a/drivers/media/video/gspca/conex.c +++ b/drivers/media/video/gspca/conex.c | |||
@@ -826,8 +826,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
826 | return 0; | 826 | return 0; |
827 | } | 827 | } |
828 | 828 | ||
829 | /* this function is called at open time */ | 829 | /* this function is called at probe and resume time */ |
830 | static int sd_open(struct gspca_dev *gspca_dev) | 830 | static int sd_init(struct gspca_dev *gspca_dev) |
831 | { | 831 | { |
832 | cx11646_init1(gspca_dev); | 832 | cx11646_init1(gspca_dev); |
833 | cx11646_initsize(gspca_dev); | 833 | cx11646_initsize(gspca_dev); |
@@ -845,10 +845,6 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
845 | cx11646_jpeg(gspca_dev); | 845 | cx11646_jpeg(gspca_dev); |
846 | } | 846 | } |
847 | 847 | ||
848 | static void sd_stopN(struct gspca_dev *gspca_dev) | ||
849 | { | ||
850 | } | ||
851 | |||
852 | static void sd_stop0(struct gspca_dev *gspca_dev) | 848 | static void sd_stop0(struct gspca_dev *gspca_dev) |
853 | { | 849 | { |
854 | int retry = 50; | 850 | int retry = 50; |
@@ -871,10 +867,6 @@ static void sd_stop0(struct gspca_dev *gspca_dev) | |||
871 | reg_w_val(gspca_dev, 0x00fc, 0xe0); | 867 | reg_w_val(gspca_dev, 0x00fc, 0xe0); |
872 | } | 868 | } |
873 | 869 | ||
874 | static void sd_close(struct gspca_dev *gspca_dev) | ||
875 | { | ||
876 | } | ||
877 | |||
878 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 870 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
879 | struct gspca_frame *frame, /* target */ | 871 | struct gspca_frame *frame, /* target */ |
880 | __u8 *data, /* isoc packet */ | 872 | __u8 *data, /* isoc packet */ |
@@ -998,11 +990,9 @@ static struct sd_desc sd_desc = { | |||
998 | .ctrls = sd_ctrls, | 990 | .ctrls = sd_ctrls, |
999 | .nctrls = ARRAY_SIZE(sd_ctrls), | 991 | .nctrls = ARRAY_SIZE(sd_ctrls), |
1000 | .config = sd_config, | 992 | .config = sd_config, |
1001 | .open = sd_open, | 993 | .init = sd_init, |
1002 | .start = sd_start, | 994 | .start = sd_start, |
1003 | .stopN = sd_stopN, | ||
1004 | .stop0 = sd_stop0, | 995 | .stop0 = sd_stop0, |
1005 | .close = sd_close, | ||
1006 | .pkt_scan = sd_pkt_scan, | 996 | .pkt_scan = sd_pkt_scan, |
1007 | }; | 997 | }; |
1008 | 998 | ||
diff --git a/drivers/media/video/gspca/etoms.c b/drivers/media/video/gspca/etoms.c index e5a9eee673a9..c03b1f45de10 100644 --- a/drivers/media/video/gspca/etoms.c +++ b/drivers/media/video/gspca/etoms.c | |||
@@ -676,8 +676,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
676 | return 0; | 676 | return 0; |
677 | } | 677 | } |
678 | 678 | ||
679 | /* this function is called at open time */ | 679 | /* this function is called at probe and resume time */ |
680 | static int sd_open(struct gspca_dev *gspca_dev) | 680 | static int sd_init(struct gspca_dev *gspca_dev) |
681 | { | 681 | { |
682 | struct sd *sd = (struct sd *) gspca_dev; | 682 | struct sd *sd = (struct sd *) gspca_dev; |
683 | 683 | ||
@@ -711,14 +711,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
711 | et_video(gspca_dev, 0); /* video off */ | 711 | et_video(gspca_dev, 0); /* video off */ |
712 | } | 712 | } |
713 | 713 | ||
714 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
715 | { | ||
716 | } | ||
717 | |||
718 | static void sd_close(struct gspca_dev *gspca_dev) | ||
719 | { | ||
720 | } | ||
721 | |||
722 | static __u8 Et_getgainG(struct gspca_dev *gspca_dev) | 714 | static __u8 Et_getgainG(struct gspca_dev *gspca_dev) |
723 | { | 715 | { |
724 | struct sd *sd = (struct sd *) gspca_dev; | 716 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -895,11 +887,9 @@ static struct sd_desc sd_desc = { | |||
895 | .ctrls = sd_ctrls, | 887 | .ctrls = sd_ctrls, |
896 | .nctrls = ARRAY_SIZE(sd_ctrls), | 888 | .nctrls = ARRAY_SIZE(sd_ctrls), |
897 | .config = sd_config, | 889 | .config = sd_config, |
898 | .open = sd_open, | 890 | .init = sd_init, |
899 | .start = sd_start, | 891 | .start = sd_start, |
900 | .stopN = sd_stopN, | 892 | .stopN = sd_stopN, |
901 | .stop0 = sd_stop0, | ||
902 | .close = sd_close, | ||
903 | .pkt_scan = sd_pkt_scan, | 893 | .pkt_scan = sd_pkt_scan, |
904 | .dq_callback = do_autogain, | 894 | .dq_callback = do_autogain, |
905 | }; | 895 | }; |
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 1767991c1f4b..fe096e76e5c3 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c | |||
@@ -558,10 +558,12 @@ static void gspca_stream_off(struct gspca_dev *gspca_dev) | |||
558 | gspca_dev->streaming = 0; | 558 | gspca_dev->streaming = 0; |
559 | atomic_set(&gspca_dev->nevent, 0); | 559 | atomic_set(&gspca_dev->nevent, 0); |
560 | if (gspca_dev->present) { | 560 | if (gspca_dev->present) { |
561 | gspca_dev->sd_desc->stopN(gspca_dev); | 561 | if (gspca_dev->sd_desc->stopN) |
562 | gspca_dev->sd_desc->stopN(gspca_dev); | ||
562 | destroy_urbs(gspca_dev); | 563 | destroy_urbs(gspca_dev); |
563 | gspca_set_alt0(gspca_dev); | 564 | gspca_set_alt0(gspca_dev); |
564 | gspca_dev->sd_desc->stop0(gspca_dev); | 565 | if (gspca_dev->sd_desc->stop0) |
566 | gspca_dev->sd_desc->stop0(gspca_dev); | ||
565 | PDEBUG(D_STREAM, "stream off OK"); | 567 | PDEBUG(D_STREAM, "stream off OK"); |
566 | } | 568 | } |
567 | } | 569 | } |
@@ -770,19 +772,7 @@ static int dev_open(struct inode *inode, struct file *file) | |||
770 | goto out; | 772 | goto out; |
771 | } | 773 | } |
772 | 774 | ||
773 | /* if not done yet, initialize the sensor */ | 775 | if (gspca_dev->users > 4) { /* (arbitrary value) */ |
774 | if (gspca_dev->users == 0) { | ||
775 | if (mutex_lock_interruptible(&gspca_dev->usb_lock)) { | ||
776 | ret = -ERESTARTSYS; | ||
777 | goto out; | ||
778 | } | ||
779 | ret = gspca_dev->sd_desc->open(gspca_dev); | ||
780 | mutex_unlock(&gspca_dev->usb_lock); | ||
781 | if (ret != 0) { | ||
782 | PDEBUG(D_ERR|D_CONF, "init device failed %d", ret); | ||
783 | goto out; | ||
784 | } | ||
785 | } else if (gspca_dev->users > 4) { /* (arbitrary value) */ | ||
786 | ret = -EBUSY; | 776 | ret = -EBUSY; |
787 | goto out; | 777 | goto out; |
788 | } | 778 | } |
@@ -795,6 +785,7 @@ static int dev_open(struct inode *inode, struct file *file) | |||
795 | else | 785 | else |
796 | gspca_dev->vdev.debug &= ~3; | 786 | gspca_dev->vdev.debug &= ~3; |
797 | #endif | 787 | #endif |
788 | ret = 0; | ||
798 | out: | 789 | out: |
799 | mutex_unlock(&gspca_dev->queue_lock); | 790 | mutex_unlock(&gspca_dev->queue_lock); |
800 | if (ret != 0) | 791 | if (ret != 0) |
@@ -815,11 +806,6 @@ static int dev_close(struct inode *inode, struct file *file) | |||
815 | 806 | ||
816 | /* if the file did the capture, free the streaming resources */ | 807 | /* if the file did the capture, free the streaming resources */ |
817 | if (gspca_dev->capt_file == file) { | 808 | if (gspca_dev->capt_file == file) { |
818 | mutex_lock(&gspca_dev->usb_lock); | ||
819 | if (gspca_dev->streaming) | ||
820 | gspca_stream_off(gspca_dev); | ||
821 | gspca_dev->sd_desc->close(gspca_dev); | ||
822 | mutex_unlock(&gspca_dev->usb_lock); | ||
823 | frame_free(gspca_dev); | 809 | frame_free(gspca_dev); |
824 | gspca_dev->capt_file = NULL; | 810 | gspca_dev->capt_file = NULL; |
825 | gspca_dev->memory = GSPCA_MEMORY_NO; | 811 | gspca_dev->memory = GSPCA_MEMORY_NO; |
@@ -1747,10 +1733,13 @@ int gspca_dev_probe(struct usb_interface *intf, | |||
1747 | /* gspca_dev->users = 0; (done by kzalloc) */ | 1733 | /* gspca_dev->users = 0; (done by kzalloc) */ |
1748 | gspca_dev->nbufread = 2; | 1734 | gspca_dev->nbufread = 2; |
1749 | 1735 | ||
1750 | /* configure the subdriver */ | 1736 | /* configure the subdriver and initialize the USB device */ |
1751 | ret = gspca_dev->sd_desc->config(gspca_dev, id); | 1737 | ret = gspca_dev->sd_desc->config(gspca_dev, id); |
1752 | if (ret < 0) | 1738 | if (ret < 0) |
1753 | goto out; | 1739 | goto out; |
1740 | ret = gspca_dev->sd_desc->init(gspca_dev); | ||
1741 | if (ret < 0) | ||
1742 | goto out; | ||
1754 | ret = gspca_set_alt0(gspca_dev); | 1743 | ret = gspca_set_alt0(gspca_dev); |
1755 | if (ret < 0) | 1744 | if (ret < 0) |
1756 | goto out; | 1745 | goto out; |
@@ -1825,10 +1814,12 @@ int gspca_suspend(struct usb_interface *intf, pm_message_t message) | |||
1825 | if (!gspca_dev->streaming) | 1814 | if (!gspca_dev->streaming) |
1826 | return 0; | 1815 | return 0; |
1827 | gspca_dev->frozen = 1; /* avoid urb error messages */ | 1816 | gspca_dev->frozen = 1; /* avoid urb error messages */ |
1828 | gspca_dev->sd_desc->stopN(gspca_dev); | 1817 | if (gspca_dev->sd_desc->stopN) |
1818 | gspca_dev->sd_desc->stopN(gspca_dev); | ||
1829 | destroy_urbs(gspca_dev); | 1819 | destroy_urbs(gspca_dev); |
1830 | gspca_set_alt0(gspca_dev); | 1820 | gspca_set_alt0(gspca_dev); |
1831 | gspca_dev->sd_desc->stop0(gspca_dev); | 1821 | if (gspca_dev->sd_desc->stop0) |
1822 | gspca_dev->sd_desc->stop0(gspca_dev); | ||
1832 | return 0; | 1823 | return 0; |
1833 | } | 1824 | } |
1834 | EXPORT_SYMBOL(gspca_suspend); | 1825 | EXPORT_SYMBOL(gspca_suspend); |
@@ -1838,11 +1829,9 @@ int gspca_resume(struct usb_interface *intf) | |||
1838 | struct gspca_dev *gspca_dev = usb_get_intfdata(intf); | 1829 | struct gspca_dev *gspca_dev = usb_get_intfdata(intf); |
1839 | 1830 | ||
1840 | gspca_dev->frozen = 0; | 1831 | gspca_dev->frozen = 0; |
1841 | if (gspca_dev->users != 0) { | 1832 | gspca_dev->sd_desc->init(gspca_dev); |
1842 | gspca_dev->sd_desc->open(gspca_dev); | 1833 | if (gspca_dev->streaming) |
1843 | if (gspca_dev->streaming) | 1834 | return gspca_init_transfer(gspca_dev); |
1844 | return gspca_init_transfer(gspca_dev); | ||
1845 | } | ||
1846 | return 0; | 1835 | return 0; |
1847 | } | 1836 | } |
1848 | EXPORT_SYMBOL(gspca_resume); | 1837 | EXPORT_SYMBOL(gspca_resume); |
diff --git a/drivers/media/video/gspca/gspca.h b/drivers/media/video/gspca/gspca.h index a804ef18b8da..7c2f44b2397f 100644 --- a/drivers/media/video/gspca/gspca.h +++ b/drivers/media/video/gspca/gspca.h | |||
@@ -90,15 +90,14 @@ struct sd_desc { | |||
90 | /* controls */ | 90 | /* controls */ |
91 | const struct ctrl *ctrls; | 91 | const struct ctrl *ctrls; |
92 | int nctrls; | 92 | int nctrls; |
93 | /* operations */ | 93 | /* mandatory operations */ |
94 | cam_cf_op config; /* called on probe */ | 94 | cam_cf_op config; /* called on probe */ |
95 | cam_op open; /* called on open */ | 95 | cam_op init; /* called on probe and resume */ |
96 | cam_v_op start; /* called on stream on */ | 96 | cam_v_op start; /* called on stream on */ |
97 | cam_v_op stopN; /* called on stream off - main alt */ | ||
98 | cam_v_op stop0; /* called on stream off - alt 0 */ | ||
99 | cam_v_op close; /* called on close */ | ||
100 | cam_pkt_op pkt_scan; | 97 | cam_pkt_op pkt_scan; |
101 | /* optional operations */ | 98 | /* optional operations */ |
99 | cam_v_op stopN; /* called on stream off - main alt */ | ||
100 | cam_v_op stop0; /* called on stream off - alt 0 */ | ||
102 | cam_v_op dq_callback; /* called when a frame has been dequeued */ | 101 | cam_v_op dq_callback; /* called when a frame has been dequeued */ |
103 | cam_jpg_op get_jcomp; | 102 | cam_jpg_op get_jcomp; |
104 | cam_jpg_op set_jcomp; | 103 | cam_jpg_op set_jcomp; |
diff --git a/drivers/media/video/gspca/mars.c b/drivers/media/video/gspca/mars.c index d7e209578186..281475913a61 100644 --- a/drivers/media/video/gspca/mars.c +++ b/drivers/media/video/gspca/mars.c | |||
@@ -144,8 +144,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
144 | return 0; | 144 | return 0; |
145 | } | 145 | } |
146 | 146 | ||
147 | /* this function is called at open time */ | 147 | /* this function is called at probe and resume time */ |
148 | static int sd_open(struct gspca_dev *gspca_dev) | 148 | static int sd_init(struct gspca_dev *gspca_dev) |
149 | { | 149 | { |
150 | return 0; | 150 | return 0; |
151 | } | 151 | } |
@@ -358,14 +358,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
358 | PDEBUG(D_ERR, "Camera Stop failed"); | 358 | PDEBUG(D_ERR, "Camera Stop failed"); |
359 | } | 359 | } |
360 | 360 | ||
361 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
362 | { | ||
363 | } | ||
364 | |||
365 | static void sd_close(struct gspca_dev *gspca_dev) | ||
366 | { | ||
367 | } | ||
368 | |||
369 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 361 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
370 | struct gspca_frame *frame, /* target */ | 362 | struct gspca_frame *frame, /* target */ |
371 | __u8 *data, /* isoc packet */ | 363 | __u8 *data, /* isoc packet */ |
@@ -411,11 +403,9 @@ static const struct sd_desc sd_desc = { | |||
411 | .ctrls = sd_ctrls, | 403 | .ctrls = sd_ctrls, |
412 | .nctrls = ARRAY_SIZE(sd_ctrls), | 404 | .nctrls = ARRAY_SIZE(sd_ctrls), |
413 | .config = sd_config, | 405 | .config = sd_config, |
414 | .open = sd_open, | 406 | .init = sd_init, |
415 | .start = sd_start, | 407 | .start = sd_start, |
416 | .stopN = sd_stopN, | 408 | .stopN = sd_stopN, |
417 | .stop0 = sd_stop0, | ||
418 | .close = sd_close, | ||
419 | .pkt_scan = sd_pkt_scan, | 409 | .pkt_scan = sd_pkt_scan, |
420 | }; | 410 | }; |
421 | 411 | ||
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c index 4062aed24139..19378dde27c6 100644 --- a/drivers/media/video/gspca/ov519.c +++ b/drivers/media/video/gspca/ov519.c | |||
@@ -1376,8 +1376,8 @@ error: | |||
1376 | return -EBUSY; | 1376 | return -EBUSY; |
1377 | } | 1377 | } |
1378 | 1378 | ||
1379 | /* this function is called at open time */ | 1379 | /* this function is called at probe and resume time */ |
1380 | static int sd_open(struct gspca_dev *gspca_dev) | 1380 | static int sd_init(struct gspca_dev *gspca_dev) |
1381 | { | 1381 | { |
1382 | struct sd *sd = (struct sd *) gspca_dev; | 1382 | struct sd *sd = (struct sd *) gspca_dev; |
1383 | 1383 | ||
@@ -1877,14 +1877,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
1877 | ov51x_led_control((struct sd *) gspca_dev, 0); | 1877 | ov51x_led_control((struct sd *) gspca_dev, 0); |
1878 | } | 1878 | } |
1879 | 1879 | ||
1880 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
1881 | { | ||
1882 | } | ||
1883 | |||
1884 | static void sd_close(struct gspca_dev *gspca_dev) | ||
1885 | { | ||
1886 | } | ||
1887 | |||
1888 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 1880 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
1889 | struct gspca_frame *frame, /* target */ | 1881 | struct gspca_frame *frame, /* target */ |
1890 | __u8 *data, /* isoc packet */ | 1882 | __u8 *data, /* isoc packet */ |
@@ -2141,11 +2133,9 @@ static const struct sd_desc sd_desc = { | |||
2141 | .ctrls = sd_ctrls, | 2133 | .ctrls = sd_ctrls, |
2142 | .nctrls = ARRAY_SIZE(sd_ctrls), | 2134 | .nctrls = ARRAY_SIZE(sd_ctrls), |
2143 | .config = sd_config, | 2135 | .config = sd_config, |
2144 | .open = sd_open, | 2136 | .init = sd_init, |
2145 | .start = sd_start, | 2137 | .start = sd_start, |
2146 | .stopN = sd_stopN, | 2138 | .stopN = sd_stopN, |
2147 | .stop0 = sd_stop0, | ||
2148 | .close = sd_close, | ||
2149 | .pkt_scan = sd_pkt_scan, | 2139 | .pkt_scan = sd_pkt_scan, |
2150 | }; | 2140 | }; |
2151 | 2141 | ||
diff --git a/drivers/media/video/gspca/pac207.c b/drivers/media/video/gspca/pac207.c index e6b5c8a5b5d9..a15bccad947b 100644 --- a/drivers/media/video/gspca/pac207.c +++ b/drivers/media/video/gspca/pac207.c | |||
@@ -273,8 +273,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
273 | return 0; | 273 | return 0; |
274 | } | 274 | } |
275 | 275 | ||
276 | /* this function is called at open time */ | 276 | /* this function is called at probe and resume time */ |
277 | static int sd_open(struct gspca_dev *gspca_dev) | 277 | static int sd_init(struct gspca_dev *gspca_dev) |
278 | { | 278 | { |
279 | pac207_write_reg(gspca_dev, 0x41, 0x00); | 279 | pac207_write_reg(gspca_dev, 0x41, 0x00); |
280 | /* Bit_0=Image Format, | 280 | /* Bit_0=Image Format, |
@@ -338,15 +338,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
338 | pac207_write_reg(gspca_dev, 0x0f, 0x00); /* Power Control */ | 338 | pac207_write_reg(gspca_dev, 0x0f, 0x00); /* Power Control */ |
339 | } | 339 | } |
340 | 340 | ||
341 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
342 | { | ||
343 | } | ||
344 | |||
345 | /* this function is called at close time */ | ||
346 | static void sd_close(struct gspca_dev *gspca_dev) | ||
347 | { | ||
348 | } | ||
349 | |||
350 | static void pac207_do_auto_gain(struct gspca_dev *gspca_dev) | 341 | static void pac207_do_auto_gain(struct gspca_dev *gspca_dev) |
351 | { | 342 | { |
352 | struct sd *sd = (struct sd *) gspca_dev; | 343 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -532,11 +523,9 @@ static const struct sd_desc sd_desc = { | |||
532 | .ctrls = sd_ctrls, | 523 | .ctrls = sd_ctrls, |
533 | .nctrls = ARRAY_SIZE(sd_ctrls), | 524 | .nctrls = ARRAY_SIZE(sd_ctrls), |
534 | .config = sd_config, | 525 | .config = sd_config, |
535 | .open = sd_open, | 526 | .init = sd_init, |
536 | .start = sd_start, | 527 | .start = sd_start, |
537 | .stopN = sd_stopN, | 528 | .stopN = sd_stopN, |
538 | .stop0 = sd_stop0, | ||
539 | .close = sd_close, | ||
540 | .dq_callback = pac207_do_auto_gain, | 529 | .dq_callback = pac207_do_auto_gain, |
541 | .pkt_scan = sd_pkt_scan, | 530 | .pkt_scan = sd_pkt_scan, |
542 | }; | 531 | }; |
diff --git a/drivers/media/video/gspca/pac7311.c b/drivers/media/video/gspca/pac7311.c index 69d610062d00..e22ca610334f 100644 --- a/drivers/media/video/gspca/pac7311.c +++ b/drivers/media/video/gspca/pac7311.c | |||
@@ -590,8 +590,8 @@ static void sethvflip(struct gspca_dev *gspca_dev) | |||
590 | reg_w(gspca_dev, 0x11, 0x01); | 590 | reg_w(gspca_dev, 0x11, 0x01); |
591 | } | 591 | } |
592 | 592 | ||
593 | /* this function is called at open time */ | 593 | /* this function is called at probe and resume time */ |
594 | static int sd_open(struct gspca_dev *gspca_dev) | 594 | static int sd_init(struct gspca_dev *gspca_dev) |
595 | { | 595 | { |
596 | return 0; | 596 | return 0; |
597 | } | 597 | } |
@@ -691,11 +691,6 @@ static void sd_stop0(struct gspca_dev *gspca_dev) | |||
691 | } | 691 | } |
692 | } | 692 | } |
693 | 693 | ||
694 | /* this function is called at close time */ | ||
695 | static void sd_close(struct gspca_dev *gspca_dev) | ||
696 | { | ||
697 | } | ||
698 | |||
699 | static void do_autogain(struct gspca_dev *gspca_dev) | 694 | static void do_autogain(struct gspca_dev *gspca_dev) |
700 | { | 695 | { |
701 | } | 696 | } |
@@ -902,11 +897,10 @@ static struct sd_desc sd_desc = { | |||
902 | .ctrls = sd_ctrls, | 897 | .ctrls = sd_ctrls, |
903 | .nctrls = ARRAY_SIZE(sd_ctrls), | 898 | .nctrls = ARRAY_SIZE(sd_ctrls), |
904 | .config = sd_config, | 899 | .config = sd_config, |
905 | .open = sd_open, | 900 | .init = sd_init, |
906 | .start = sd_start, | 901 | .start = sd_start, |
907 | .stopN = sd_stopN, | 902 | .stopN = sd_stopN, |
908 | .stop0 = sd_stop0, | 903 | .stop0 = sd_stop0, |
909 | .close = sd_close, | ||
910 | .pkt_scan = sd_pkt_scan, | 904 | .pkt_scan = sd_pkt_scan, |
911 | .dq_callback = do_autogain, | 905 | .dq_callback = do_autogain, |
912 | }; | 906 | }; |
diff --git a/drivers/media/video/gspca/sonixb.c b/drivers/media/video/gspca/sonixb.c index 64aae060a934..044a9ec58db5 100644 --- a/drivers/media/video/gspca/sonixb.c +++ b/drivers/media/video/gspca/sonixb.c | |||
@@ -799,8 +799,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
799 | return 0; | 799 | return 0; |
800 | } | 800 | } |
801 | 801 | ||
802 | /* this function is called at open time */ | 802 | /* this function is called at probe and resume time */ |
803 | static int sd_open(struct gspca_dev *gspca_dev) | 803 | static int sd_init(struct gspca_dev *gspca_dev) |
804 | { | 804 | { |
805 | return 0; | 805 | return 0; |
806 | } | 806 | } |
@@ -963,14 +963,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
963 | reg_w(gspca_dev, 0x01, &ByteSend, 1); | 963 | reg_w(gspca_dev, 0x01, &ByteSend, 1); |
964 | } | 964 | } |
965 | 965 | ||
966 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
967 | { | ||
968 | } | ||
969 | |||
970 | static void sd_close(struct gspca_dev *gspca_dev) | ||
971 | { | ||
972 | } | ||
973 | |||
974 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 966 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
975 | struct gspca_frame *frame, /* target */ | 967 | struct gspca_frame *frame, /* target */ |
976 | unsigned char *data, /* isoc packet */ | 968 | unsigned char *data, /* isoc packet */ |
@@ -1162,11 +1154,9 @@ static const struct sd_desc sd_desc = { | |||
1162 | .ctrls = sd_ctrls, | 1154 | .ctrls = sd_ctrls, |
1163 | .nctrls = ARRAY_SIZE(sd_ctrls), | 1155 | .nctrls = ARRAY_SIZE(sd_ctrls), |
1164 | .config = sd_config, | 1156 | .config = sd_config, |
1165 | .open = sd_open, | 1157 | .init = sd_init, |
1166 | .start = sd_start, | 1158 | .start = sd_start, |
1167 | .stopN = sd_stopN, | 1159 | .stopN = sd_stopN, |
1168 | .stop0 = sd_stop0, | ||
1169 | .close = sd_close, | ||
1170 | .pkt_scan = sd_pkt_scan, | 1160 | .pkt_scan = sd_pkt_scan, |
1171 | .querymenu = sd_querymenu, | 1161 | .querymenu = sd_querymenu, |
1172 | .dq_callback = do_autogain, | 1162 | .dq_callback = do_autogain, |
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c index e657b8ba6db7..5380b4323a70 100644 --- a/drivers/media/video/gspca/sonixj.c +++ b/drivers/media/video/gspca/sonixj.c | |||
@@ -948,8 +948,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
948 | return 0; | 948 | return 0; |
949 | } | 949 | } |
950 | 950 | ||
951 | /* this function is called at open time */ | 951 | /* this function is called at probe and resume time */ |
952 | static int sd_open(struct gspca_dev *gspca_dev) | 952 | static int sd_init(struct gspca_dev *gspca_dev) |
953 | { | 953 | { |
954 | struct sd *sd = (struct sd *) gspca_dev; | 954 | struct sd *sd = (struct sd *) gspca_dev; |
955 | /* const __u8 *sn9c1xx; */ | 955 | /* const __u8 *sn9c1xx; */ |
@@ -1353,14 +1353,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
1353 | reg_w1(gspca_dev, 0xf1, 0x00); | 1353 | reg_w1(gspca_dev, 0xf1, 0x00); |
1354 | } | 1354 | } |
1355 | 1355 | ||
1356 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
1357 | { | ||
1358 | } | ||
1359 | |||
1360 | static void sd_close(struct gspca_dev *gspca_dev) | ||
1361 | { | ||
1362 | } | ||
1363 | |||
1364 | static void do_autogain(struct gspca_dev *gspca_dev) | 1356 | static void do_autogain(struct gspca_dev *gspca_dev) |
1365 | { | 1357 | { |
1366 | struct sd *sd = (struct sd *) gspca_dev; | 1358 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -1548,11 +1540,9 @@ static const struct sd_desc sd_desc = { | |||
1548 | .ctrls = sd_ctrls, | 1540 | .ctrls = sd_ctrls, |
1549 | .nctrls = ARRAY_SIZE(sd_ctrls), | 1541 | .nctrls = ARRAY_SIZE(sd_ctrls), |
1550 | .config = sd_config, | 1542 | .config = sd_config, |
1551 | .open = sd_open, | 1543 | .init = sd_init, |
1552 | .start = sd_start, | 1544 | .start = sd_start, |
1553 | .stopN = sd_stopN, | 1545 | .stopN = sd_stopN, |
1554 | .stop0 = sd_stop0, | ||
1555 | .close = sd_close, | ||
1556 | .pkt_scan = sd_pkt_scan, | 1546 | .pkt_scan = sd_pkt_scan, |
1557 | .dq_callback = do_autogain, | 1547 | .dq_callback = do_autogain, |
1558 | }; | 1548 | }; |
diff --git a/drivers/media/video/gspca/spca500.c b/drivers/media/video/gspca/spca500.c index 5a20385fb170..6e733901fcca 100644 --- a/drivers/media/video/gspca/spca500.c +++ b/drivers/media/video/gspca/spca500.c | |||
@@ -645,8 +645,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
645 | return 0; | 645 | return 0; |
646 | } | 646 | } |
647 | 647 | ||
648 | /* this function is called at open time */ | 648 | /* this function is called at probe and resume time */ |
649 | static int sd_open(struct gspca_dev *gspca_dev) | 649 | static int sd_init(struct gspca_dev *gspca_dev) |
650 | { | 650 | { |
651 | struct sd *sd = (struct sd *) gspca_dev; | 651 | struct sd *sd = (struct sd *) gspca_dev; |
652 | 652 | ||
@@ -880,14 +880,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
880 | gspca_dev->usb_buf[0]); | 880 | gspca_dev->usb_buf[0]); |
881 | } | 881 | } |
882 | 882 | ||
883 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
884 | { | ||
885 | } | ||
886 | |||
887 | static void sd_close(struct gspca_dev *gspca_dev) | ||
888 | { | ||
889 | } | ||
890 | |||
891 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 883 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
892 | struct gspca_frame *frame, /* target */ | 884 | struct gspca_frame *frame, /* target */ |
893 | __u8 *data, /* isoc packet */ | 885 | __u8 *data, /* isoc packet */ |
@@ -1051,11 +1043,9 @@ static struct sd_desc sd_desc = { | |||
1051 | .ctrls = sd_ctrls, | 1043 | .ctrls = sd_ctrls, |
1052 | .nctrls = ARRAY_SIZE(sd_ctrls), | 1044 | .nctrls = ARRAY_SIZE(sd_ctrls), |
1053 | .config = sd_config, | 1045 | .config = sd_config, |
1054 | .open = sd_open, | 1046 | .init = sd_init, |
1055 | .start = sd_start, | 1047 | .start = sd_start, |
1056 | .stopN = sd_stopN, | 1048 | .stopN = sd_stopN, |
1057 | .stop0 = sd_stop0, | ||
1058 | .close = sd_close, | ||
1059 | .pkt_scan = sd_pkt_scan, | 1049 | .pkt_scan = sd_pkt_scan, |
1060 | }; | 1050 | }; |
1061 | 1051 | ||
diff --git a/drivers/media/video/gspca/spca501.c b/drivers/media/video/gspca/spca501.c index 525f1b3400e4..e9eb59bae4fb 100644 --- a/drivers/media/video/gspca/spca501.c +++ b/drivers/media/video/gspca/spca501.c | |||
@@ -1953,8 +1953,8 @@ error: | |||
1953 | return -EINVAL; | 1953 | return -EINVAL; |
1954 | } | 1954 | } |
1955 | 1955 | ||
1956 | /* this function is called at open time */ | 1956 | /* this function is called at probe and resume time */ |
1957 | static int sd_open(struct gspca_dev *gspca_dev) | 1957 | static int sd_init(struct gspca_dev *gspca_dev) |
1958 | { | 1958 | { |
1959 | struct sd *sd = (struct sd *) gspca_dev; | 1959 | struct sd *sd = (struct sd *) gspca_dev; |
1960 | 1960 | ||
@@ -2023,11 +2023,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
2023 | 2023 | ||
2024 | static void sd_stop0(struct gspca_dev *gspca_dev) | 2024 | static void sd_stop0(struct gspca_dev *gspca_dev) |
2025 | { | 2025 | { |
2026 | } | ||
2027 | |||
2028 | /* this function is called at close time */ | ||
2029 | static void sd_close(struct gspca_dev *gspca_dev) | ||
2030 | { | ||
2031 | reg_write(gspca_dev->dev, SPCA501_REG_CTLRL, 0x05, 0x00); | 2026 | reg_write(gspca_dev->dev, SPCA501_REG_CTLRL, 0x05, 0x00); |
2032 | } | 2027 | } |
2033 | 2028 | ||
@@ -2120,11 +2115,10 @@ static const struct sd_desc sd_desc = { | |||
2120 | .ctrls = sd_ctrls, | 2115 | .ctrls = sd_ctrls, |
2121 | .nctrls = ARRAY_SIZE(sd_ctrls), | 2116 | .nctrls = ARRAY_SIZE(sd_ctrls), |
2122 | .config = sd_config, | 2117 | .config = sd_config, |
2123 | .open = sd_open, | 2118 | .init = sd_init, |
2124 | .start = sd_start, | 2119 | .start = sd_start, |
2125 | .stopN = sd_stopN, | 2120 | .stopN = sd_stopN, |
2126 | .stop0 = sd_stop0, | 2121 | .stop0 = sd_stop0, |
2127 | .close = sd_close, | ||
2128 | .pkt_scan = sd_pkt_scan, | 2122 | .pkt_scan = sd_pkt_scan, |
2129 | }; | 2123 | }; |
2130 | 2124 | ||
diff --git a/drivers/media/video/gspca/spca505.c b/drivers/media/video/gspca/spca505.c index 8f00558c2f59..f601daf19ebe 100644 --- a/drivers/media/video/gspca/spca505.c +++ b/drivers/media/video/gspca/spca505.c | |||
@@ -655,8 +655,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
655 | return 0; | 655 | return 0; |
656 | } | 656 | } |
657 | 657 | ||
658 | /* this function is called at open time */ | 658 | /* this function is called at probe and resume time */ |
659 | static int sd_open(struct gspca_dev *gspca_dev) | 659 | static int sd_init(struct gspca_dev *gspca_dev) |
660 | { | 660 | { |
661 | struct sd *sd = (struct sd *) gspca_dev; | 661 | struct sd *sd = (struct sd *) gspca_dev; |
662 | int ret; | 662 | int ret; |
@@ -743,11 +743,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
743 | 743 | ||
744 | static void sd_stop0(struct gspca_dev *gspca_dev) | 744 | static void sd_stop0(struct gspca_dev *gspca_dev) |
745 | { | 745 | { |
746 | } | ||
747 | |||
748 | /* this function is called at close time */ | ||
749 | static void sd_close(struct gspca_dev *gspca_dev) | ||
750 | { | ||
751 | /* This maybe reset or power control */ | 746 | /* This maybe reset or power control */ |
752 | reg_write(gspca_dev->dev, 0x03, 0x03, 0x20); | 747 | reg_write(gspca_dev->dev, 0x03, 0x03, 0x20); |
753 | reg_write(gspca_dev->dev, 0x03, 0x01, 0x0); | 748 | reg_write(gspca_dev->dev, 0x03, 0x01, 0x0); |
@@ -825,11 +820,10 @@ static const struct sd_desc sd_desc = { | |||
825 | .ctrls = sd_ctrls, | 820 | .ctrls = sd_ctrls, |
826 | .nctrls = ARRAY_SIZE(sd_ctrls), | 821 | .nctrls = ARRAY_SIZE(sd_ctrls), |
827 | .config = sd_config, | 822 | .config = sd_config, |
828 | .open = sd_open, | 823 | .init = sd_init, |
829 | .start = sd_start, | 824 | .start = sd_start, |
830 | .stopN = sd_stopN, | 825 | .stopN = sd_stopN, |
831 | .stop0 = sd_stop0, | 826 | .stop0 = sd_stop0, |
832 | .close = sd_close, | ||
833 | .pkt_scan = sd_pkt_scan, | 827 | .pkt_scan = sd_pkt_scan, |
834 | }; | 828 | }; |
835 | 829 | ||
diff --git a/drivers/media/video/gspca/spca506.c b/drivers/media/video/gspca/spca506.c index ae772488cf73..195dce96ef06 100644 --- a/drivers/media/video/gspca/spca506.c +++ b/drivers/media/video/gspca/spca506.c | |||
@@ -313,8 +313,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
313 | return 0; | 313 | return 0; |
314 | } | 314 | } |
315 | 315 | ||
316 | /* this function is called at open time */ | 316 | /* this function is called at probe and resume time */ |
317 | static int sd_open(struct gspca_dev *gspca_dev) | 317 | static int sd_init(struct gspca_dev *gspca_dev) |
318 | { | 318 | { |
319 | struct usb_device *dev = gspca_dev->dev; | 319 | struct usb_device *dev = gspca_dev->dev; |
320 | 320 | ||
@@ -560,14 +560,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
560 | reg_w(dev, 0x03, 0x00, 0x0003); | 560 | reg_w(dev, 0x03, 0x00, 0x0003); |
561 | } | 561 | } |
562 | 562 | ||
563 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
564 | { | ||
565 | } | ||
566 | |||
567 | static void sd_close(struct gspca_dev *gspca_dev) | ||
568 | { | ||
569 | } | ||
570 | |||
571 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 563 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
572 | struct gspca_frame *frame, /* target */ | 564 | struct gspca_frame *frame, /* target */ |
573 | __u8 *data, /* isoc packet */ | 565 | __u8 *data, /* isoc packet */ |
@@ -740,11 +732,9 @@ static struct sd_desc sd_desc = { | |||
740 | .ctrls = sd_ctrls, | 732 | .ctrls = sd_ctrls, |
741 | .nctrls = ARRAY_SIZE(sd_ctrls), | 733 | .nctrls = ARRAY_SIZE(sd_ctrls), |
742 | .config = sd_config, | 734 | .config = sd_config, |
743 | .open = sd_open, | 735 | .init = sd_init, |
744 | .start = sd_start, | 736 | .start = sd_start, |
745 | .stopN = sd_stopN, | 737 | .stopN = sd_stopN, |
746 | .stop0 = sd_stop0, | ||
747 | .close = sd_close, | ||
748 | .pkt_scan = sd_pkt_scan, | 738 | .pkt_scan = sd_pkt_scan, |
749 | }; | 739 | }; |
750 | 740 | ||
diff --git a/drivers/media/video/gspca/spca508.c b/drivers/media/video/gspca/spca508.c index 7b38c4e70fdf..281ce02103a3 100644 --- a/drivers/media/video/gspca/spca508.c +++ b/drivers/media/video/gspca/spca508.c | |||
@@ -1521,8 +1521,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1521 | return 0; /* success */ | 1521 | return 0; /* success */ |
1522 | } | 1522 | } |
1523 | 1523 | ||
1524 | /* this function is called at open time */ | 1524 | /* this function is called at probe and resume time */ |
1525 | static int sd_open(struct gspca_dev *gspca_dev) | 1525 | static int sd_init(struct gspca_dev *gspca_dev) |
1526 | { | 1526 | { |
1527 | /* write_vector(gspca_dev, spca508_open_data); */ | 1527 | /* write_vector(gspca_dev, spca508_open_data); */ |
1528 | return 0; | 1528 | return 0; |
@@ -1554,15 +1554,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
1554 | reg_write(gspca_dev->dev, 0x8112, 0x20); | 1554 | reg_write(gspca_dev->dev, 0x8112, 0x20); |
1555 | } | 1555 | } |
1556 | 1556 | ||
1557 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
1558 | { | ||
1559 | } | ||
1560 | |||
1561 | /* this function is called at close time */ | ||
1562 | static void sd_close(struct gspca_dev *gspca_dev) | ||
1563 | { | ||
1564 | } | ||
1565 | |||
1566 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 1557 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
1567 | struct gspca_frame *frame, /* target */ | 1558 | struct gspca_frame *frame, /* target */ |
1568 | __u8 *data, /* isoc packet */ | 1559 | __u8 *data, /* isoc packet */ |
@@ -1633,11 +1624,9 @@ static const struct sd_desc sd_desc = { | |||
1633 | .ctrls = sd_ctrls, | 1624 | .ctrls = sd_ctrls, |
1634 | .nctrls = ARRAY_SIZE(sd_ctrls), | 1625 | .nctrls = ARRAY_SIZE(sd_ctrls), |
1635 | .config = sd_config, | 1626 | .config = sd_config, |
1636 | .open = sd_open, | 1627 | .init = sd_init, |
1637 | .start = sd_start, | 1628 | .start = sd_start, |
1638 | .stopN = sd_stopN, | 1629 | .stopN = sd_stopN, |
1639 | .stop0 = sd_stop0, | ||
1640 | .close = sd_close, | ||
1641 | .pkt_scan = sd_pkt_scan, | 1630 | .pkt_scan = sd_pkt_scan, |
1642 | }; | 1631 | }; |
1643 | 1632 | ||
diff --git a/drivers/media/video/gspca/spca561.c b/drivers/media/video/gspca/spca561.c index b6a013f1dec4..2ca509daf0b4 100644 --- a/drivers/media/video/gspca/spca561.c +++ b/drivers/media/video/gspca/spca561.c | |||
@@ -560,14 +560,14 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
560 | return 0; | 560 | return 0; |
561 | } | 561 | } |
562 | 562 | ||
563 | /* this function is called at open time */ | 563 | /* this function is called at probe and resume time */ |
564 | static int sd_open_12a(struct gspca_dev *gspca_dev) | 564 | static int sd_init_12a(struct gspca_dev *gspca_dev) |
565 | { | 565 | { |
566 | PDEBUG(D_STREAM, "Chip revision: 012a"); | 566 | PDEBUG(D_STREAM, "Chip revision: 012a"); |
567 | init_161rev12A(gspca_dev); | 567 | init_161rev12A(gspca_dev); |
568 | return 0; | 568 | return 0; |
569 | } | 569 | } |
570 | static int sd_open_72a(struct gspca_dev *gspca_dev) | 570 | static int sd_init_72a(struct gspca_dev *gspca_dev) |
571 | { | 571 | { |
572 | PDEBUG(D_STREAM, "Chip revision: 072a"); | 572 | PDEBUG(D_STREAM, "Chip revision: 072a"); |
573 | write_vector(gspca_dev, spca561_init_data); | 573 | write_vector(gspca_dev, spca561_init_data); |
@@ -733,12 +733,7 @@ static void sd_stop0(struct gspca_dev *gspca_dev) | |||
733 | reg_w_val(gspca_dev->dev, 0x8118, 0x29); | 733 | reg_w_val(gspca_dev->dev, 0x8118, 0x29); |
734 | reg_w_val(gspca_dev->dev, 0x8114, 0x08); | 734 | reg_w_val(gspca_dev->dev, 0x8114, 0x08); |
735 | } | 735 | } |
736 | } | 736 | /* reg_w_val(gspca_dev->dev, 0x8114, 0); */ |
737 | |||
738 | /* this function is called at close time */ | ||
739 | static void sd_close(struct gspca_dev *gspca_dev) | ||
740 | { | ||
741 | reg_w_val(gspca_dev->dev, 0x8114, 0); | ||
742 | } | 737 | } |
743 | 738 | ||
744 | static void do_autogain(struct gspca_dev *gspca_dev) | 739 | static void do_autogain(struct gspca_dev *gspca_dev) |
@@ -1121,11 +1116,10 @@ static const struct sd_desc sd_desc_12a = { | |||
1121 | .ctrls = sd_ctrls_12a, | 1116 | .ctrls = sd_ctrls_12a, |
1122 | .nctrls = ARRAY_SIZE(sd_ctrls_12a), | 1117 | .nctrls = ARRAY_SIZE(sd_ctrls_12a), |
1123 | .config = sd_config, | 1118 | .config = sd_config, |
1124 | .open = sd_open_12a, | 1119 | .init = sd_init_12a, |
1125 | .start = sd_start_12a, | 1120 | .start = sd_start_12a, |
1126 | .stopN = sd_stopN, | 1121 | .stopN = sd_stopN, |
1127 | .stop0 = sd_stop0, | 1122 | .stop0 = sd_stop0, |
1128 | .close = sd_close, | ||
1129 | .pkt_scan = sd_pkt_scan, | 1123 | .pkt_scan = sd_pkt_scan, |
1130 | /* .dq_callback = do_autogain, * fixme */ | 1124 | /* .dq_callback = do_autogain, * fixme */ |
1131 | }; | 1125 | }; |
@@ -1134,11 +1128,10 @@ static const struct sd_desc sd_desc_72a = { | |||
1134 | .ctrls = sd_ctrls_72a, | 1128 | .ctrls = sd_ctrls_72a, |
1135 | .nctrls = ARRAY_SIZE(sd_ctrls_72a), | 1129 | .nctrls = ARRAY_SIZE(sd_ctrls_72a), |
1136 | .config = sd_config, | 1130 | .config = sd_config, |
1137 | .open = sd_open_72a, | 1131 | .init = sd_init_72a, |
1138 | .start = sd_start_72a, | 1132 | .start = sd_start_72a, |
1139 | .stopN = sd_stopN, | 1133 | .stopN = sd_stopN, |
1140 | .stop0 = sd_stop0, | 1134 | .stop0 = sd_stop0, |
1141 | .close = sd_close, | ||
1142 | .pkt_scan = sd_pkt_scan, | 1135 | .pkt_scan = sd_pkt_scan, |
1143 | .dq_callback = do_autogain, | 1136 | .dq_callback = do_autogain, |
1144 | }; | 1137 | }; |
diff --git a/drivers/media/video/gspca/stk014.c b/drivers/media/video/gspca/stk014.c index 387a8cf2b3b1..2f2de429e273 100644 --- a/drivers/media/video/gspca/stk014.c +++ b/drivers/media/video/gspca/stk014.c | |||
@@ -306,8 +306,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
306 | return 0; | 306 | return 0; |
307 | } | 307 | } |
308 | 308 | ||
309 | /* this function is called at open time */ | 309 | /* this function is called at probe and resume time */ |
310 | static int sd_open(struct gspca_dev *gspca_dev) | 310 | static int sd_init(struct gspca_dev *gspca_dev) |
311 | { | 311 | { |
312 | int ret; | 312 | int ret; |
313 | 313 | ||
@@ -398,14 +398,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
398 | PDEBUG(D_STREAM, "camera stopped"); | 398 | PDEBUG(D_STREAM, "camera stopped"); |
399 | } | 399 | } |
400 | 400 | ||
401 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
402 | { | ||
403 | } | ||
404 | |||
405 | static void sd_close(struct gspca_dev *gspca_dev) | ||
406 | { | ||
407 | } | ||
408 | |||
409 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 401 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
410 | struct gspca_frame *frame, /* target */ | 402 | struct gspca_frame *frame, /* target */ |
411 | __u8 *data, /* isoc packet */ | 403 | __u8 *data, /* isoc packet */ |
@@ -535,11 +527,9 @@ static const struct sd_desc sd_desc = { | |||
535 | .ctrls = sd_ctrls, | 527 | .ctrls = sd_ctrls, |
536 | .nctrls = ARRAY_SIZE(sd_ctrls), | 528 | .nctrls = ARRAY_SIZE(sd_ctrls), |
537 | .config = sd_config, | 529 | .config = sd_config, |
538 | .open = sd_open, | 530 | .init = sd_init, |
539 | .start = sd_start, | 531 | .start = sd_start, |
540 | .stopN = sd_stopN, | 532 | .stopN = sd_stopN, |
541 | .stop0 = sd_stop0, | ||
542 | .close = sd_close, | ||
543 | .pkt_scan = sd_pkt_scan, | 533 | .pkt_scan = sd_pkt_scan, |
544 | .querymenu = sd_querymenu, | 534 | .querymenu = sd_querymenu, |
545 | }; | 535 | }; |
diff --git a/drivers/media/video/gspca/sunplus.c b/drivers/media/video/gspca/sunplus.c index c935384fc232..bddf73360c25 100644 --- a/drivers/media/video/gspca/sunplus.c +++ b/drivers/media/video/gspca/sunplus.c | |||
@@ -848,8 +848,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
848 | return 0; | 848 | return 0; |
849 | } | 849 | } |
850 | 850 | ||
851 | /* this function is called at open time */ | 851 | /* this function is called at probe and resume time */ |
852 | static int sd_open(struct gspca_dev *gspca_dev) | 852 | static int sd_init(struct gspca_dev *gspca_dev) |
853 | { | 853 | { |
854 | struct sd *sd = (struct sd *) gspca_dev; | 854 | struct sd *sd = (struct sd *) gspca_dev; |
855 | struct usb_device *dev = gspca_dev->dev; | 855 | struct usb_device *dev = gspca_dev->dev; |
@@ -1069,14 +1069,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
1069 | } | 1069 | } |
1070 | } | 1070 | } |
1071 | 1071 | ||
1072 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
1073 | { | ||
1074 | } | ||
1075 | |||
1076 | static void sd_close(struct gspca_dev *gspca_dev) | ||
1077 | { | ||
1078 | } | ||
1079 | |||
1080 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 1072 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
1081 | struct gspca_frame *frame, /* target */ | 1073 | struct gspca_frame *frame, /* target */ |
1082 | __u8 *data, /* isoc packet */ | 1074 | __u8 *data, /* isoc packet */ |
@@ -1369,11 +1361,9 @@ static const struct sd_desc sd_desc = { | |||
1369 | .ctrls = sd_ctrls, | 1361 | .ctrls = sd_ctrls, |
1370 | .nctrls = ARRAY_SIZE(sd_ctrls), | 1362 | .nctrls = ARRAY_SIZE(sd_ctrls), |
1371 | .config = sd_config, | 1363 | .config = sd_config, |
1372 | .open = sd_open, | 1364 | .init = sd_init, |
1373 | .start = sd_start, | 1365 | .start = sd_start, |
1374 | .stopN = sd_stopN, | 1366 | .stopN = sd_stopN, |
1375 | .stop0 = sd_stop0, | ||
1376 | .close = sd_close, | ||
1377 | .pkt_scan = sd_pkt_scan, | 1367 | .pkt_scan = sd_pkt_scan, |
1378 | }; | 1368 | }; |
1379 | 1369 | ||
diff --git a/drivers/media/video/gspca/t613.c b/drivers/media/video/gspca/t613.c index 962c1df58297..81b175e15ca7 100644 --- a/drivers/media/video/gspca/t613.c +++ b/drivers/media/video/gspca/t613.c | |||
@@ -552,6 +552,13 @@ static int init_default_parameters(struct gspca_dev *gspca_dev) | |||
552 | return 0; | 552 | return 0; |
553 | } | 553 | } |
554 | 554 | ||
555 | /* this function is called at probe and resume time */ | ||
556 | static int sd_init(struct gspca_dev *gspca_dev) | ||
557 | { | ||
558 | init_default_parameters(gspca_dev); | ||
559 | return 0; | ||
560 | } | ||
561 | |||
555 | static void setbrightness(struct gspca_dev *gspca_dev) | 562 | static void setbrightness(struct gspca_dev *gspca_dev) |
556 | { | 563 | { |
557 | struct sd *sd = (struct sd *) gspca_dev; | 564 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -893,18 +900,6 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
893 | setcolors(gspca_dev); | 900 | setcolors(gspca_dev); |
894 | } | 901 | } |
895 | 902 | ||
896 | static void sd_stopN(struct gspca_dev *gspca_dev) | ||
897 | { | ||
898 | } | ||
899 | |||
900 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
901 | { | ||
902 | } | ||
903 | |||
904 | static void sd_close(struct gspca_dev *gspca_dev) | ||
905 | { | ||
906 | } | ||
907 | |||
908 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 903 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
909 | struct gspca_frame *frame, /* target */ | 904 | struct gspca_frame *frame, /* target */ |
910 | __u8 *data, /* isoc packet */ | 905 | __u8 *data, /* isoc packet */ |
@@ -972,24 +967,14 @@ static int sd_querymenu(struct gspca_dev *gspca_dev, | |||
972 | return -EINVAL; | 967 | return -EINVAL; |
973 | } | 968 | } |
974 | 969 | ||
975 | /* this function is called at open time */ | ||
976 | static int sd_open(struct gspca_dev *gspca_dev) | ||
977 | { | ||
978 | init_default_parameters(gspca_dev); | ||
979 | return 0; | ||
980 | } | ||
981 | |||
982 | /* sub-driver description */ | 970 | /* sub-driver description */ |
983 | static const struct sd_desc sd_desc = { | 971 | static const struct sd_desc sd_desc = { |
984 | .name = MODULE_NAME, | 972 | .name = MODULE_NAME, |
985 | .ctrls = sd_ctrls, | 973 | .ctrls = sd_ctrls, |
986 | .nctrls = ARRAY_SIZE(sd_ctrls), | 974 | .nctrls = ARRAY_SIZE(sd_ctrls), |
987 | .config = sd_config, | 975 | .config = sd_config, |
988 | .open = sd_open, | 976 | .init = sd_init, |
989 | .start = sd_start, | 977 | .start = sd_start, |
990 | .stopN = sd_stopN, | ||
991 | .stop0 = sd_stop0, | ||
992 | .close = sd_close, | ||
993 | .pkt_scan = sd_pkt_scan, | 978 | .pkt_scan = sd_pkt_scan, |
994 | .querymenu = sd_querymenu, | 979 | .querymenu = sd_querymenu, |
995 | }; | 980 | }; |
diff --git a/drivers/media/video/gspca/tv8532.c b/drivers/media/video/gspca/tv8532.c index d2273624a91d..084af05302a0 100644 --- a/drivers/media/video/gspca/tv8532.c +++ b/drivers/media/video/gspca/tv8532.c | |||
@@ -331,8 +331,8 @@ static void tv_8532_PollReg(struct gspca_dev *gspca_dev) | |||
331 | } | 331 | } |
332 | } | 332 | } |
333 | 333 | ||
334 | /* this function is called at open time */ | 334 | /* this function is called at probe and resume time */ |
335 | static int sd_open(struct gspca_dev *gspca_dev) | 335 | static int sd_init(struct gspca_dev *gspca_dev) |
336 | { | 336 | { |
337 | reg_w_1(gspca_dev, TV8532_AD_SLOPE, 0x32); | 337 | reg_w_1(gspca_dev, TV8532_AD_SLOPE, 0x32); |
338 | reg_w_1(gspca_dev, TV8532_AD_BITCTRL, 0x00); | 338 | reg_w_1(gspca_dev, TV8532_AD_BITCTRL, 0x00); |
@@ -450,14 +450,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
450 | reg_w_1(gspca_dev, TV8532_GPIO_OE, 0x0b); | 450 | reg_w_1(gspca_dev, TV8532_GPIO_OE, 0x0b); |
451 | } | 451 | } |
452 | 452 | ||
453 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
454 | { | ||
455 | } | ||
456 | |||
457 | static void sd_close(struct gspca_dev *gspca_dev) | ||
458 | { | ||
459 | } | ||
460 | |||
461 | static void tv8532_preprocess(struct gspca_dev *gspca_dev) | 453 | static void tv8532_preprocess(struct gspca_dev *gspca_dev) |
462 | { | 454 | { |
463 | struct sd *sd = (struct sd *) gspca_dev; | 455 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -611,11 +603,9 @@ static const struct sd_desc sd_desc = { | |||
611 | .ctrls = sd_ctrls, | 603 | .ctrls = sd_ctrls, |
612 | .nctrls = ARRAY_SIZE(sd_ctrls), | 604 | .nctrls = ARRAY_SIZE(sd_ctrls), |
613 | .config = sd_config, | 605 | .config = sd_config, |
614 | .open = sd_open, | 606 | .init = sd_init, |
615 | .start = sd_start, | 607 | .start = sd_start, |
616 | .stopN = sd_stopN, | 608 | .stopN = sd_stopN, |
617 | .stop0 = sd_stop0, | ||
618 | .close = sd_close, | ||
619 | .pkt_scan = sd_pkt_scan, | 609 | .pkt_scan = sd_pkt_scan, |
620 | }; | 610 | }; |
621 | 611 | ||
diff --git a/drivers/media/video/gspca/vc032x.c b/drivers/media/video/gspca/vc032x.c index 5454f0eb0077..f8c3ff30e464 100644 --- a/drivers/media/video/gspca/vc032x.c +++ b/drivers/media/video/gspca/vc032x.c | |||
@@ -1477,8 +1477,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1477 | return 0; | 1477 | return 0; |
1478 | } | 1478 | } |
1479 | 1479 | ||
1480 | /* this function is called at open time */ | 1480 | /* this function is called at probe and time */ |
1481 | static int sd_open(struct gspca_dev *gspca_dev) | 1481 | static int sd_init(struct gspca_dev *gspca_dev) |
1482 | { | 1482 | { |
1483 | return 0; | 1483 | return 0; |
1484 | } | 1484 | } |
@@ -1640,19 +1640,6 @@ static void sd_stop0(struct gspca_dev *gspca_dev) | |||
1640 | reg_w(dev, 0x89, 0xffff, 0xffff); | 1640 | reg_w(dev, 0x89, 0xffff, 0xffff); |
1641 | } | 1641 | } |
1642 | 1642 | ||
1643 | /* this function is called at close time */ | ||
1644 | static void sd_close(struct gspca_dev *gspca_dev) | ||
1645 | { | ||
1646 | /* struct usb_device *dev = gspca_dev->dev; | ||
1647 | __u8 buffread; | ||
1648 | |||
1649 | reg_w(dev, 0x89, 0xffff, 0xffff); | ||
1650 | reg_w(dev, 0xa0, 0x01, 0xb301); | ||
1651 | reg_w(dev, 0xa0, 0x09, 0xb303); | ||
1652 | reg_w(dev, 0x89, 0xffff, 0xffff); | ||
1653 | */ | ||
1654 | } | ||
1655 | |||
1656 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 1643 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
1657 | struct gspca_frame *frame, /* target */ | 1644 | struct gspca_frame *frame, /* target */ |
1658 | __u8 *data, /* isoc packet */ | 1645 | __u8 *data, /* isoc packet */ |
@@ -1741,11 +1728,10 @@ static const struct sd_desc sd_desc = { | |||
1741 | .ctrls = sd_ctrls, | 1728 | .ctrls = sd_ctrls, |
1742 | .nctrls = ARRAY_SIZE(sd_ctrls), | 1729 | .nctrls = ARRAY_SIZE(sd_ctrls), |
1743 | .config = sd_config, | 1730 | .config = sd_config, |
1744 | .open = sd_open, | 1731 | .init = sd_init, |
1745 | .start = sd_start, | 1732 | .start = sd_start, |
1746 | .stopN = sd_stopN, | 1733 | .stopN = sd_stopN, |
1747 | .stop0 = sd_stop0, | 1734 | .stop0 = sd_stop0, |
1748 | .close = sd_close, | ||
1749 | .pkt_scan = sd_pkt_scan, | 1735 | .pkt_scan = sd_pkt_scan, |
1750 | .querymenu = sd_querymenu, | 1736 | .querymenu = sd_querymenu, |
1751 | }; | 1737 | }; |
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c index e78b9b7591d5..f4239b442c11 100644 --- a/drivers/media/video/gspca/zc3xx.c +++ b/drivers/media/video/gspca/zc3xx.c | |||
@@ -7171,8 +7171,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
7171 | return 0; | 7171 | return 0; |
7172 | } | 7172 | } |
7173 | 7173 | ||
7174 | /* this function is called at open time */ | 7174 | /* this function is called at probe and resume time */ |
7175 | static int sd_open(struct gspca_dev *gspca_dev) | 7175 | static int sd_init(struct gspca_dev *gspca_dev) |
7176 | { | 7176 | { |
7177 | reg_w(gspca_dev->dev, 0x01, 0x0000); | 7177 | reg_w(gspca_dev->dev, 0x01, 0x0000); |
7178 | return 0; | 7178 | return 0; |
@@ -7333,10 +7333,6 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
7333 | } | 7333 | } |
7334 | } | 7334 | } |
7335 | 7335 | ||
7336 | static void sd_stopN(struct gspca_dev *gspca_dev) | ||
7337 | { | ||
7338 | } | ||
7339 | |||
7340 | static void sd_stop0(struct gspca_dev *gspca_dev) | 7336 | static void sd_stop0(struct gspca_dev *gspca_dev) |
7341 | { | 7337 | { |
7342 | struct sd *sd = (struct sd *) gspca_dev; | 7338 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -7344,11 +7340,6 @@ static void sd_stop0(struct gspca_dev *gspca_dev) | |||
7344 | send_unknown(gspca_dev->dev, sd->sensor); | 7340 | send_unknown(gspca_dev->dev, sd->sensor); |
7345 | } | 7341 | } |
7346 | 7342 | ||
7347 | /* this function is called at close time */ | ||
7348 | static void sd_close(struct gspca_dev *gspca_dev) | ||
7349 | { | ||
7350 | } | ||
7351 | |||
7352 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 7343 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
7353 | struct gspca_frame *frame, | 7344 | struct gspca_frame *frame, |
7354 | __u8 *data, | 7345 | __u8 *data, |
@@ -7508,11 +7499,9 @@ static const struct sd_desc sd_desc = { | |||
7508 | .ctrls = sd_ctrls, | 7499 | .ctrls = sd_ctrls, |
7509 | .nctrls = sizeof sd_ctrls / sizeof sd_ctrls[0], | 7500 | .nctrls = sizeof sd_ctrls / sizeof sd_ctrls[0], |
7510 | .config = sd_config, | 7501 | .config = sd_config, |
7511 | .open = sd_open, | 7502 | .init = sd_init, |
7512 | .start = sd_start, | 7503 | .start = sd_start, |
7513 | .stopN = sd_stopN, | ||
7514 | .stop0 = sd_stop0, | 7504 | .stop0 = sd_stop0, |
7515 | .close = sd_close, | ||
7516 | .pkt_scan = sd_pkt_scan, | 7505 | .pkt_scan = sd_pkt_scan, |
7517 | .querymenu = sd_querymenu, | 7506 | .querymenu = sd_querymenu, |
7518 | }; | 7507 | }; |