aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2006-01-08 18:43:39 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-31 20:23:42 -0500
commit7f2c01ab8ad50c74d174acdd814ddb53383bee93 (patch)
tree0cad74779f6e8deff6508372e5a83ceddc9f81a8
parentbf8b2b5345145d41d39035b80f36c8e17342d833 (diff)
[PATCH] USB: drivers/usb/media/w9968cf.c: remove hooks for the vpp module
- the w9968cf-vpp module is not intended for inclusion into the kernel - the upstream w9968cf package shipping the w9968cf-vpp module suggests to simply replace the w9968cf module shipped with the kernel Therefore, there seems to be no good reason spending some bytes of kernel memory for hooks for the w9968cf-vpp module. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Luca Risolia <luca.risolia@studio.unibo.it> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--Documentation/usb/w9968cf.txt30
-rw-r--r--drivers/usb/media/w9968cf.c128
-rw-r--r--drivers/usb/media/w9968cf.h1
-rw-r--r--drivers/usb/media/w9968cf_vpp.h3
4 files changed, 6 insertions, 156 deletions
diff --git a/Documentation/usb/w9968cf.txt b/Documentation/usb/w9968cf.txt
index 18a47738d56c..9d46cd0b19e3 100644
--- a/Documentation/usb/w9968cf.txt
+++ b/Documentation/usb/w9968cf.txt
@@ -57,16 +57,12 @@ based cameras should be supported as well.
57The driver is divided into two modules: the basic one, "w9968cf", is needed for 57The driver is divided into two modules: the basic one, "w9968cf", is needed for
58the supported devices to work; the second one, "w9968cf-vpp", is an optional 58the supported devices to work; the second one, "w9968cf-vpp", is an optional
59module, which provides some useful video post-processing functions like video 59module, which provides some useful video post-processing functions like video
60decoding, up-scaling and colour conversions. Once the driver is installed, 60decoding, up-scaling and colour conversions.
61every time an application tries to open a recognized device, "w9968cf" checks
62the presence of the "w9968cf-vpp" module and loads it automatically by default.
63 61
64Please keep in mind that official kernels do not include the second module for 62Note that the official kernels do neither include nor support the second
65performance purposes. However it is always recommended to download and install 63module for performance purposes. Therefore, it is always recommended to
66the latest and complete release of the driver, replacing the existing one, if 64download and install the latest and complete release of the driver,
67present: it will be still even possible not to load the "w9968cf-vpp" module at 65replacing the existing one, if present.
68all, if you ever want to. Another important missing feature of the version in
69the official Linux 2.4 kernels is the writeable /proc filesystem interface.
70 66
71The latest and full-featured version of the W996[87]CF driver can be found at: 67The latest and full-featured version of the W996[87]CF driver can be found at:
72http://www.linux-projects.org. Please refer to the documentation included in 68http://www.linux-projects.org. Please refer to the documentation included in
@@ -201,22 +197,6 @@ Note: The kernel must be compiled with the CONFIG_KMOD option
201 enabled for the 'ovcamchip' module to be loaded and for 197 enabled for the 'ovcamchip' module to be loaded and for
202 this parameter to be present. 198 this parameter to be present.
203------------------------------------------------------------------------------- 199-------------------------------------------------------------------------------
204Name: vppmod_load
205Type: bool
206Syntax: <0|1>
207Description: Automatic 'w9968cf-vpp' module loading: 0 disabled, 1 enabled.
208 If enabled, every time an application attempts to open a
209 camera, 'insmod' searches for the video post-processing module
210 in the system and loads it automatically (if present).
211 The optional 'w9968cf-vpp' module adds extra image manipulation
212 capabilities to the 'w9968cf' module,like software up-scaling,
213 colour conversions and video decompression for very high frame
214 rates.
215Default: 1
216Note: The kernel must be compiled with the CONFIG_KMOD option
217 enabled for the 'w9968cf-vpp' module to be loaded and for
218 this parameter to be present.
219-------------------------------------------------------------------------------
220Name: simcams 200Name: simcams
221Type: int 201Type: int
222Syntax: <n> 202Syntax: <n>
diff --git a/drivers/usb/media/w9968cf.c b/drivers/usb/media/w9968cf.c
index bff9434c8e55..9937fc64c8bf 100644
--- a/drivers/usb/media/w9968cf.c
+++ b/drivers/usb/media/w9968cf.c
@@ -62,7 +62,6 @@ MODULE_LICENSE(W9968CF_MODULE_LICENSE);
62MODULE_SUPPORTED_DEVICE("Video"); 62MODULE_SUPPORTED_DEVICE("Video");
63 63
64static int ovmod_load = W9968CF_OVMOD_LOAD; 64static int ovmod_load = W9968CF_OVMOD_LOAD;
65static int vppmod_load = W9968CF_VPPMOD_LOAD;
66static unsigned short simcams = W9968CF_SIMCAMS; 65static unsigned short simcams = W9968CF_SIMCAMS;
67static short video_nr[]={[0 ... W9968CF_MAX_DEVICES-1] = -1}; /*-1=first free*/ 66static short video_nr[]={[0 ... W9968CF_MAX_DEVICES-1] = -1}; /*-1=first free*/
68static unsigned int packet_size[] = {[0 ... W9968CF_MAX_DEVICES-1] = 67static unsigned int packet_size[] = {[0 ... W9968CF_MAX_DEVICES-1] =
@@ -107,7 +106,6 @@ static unsigned int param_nv[24]; /* number of values per parameter */
107 106
108#ifdef CONFIG_KMOD 107#ifdef CONFIG_KMOD
109module_param(ovmod_load, bool, 0644); 108module_param(ovmod_load, bool, 0644);
110module_param(vppmod_load, bool, 0444);
111#endif 109#endif
112module_param(simcams, ushort, 0644); 110module_param(simcams, ushort, 0644);
113module_param_array(video_nr, short, &param_nv[0], 0444); 111module_param_array(video_nr, short, &param_nv[0], 0444);
@@ -150,18 +148,6 @@ MODULE_PARM_DESC(ovmod_load,
150 "\ninto memory." 148 "\ninto memory."
151 "\nDefault value is "__MODULE_STRING(W9968CF_OVMOD_LOAD)"." 149 "\nDefault value is "__MODULE_STRING(W9968CF_OVMOD_LOAD)"."
152 "\n"); 150 "\n");
153MODULE_PARM_DESC(vppmod_load,
154 "\n<0|1> Automatic 'w9968cf-vpp' module loading."
155 "\n0 disabled, 1 enabled."
156 "\nIf enabled, every time an application attempts to open a"
157 "\ncamera, 'insmod' searches for the video post-processing"
158 "\nmodule in the system and loads it automatically (if"
159 "\npresent). The optional 'w9968cf-vpp' module adds extra"
160 "\n image manipulation functions to the 'w9968cf' module,like"
161 "\nsoftware up-scaling,colour conversions and video decoding"
162 "\nfor very high frame rates."
163 "\nDefault value is "__MODULE_STRING(W9968CF_VPPMOD_LOAD)"."
164 "\n");
165#endif 151#endif
166MODULE_PARM_DESC(simcams, 152MODULE_PARM_DESC(simcams,
167 "\n<n> Number of cameras allowed to stream simultaneously." 153 "\n<n> Number of cameras allowed to stream simultaneously."
@@ -492,10 +478,6 @@ static void w9968cf_push_frame(struct w9968cf_device*, u8 f_num);
492static void w9968cf_pop_frame(struct w9968cf_device*,struct w9968cf_frame_t**); 478static void w9968cf_pop_frame(struct w9968cf_device*,struct w9968cf_frame_t**);
493static void w9968cf_release_resources(struct w9968cf_device*); 479static void w9968cf_release_resources(struct w9968cf_device*);
494 480
495/* Intermodule communication */
496static int w9968cf_vppmod_detect(struct w9968cf_device*);
497static void w9968cf_vppmod_release(struct w9968cf_device*);
498
499 481
500 482
501/**************************************************************************** 483/****************************************************************************
@@ -2737,9 +2719,7 @@ static int w9968cf_open(struct inode* inode, struct file* filp)
2737 cam->streaming = 0; 2719 cam->streaming = 0;
2738 cam->misconfigured = 0; 2720 cam->misconfigured = 0;
2739 2721
2740 if (!w9968cf_vpp) 2722 w9968cf_adjust_configuration(cam);
2741 if ((err = w9968cf_vppmod_detect(cam)))
2742 goto out;
2743 2723
2744 if ((err = w9968cf_allocate_memory(cam))) 2724 if ((err = w9968cf_allocate_memory(cam)))
2745 goto deallocate_memory; 2725 goto deallocate_memory;
@@ -2766,7 +2746,6 @@ static int w9968cf_open(struct inode* inode, struct file* filp)
2766 2746
2767deallocate_memory: 2747deallocate_memory:
2768 w9968cf_deallocate_memory(cam); 2748 w9968cf_deallocate_memory(cam);
2769out:
2770 DBG(2, "Failed to open the video device") 2749 DBG(2, "Failed to open the video device")
2771 up(&cam->dev_sem); 2750 up(&cam->dev_sem);
2772 up_read(&w9968cf_disconnect); 2751 up_read(&w9968cf_disconnect);
@@ -2784,8 +2763,6 @@ static int w9968cf_release(struct inode* inode, struct file* filp)
2784 2763
2785 w9968cf_stop_transfer(cam); 2764 w9968cf_stop_transfer(cam);
2786 2765
2787 w9968cf_vppmod_release(cam);
2788
2789 if (cam->disconnected) { 2766 if (cam->disconnected) {
2790 w9968cf_release_resources(cam); 2767 w9968cf_release_resources(cam);
2791 up(&cam->dev_sem); 2768 up(&cam->dev_sem);
@@ -3681,106 +3658,6 @@ static struct usb_driver w9968cf_usb_driver = {
3681 * Module init, exit and intermodule communication * 3658 * Module init, exit and intermodule communication *
3682 ****************************************************************************/ 3659 ****************************************************************************/
3683 3660
3684static int w9968cf_vppmod_detect(struct w9968cf_device* cam)
3685{
3686 if (!w9968cf_vpp)
3687 if (vppmod_load)
3688 request_module("w9968cf-vpp");
3689
3690 down(&w9968cf_vppmod_lock);
3691
3692 if (!w9968cf_vpp) {
3693 DBG(4, "Video post-processing module not detected")
3694 w9968cf_adjust_configuration(cam);
3695 goto out;
3696 }
3697
3698 if (!try_module_get(w9968cf_vpp->owner)) {
3699 DBG(1, "Couldn't increment the reference count of "
3700 "the video post-processing module")
3701 up(&w9968cf_vppmod_lock);
3702 return -ENOSYS;
3703 }
3704
3705 w9968cf_vpp->busy++;
3706
3707 DBG(5, "Video post-processing module detected")
3708
3709out:
3710 up(&w9968cf_vppmod_lock);
3711 return 0;
3712}
3713
3714
3715static void w9968cf_vppmod_release(struct w9968cf_device* cam)
3716{
3717 down(&w9968cf_vppmod_lock);
3718
3719 if (w9968cf_vpp && w9968cf_vpp->busy) {
3720 module_put(w9968cf_vpp->owner);
3721 w9968cf_vpp->busy--;
3722 wake_up(&w9968cf_vppmod_wait);
3723 DBG(5, "Video post-processing module released")
3724 }
3725
3726 up(&w9968cf_vppmod_lock);
3727}
3728
3729
3730int w9968cf_vppmod_register(struct w9968cf_vpp_t* vpp)
3731{
3732 down(&w9968cf_vppmod_lock);
3733
3734 if (w9968cf_vpp) {
3735 KDBG(1, "Video post-processing module already registered")
3736 up(&w9968cf_vppmod_lock);
3737 return -EINVAL;
3738 }
3739
3740 w9968cf_vpp = vpp;
3741 w9968cf_vpp->busy = 0;
3742
3743 KDBG(2, "Video post-processing module registered")
3744 up(&w9968cf_vppmod_lock);
3745 return 0;
3746}
3747
3748
3749int w9968cf_vppmod_deregister(struct w9968cf_vpp_t* vpp)
3750{
3751 down(&w9968cf_vppmod_lock);
3752
3753 if (!w9968cf_vpp) {
3754 up(&w9968cf_vppmod_lock);
3755 return -EINVAL;
3756 }
3757
3758 if (w9968cf_vpp != vpp) {
3759 KDBG(1, "Only the owner can unregister the video "
3760 "post-processing module")
3761 up(&w9968cf_vppmod_lock);
3762 return -EINVAL;
3763 }
3764
3765 if (w9968cf_vpp->busy) {
3766 KDBG(2, "Video post-processing module busy. Wait for it to be "
3767 "released...")
3768 up(&w9968cf_vppmod_lock);
3769 wait_event(w9968cf_vppmod_wait, !w9968cf_vpp->busy);
3770 w9968cf_vpp = NULL;
3771 goto out;
3772 }
3773
3774 w9968cf_vpp = NULL;
3775
3776 up(&w9968cf_vppmod_lock);
3777
3778out:
3779 KDBG(2, "Video post-processing module unregistered")
3780 return 0;
3781}
3782
3783
3784static int __init w9968cf_module_init(void) 3661static int __init w9968cf_module_init(void)
3785{ 3662{
3786 int err; 3663 int err;
@@ -3810,6 +3687,3 @@ static void __exit w9968cf_module_exit(void)
3810module_init(w9968cf_module_init); 3687module_init(w9968cf_module_init);
3811module_exit(w9968cf_module_exit); 3688module_exit(w9968cf_module_exit);
3812 3689
3813
3814EXPORT_SYMBOL(w9968cf_vppmod_register);
3815EXPORT_SYMBOL(w9968cf_vppmod_deregister);
diff --git a/drivers/usb/media/w9968cf.h b/drivers/usb/media/w9968cf.h
index 8acbfe205bc7..47a6ff794171 100644
--- a/drivers/usb/media/w9968cf.h
+++ b/drivers/usb/media/w9968cf.h
@@ -195,7 +195,6 @@ enum w9968cf_vpp_flag {
195}; 195};
196 196
197static struct w9968cf_vpp_t* w9968cf_vpp; 197static struct w9968cf_vpp_t* w9968cf_vpp;
198static DECLARE_MUTEX(w9968cf_vppmod_lock);
199static DECLARE_WAIT_QUEUE_HEAD(w9968cf_vppmod_wait); 198static DECLARE_WAIT_QUEUE_HEAD(w9968cf_vppmod_wait);
200 199
201static LIST_HEAD(w9968cf_dev_list); /* head of V4L registered cameras list */ 200static LIST_HEAD(w9968cf_dev_list); /* head of V4L registered cameras list */
diff --git a/drivers/usb/media/w9968cf_vpp.h b/drivers/usb/media/w9968cf_vpp.h
index 3f5317dc4c29..f3b91b782671 100644
--- a/drivers/usb/media/w9968cf_vpp.h
+++ b/drivers/usb/media/w9968cf_vpp.h
@@ -37,7 +37,4 @@ struct w9968cf_vpp_t {
37 u8 busy; /* read-only flag: module is/is not in use */ 37 u8 busy; /* read-only flag: module is/is not in use */
38}; 38};
39 39
40extern int w9968cf_vppmod_register(struct w9968cf_vpp_t*);
41extern int w9968cf_vppmod_deregister(struct w9968cf_vpp_t*);
42
43#endif /* _W9968CF_VPP_H_ */ 40#endif /* _W9968CF_VPP_H_ */