All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmytro Bagrii <dimich.dmb@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>,
	Jan-Niklas Burfeind <kernel@aiyionpri.me>
Cc: linux-usb@vger.kernel.org,
	Frank A Kingswood <frank@kingswood-consulting.co.uk>,
	Frank Zago <frank@zago.net>, Johan Hovold <johan@kernel.org>
Subject: Re: [PATCH] Revert "USB: serial: ch341: add new Product ID for CH341A"
Date: Tue, 8 Feb 2022 15:34:19 +0200	[thread overview]
Message-ID: <6df2c9e6-8757-d5e4-0c27-d47f53bee2e1@gmail.com> (raw)
In-Reply-To: <YgJHRKQHQheKTwjU@kroah.com>

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

  reply	other threads:[~2022-02-08 13:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6df2c9e6-8757-d5e4-0c27-d47f53bee2e1@gmail.com \
    --to=dimich.dmb@gmail.com \
    --cc=frank@kingswood-consulting.co.uk \
    --cc=frank@zago.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=kernel@aiyionpri.me \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.