From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755915Ab0JGUn0 (ORCPT ); Thu, 7 Oct 2010 16:43:26 -0400 Received: from earthlight.etchedpixels.co.uk ([81.2.110.250]:38776 "EHLO www.etchedpixels.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752185Ab0JGUnZ (ORCPT ); Thu, 7 Oct 2010 16:43:25 -0400 Date: Thu, 7 Oct 2010 22:08:52 +0100 From: Alan Cox To: Daniel Walker Cc: Mike Frysinger , linux-kernel@vger.kernel.org, "Hyok S. Choi" , Tony Lindgren , Jeff Ohlstein , Greg Kroah-Hartman , Ben Dooks , Alan Cox , Kukjin Kim , Feng Tang , Tobias Klauser , Jason Wessel , Philippe Langlais Subject: Re: [PATCH] serial: DCC(JTAG) serial and console emulation support Message-ID: <20101007220852.23524d0b@lxorguk.ukuu.org.uk> In-Reply-To: <1286483831.23836.40.camel@c-dwalke-linux.qualcomm.com> References: <1286476616-3373-1-git-send-email-dwalker@codeaurora.org> <20101007215202.65ffeace@lxorguk.ukuu.org.uk> <1286483831.23836.40.camel@c-dwalke-linux.qualcomm.com> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEWysKsSBQMIAwIZCwj///8wIhxoRDXH9QHCAAABeUlEQVQ4jaXTvW7DIBAAYCQTzz2hdq+rdg494ZmBeE5KYHZjm/d/hJ6NfzBJpp5kRb5PHJwvMPMk2L9As5Y9AmYRBL+HAyJKeOU5aHRhsAAvORQ+UEgAvgddj/lwAXndw2laEDqA4x6KEBhjYRCg9tBFCOuJFxg2OKegbWjbsRTk8PPhKPD7HcRxB7cqhgBRp9Dcqs+B8v4CQvFdqeot3Kov6hBUn0AJitrzY+sgUuiA8i0r7+B3AfqKcN6t8M6HtqQ+AOoELCikgQSbgabKaJW3kn5lBs47JSGDhhLKDUh1UMipwwinMYPTBuIBjEclSaGZUk9hDlTb5sUTYN2SFFQuPe4Gox1X0FZOufjgBiV1Vls7b+GvK3SU4wfmcGo9rPPQzgIabfj4TYQo15k3bTHX9RIw/kniir5YbtJF4jkFG+dsDK1IgE413zAthU/vR2HVMmFUPIHTvF6jWCpFaGw/A3qWgnbxpSm9MSmY5b3pM1gvNc/gQfwBsGwF0VCtxZgAAAAASUVORK5CYII= Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > I would agree 100% with this for the driver in question. The tty_port > > helpers now make it trivial to do so and it'll be small and clean as a > > result. > > Can you give some example of other drivers which have done this? The blackfin driver is probably the nicest example for a very simple device but see also the USB serial drivers (complex example), the SDIO serial support (shows how to do fancy hotpluggable device stuff with it). Basically tty_port_open/tty_port_close/tty_port_hangup do all the icky nasty POSIX open/close/hangup handling and provide you with simple methods to implement activate/shutdown of a port and carrier detect etc most of which you don't even need to supply. You can also skip a lot of other stuff like modem lines - although I can see why you might want to provide an emulated modem line response for a console emulation. Alan