Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751596AbbFYIGQ (ORCPT ); Thu, 25 Jun 2015 04:06:16 -0400 Received: from mail-lb0-f182.google.com ([209.85.217.182]:34072 "EHLO mail-lb0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751105AbbFYIGH (ORCPT ); Thu, 25 Jun 2015 04:06:07 -0400 Date: Thu, 25 Jun 2015 10:06:07 +0200 From: Johan Hovold To: Peter Hung Cc: johan@kernel.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, peter_hong@fintek.com.tw, tom_tsai@fintek.com.tw, Peter Hung Subject: Re: [PATCH V2 1/1] usb:serial:f81534 Add F81532/534 Driver Message-ID: <20150625080607.GA28464@localhost> References: <1434333267-10054-1-git-send-email-hpeter+linux_kernel@gmail.com> <558B8EC8.10806@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <558B8EC8.10806@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1784 Lines: 46 Hi Peter, On Thu, Jun 25, 2015 at 01:16:56PM +0800, Peter Hung wrote: > Hello Johan, > > Peter Hung 於 2015/6/15 上午 09:54 寫道: > > This driver is for Fintek F81532/F81534 USB to Serial Ports IC. > > > > Features: > > 1. F81534 is 1-to-4 & F81532 is 1-to-2 serial ports IC > > 2. Support Baudrate from B50 to B1500000 (excluding B1000000). > > 3. The RTS signal can be transformed their behavior with configuration > > for transceiver (for RS232/RS485/RS422) (/sys/class/ttyUSBx/uart_mode) > > 4. There are 4x3 output-only GPIOs to control transceiver mode. It's > > can be controlled via sysfs (/sys/class/ttyUSBx/gpio) > > > > Do you receive my patch? Yes, I did. I just haven't had time to review it yet. > Are there anything should I do to improve it ? There are, including - your custom read and write implementations look odd, you should be able to reuse a lot more of the generic framework - you'll also need to implement open/and close in some way (enable/disable in hardware or flag in software) as you should not push data to a closed tty - stack allocated buffers used for DMA (register accessors) - DMA buffers allocated as part of larger struct (read/write buffers) - lots of magic constants (e.g. use defines for the registers) - As Greg already mentioned, you need to implement gpio support using gpiolib, not a custom sysfs interface I don't have time to look closer at the architectural bits until next week I'm afraid, but perhaps you could start with the above. Thanks, Johan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/