0009:
- ok, but maybe a "bandwidth" parameter will make them interesting in the
future (AMcap has a similar setting)

I believe AMcap bandwidth just changes what alternate setting is used
which neither  of those functions did. At anyrate I don't think its
really a good idea keeping unused functions around simply because we
might use them later. If we need them later its not that much of a
problem to reimplement them at a later date.

Here's a patch that should implement the idea.

GWater
From 45b00b81c6c098eade88218afa48f0051aa1c4b1 Mon Sep 17 00:00:00 2001
From: GWater <[email protected]>
Date: Thu, 1 Jan 2009 16:14:26 +0100
Subject: [PATCH] Add "bandwidth" parameter for ISOC

Signed-off-by: GWater <[email protected]>
---
 sn9c20x-usb.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/sn9c20x-usb.c b/sn9c20x-usb.c
index 1651ba7..c7fd1b0 100644
--- a/sn9c20x-usb.c
+++ b/sn9c20x-usb.c
@@ -60,6 +60,12 @@ static __u8 bulk;
 __u8 jpeg = 1;
 
 /**
+ * @var bandwidth
+ *  Module parameter to set the available bandwidth via the alternate setting
+ */
+static __u8 bandwidth = 8;
+
+/**
  * @var hflip
  *  Module parameter to enable/disable the horizontal flip process
  */
@@ -373,12 +379,14 @@ int usb_sn9c20x_init_urbs(struct usb_sn9c20x *dev)
                return ret;
 
        if (!bulk) {
-               ep = find_endpoint(usb_altnum_to_altsetting(intf, 8), 
SN9C20X_VID_ISOC);
+               if (bandwidth > 8)
+                       return -EINVAL;
 
+               ep = find_endpoint(usb_altnum_to_altsetting(intf, bandwidth), 
SN9C20X_VID_ISOC);
                if (ep == NULL)
                        return -EIO;
 
-               ret = usb_set_interface(dev->udev, 0, 8);
+               ret = usb_set_interface(dev->udev, 0, bandwidth);
                if (ret < 0)
                        return ret;
 
@@ -858,6 +866,7 @@ static struct usb_driver usb_sn9c20x_driver = {
 module_param(fps, byte, 0444);                 /**< @brief Module parameter 
frames per second */
 module_param(bulk, byte, 0444);
 module_param(jpeg, byte, 0444);
+module_param(bandwidth, byte, 0444);
 module_param(hflip, byte, 0444);                       /**< @brief Module 
parameter horizontal flip process */
 module_param(vflip, byte, 0444);                       /**< @brief Module 
parameter vertical flip process */
 module_param(flip_detect, byte, 0444);         /**< @brief Module parameter 
flip detect */
@@ -1001,6 +1010,7 @@ MODULE_PARM_DESC(fps, "Frames per second [10-30]");       
/**< @brief Description of '
 
 MODULE_PARM_DESC(jpeg, "Enable JPEG support (default is enabled)");
 MODULE_PARM_DESC(bulk, "Enable Bulk transfer (default is to use ISOC)");
+MODULE_PARM_DESC(bandwidth, "Bandwidth Setting (only for ISOC)");
 
 MODULE_PARM_DESC(hflip, "Horizontal image flip");      /**< @brief Description 
of 'hflip' parameter */
 MODULE_PARM_DESC(vflip, "Vertical image flip");                /**< @brief 
Description of 'vflip' parameter */
-- 
1.6.0.6

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to