All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "USB: serial: ch341: add new Product ID for CH341A"
@ 2022-02-07  0:08 Dmytro Bagrii
  2022-02-08 10:34 ` Greg KH
  0 siblings, 1 reply; 11+ messages in thread
From: Dmytro Bagrii @ 2022-02-07  0:08 UTC (permalink / raw)
  To: linux-usb; +Cc: Dmytro Bagrii

This reverts commit 46ee4abb10a07bd8f8ce910ee6b4ae6a947d7f63.

CH341A has three different modes of operation selectable either by
hardware pin connections or by external EEPROM configuration. Each
mode is represented by corresponding product ID:

0x5523: Asyncronous Serial Interface
0x5584: Parallel Printer Interface
0x5512: EPP/MEM Interface

(See "5.3.Function configuration" in datasheet at wch-ic.com/downloads/CH341DS1_PDF.html)

When CH341A is configured as EPP/MEM Interface it appears as 1a86:5512 and being mistakenly
handled by ch341 USB serial driver.

It is possible to use CH341A in EPP/MEM mode only if ch341 module is blacklisted, but it must be
unblacklisted every time to use CH341A as a serial converter. Also obviously it is impossible
to use two CH341A boards in different modes simoultaneously.

Signed-off-by: Dmytro Bagrii <dimich.dmb@gmail.com>
---
 drivers/usb/serial/ch341.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
index 29f4b87a9e74..65f1286f7905 100644
--- a/drivers/usb/serial/ch341.c
+++ b/drivers/usb/serial/ch341.c
@@ -81,7 +81,6 @@
 #define CH341_QUIRK_SIMULATE_BREAK	BIT(1)
 
 static const struct usb_device_id id_table[] = {
-	{ USB_DEVICE(0x1a86, 0x5512) },
 	{ USB_DEVICE(0x1a86, 0x5523) },
 	{ USB_DEVICE(0x1a86, 0x7522) },
 	{ USB_DEVICE(0x1a86, 0x7523) },
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] Revert "USB: serial: ch341: add new Product ID for CH341A"
  2022-02-07  0:08 [PATCH] Revert "USB: serial: ch341: add new Product ID for CH341A" Dmytro Bagrii
@ 2022-02-08 10:34 ` Greg KH
  2022-02-08 13:34   ` Dmytro Bagrii
  2022-02-10 16:41   ` [PATCH v2] " Dmytro Bagrii
  0 siblings, 2 replies; 11+ messages in thread
From: Greg KH @ 2022-02-08 10:34 UTC (permalink / raw)
  To: Jan-Niklas Burfeind, Dmytro Bagrii; +Cc: linux-usb

On Mon, Feb 07, 2022 at 02:08:23AM +0200, Dmytro Bagrii wrote:
> This reverts commit 46ee4abb10a07bd8f8ce910ee6b4ae6a947d7f63.

You forgot to cc: the author of that commit, why?

Also forgot to cc: the maintainer of the driver/subsytem?

> CH341A has three different modes of operation selectable either by
> hardware pin connections or by external EEPROM configuration. Each
> mode is represented by corresponding product ID:
> 
> 0x5523: Asyncronous Serial Interface
> 0x5584: Parallel Printer Interface
> 0x5512: EPP/MEM Interface

That does not corrispond with what Jan-Niklas said in the original
commit.

> 
> (See "5.3.Function configuration" in datasheet at wch-ic.com/downloads/CH341DS1_PDF.html)
> 
> When CH341A is configured as EPP/MEM Interface it appears as 1a86:5512 and being mistakenly
> handled by ch341 USB serial driver.
> 
> It is possible to use CH341A in EPP/MEM mode only if ch341 module is blacklisted, but it must be
> unblacklisted every time to use CH341A as a serial converter. Also obviously it is impossible
> to use two CH341A boards in different modes simoultaneously.

Please wrap your lines at 72 columns.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Revert "USB: serial: ch341: add new Product ID for CH341A"
  2022-02-08 10:34 ` Greg KH
@ 2022-02-08 13:34   ` Dmytro Bagrii
  2022-02-09 14:18     ` Johan Hovold
  2022-02-10 16:41   ` [PATCH v2] " Dmytro Bagrii
  1 sibling, 1 reply; 11+ messages in thread
From: Dmytro Bagrii @ 2022-02-08 13:34 UTC (permalink / raw)
  To: Greg KH, Jan-Niklas Burfeind
  Cc: linux-usb, Frank A Kingswood, Frank Zago, Johan Hovold

On 08.02.22 12:34, Greg KH wrote:
> On Mon, Feb 07, 2022 at 02:08:23AM +0200, Dmytro Bagrii wrote:
>> This reverts commit 46ee4abb10a07bd8f8ce910ee6b4ae6a947d7f63.
> 
> You forgot to cc: the author of that commit, why?
> 
> Also forgot to cc: the maintainer of the driver/subsytem?

Sorry, forgot to add them. Also adding Johan Hovold, Frank A Kingswood 
and Frank Zago in the loop.

>> CH341A has three different modes of operation selectable either by
>> hardware pin connections or by external EEPROM configuration. Each
>> mode is represented by corresponding product ID:
>>
>> 0x5523: Asyncronous Serial Interface
>> 0x5584: Parallel Printer Interface
>> 0x5512: EPP/MEM Interface
> 
> That does not corrispond with what Jan-Niklas said in the original
> commit.

The page mentioned in the original commit is unavailable for me for some 
reason.

I refer to the chip manufacturer documentation from here: 
http://wch-ic.com/downloads/CH341DS1_PDF.html.

I have this kind of CH341A programmer: 
http://www.chinalctech.com/cpzx/Programmer/Serial_Module/266.html

When mode selection jumper is set to UART:

[52206.834474] usb 1-4.1: new full-speed USB device number 10 using xhci_hcd
[52206.925482] usb 1-4.1: New USB device found, idVendor=1a86, 
idProduct=5523, bcdDevice= 3.04
[52206.925494] usb 1-4.1: New USB device strings: Mfr=0, Product=0, 
SerialNumber=0
[52206.973701] usbcore: registered new interface driver ch341
[52206.973710] usbserial: USB Serial support registered for ch341-uart
[52206.973720] ch341 1-4.1:1.0: ch341-uart converter detected
[52206.974424] usb 1-4.1: ch341-uart converter now attached to ttyUSB0

ch341 creates /dev/ttyUSB0 and it works as a serial port, as expected.

When mode selection jumper is set to I2C/SPI (it uses EPP/MEM Interface):

[52413.942116] usb 1-4.1: new full-speed USB device number 11 using xhci_hcd
[52414.033085] usb 1-4.1: New USB device found, idVendor=1a86, 
idProduct=5512, bcdDevice= 3.04
[52414.033097] usb 1-4.1: New USB device strings: Mfr=0, Product=0, 
SerialNumber=0
[52414.040928] ch341 1-4.1:1.0: ch341-uart converter detected
[52414.041930] usb 1-4.1: ch341-uart converter now attached to ttyUSB0

ch341 creates /dev/ttyUSB0 but it doesn't work.

To use CH341A programmer as I2C/SPI converter either external module is 
required or userspace tools must be used. But they don't work until 
ch341 handles 1a86:5512.

If unbind device from ch341 module:

# echo 1-4.1:1.0 > /sys/bus/usb/drivers/ch341/unbind

I2C/SPI tools start to work correctly.

>> (See "5.3.Function configuration" in datasheet at wch-ic.com/downloads/CH341DS1_PDF.html)
>>
>> When CH341A is configured as EPP/MEM Interface it appears as 1a86:5512 and being mistakenly
>> handled by ch341 USB serial driver.
>>
>> It is possible to use CH341A in EPP/MEM mode only if ch341 module is blacklisted, but it must be
>> unblacklisted every time to use CH341A as a serial converter. Also obviously it is impossible
>> to use two CH341A boards in different modes simoultaneously.
> 
> Please wrap your lines at 72 columns.

Sure. Should i submit new patch verіon then?

> thanks,
> 
> greg k-h

-dmytro

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Revert "USB: serial: ch341: add new Product ID for CH341A"
  2022-02-08 13:34   ` Dmytro Bagrii
@ 2022-02-09 14:18     ` Johan Hovold
  2022-02-09 17:24       ` Jan-Niklas Burfeind
                         ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Johan Hovold @ 2022-02-09 14:18 UTC (permalink / raw)
  To: Dmytro Bagrii, Jan-Niklas Burfeind
  Cc: Greg KH, Jan-Niklas Burfeind, linux-usb, Frank A Kingswood, Frank Zago

On Tue, Feb 08, 2022 at 03:34:19PM +0200, Dmytro Bagrii wrote:
> On 08.02.22 12:34, Greg KH wrote:
> > On Mon, Feb 07, 2022 at 02:08:23AM +0200, Dmytro Bagrii wrote:
> >> This reverts commit 46ee4abb10a07bd8f8ce910ee6b4ae6a947d7f63.

> >> CH341A has three different modes of operation selectable either by
> >> hardware pin connections or by external EEPROM configuration. Each
> >> mode is represented by corresponding product ID:
> >>
> >> 0x5523: Asyncronous Serial Interface
> >> 0x5584: Parallel Printer Interface
> >> 0x5512: EPP/MEM Interface
> > 
> > That does not corrispond with what Jan-Niklas said in the original
> > commit.
> 
> The page mentioned in the original commit is unavailable for me for some 
> reason.
> 
> I refer to the chip manufacturer documentation from here: 
> http://wch-ic.com/downloads/CH341DS1_PDF.html.
> 
> I have this kind of CH341A programmer: 
> http://www.chinalctech.com/cpzx/Programmer/Serial_Module/266.html
> 
> When mode selection jumper is set to UART:
> 
> [52206.834474] usb 1-4.1: new full-speed USB device number 10 using xhci_hcd
> [52206.925482] usb 1-4.1: New USB device found, idVendor=1a86, 
> idProduct=5523, bcdDevice= 3.04
> [52206.925494] usb 1-4.1: New USB device strings: Mfr=0, Product=0, 
> SerialNumber=0
> [52206.973701] usbcore: registered new interface driver ch341
> [52206.973710] usbserial: USB Serial support registered for ch341-uart
> [52206.973720] ch341 1-4.1:1.0: ch341-uart converter detected
> [52206.974424] usb 1-4.1: ch341-uart converter now attached to ttyUSB0
> 
> ch341 creates /dev/ttyUSB0 and it works as a serial port, as expected.
> 
> When mode selection jumper is set to I2C/SPI (it uses EPP/MEM Interface):
> 
> [52413.942116] usb 1-4.1: new full-speed USB device number 11 using xhci_hcd
> [52414.033085] usb 1-4.1: New USB device found, idVendor=1a86, 
> idProduct=5512, bcdDevice= 3.04
> [52414.033097] usb 1-4.1: New USB device strings: Mfr=0, Product=0, 
> SerialNumber=0
> [52414.040928] ch341 1-4.1:1.0: ch341-uart converter detected
> [52414.041930] usb 1-4.1: ch341-uart converter now attached to ttyUSB0
> 
> ch341 creates /dev/ttyUSB0 but it doesn't work.
> 
> To use CH341A programmer as I2C/SPI converter either external module is 
> required or userspace tools must be used. But they don't work until 
> ch341 handles 1a86:5512.
> 
> If unbind device from ch341 module:
> 
> # echo 1-4.1:1.0 > /sys/bus/usb/drivers/ch341/unbind
> 
> I2C/SPI tools start to work correctly.
> 
> >> (See "5.3.Function configuration" in datasheet at wch-ic.com/downloads/CH341DS1_PDF.html)
> >>
> >> When CH341A is configured as EPP/MEM Interface it appears as 1a86:5512 and being mistakenly
> >> handled by ch341 USB serial driver.
> >>
> >> It is possible to use CH341A in EPP/MEM mode only if ch341 module is blacklisted, but it must be
> >> unblacklisted every time to use CH341A as a serial converter. Also obviously it is impossible
> >> to use two CH341A boards in different modes simoultaneously.
> > 
> > Please wrap your lines at 72 columns.
> 
> Sure. Should i submit new patch verіon then?

Please do so. But make sure you read this thread first if you haven't
already:

	https://lore.kernel.org/r/YJ0OCS/sh+1ifD/q@hovoldconsulting.com

I don't remember all the details, but judging from a quick look it seems
we're just waiting for someone to resend the revert with a proper
explanation.

It would be good if Jan-Niklas could chime in too and confirm if he's
able to use the device in UART mode instead.

Johan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Revert "USB: serial: ch341: add new Product ID for CH341A"
  2022-02-09 14:18     ` Johan Hovold
@ 2022-02-09 17:24       ` Jan-Niklas Burfeind
  2022-02-10  5:41       ` Dmytro Bagrii
  2022-02-10 10:18       ` Jan-Niklas Burfeind
  2 siblings, 0 replies; 11+ messages in thread
From: Jan-Niklas Burfeind @ 2022-02-09 17:24 UTC (permalink / raw)
  To: Johan Hovold, Dmytro Bagrii, Jan-Niklas Burfeind
  Cc: Greg KH, linux-usb, Frank A Kingswood, Frank Zago

I'm sorry, I did not notice this earlier;
will look into it tomorrow morning.

Thanks
Jan-Niklas Burfeind

On 2/9/22 15:18, Johan Hovold wrote:

> 
> It would be good if Jan-Niklas could chime in too and confirm if he's
> able to use the device in UART mode instead.
> 
> Johan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Revert "USB: serial: ch341: add new Product ID for CH341A"
  2022-02-09 14:18     ` Johan Hovold
  2022-02-09 17:24       ` Jan-Niklas Burfeind
@ 2022-02-10  5:41       ` Dmytro Bagrii
  2022-02-21  8:48         ` Johan Hovold
  2022-02-10 10:18       ` Jan-Niklas Burfeind
  2 siblings, 1 reply; 11+ messages in thread
From: Dmytro Bagrii @ 2022-02-10  5:41 UTC (permalink / raw)
  To: Johan Hovold, Jan-Niklas Burfeind
  Cc: Greg KH, linux-usb, Frank A Kingswood, Frank Zago

On 09.02.22 16:18, Johan Hovold wrote:
> On Tue, Feb 08, 2022 at 03:34:19PM +0200, Dmytro Bagrii wrote:
>> On 08.02.22 12:34, Greg KH wrote:
>>> On Mon, Feb 07, 2022 at 02:08:23AM +0200, Dmytro Bagrii wrote:
>>>> This reverts commit 46ee4abb10a07bd8f8ce910ee6b4ae6a947d7f63.
> 
>>>> CH341A has three different modes of operation selectable either by
>>>> hardware pin connections or by external EEPROM configuration. Each
>>>> mode is represented by corresponding product ID:
>>>>
>>>> 0x5523: Asyncronous Serial Interface
>>>> 0x5584: Parallel Printer Interface
>>>> 0x5512: EPP/MEM Interface
>>>
>>> That does not corrispond with what Jan-Niklas said in the original
>>> commit.
>>
>> The page mentioned in the original commit is unavailable for me for some 
>> reason.
>>
>> I refer to the chip manufacturer documentation from here: 
>> http://wch-ic.com/downloads/CH341DS1_PDF.html.
>>
>> I have this kind of CH341A programmer: 
>> http://www.chinalctech.com/cpzx/Programmer/Serial_Module/266.html
>>
>> When mode selection jumper is set to UART:
>>
>> [52206.834474] usb 1-4.1: new full-speed USB device number 10 using xhci_hcd
>> [52206.925482] usb 1-4.1: New USB device found, idVendor=1a86, 
>> idProduct=5523, bcdDevice= 3.04
>> [52206.925494] usb 1-4.1: New USB device strings: Mfr=0, Product=0, 
>> SerialNumber=0
>> [52206.973701] usbcore: registered new interface driver ch341
>> [52206.973710] usbserial: USB Serial support registered for ch341-uart
>> [52206.973720] ch341 1-4.1:1.0: ch341-uart converter detected
>> [52206.974424] usb 1-4.1: ch341-uart converter now attached to ttyUSB0
>>
>> ch341 creates /dev/ttyUSB0 and it works as a serial port, as expected.
>>
>> When mode selection jumper is set to I2C/SPI (it uses EPP/MEM Interface):
>>
>> [52413.942116] usb 1-4.1: new full-speed USB device number 11 using xhci_hcd
>> [52414.033085] usb 1-4.1: New USB device found, idVendor=1a86, 
>> idProduct=5512, bcdDevice= 3.04
>> [52414.033097] usb 1-4.1: New USB device strings: Mfr=0, Product=0, 
>> SerialNumber=0
>> [52414.040928] ch341 1-4.1:1.0: ch341-uart converter detected
>> [52414.041930] usb 1-4.1: ch341-uart converter now attached to ttyUSB0
>>
>> ch341 creates /dev/ttyUSB0 but it doesn't work.
>>
>> To use CH341A programmer as I2C/SPI converter either external module is 
>> required or userspace tools must be used. But they don't work until 
>> ch341 handles 1a86:5512.
>>
>> If unbind device from ch341 module:
>>
>> # echo 1-4.1:1.0 > /sys/bus/usb/drivers/ch341/unbind
>>
>> I2C/SPI tools start to work correctly.
>>
>>>> (See "5.3.Function configuration" in datasheet at wch-ic.com/downloads/CH341DS1_PDF.html)
>>>>
>>>> When CH341A is configured as EPP/MEM Interface it appears as 1a86:5512 and being mistakenly
>>>> handled by ch341 USB serial driver.
>>>>
>>>> It is possible to use CH341A in EPP/MEM mode only if ch341 module is blacklisted, but it must be
>>>> unblacklisted every time to use CH341A as a serial converter. Also obviously it is impossible
>>>> to use two CH341A boards in different modes simoultaneously.
>>>
>>> Please wrap your lines at 72 columns.
>>
>> Sure. Should i submit new patch verіon then?
> 
> Please do so. But make sure you read this thread first if you haven't
> already:
> 
> 	https://lore.kernel.org/r/YJ0OCS/sh+1ifD/q@hovoldconsulting.com

Thanks. After i saw this patch i figured it out to remove and blacklist 
ch341 module to get CH341A working as I2C/SPI converter with i2c-ch341 
and spi-ch341-usb drivers.

I can confirm, CH341A works as serial converter with ch341 driver when it 
is configured as UART and has PID 5523. It can't work as I2C/SPI converter 
when configured as I2C/SPI and has PID5512 unless ch341 module is removed 
and blacklisted.

> I don't remember all the details, but judging from a quick look it seems
> we're just waiting for someone to resend the revert with a proper
> explanation.
> 
> It would be good if Jan-Niklas could chime in too and confirm if he's
> able to use the device in UART mode instead.

I'd like to take a look at that keeyees device from original commit 
message to see if it has EEPROM chip. I can hypothesize that some 
manufacturer of a CH341-based programmer could use external configuration 
EEPROM and mixed-up PID value. I haven't experiment with configuring 
CH341A with EEPROM but suppose it's possible to burn any custom VID:PID 
there. I don't think ch341 driver has to handle any of such custom 
VID/PID, especially if it conflicts with an original VID/PID assigned by 
chip manufacturer. In case of some peculiar devices it's possible to bind 
custom VID:PID to the driver via sysfs.

But it's just my hypothetical assumption how ch341-based device with PID 
5512 could work as UART in that case.

I just checked if CH341 that i have can work as UART when configured as 
I2C/SPI (PID 5512). I doesn't work: no output signal on TX pin, no 
loopback echo when RX connected to self TX.

-- 
Best Regards,
Dmytro Bagrii.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Revert "USB: serial: ch341: add new Product ID for CH341A"
  2022-02-09 14:18     ` Johan Hovold
  2022-02-09 17:24       ` Jan-Niklas Burfeind
  2022-02-10  5:41       ` Dmytro Bagrii
@ 2022-02-10 10:18       ` Jan-Niklas Burfeind
  2022-02-21  8:49         ` Johan Hovold
  2 siblings, 1 reply; 11+ messages in thread
From: Jan-Niklas Burfeind @ 2022-02-10 10:18 UTC (permalink / raw)
  To: Johan Hovold, Dmytro Bagrii, Jan-Niklas Burfeind
  Cc: Greg KH, linux-usb, Frank A Kingswood, Frank Zago

Hello everyone.

For now I can identify two different USB-IDs depending on the Jumper 
position on the board:

1-2 connected: idVendor=1a86, idProduct=5512
2-3 or none  : idVendor=1a86, idProduct=5523

I'm not sure how I'd plug it to reach the Parallel Printer Interface 
mentioned before.

The advertised position of this Jumper is 1-2.
Both positions are labeled with two different chinese symbols, "2-3" is 
labeled with TTL as well.

Looking at the devices schematics I think its safe to revert my original 
commit and I'm sorry to have caused you all this trouble.

At the time I added the device I missidentified the Jumper as voltage 
level selector.

I had seen others using the board on youtube, with Jumper position 1-2;
and did not understand, why my system would not recognize it at all.


Sorry again and thanks for the effort
Jan-Niklas


On 2/9/22 15:18, Johan Hovold wrote:
> On Tue, Feb 08, 2022 at 03:34:19PM +0200, Dmytro Bagrii wrote:
>> On 08.02.22 12:34, Greg KH wrote:
>>> On Mon, Feb 07, 2022 at 02:08:23AM +0200, Dmytro Bagrii wrote:
>>>> This reverts commit 46ee4abb10a07bd8f8ce910ee6b4ae6a947d7f63.
> 
>>>> CH341A has three different modes of operation selectable either by
>>>> hardware pin connections or by external EEPROM configuration. Each
>>>> mode is represented by corresponding product ID:
>>>>
>>>> 0x5523: Asyncronous Serial Interface
>>>> 0x5584: Parallel Printer Interface
>>>> 0x5512: EPP/MEM Interface
>>>
>>> That does not corrispond with what Jan-Niklas said in the original
>>> commit.
>>
>> The page mentioned in the original commit is unavailable for me for some
>> reason.
>>
>> I refer to the chip manufacturer documentation from here:
>> http://wch-ic.com/downloads/CH341DS1_PDF.html.
>>
>> I have this kind of CH341A programmer:
>> http://www.chinalctech.com/cpzx/Programmer/Serial_Module/266.html
>>
>> When mode selection jumper is set to UART:
>>
>> [52206.834474] usb 1-4.1: new full-speed USB device number 10 using xhci_hcd
>> [52206.925482] usb 1-4.1: New USB device found, idVendor=1a86,
>> idProduct=5523, bcdDevice= 3.04
>> [52206.925494] usb 1-4.1: New USB device strings: Mfr=0, Product=0,
>> SerialNumber=0
>> [52206.973701] usbcore: registered new interface driver ch341
>> [52206.973710] usbserial: USB Serial support registered for ch341-uart
>> [52206.973720] ch341 1-4.1:1.0: ch341-uart converter detected
>> [52206.974424] usb 1-4.1: ch341-uart converter now attached to ttyUSB0
>>
>> ch341 creates /dev/ttyUSB0 and it works as a serial port, as expected.
>>
>> When mode selection jumper is set to I2C/SPI (it uses EPP/MEM Interface):
>>
>> [52413.942116] usb 1-4.1: new full-speed USB device number 11 using xhci_hcd
>> [52414.033085] usb 1-4.1: New USB device found, idVendor=1a86,
>> idProduct=5512, bcdDevice= 3.04
>> [52414.033097] usb 1-4.1: New USB device strings: Mfr=0, Product=0,
>> SerialNumber=0
>> [52414.040928] ch341 1-4.1:1.0: ch341-uart converter detected
>> [52414.041930] usb 1-4.1: ch341-uart converter now attached to ttyUSB0
>>
>> ch341 creates /dev/ttyUSB0 but it doesn't work.
>>
>> To use CH341A programmer as I2C/SPI converter either external module is
>> required or userspace tools must be used. But they don't work until
>> ch341 handles 1a86:5512.
>>
>> If unbind device from ch341 module:
>>
>> # echo 1-4.1:1.0 > /sys/bus/usb/drivers/ch341/unbind
>>
>> I2C/SPI tools start to work correctly.
>>
>>>> (See "5.3.Function configuration" in datasheet at wch-ic.com/downloads/CH341DS1_PDF.html)
>>>>
>>>> When CH341A is configured as EPP/MEM Interface it appears as 1a86:5512 and being mistakenly
>>>> handled by ch341 USB serial driver.
>>>>
>>>> It is possible to use CH341A in EPP/MEM mode only if ch341 module is blacklisted, but it must be
>>>> unblacklisted every time to use CH341A as a serial converter. Also obviously it is impossible
>>>> to use two CH341A boards in different modes simoultaneously.
>>>
>>> Please wrap your lines at 72 columns.
>>
>> Sure. Should i submit new patch verіon then?
> 
> Please do so. But make sure you read this thread first if you haven't
> already:
> 
> 	https://lore.kernel.org/r/YJ0OCS/sh+1ifD/q@hovoldconsulting.com
> 
> I don't remember all the details, but judging from a quick look it seems
> we're just waiting for someone to resend the revert with a proper
> explanation.
> 
> It would be good if Jan-Niklas could chime in too and confirm if he's
> able to use the device in UART mode instead.
> 
> Johan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2] Revert "USB: serial: ch341: add new Product ID for CH341A"
  2022-02-08 10:34 ` Greg KH
  2022-02-08 13:34   ` Dmytro Bagrii
@ 2022-02-10 16:41   ` Dmytro Bagrii
  2022-02-21  9:02     ` Johan Hovold
  1 sibling, 1 reply; 11+ messages in thread
From: Dmytro Bagrii @ 2022-02-10 16:41 UTC (permalink / raw)
  To: linux-usb, johan; +Cc: gregkh, kernel, Dmytro Bagrii

This reverts commit 46ee4abb10a07bd8f8ce910ee6b4ae6a947d7f63.

CH341 has Product ID 0x5512 in EPP/MEM mode which is used for
I2C/SPI/GPIO interfaces. In asynchronous serial interface mode
CH341 has PID 0x5523 which is already in the table.

Mode is selected by corresponding jumper setting.

Signed-off-by: Dmytro Bagrii <dimich.dmb@gmail.com>
---
 drivers/usb/serial/ch341.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
index 29f4b87a9e74..65f1286f7905 100644
--- a/drivers/usb/serial/ch341.c
+++ b/drivers/usb/serial/ch341.c
@@ -81,7 +81,6 @@
 #define CH341_QUIRK_SIMULATE_BREAK	BIT(1)
 
 static const struct usb_device_id id_table[] = {
-	{ USB_DEVICE(0x1a86, 0x5512) },
 	{ USB_DEVICE(0x1a86, 0x5523) },
 	{ USB_DEVICE(0x1a86, 0x7522) },
 	{ USB_DEVICE(0x1a86, 0x7523) },
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] Revert "USB: serial: ch341: add new Product ID for CH341A"
  2022-02-10  5:41       ` Dmytro Bagrii
@ 2022-02-21  8:48         ` Johan Hovold
  0 siblings, 0 replies; 11+ messages in thread
From: Johan Hovold @ 2022-02-21  8:48 UTC (permalink / raw)
  To: Dmytro Bagrii
  Cc: Jan-Niklas Burfeind, Greg KH, linux-usb, Frank A Kingswood, Frank Zago

On Thu, Feb 10, 2022 at 07:41:22AM +0200, Dmytro Bagrii wrote:
> On 09.02.22 16:18, Johan Hovold wrote:

> > I don't remember all the details, but judging from a quick look it seems
> > we're just waiting for someone to resend the revert with a proper
> > explanation.
> > 
> > It would be good if Jan-Niklas could chime in too and confirm if he's
> > able to use the device in UART mode instead.
> 
> I'd like to take a look at that keeyees device from original commit 
> message to see if it has EEPROM chip. I can hypothesize that some 
> manufacturer of a CH341-based programmer could use external configuration 
> EEPROM and mixed-up PID value. I haven't experiment with configuring 
> CH341A with EEPROM but suppose it's possible to burn any custom VID:PID 
> there. I don't think ch341 driver has to handle any of such custom 
> VID/PID, especially if it conflicts with an original VID/PID assigned by 
> chip manufacturer. In case of some peculiar devices it's possible to bind 
> custom VID:PID to the driver via sysfs.
> 
> But it's just my hypothetical assumption how ch341-based device with PID 
> 5512 could work as UART in that case.
> 
> I just checked if CH341 that i have can work as UART when configured as 
> I2C/SPI (PID 5512). I doesn't work: no output signal on TX pin, no 
> loopback echo when RX connected to self TX.

Thanks for confirming.

Johan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Revert "USB: serial: ch341: add new Product ID for CH341A"
  2022-02-10 10:18       ` Jan-Niklas Burfeind
@ 2022-02-21  8:49         ` Johan Hovold
  0 siblings, 0 replies; 11+ messages in thread
From: Johan Hovold @ 2022-02-21  8:49 UTC (permalink / raw)
  To: Jan-Niklas Burfeind
  Cc: Dmytro Bagrii, Greg KH, linux-usb, Frank A Kingswood, Frank Zago

On Thu, Feb 10, 2022 at 11:18:22AM +0100, Jan-Niklas Burfeind wrote:
> Hello everyone.
> 
> For now I can identify two different USB-IDs depending on the Jumper 
> position on the board:
> 
> 1-2 connected: idVendor=1a86, idProduct=5512
> 2-3 or none  : idVendor=1a86, idProduct=5523
> 
> I'm not sure how I'd plug it to reach the Parallel Printer Interface 
> mentioned before.
> 
> The advertised position of this Jumper is 1-2.
> Both positions are labeled with two different chinese symbols, "2-3" is 
> labeled with TTL as well.
> 
> Looking at the devices schematics I think its safe to revert my original 
> commit and I'm sorry to have caused you all this trouble.
> 
> At the time I added the device I missidentified the Jumper as voltage 
> level selector.
> 
> I had seen others using the board on youtube, with Jumper position 1-2;
> and did not understand, why my system would not recognize it at all.
> 
> 
> Sorry again and thanks for the effort

No problem. Thanks for helping us clear this up.

Johan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] Revert "USB: serial: ch341: add new Product ID for CH341A"
  2022-02-10 16:41   ` [PATCH v2] " Dmytro Bagrii
@ 2022-02-21  9:02     ` Johan Hovold
  0 siblings, 0 replies; 11+ messages in thread
From: Johan Hovold @ 2022-02-21  9:02 UTC (permalink / raw)
  To: Dmytro Bagrii; +Cc: linux-usb, gregkh, kernel

On Thu, Feb 10, 2022 at 06:41:37PM +0200, Dmytro Bagrii wrote:
> This reverts commit 46ee4abb10a07bd8f8ce910ee6b4ae6a947d7f63.
> 
> CH341 has Product ID 0x5512 in EPP/MEM mode which is used for
> I2C/SPI/GPIO interfaces. In asynchronous serial interface mode
> CH341 has PID 0x5523 which is already in the table.
> 
> Mode is selected by corresponding jumper setting.
> 
> Signed-off-by: Dmytro Bagrii <dimich.dmb@gmail.com>

I was hoping for some more details in the commit message so we don't
have to dig out the information from long email-threads if this ever
comes up again. 

Well, well. I added links to the mail archives before applying.

Thanks!

Johan

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-02-21  9:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-07  0:08 [PATCH] Revert "USB: serial: ch341: add new Product ID for CH341A" Dmytro Bagrii
2022-02-08 10:34 ` Greg KH
2022-02-08 13:34   ` Dmytro Bagrii
2022-02-09 14:18     ` Johan Hovold
2022-02-09 17:24       ` Jan-Niklas Burfeind
2022-02-10  5:41       ` Dmytro Bagrii
2022-02-21  8:48         ` Johan Hovold
2022-02-10 10:18       ` Jan-Niklas Burfeind
2022-02-21  8:49         ` Johan Hovold
2022-02-10 16:41   ` [PATCH v2] " Dmytro Bagrii
2022-02-21  9:02     ` Johan Hovold

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.