Patchwork USB: serial: pl2303: add Delock Infrared device id

login
register
mail settings
Submitter ebrahim@gnu.org
Date Feb. 9, 2019, 10:44 a.m.
Message ID <77004b4f-c9e2-fab5-7a87-f9c89b1d14f0@gnu.org>
Download mbox | patch
Permalink /patch/722213/
State New
Headers show

Comments

ebrahim@gnu.org - Feb. 9, 2019, 10:44 a.m.
On 2/9/19 1:16 PM, Johan Hovold wrote:
> On Sat, Feb 09, 2019 at 12:18:40PM +0330, ebrahim@gnu.org wrote:
>> From: Ebrahim Byagowi <ebrahim@gnu.org>
>>
>> This makes Delock Infrared adapter to work as a USB to Serial device.
>> ---
>>  drivers/usb/serial/pl2303.c | 1 +
>>  drivers/usb/serial/pl2303.h | 3 +++
>>  2 files changed, 4 insertions(+)
>>
>> diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
>> index 98e7a5df0..d5ec72575 100644
>> --- a/drivers/usb/serial/pl2303.c
>> +++ b/drivers/usb/serial/pl2303.c
>> @@ -105,6 +105,7 @@ static const struct usb_device_id id_table[] = {
>>  	{ USB_DEVICE(SANWA_VENDOR_ID, SANWA_PRODUCT_ID) },
>>  	{ USB_DEVICE(ADLINK_VENDOR_ID, ADLINK_ND6530_PRODUCT_ID) },
>>  	{ USB_DEVICE(SMART_VENDOR_ID, SMART_PRODUCT_ID) },
>> +	{ USB_DEVICE(DELOCK_VENDOR_ID, DELOCK_PRODUCT_ID) },
>>  	{ }					/* Terminating entry */
>>  };
>>  
>> diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
>> index 4e2554d55..01936de13 100644
>> --- a/drivers/usb/serial/pl2303.h
>> +++ b/drivers/usb/serial/pl2303.h
>> @@ -153,3 +153,6 @@
>>  #define SMART_VENDOR_ID	0x0b8c
>>  #define SMART_PRODUCT_ID	0x2303
>>  
>> +/* Delock Infrared Adapter */
>> +#define DELOCK_VENDOR_ID	0x1685
>> +#define DELOCK_PRODUCT_ID	0x2000
> Please post the output of lsusb -v for this device, and perhaps also a
> log from when connecting the device with driver debugging enabled.
lsusb -v -d 1685:0200

Bus 002 Device 019: ID 1685:0200 Delock Infrared adapter
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass         1
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x1685 Delock
  idProduct          0x0200 Infrared adapter
  bcdDevice            0.08
  iManufacturer           0
  iProduct                0
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0027
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              440mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass         0
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000a  1x 10 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0


I've uploaded a screenshot here
https://commons.wikimedia.org/wiki/File:A_modified_kernel_screenshot_on_QEMU.png
which shows it understands a remote control commands also.

>
> How did you determine that this a pl2303 device?

I tried to find a compatible driver from different IR adapters I have
around, one of them a 0df7:0620 which identifies itself as a `Mobile
Action Technology, Inc. MA-620 Infrared Adapter`, enlisted on the same
header, uses the driver and I found the same driver works for this dongle.

Uploaded the patch with signed-off tag and correcting a copy paste
error, please ignore the original. Thanks!

>
> Johan
>
>
From 05164e35fca7c2b2bc3bb14e50c744a778460f6a Mon Sep 17 00:00:00 2001
From: Ebrahim Byagowi <ebrahim@gnu.org>
Date: Sat, 9 Feb 2019 11:05:23 +0330
Subject: [PATCH] USB: serial: pl2303: add Delock Infrared device id

This makes Delock Infrared adapter to work as a USB to Serial device.

Signed-off-by: Ebrahim Byagowi <ebrahim@gnu.org>
---
 drivers/usb/serial/pl2303.c | 1 +
 drivers/usb/serial/pl2303.h | 3 +++
 2 files changed, 4 insertions(+)
Johan Hovold - Feb. 9, 2019, 3:41 p.m.
On Sat, Feb 09, 2019 at 02:14:21PM +0330, Ebrahim Byagowi wrote:
> 
> On 2/9/19 1:16 PM, Johan Hovold wrote:
> > On Sat, Feb 09, 2019 at 12:18:40PM +0330, ebrahim@gnu.org wrote:
> >> From: Ebrahim Byagowi <ebrahim@gnu.org>
> >>
> >> This makes Delock Infrared adapter to work as a USB to Serial device.
> >> ---
> >>  drivers/usb/serial/pl2303.c | 1 +
> >>  drivers/usb/serial/pl2303.h | 3 +++
> >>  2 files changed, 4 insertions(+)
 
> >> +/* Delock Infrared Adapter */
> >> +#define DELOCK_VENDOR_ID	0x1685
> >> +#define DELOCK_PRODUCT_ID	0x2000
> > Please post the output of lsusb -v for this device, and perhaps also a
> > log from when connecting the device with driver debugging enabled.
> lsusb -v -d 1685:0200
> 
> Bus 002 Device 019: ID 1685:0200 Delock Infrared adapter
> Couldn't open device, some information will be missing
> Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               1.10
>   bDeviceClass          255 Vendor Specific Class
>   bDeviceSubClass         1
>   bDeviceProtocol         0
>   bMaxPacketSize0         8
>   idVendor           0x1685 Delock
>   idProduct          0x0200 Infrared adapter
>   bcdDevice            0.08
>   iManufacturer           0
>   iProduct                0
>   iSerial                 0
>   bNumConfigurations      1
>   Configuration Descriptor:
>     bLength                 9
>     bDescriptorType         2
>     wTotalLength       0x0027
>     bNumInterfaces          1
>     bConfigurationValue     1
>     iConfiguration          0
>     bmAttributes         0x80
>       (Bus Powered)
>     MaxPower              440mA
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        0
>       bAlternateSetting       0
>       bNumEndpoints           3
>       bInterfaceClass         0
>       bInterfaceSubClass      0
>       bInterfaceProtocol      0
>       iInterface              0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x81  EP 1 IN
>         bmAttributes            3
>           Transfer Type            Interrupt
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x000a  1x 10 bytes
>         bInterval               1
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x02  EP 2 OUT
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0040  1x 64 bytes
>         bInterval               0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x83  EP 3 IN
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0040  1x 64 bytes
>         bInterval               0

These descriptors do no look like they come from a pl2303 device (e.g.
the device descriptor class and protocol is 255/1/0 and not 0/0/0).

> I've uploaded a screenshot here
> https://commons.wikimedia.org/wiki/File:A_modified_kernel_screenshot_on_QEMU.png
> which shows it understands a remote control commands also.

It shows that you receive something over the bulk-in endpoint at the
default line speed, but those -EPIPE errors also tells us that this is
not a pl2303 device.

I suspect there are further errors in the log after you've opened the
device which can involve setting the baudrate.

> > How did you determine that this a pl2303 device?
> 
> I tried to find a compatible driver from different IR adapters I have
> around, one of them a 0df7:0620 which identifies itself as a `Mobile
> Action Technology, Inc. MA-620 Infrared Adapter`, enlisted on the same
> header, uses the driver and I found the same driver works for this dongle.

Some quick searching for the MA-620 descriptors show that those are
indeed from a pl2303 and are quite different from the ones you posted
above:

	https://sparcher.blogspot.com/2016/11/howto-some-experience-with-usb-irda.html

There are other usb-serial chips that can be found in other ir-devices
too.

Would you be able to open the device to see if you can identify a
generic usb-serial chip inside?

Johan
ebrahim@gnu.org - Feb. 9, 2019, 10:19 p.m.
On 2/9/19 7:11 PM, Johan Hovold wrote:
> On Sat, Feb 09, 2019 at 02:14:21PM +0330, Ebrahim Byagowi wrote:
>> On 2/9/19 1:16 PM, Johan Hovold wrote:
>>> On Sat, Feb 09, 2019 at 12:18:40PM +0330, ebrahim@gnu.org wrote:
>>>> From: Ebrahim Byagowi <ebrahim@gnu.org>
>>>>
>>>> This makes Delock Infrared adapter to work as a USB to Serial device.
>>>> ---
>>>>  drivers/usb/serial/pl2303.c | 1 +
>>>>  drivers/usb/serial/pl2303.h | 3 +++
>>>>  2 files changed, 4 insertions(+)
>  
>>>> +/* Delock Infrared Adapter */
>>>> +#define DELOCK_VENDOR_ID	0x1685
>>>> +#define DELOCK_PRODUCT_ID	0x2000
>>> Please post the output of lsusb -v for this device, and perhaps also a
>>> log from when connecting the device with driver debugging enabled.
>> lsusb -v -d 1685:0200
>>
>> Bus 002 Device 019: ID 1685:0200 Delock Infrared adapter
>> Couldn't open device, some information will be missing
>> Device Descriptor:
>>   bLength                18
>>   bDescriptorType         1
>>   bcdUSB               1.10
>>   bDeviceClass          255 Vendor Specific Class
>>   bDeviceSubClass         1
>>   bDeviceProtocol         0
>>   bMaxPacketSize0         8
>>   idVendor           0x1685 Delock
>>   idProduct          0x0200 Infrared adapter
>>   bcdDevice            0.08
>>   iManufacturer           0
>>   iProduct                0
>>   iSerial                 0
>>   bNumConfigurations      1
>>   Configuration Descriptor:
>>     bLength                 9
>>     bDescriptorType         2
>>     wTotalLength       0x0027
>>     bNumInterfaces          1
>>     bConfigurationValue     1
>>     iConfiguration          0
>>     bmAttributes         0x80
>>       (Bus Powered)
>>     MaxPower              440mA
>>     Interface Descriptor:
>>       bLength                 9
>>       bDescriptorType         4
>>       bInterfaceNumber        0
>>       bAlternateSetting       0
>>       bNumEndpoints           3
>>       bInterfaceClass         0
>>       bInterfaceSubClass      0
>>       bInterfaceProtocol      0
>>       iInterface              0
>>       Endpoint Descriptor:
>>         bLength                 7
>>         bDescriptorType         5
>>         bEndpointAddress     0x81  EP 1 IN
>>         bmAttributes            3
>>           Transfer Type            Interrupt
>>           Synch Type               None
>>           Usage Type               Data
>>         wMaxPacketSize     0x000a  1x 10 bytes
>>         bInterval               1
>>       Endpoint Descriptor:
>>         bLength                 7
>>         bDescriptorType         5
>>         bEndpointAddress     0x02  EP 2 OUT
>>         bmAttributes            2
>>           Transfer Type            Bulk
>>           Synch Type               None
>>           Usage Type               Data
>>         wMaxPacketSize     0x0040  1x 64 bytes
>>         bInterval               0
>>       Endpoint Descriptor:
>>         bLength                 7
>>         bDescriptorType         5
>>         bEndpointAddress     0x83  EP 3 IN
>>         bmAttributes            2
>>           Transfer Type            Bulk
>>           Synch Type               None
>>           Usage Type               Data
>>         wMaxPacketSize     0x0040  1x 64 bytes
>>         bInterval               0
> These descriptors do no look like they come from a pl2303 device (e.g.
> the device descriptor class and protocol is 255/1/0 and not 0/0/0).
>
>> I've uploaded a screenshot here
>> https://commons.wikimedia.org/wiki/File:A_modified_kernel_screenshot_on_QEMU.png
>> which shows it understands a remote control commands also.
> It shows that you receive something over the bulk-in endpoint at the
> default line speed, but those -EPIPE errors also tells us that this is
> not a pl2303 device.
Oh, understandable. And very sorry that I was misleading here.
>
> I suspect there are further errors in the log after you've opened the
> device which can involve setting the baudrate.
>
>>> How did you determine that this a pl2303 device?
>> I tried to find a compatible driver from different IR adapters I have
>> around, one of them a 0df7:0620 which identifies itself as a `Mobile
>> Action Technology, Inc. MA-620 Infrared Adapter`, enlisted on the same
>> header, uses the driver and I found the same driver works for this dongle.
> Some quick searching for the MA-620 descriptors show that those are
> indeed from a pl2303 and are quite different from the ones you posted
> above:
>
> 	https://sparcher.blogspot.com/2016/11/howto-some-experience-with-usb-irda.html
>
> There are other usb-serial chips that can be found in other ir-devices
> too.
>
> Would you be able to open the device to see if you can identify a
> generic usb-serial chip inside?

Here is a picture of its inside[1] and that 3606 apparently is the usb
to serial chip.

We suspected it is related to[2] but its pins doesn't match and I
couldn't yet test the module provided there is related for some reason
so any pointer will be nice.

Thanks!

  [1]:
https://commons.wikimedia.org/wiki/File:Infrared_Device,_VID1685_PID0200.jpg

  [2]:
https://www.asix.com.tw/products.php?op=pItemdetail&PItemID=112;74;109&PLine=74

>
> Johan
>
>
Johan Hovold - Feb. 11, 2019, 8:24 a.m.
On Sun, Feb 10, 2019 at 01:49:16AM +0330, Ebrahim Byagowi wrote:
> 
> On 2/9/19 7:11 PM, Johan Hovold wrote:
> > On Sat, Feb 09, 2019 at 02:14:21PM +0330, Ebrahim Byagowi wrote:
> >> On 2/9/19 1:16 PM, Johan Hovold wrote:
> >>> On Sat, Feb 09, 2019 at 12:18:40PM +0330, ebrahim@gnu.org wrote:
> >>>> From: Ebrahim Byagowi <ebrahim@gnu.org>
> >>>>
> >>>> This makes Delock Infrared adapter to work as a USB to Serial device.
> >>>> ---
> >>>>  drivers/usb/serial/pl2303.c | 1 +
> >>>>  drivers/usb/serial/pl2303.h | 3 +++
> >>>>  2 files changed, 4 insertions(+)

> > These descriptors do no look like they come from a pl2303 device (e.g.
> > the device descriptor class and protocol is 255/1/0 and not 0/0/0).
> >
> >> I've uploaded a screenshot here
> >> https://commons.wikimedia.org/wiki/File:A_modified_kernel_screenshot_on_QEMU.png
> >> which shows it understands a remote control commands also.
> > It shows that you receive something over the bulk-in endpoint at the
> > default line speed, but those -EPIPE errors also tells us that this is
> > not a pl2303 device.
> Oh, understandable. And very sorry that I was misleading here.

No, problem.

> > Would you be able to open the device to see if you can identify a
> > generic usb-serial chip inside?
> 
> Here is a picture of its inside[1] and that 3606 apparently is the usb
> to serial chip.
> 
> We suspected it is related to[2] but its pins doesn't match and I
> couldn't yet test the module provided there is related for some reason
> so any pointer will be nice.

No, sorry. It's seems unlikely to be a mcs7780 given the pins.

Perhaps looking closer at the windows driver and snooping traffic might
provide some insights into the protocol used.

A search also revealed one libusb project for this device on
sourcefourge, but judging from a very quick look it also just did reads
and writes over the bulk-endpoints without any control commands. But
perhaps someone has done some research in this area before you.

Johan

>   [1]:
> https://commons.wikimedia.org/wiki/File:Infrared_Device,_VID1685_PID0200.jpg
> 
>   [2]:
> https://www.asix.com.tw/products.php?op=pItemdetail&PItemID=112;74;109&PLine=74
ebrahim@gnu.org - Feb. 11, 2019, 10:17 a.m.
Fantastic, thank you so much for the help.

On 2/11/19 11:54 AM, Johan Hovold wrote:
> On Sun, Feb 10, 2019 at 01:49:16AM +0330, Ebrahim Byagowi wrote:
>> On 2/9/19 7:11 PM, Johan Hovold wrote:
>>> On Sat, Feb 09, 2019 at 02:14:21PM +0330, Ebrahim Byagowi wrote:
>>>> On 2/9/19 1:16 PM, Johan Hovold wrote:
>>>>> On Sat, Feb 09, 2019 at 12:18:40PM +0330, ebrahim@gnu.org wrote:
>>>>>> From: Ebrahim Byagowi <ebrahim@gnu.org>
>>>>>>
>>>>>> This makes Delock Infrared adapter to work as a USB to Serial device.
>>>>>> ---
>>>>>>  drivers/usb/serial/pl2303.c | 1 +
>>>>>>  drivers/usb/serial/pl2303.h | 3 +++
>>>>>>  2 files changed, 4 insertions(+)
>>> These descriptors do no look like they come from a pl2303 device (e.g.
>>> the device descriptor class and protocol is 255/1/0 and not 0/0/0).
>>>
>>>> I've uploaded a screenshot here
>>>> https://commons.wikimedia.org/wiki/File:A_modified_kernel_screenshot_on_QEMU.png
>>>> which shows it understands a remote control commands also.
>>> It shows that you receive something over the bulk-in endpoint at the
>>> default line speed, but those -EPIPE errors also tells us that this is
>>> not a pl2303 device.
>> Oh, understandable. And very sorry that I was misleading here.
> No, problem.
>
>>> Would you be able to open the device to see if you can identify a
>>> generic usb-serial chip inside?
>> Here is a picture of its inside[1] and that 3606 apparently is the usb
>> to serial chip.
>>
>> We suspected it is related to[2] but its pins doesn't match and I
>> couldn't yet test the module provided there is related for some reason
>> so any pointer will be nice.
> No, sorry. It's seems unlikely to be a mcs7780 given the pins.
>
> Perhaps looking closer at the windows driver and snooping traffic might
> provide some insights into the protocol used.
>
> A search also revealed one libusb project for this device on
> sourcefourge, but judging from a very quick look it also just did reads
> and writes over the bulk-endpoints without any control commands. But
> perhaps someone has done some research in this area before you.
>
> Johan
>
>>   [1]:
>> https://commons.wikimedia.org/wiki/File:Infrared_Device,_VID1685_PID0200.jpg
>>
>>   [2]:
>> https://www.asix.com.tw/products.php?op=pItemdetail&PItemID=112;74;109&PLine=74
>

Patch

From 05164e35fca7c2b2bc3bb14e50c744a778460f6a Mon Sep 17 00:00:00 2001
From: Ebrahim Byagowi <ebrahim@gnu.org>
Date: Sat, 9 Feb 2019 11:05:23 +0330
Subject: [PATCH] USB: serial: pl2303: add Delock Infrared device id

This makes Delock Infrared adapter to work as a USB to Serial device.

Signed-off-by: Ebrahim Byagowi <ebrahim@gnu.org>
---
 drivers/usb/serial/pl2303.c | 1 +
 drivers/usb/serial/pl2303.h | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 98e7a5df0..d5ec72575 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -105,6 +105,7 @@  static const struct usb_device_id id_table[] = {
 	{ USB_DEVICE(SANWA_VENDOR_ID, SANWA_PRODUCT_ID) },
 	{ USB_DEVICE(ADLINK_VENDOR_ID, ADLINK_ND6530_PRODUCT_ID) },
 	{ USB_DEVICE(SMART_VENDOR_ID, SMART_PRODUCT_ID) },
+	{ USB_DEVICE(DELOCK_VENDOR_ID, DELOCK_PRODUCT_ID) },
 	{ }					/* Terminating entry */
 };
 
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
index 4e2554d55..6e6df7823 100644
--- a/drivers/usb/serial/pl2303.h
+++ b/drivers/usb/serial/pl2303.h
@@ -153,3 +153,6 @@ 
 #define SMART_VENDOR_ID	0x0b8c
 #define SMART_PRODUCT_ID	0x2303
 
+/* Delock Infrared Adapter */
+#define DELOCK_VENDOR_ID	0x1685
+#define DELOCK_PRODUCT_ID	0x0200
-- 
2.20.1