ChangeSet 1.1722.83.15, 2004/06/03 16:50:29-07:00, scott@concord.org [PATCH] USB: kyocera 7135 patch Here is a patch based on 2.6.7-rc2 that makes the Kyocera 7135 work. The Kyocera appears to have the same setup as the Trio. Its endpoints are laid out like this: > >>>type address > >>>usb bulk out: 0x01 > >>>usb interrupt in: 0x82 > >>>usb bulk out: 0x03 > >>>usb bulk in: 0x84 The last two are the ones used for the syncing communication. So the patch adds the ids for the kyocera and makes the treo_attach function handle the kyocera too. I also changed the comment; it appears there was an error in the original comment about the treo: Joe Nardelli wrote: > Actually, the comment isn't quite right for Treos either (oops). It > should read: > > ... > 1st bulk in endpoint to communicate with the 2nd bulk out endpoint > ... Signed-off-by: Greg Kroah-Hartman drivers/usb/serial/visor.c | 18 +++++++++++------- drivers/usb/serial/visor.h | 3 +++ 2 files changed, 14 insertions(+), 7 deletions(-) diff -Nru a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c --- a/drivers/usb/serial/visor.c Fri Jun 18 11:04:28 2004 +++ b/drivers/usb/serial/visor.c Fri Jun 18 11:04:28 2004 @@ -247,6 +247,8 @@ .driver_info = (kernel_ulong_t)&palm_os_4_probe }, { USB_DEVICE(ACEECA_VENDOR_ID, ACEECA_MEZ1000_ID), .driver_info = (kernel_ulong_t)&palm_os_4_probe }, + { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_7135_ID), + .driver_info = (kernel_ulong_t)&palm_os_4_probe }, { }, /* optional parameter entry */ { } /* Terminating entry */ }; @@ -290,6 +292,7 @@ { USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_SPH_I500_ID) }, { USB_DEVICE(GARMIN_VENDOR_ID, GARMIN_IQUE_3600_ID) }, { USB_DEVICE(ACEECA_VENDOR_ID, ACEECA_MEZ1000_ID) }, + { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_7135_ID) }, { }, /* optional parameter entry */ { } /* Terminating entry */ }; @@ -795,7 +798,7 @@ dev_err(dev, "%s - error %d getting connection info\n", __FUNCTION__, retval); else - usb_serial_debug_data (__FILE__, __FUNCTION__, 0x14, transfer_buffer); + usb_serial_debug_data (__FILE__, __FUNCTION__, retval, transfer_buffer); kfree (transfer_buffer); return 0; @@ -881,18 +884,19 @@ /* Only do this endpoint hack for the Handspring devices with * interrupt in endpoints, which for now are the Treo devices. */ - if ((serial->dev->descriptor.idVendor != HANDSPRING_VENDOR_ID) || + if (!((serial->dev->descriptor.idVendor == HANDSPRING_VENDOR_ID) || + (serial->dev->descriptor.idVendor == KYOCERA_VENDOR_ID)) || (serial->num_interrupt_in == 0)) return 0; dbg("%s", __FUNCTION__); /* - * It appears that Treos want to use the 1st interrupt endpoint to - * communicate with the 2nd bulk out endpoint, so let's swap the 1st - * and 2nd bulk in and interrupt endpoints. Note that swapping the - * bulk out endpoints would break lots of apps that want to communicate - * on the second port. + * It appears that Treos and Kyoceras want to use the + * 1st bulk in endpoint to communicate with the 2nd bulk out endpoint, + * so let's swap the 1st and 2nd bulk in and interrupt endpoints. + * Note that swapping the bulk out endpoints would break lots of + * apps that want to communicate on the second port. */ #define COPY_PORT(dest, src) \ dest->read_urb = src->read_urb; \ diff -Nru a/drivers/usb/serial/visor.h b/drivers/usb/serial/visor.h --- a/drivers/usb/serial/visor.h Fri Jun 18 11:04:28 2004 +++ b/drivers/usb/serial/visor.h Fri Jun 18 11:04:28 2004 @@ -55,6 +55,9 @@ #define ACEECA_VENDOR_ID 0x4766 #define ACEECA_MEZ1000_ID 0x0001 +#define KYOCERA_VENDOR_ID 0x0C88 +#define KYOCERA_7135_ID 0x0021 + /**************************************************************************** * Handspring Visor Vendor specific request codes (bRequest values) * A big thank you to Handspring for providing the following information.