Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753896AbcDBRSA (ORCPT ); Sat, 2 Apr 2016 13:18:00 -0400 Received: from pygmy.kinoho.net ([134.0.27.24]:38068 "EHLO pygmy.kinoho.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753120AbcDBRRf (ORCPT ); Sat, 2 Apr 2016 13:17:35 -0400 From: Grigori Goronzy To: Johan Hovold Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Major improvements to the ch341 driver Date: Sat, 2 Apr 2016 19:07:09 +0200 Message-Id: <1459616843-23829-1-git-send-email-greg@chown.ath.cx> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1598 Lines: 40 Hi, this patchset consists of several improvements and cleanups to the ch341 driver, which has been mostly unmaintained for the last few years, despite major shortcomings. For instance, there is no support at all for parity, which is an often used feature. Other settings are missing too, as is hardware flow control. Here's a summary of changes: - Restructured initialization and configuration, which makes CH341A hardware work for the first time and is the basis for some following additions. - Support for the different parity modes, including mark/space - Support for two stop bits - Support for 5, 6 and 7 bit transfers - Support for RTS/CTS hardware flow control - Improved handling of B0 and DTR/RTS lines - Added tx_empty callback - Extracted magic numbers into definitions - Cleaned up code style and debug/error messages This has been tested on several different CH340G dongles and a CH341A adapter which is designed for EEPROM programming (but still supports UART). Functionality of the different configurations has been verified with a logic analyzer. In addition I did some quick interoperability tests with a CP2102 UART. My original motivation for this work was parity support which I needed for stcgal [1], and it works fine with that software too, of course. Please review. I would also appreciate to get some more testing done. In particular, I would like to make the sure the restructured initialization does not break anything. If you wonder, this is v2 because I initially sent it to the wrong list. Best regards Grigori [1] https://github.com/grigorig/stcgal