aboutsummaryrefslogtreecommitdiffstats
path: root/usb
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2006-02-22 15:02:34 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2006-02-22 15:02:34 -0800
commiteb6b406dcc7096974eec722b436e0f05eca353a4 (patch)
tree0fa607d200cd276b6774f0f863e317a0741fc493 /usb
parent4fffec22d6b7a52d17e144280ea226114c92e0a0 (diff)
downloadpatches-eb6b406dcc7096974eec722b436e0f05eca353a4.tar.gz
usb, pci, and driver patches added
Diffstat (limited to 'usb')
-rw-r--r--usb/usb-credits-add-credits-about-the-zc0301-and-et61x51-usb-drivers.patch29
-rw-r--r--usb/usb-ethernet-gadget-driver-section-fixups.patch145
-rw-r--r--usb/usb-fix-warning-in-drivers-usb-media-ov511.c.patch33
-rw-r--r--usb/usb-gadget-driver-section-fixups.patch147
-rw-r--r--usb/usb-visor.c-id-for-gspda-smartphone.patch49
-rw-r--r--usb/usb-zc0301-driver-updates.patch214
6 files changed, 617 insertions, 0 deletions
diff --git a/usb/usb-credits-add-credits-about-the-zc0301-and-et61x51-usb-drivers.patch b/usb/usb-credits-add-credits-about-the-zc0301-and-et61x51-usb-drivers.patch
new file mode 100644
index 00000000000000..44a149c6b1d662
--- /dev/null
+++ b/usb/usb-credits-add-credits-about-the-zc0301-and-et61x51-usb-drivers.patch
@@ -0,0 +1,29 @@
+From luca.risolia@studio.unibo.it Tue Feb 7 15:49:05 2006
+Date: Wed, 8 Feb 2006 00:50:59 +0000
+From: Luca Risolia <luca.risolia@studio.unibo.it>
+To: Greg Kroah-Hartman <gregkh@suse.de>
+Subject: USB: CREDITS: Add credits about the ZC0301 and ET61X[12]51 USB drivers
+Message-ID: <20060208005059.GA10459@studio.unibo.it>
+Content-Disposition: inline
+
+This patch adds credits about the ZC0301 and ET61X[12]51 USB drivers
+which have been included in the mainline kernel recently.
+
+Signed-off-by: Luca Risolia <luca.risolia@studio.unibo.it>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ CREDITS | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- gregkh-2.6.orig/CREDITS
++++ gregkh-2.6/CREDITS
+@@ -2814,6 +2814,8 @@ E: luca.risolia@studio.unibo.it
+ P: 1024D/FCE635A4 88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4
+ D: V4L driver for W996[87]CF JPEG USB Dual Mode Camera Chips
+ D: V4L2 driver for SN9C10x PC Camera Controllers
++D: V4L2 driver for ET61X151 and ET61X251 PC Camera Controllers
++D: V4L2 driver for ZC0301 Image Processor and Control Chip
+ S: Via Liberta' 41/A
+ S: Osio Sotto, 24046, Bergamo
+ S: Italy
diff --git a/usb/usb-ethernet-gadget-driver-section-fixups.patch b/usb/usb-ethernet-gadget-driver-section-fixups.patch
new file mode 100644
index 00000000000000..a4e78ff61afd0e
--- /dev/null
+++ b/usb/usb-ethernet-gadget-driver-section-fixups.patch
@@ -0,0 +1,145 @@
+From david-b@pacbell.net Sat Feb 18 12:51:14 2006
+From: David Brownell <david-b@pacbell.net>
+To: Greg KH <gregkh@suse.de>
+Subject: USB: ethernet gadget driver section fixups
+Date: Sat, 18 Feb 2006 12:31:23 -0800
+Cc: Aras Vaichas <arasv@magellan-technology.com>
+Message-Id: <200602181231.23445.david-b@pacbell.net>
+
+From: Aras Vaichas <arasv@magellan-technology.com>
+
+This patch allows you to set the iSerialNumber field in the
+usb_device_descriptor structure for your USB ethernet gadget.
+
+It also changes the parameters shown through sysfs so they're
+no longer declared as __initdata, preventing potential oopses.
+
+That's most useful for the Ethernet addresses, which may in
+some cases be random "locally administered" addresses.
+
+Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/gadget/ether.c | 38 +++++++++++++++++++++++++++-----------
+ 1 file changed, 27 insertions(+), 11 deletions(-)
+
+--- gregkh-2.6.orig/drivers/usb/gadget/ether.c
++++ gregkh-2.6/drivers/usb/gadget/ether.c
+@@ -182,33 +182,37 @@ struct eth_dev {
+ * parameters are in UTF-8 (superset of ASCII's 7 bit characters).
+ */
+
+-static ushort __initdata idVendor;
++static ushort idVendor;
+ module_param(idVendor, ushort, S_IRUGO);
+ MODULE_PARM_DESC(idVendor, "USB Vendor ID");
+
+-static ushort __initdata idProduct;
++static ushort idProduct;
+ module_param(idProduct, ushort, S_IRUGO);
+ MODULE_PARM_DESC(idProduct, "USB Product ID");
+
+-static ushort __initdata bcdDevice;
++static ushort bcdDevice;
+ module_param(bcdDevice, ushort, S_IRUGO);
+ MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)");
+
+-static char *__initdata iManufacturer;
++static char *iManufacturer;
+ module_param(iManufacturer, charp, S_IRUGO);
+ MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string");
+
+-static char *__initdata iProduct;
++static char *iProduct;
+ module_param(iProduct, charp, S_IRUGO);
+ MODULE_PARM_DESC(iProduct, "USB Product string");
+
++static char *iSerialNumber;
++module_param(iSerialNumber, charp, S_IRUGO);
++MODULE_PARM_DESC(iSerialNumber, "SerialNumber");
++
+ /* initial value, changed by "ifconfig usb0 hw ether xx:xx:xx:xx:xx:xx" */
+-static char *__initdata dev_addr;
++static char *dev_addr;
+ module_param(dev_addr, charp, S_IRUGO);
+ MODULE_PARM_DESC(dev_addr, "Device Ethernet Address");
+
+ /* this address is invisible to ifconfig */
+-static char *__initdata host_addr;
++static char *host_addr;
+ module_param(host_addr, charp, S_IRUGO);
+ MODULE_PARM_DESC(host_addr, "Host Ethernet Address");
+
+@@ -403,6 +407,7 @@ static inline int BITRATE(struct usb_gad
+ #define STRING_CDC 7
+ #define STRING_SUBSET 8
+ #define STRING_RNDIS 9
++#define STRING_SERIALNUMBER 10
+
+ /* holds our biggest descriptor (or RNDIS response) */
+ #define USB_BUFSIZ 256
+@@ -870,6 +875,7 @@ static inline void __init hs_subset_desc
+
+ static char manufacturer [50];
+ static char product_desc [40] = DRIVER_DESC;
++static char serial_number [20];
+
+ #ifdef DEV_CONFIG_CDC
+ /* address that the host will use ... usually assigned at random */
+@@ -880,6 +886,7 @@ static char ethaddr [2 * ETH_ALEN + 1
+ static struct usb_string strings [] = {
+ { STRING_MANUFACTURER, manufacturer, },
+ { STRING_PRODUCT, product_desc, },
++ { STRING_SERIALNUMBER, serial_number, },
+ { STRING_DATA, "Ethernet Data", },
+ #ifdef DEV_CONFIG_CDC
+ { STRING_CDC, "CDC Ethernet", },
+@@ -2162,7 +2169,7 @@ static u8 __init nibble (unsigned char c
+ return 0;
+ }
+
+-static void __init get_ether_addr (const char *str, u8 *dev_addr)
++static int __init get_ether_addr(const char *str, u8 *dev_addr)
+ {
+ if (str) {
+ unsigned i;
+@@ -2177,9 +2184,10 @@ static void __init get_ether_addr (const
+ dev_addr [i] = num;
+ }
+ if (is_valid_ether_addr (dev_addr))
+- return;
++ return 0;
+ }
+ random_ether_addr(dev_addr);
++ return 1;
+ }
+
+ static int __init
+@@ -2277,6 +2285,10 @@ eth_bind (struct usb_gadget *gadget)
+ strlcpy (manufacturer, iManufacturer, sizeof manufacturer);
+ if (iProduct)
+ strlcpy (product_desc, iProduct, sizeof product_desc);
++ if (iSerialNumber) {
++ device_desc.iSerialNumber = STRING_SERIALNUMBER,
++ strlcpy(serial_number, iSerialNumber, sizeof serial_number);
++ }
+
+ /* all we really need is bulk IN/OUT */
+ usb_ep_autoconfig_reset (gadget);
+@@ -2386,9 +2398,13 @@ autoconf_fail:
+ * The host side address is used with CDC and RNDIS, and commonly
+ * ends up in a persistent config database.
+ */
+- get_ether_addr(dev_addr, net->dev_addr);
++ if (get_ether_addr(dev_addr, net->dev_addr))
++ dev_warn(&gadget->dev,
++ "using random %s ethernet address\n", "self");
+ if (cdc || rndis) {
+- get_ether_addr(host_addr, dev->host_mac);
++ if (get_ether_addr(host_addr, dev->host_mac))
++ dev_warn(&gadget->dev,
++ "using random %s ethernet address\n", "host");
+ #ifdef DEV_CONFIG_CDC
+ snprintf (ethaddr, sizeof ethaddr, "%02X%02X%02X%02X%02X%02X",
+ dev->host_mac [0], dev->host_mac [1],
diff --git a/usb/usb-fix-warning-in-drivers-usb-media-ov511.c.patch b/usb/usb-fix-warning-in-drivers-usb-media-ov511.c.patch
new file mode 100644
index 00000000000000..176062ebd0ac79
--- /dev/null
+++ b/usb/usb-fix-warning-in-drivers-usb-media-ov511.c.patch
@@ -0,0 +1,33 @@
+From kernel-janitors-bounces@lists.osdl.org Wed Feb 15 13:45:49 2006
+From: Matthew Martin <lihnucks@gmail.com>
+To: kernel-janitors@lists.osdl.org
+Date: Wed, 15 Feb 2006 15:41:25 -0600
+Message-Id: <1140039685.14352.1.camel@localhost.localdomain>
+Subject: USB: Fix warning in drivers/usb/media/ov511.c
+
+Gcc 4.0.2 had the warning:
+
+drivers/usb/media/ov511.c: In function 'show_exposure':
+drivers/usb/media/ov511.c:5642: warning: 'exp' may be used uninitialized
+in this function
+
+Here is the patch to fix that warning.
+
+Signed-off-by: Matthew Martin <lihnucks@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/media/ov511.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- gregkh-2.6.orig/drivers/usb/media/ov511.c
++++ gregkh-2.6/drivers/usb/media/ov511.c
+@@ -5639,7 +5639,7 @@ static CLASS_DEVICE_ATTR(hue, S_IRUGO, s
+ static ssize_t show_exposure(struct class_device *cd, char *buf)
+ {
+ struct usb_ov511 *ov = cd_to_ov(cd);
+- unsigned char exp;
++ unsigned char exp = 0;
+
+ if (!ov->dev)
+ return -ENODEV;
diff --git a/usb/usb-gadget-driver-section-fixups.patch b/usb/usb-gadget-driver-section-fixups.patch
new file mode 100644
index 00000000000000..8d30bb47b4aa95
--- /dev/null
+++ b/usb/usb-gadget-driver-section-fixups.patch
@@ -0,0 +1,147 @@
+From david-b@pacbell.net Sat Feb 18 12:51:14 2006
+From: David Brownell <david-b@pacbell.net>
+To: Greg KH <gregkh@suse.de>
+Subject: USB: gadget driver section fixups
+Date: Sat, 18 Feb 2006 12:31:05 -0800
+Message-Id: <200602181231.05193.david-b@pacbell.net>
+
+
+This adds __init section annotations to gadget driver bind() routines to
+remove calls from .text into .init sections (for endpoint autoconfig).
+Likewise it adds __exit section annotations to their unbind() routines.
+
+The specification of the gadget driver register/unregister functions is
+updated to explicitly allow use of those sections.
+
+Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/gadget/ether.c | 4 ++--
+ drivers/usb/gadget/file_storage.c | 4 ++--
+ drivers/usb/gadget/serial.c | 6 +++---
+ drivers/usb/gadget/zero.c | 6 +++---
+ include/linux/usb_gadget.h | 7 +++++--
+ 5 files changed, 15 insertions(+), 12 deletions(-)
+
+--- gregkh-2.6.orig/drivers/usb/gadget/zero.c
++++ gregkh-2.6/drivers/usb/gadget/zero.c
+@@ -1119,7 +1119,7 @@ zero_autoresume (unsigned long _dev)
+
+ /*-------------------------------------------------------------------------*/
+
+-static void
++static void __exit
+ zero_unbind (struct usb_gadget *gadget)
+ {
+ struct zero_dev *dev = get_gadget_data (gadget);
+@@ -1136,7 +1136,7 @@ zero_unbind (struct usb_gadget *gadget)
+ set_gadget_data (gadget, NULL);
+ }
+
+-static int
++static int __init
+ zero_bind (struct usb_gadget *gadget)
+ {
+ struct zero_dev *dev;
+@@ -1288,7 +1288,7 @@ static struct usb_gadget_driver zero_dri
+ #endif
+ .function = (char *) longname,
+ .bind = zero_bind,
+- .unbind = zero_unbind,
++ .unbind = __exit_p(zero_unbind),
+
+ .setup = zero_setup,
+ .disconnect = zero_disconnect,
+--- gregkh-2.6.orig/drivers/usb/gadget/ether.c
++++ gregkh-2.6/drivers/usb/gadget/ether.c
+@@ -2125,7 +2125,7 @@ eth_req_free (struct usb_ep *ep, struct
+ }
+
+
+-static void
++static void __exit
+ eth_unbind (struct usb_gadget *gadget)
+ {
+ struct eth_dev *dev = get_gadget_data (gadget);
+@@ -2532,7 +2532,7 @@ static struct usb_gadget_driver eth_driv
+
+ .function = (char *) driver_desc,
+ .bind = eth_bind,
+- .unbind = eth_unbind,
++ .unbind = __exit_p(eth_unbind),
+
+ .setup = eth_setup,
+ .disconnect = eth_disconnect,
+--- gregkh-2.6.orig/drivers/usb/gadget/file_storage.c
++++ gregkh-2.6/drivers/usb/gadget/file_storage.c
+@@ -3678,7 +3678,7 @@ static void lun_release(struct device *d
+ kref_put(&fsg->ref, fsg_release);
+ }
+
+-static void fsg_unbind(struct usb_gadget *gadget)
++static void __exit fsg_unbind(struct usb_gadget *gadget)
+ {
+ struct fsg_dev *fsg = get_gadget_data(gadget);
+ int i;
+@@ -4064,7 +4064,7 @@ static struct usb_gadget_driver fsg_dri
+ #endif
+ .function = (char *) longname,
+ .bind = fsg_bind,
+- .unbind = fsg_unbind,
++ .unbind = __exit_p(fsg_unbind),
+ .disconnect = fsg_disconnect,
+ .setup = fsg_setup,
+ .suspend = fsg_suspend,
+--- gregkh-2.6.orig/drivers/usb/gadget/serial.c
++++ gregkh-2.6/drivers/usb/gadget/serial.c
+@@ -369,7 +369,7 @@ static struct usb_gadget_driver gs_gadge
+ #endif /* CONFIG_USB_GADGET_DUALSPEED */
+ .function = GS_LONG_NAME,
+ .bind = gs_bind,
+- .unbind = gs_unbind,
++ .unbind = __exit_p(gs_unbind),
+ .setup = gs_setup,
+ .disconnect = gs_disconnect,
+ .driver = {
+@@ -1412,7 +1412,7 @@ requeue:
+ * Called on module load. Allocates and initializes the device
+ * structure and a control request.
+ */
+-static int gs_bind(struct usb_gadget *gadget)
++static int __init gs_bind(struct usb_gadget *gadget)
+ {
+ int ret;
+ struct usb_ep *ep;
+@@ -1537,7 +1537,7 @@ autoconf_fail:
+ * Called on module unload. Frees the control request and device
+ * structure.
+ */
+-static void gs_unbind(struct usb_gadget *gadget)
++static void __exit gs_unbind(struct usb_gadget *gadget)
+ {
+ struct gs_dev *dev = get_gadget_data(gadget);
+
+--- gregkh-2.6.orig/include/linux/usb_gadget.h
++++ gregkh-2.6/include/linux/usb_gadget.h
+@@ -801,7 +801,9 @@ struct usb_gadget_driver {
+ * Call this in your gadget driver's module initialization function,
+ * to tell the underlying usb controller driver about your driver.
+ * The driver's bind() function will be called to bind it to a
+- * gadget. This function must be called in a context that can sleep.
++ * gadget before this registration call returns. It's expected that
++ * the bind() functions will be in init sections.
++ * This function must be called in a context that can sleep.
+ */
+ int usb_gadget_register_driver (struct usb_gadget_driver *driver);
+
+@@ -814,7 +816,8 @@ int usb_gadget_register_driver (struct u
+ * going away. If the controller is connected to a USB host,
+ * it will first disconnect(). The driver is also requested
+ * to unbind() and clean up any device state, before this procedure
+- * finally returns.
++ * finally returns. It's expected that the unbind() functions
++ * will in in exit sections, so may not be linked in some kernels.
+ * This function must be called in a context that can sleep.
+ */
+ int usb_gadget_unregister_driver (struct usb_gadget_driver *driver);
diff --git a/usb/usb-visor.c-id-for-gspda-smartphone.patch b/usb/usb-visor.c-id-for-gspda-smartphone.patch
new file mode 100644
index 00000000000000..6ead2418393587
--- /dev/null
+++ b/usb/usb-visor.c-id-for-gspda-smartphone.patch
@@ -0,0 +1,49 @@
+From hendrik@somehost.de Sun Feb 19 10:00:11 2006
+From: Hendrik Schweppe <hendrik@somehost.de>
+To: Greg KH <greg@kroah.com>
+Date: Sun, 19 Feb 2006 19:00:04 +0100
+Subject: USB: visor.c id for gspda smartphone
+Message-Id: <1140372004.24874.39.camel@localhost.localdomain>
+
+Added the USB vendorID of GSPDA and the productID of GSPDA's palm
+smartphone 'xplore m68' to the list of known devices.
+
+Signed-off-by: Hendrik Schweppe <linuxkpatch@hendrik.fam-schweppe.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/visor.c | 3 +++
+ drivers/usb/serial/visor.h | 3 +++
+ 2 files changed, 6 insertions(+)
+
+--- gregkh-2.6.orig/drivers/usb/serial/visor.h
++++ gregkh-2.6/drivers/usb/serial/visor.h
+@@ -36,6 +36,9 @@
+ #define PALM_ZIRE_ID 0x0070
+ #define PALM_M100_ID 0x0080
+
++#define GSPDA_VENDOR_ID 0x115e
++#define GSPDA_XPLORE_M68_ID 0xf100
++
+ #define SONY_VENDOR_ID 0x054C
+ #define SONY_CLIE_3_5_ID 0x0038
+ #define SONY_CLIE_4_0_ID 0x0066
+--- gregkh-2.6.orig/drivers/usb/serial/visor.c
++++ gregkh-2.6/drivers/usb/serial/visor.c
+@@ -69,6 +69,8 @@ static struct usb_device_id id_table []
+ .driver_info = (kernel_ulong_t)&palm_os_4_probe },
+ { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_TREO600_ID),
+ .driver_info = (kernel_ulong_t)&palm_os_4_probe },
++ { USB_DEVICE(GSPDA_VENDOR_ID, GSPDA_XPLORE_M68_ID),
++ .driver_info = (kernel_ulong_t)&palm_os_4_probe },
+ { USB_DEVICE(PALM_VENDOR_ID, PALM_M500_ID),
+ .driver_info = (kernel_ulong_t)&palm_os_4_probe },
+ { USB_DEVICE(PALM_VENDOR_ID, PALM_M505_ID),
+@@ -139,6 +141,7 @@ static struct usb_device_id id_table_com
+ { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_VISOR_ID) },
+ { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_TREO_ID) },
+ { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_TREO600_ID) },
++ { USB_DEVICE(GSPDA_VENDOR_ID, GSPDA_XPLORE_M68_ID) },
+ { USB_DEVICE(PALM_VENDOR_ID, PALM_M500_ID) },
+ { USB_DEVICE(PALM_VENDOR_ID, PALM_M505_ID) },
+ { USB_DEVICE(PALM_VENDOR_ID, PALM_M515_ID) },
diff --git a/usb/usb-zc0301-driver-updates.patch b/usb/usb-zc0301-driver-updates.patch
new file mode 100644
index 00000000000000..0f108dc9d137c2
--- /dev/null
+++ b/usb/usb-zc0301-driver-updates.patch
@@ -0,0 +1,214 @@
+From luca.risolia@studio.unibo.it Tue Feb 7 15:03:45 2006
+Date: Wed, 8 Feb 2006 00:05:27 +0000
+From: Luca Risolia <luca.risolia@studio.unibo.it>
+To: Greg Kroah-Hartman <gregkh@suse.de>
+Cc: Andrew Morton <akpm@osdl.org>
+Subject: USB: ZC0301 driver updates
+Message-ID: <20060208000527.GA10310@studio.unibo.it>
+Content-Disposition: inline
+
+"Cosmetic" driver updates for the ZC0301 driver:
+
+- Fix stream_interrupt() (and work around a possible kernel bug);
+
+- Fix vidioc_enum_input() and split vidioc_gs_input() in two parts;
+- Use wait_event_interruptible_timeout() instead of wait_event_interruptible()
+ when waiting for video frames;
+- replace erroneous wake_up_interruptible(&wait_stream) with
+ wake_up(&wait_stream);
+- Cosmetic cleanups in the documentation.
+
+Signed-off-by: Luca Risolia <luca.risolia@studio.unibo.it>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ Documentation/usb/zc0301.txt | 19 +++++----------
+ drivers/usb/media/zc0301.h | 2 -
+ drivers/usb/media/zc0301_core.c | 43 ++++++++++++++++++++++-------------
+ drivers/usb/media/zc0301_pas202bcb.c | 2 -
+ 4 files changed, 37 insertions(+), 29 deletions(-)
+
+--- gregkh-2.6.orig/Documentation/usb/zc0301.txt
++++ gregkh-2.6/Documentation/usb/zc0301.txt
+@@ -67,8 +67,7 @@ Some of the features of the driver are:
+ - available mmap or read/poll methods for video streaming through isochronous
+ data transfers;
+ - automatic detection of image sensor;
+-- video formats is standard JPEG in various compression qualities
+- (see also "Notes for V4L2 application developers" paragraph);
++- video format is standard JPEG;
+ - full support for the capabilities of every possible image sensors that can
+ be connected to the ZC0301 bridges, including, for istance, red, green,
+ blue and global gain adjustments and exposure control (see "Supported
+@@ -226,10 +225,6 @@ The same number of buffers as before wil
+ of the new video frames, so you have to map the buffers again before any I/O
+ attempts on them.
+
+-This driver supports the standard JPEG video format. The current compression
+-quality may vary from 0 to 3 and can be selected or queried thanks to the
+-VIDIOC_S_JPEGCOMP and VIDIOC_G_JPEGCOMP V4L2 ioctl's.
+-
+
+ 10. Contact information
+ =======================
+@@ -242,9 +237,9 @@ the fingerprint is: '88E8 F32F 7244 68BA
+
+ 11. Credits
+ ===========
+-- Informations about the chip internals to enable the I2C protocol have been
+- taken from the documentation of the ZC030x Video4Linux1 driver written by
+- Andrew Birkett <andy@nobugs.org>;
+-- Initialization values of the ZC0301 connected to the PAS202BCB image sensor
+- have been taken from the SPCA5XX driver maintained by
+- Michel Xhaard <mxhaard@magic.fr>
++- Informations about the chip internals needed to enable the I2C protocol have
++ been taken from the documentation of the ZC030x Video4Linux1 driver written
++ by Andrew Birkett <andy@nobugs.org>;
++- Initialization values of the ZC0301 controller connected to the PAS202BCB
++ image sensor have been taken from the SPCA5XX driver maintained by
++ Michel Xhaard <mxhaard@magic.fr>.
+--- gregkh-2.6.orig/drivers/usb/media/zc0301_core.c
++++ gregkh-2.6/drivers/usb/media/zc0301_core.c
+@@ -3,9 +3,9 @@
+ * *
+ * Copyright (C) 2006 by Luca Risolia <luca.risolia@studio.unibo.it> *
+ * *
+- * Informations about the chip internals to enable the I2C protocol have *
+- * been taken from the documentation of the ZC030x Video4Linux1 driver *
+- * written by Andrew Birkett <andy@nobugs.org> *
++ * Informations about the chip internals needed to enable the I2C protocol *
++ * have been taken from the documentation of the ZC030x Video4Linux1 *
++ * driver written by Andrew Birkett <andy@nobugs.org> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+@@ -54,8 +54,8 @@
+ #define ZC0301_MODULE_AUTHOR "(C) 2006 Luca Risolia"
+ #define ZC0301_AUTHOR_EMAIL "<luca.risolia@studio.unibo.it>"
+ #define ZC0301_MODULE_LICENSE "GPL"
+-#define ZC0301_MODULE_VERSION "1:1.00"
+-#define ZC0301_MODULE_VERSION_CODE KERNEL_VERSION(1, 0, 0)
++#define ZC0301_MODULE_VERSION "1:1.01"
++#define ZC0301_MODULE_VERSION_CODE KERNEL_VERSION(1, 0, 1)
+
+ /*****************************************************************************/
+
+@@ -314,7 +314,7 @@ static void zc0301_urb_complete(struct u
+ if ((*f))
+ (*f)->state = F_QUEUED;
+ DBG(3, "Stream interrupted");
+- wake_up_interruptible(&cam->wait_stream);
++ wake_up(&cam->wait_stream);
+ }
+
+ if (cam->state & DEV_DISCONNECTED)
+@@ -526,7 +526,7 @@ static int zc0301_stream_interrupt(struc
+ ZC0301_URB_TIMEOUT);
+ if (cam->state & DEV_DISCONNECTED)
+ return -ENODEV;
+- else if (!timeout) {
++ else if (cam->stream != STREAM_OFF) {
+ cam->state |= DEV_MISCONFIGURED;
+ DBG(1, "URB timeout reached. The camera is misconfigured. To "
+ "use it, close and open /dev/video%d again.",
+@@ -547,8 +547,7 @@ zc0301_set_compression(struct zc0301_dev
+
+ if ((r = zc0301_read_reg(cam, 0x0008)) < 0)
+ err += r;
+- err += zc0301_write_reg(cam, 0x0008,
+- r | 0x11 | (compression->quality >> 1));
++ err += zc0301_write_reg(cam, 0x0008, r | 0x11 | compression->quality);
+
+ return err ? -EIO : 0;
+ }
+@@ -737,8 +736,7 @@ static int zc0301_release(struct inode*
+
+
+ static ssize_t
+-zc0301_read(struct file* filp, char __user * buf,
+- size_t count, loff_t* f_pos)
++zc0301_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos)
+ {
+ struct zc0301_device* cam = video_get_drvdata(video_devdata(filp));
+ struct zc0301_frame_t* f, * i;
+@@ -1019,6 +1017,7 @@ zc0301_vidioc_enuminput(struct zc0301_de
+
+ memset(&i, 0, sizeof(i));
+ strcpy(i.name, "Camera");
++ i.type = V4L2_INPUT_TYPE_CAMERA;
+
+ if (copy_to_user(arg, &i, sizeof(i)))
+ return -EFAULT;
+@@ -1028,7 +1027,19 @@ zc0301_vidioc_enuminput(struct zc0301_de
+
+
+ static int
+-zc0301_vidioc_gs_input(struct zc0301_device* cam, void __user * arg)
++zc0301_vidioc_g_input(struct zc0301_device* cam, void __user * arg)
++{
++ int index = 0;
++
++ if (copy_to_user(arg, &index, sizeof(index)))
++ return -EFAULT;
++
++ return 0;
++}
++
++
++static int
++zc0301_vidioc_s_input(struct zc0301_device* cam, void __user * arg)
+ {
+ int index;
+
+@@ -1446,7 +1457,7 @@ zc0301_vidioc_s_jpegcomp(struct zc0301_d
+ if (copy_from_user(&jc, arg, sizeof(jc)))
+ return -EFAULT;
+
+- if (jc.quality < 0 || jc.quality > 3)
++ if (jc.quality != 0)
+ return -EINVAL;
+
+ if (cam->stream == STREAM_ON)
+@@ -1738,8 +1749,10 @@ static int zc0301_ioctl_v4l2(struct inod
+ return zc0301_vidioc_enuminput(cam, arg);
+
+ case VIDIOC_G_INPUT:
++ return zc0301_vidioc_g_input(cam, arg);
++
+ case VIDIOC_S_INPUT:
+- return zc0301_vidioc_gs_input(cam, arg);
++ return zc0301_vidioc_s_input(cam, arg);
+
+ case VIDIOC_QUERYCTRL:
+ return zc0301_vidioc_query_ctrl(cam, arg);
+@@ -1980,7 +1993,7 @@ static void zc0301_usb_disconnect(struct
+ zc0301_stop_transfer(cam);
+ cam->state |= DEV_DISCONNECTED;
+ wake_up_interruptible(&cam->wait_frame);
+- wake_up_interruptible(&cam->wait_stream);
++ wake_up(&cam->wait_stream);
+ } else {
+ cam->state |= DEV_DISCONNECTED;
+ zc0301_release_resources(cam);
+--- gregkh-2.6.orig/drivers/usb/media/zc0301.h
++++ gregkh-2.6/drivers/usb/media/zc0301.h
+@@ -45,7 +45,7 @@
+ #define ZC0301_MAX_DEVICES 64
+ #define ZC0301_FORCE_MUNMAP 0
+ #define ZC0301_MAX_FRAMES 32
+-#define ZC0301_COMPRESSION_QUALITY 2
++#define ZC0301_COMPRESSION_QUALITY 0
+ #define ZC0301_URBS 2
+ #define ZC0301_ISO_PACKETS 7
+ #define ZC0301_ALTERNATE_SETTING 7
+--- gregkh-2.6.orig/drivers/usb/media/zc0301_pas202bcb.c
++++ gregkh-2.6/drivers/usb/media/zc0301_pas202bcb.c
+@@ -318,7 +318,7 @@ static struct zc0301_sensor pas202bcb =
+ .width = 640,
+ .height = 480,
+ .pixelformat = V4L2_PIX_FMT_JPEG,
+- .priv = 16,
++ .priv = 8,
+ },
+ };
+