Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932435Ab0BYMmj (ORCPT ); Thu, 25 Feb 2010 07:42:39 -0500 Received: from 81-174-11-161.static.ngi.it ([81.174.11.161]:59971 "EHLO mail.enneenne.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932385Ab0BYMlh (ORCPT ); Thu, 25 Feb 2010 07:41:37 -0500 From: Rodolfo Giometti To: linux-kernel@vger.kernel.org Cc: Andrew Morton , David Woodhouse , Dave Jones , Sam Ravnborg , Greg KH , Randy Dunlap , Kay Sievers , Alan Cox , "H. Peter Anvin" , Ingo Molnar , Michael Kerrisk , Christoph Hellwig , Alexander Gordeev , Rodolfo Giometti Date: Thu, 25 Feb 2010 13:41:11 +0100 Message-Id: <1267101671-23575-7-git-send-email-giometti@linux.it> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1267101671-23575-6-git-send-email-giometti@linux.it> References: <1267101671-23575-1-git-send-email-giometti@linux.it> <1267101671-23575-2-git-send-email-giometti@linux.it> <1267101671-23575-3-git-send-email-giometti@linux.it> <1267101671-23575-4-git-send-email-giometti@linux.it> <1267101671-23575-5-git-send-email-giometti@linux.it> <1267101671-23575-6-git-send-email-giometti@linux.it> X-SA-Exim-Connect-IP: 192.168.32.37 X-SA-Exim-Mail-From: giometti@enneenne.com Subject: [PATCH 6/6] serial amba-pl010: enable PPS support. X-SA-Exim-Version: 4.2.1 (built Wed, 25 Jun 2008 17:14:11 +0000) X-SA-Exim-Scanned: Yes (on mail.enneenne.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1519 Lines: 49 Function pl010_enable_ms() is automagically called when PPS ldisc is selected. Signed-off-by: Rodolfo Giometti --- drivers/serial/amba-pl010.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c index 429a8ae..e4b3c2c 100644 --- a/drivers/serial/amba-pl010.c +++ b/drivers/serial/amba-pl010.c @@ -471,6 +471,20 @@ pl010_set_termios(struct uart_port *port, struct ktermios *termios, spin_unlock_irqrestore(&uap->port.lock, flags); } +static void pl010_set_ldisc(struct uart_port *port) +{ + int line = port->line; + + if (line >= port->state->port.tty->driver->num) + return; + + if (port->state->port.tty->ldisc->ops->num == N_PPS) { + port->flags |= UPF_HARDPPS_CD; + pl010_enable_ms(port); + } else + port->flags &= ~UPF_HARDPPS_CD; +} + static const char *pl010_type(struct uart_port *port) { return port->type == PORT_AMBA ? "AMBA" : NULL; @@ -531,6 +545,7 @@ static struct uart_ops amba_pl010_pops = { .startup = pl010_startup, .shutdown = pl010_shutdown, .set_termios = pl010_set_termios, + .set_ldisc = pl010_set_ldisc, .type = pl010_type, .release_port = pl010_release_port, .request_port = pl010_request_port, -- 1.6.3.3 -- 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/