public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rodolfo Giometti <giometti@linux.it>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Dave Jones <davej@redhat.com>, Sam Ravnborg <sam@ravnborg.org>,
	Greg KH <greg@kroah.com>, Randy Dunlap <randy.dunlap@oracle.com>,
	Kay Sievers <kay.sievers@vrfy.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@elte.hu>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	Christoph Hellwig <hch@infradead.org>,
	Alexander Gordeev <lasaine@lvk.cs.msu.su>,
	Rodolfo Giometti <giometti@linux.it>
Subject: [PATCH 5/6] serial 8250: enable PPS support.
Date: Thu, 25 Feb 2010 13:41:10 +0100	[thread overview]
Message-ID: <1267101671-23575-6-git-send-email-giometti@linux.it> (raw)
In-Reply-To: <1267101671-23575-5-git-send-email-giometti@linux.it>

Automagically function serial8250_enable_ms() is called when PPS ldisc
is selected.

Signed-off-by: Rodolfo Giometti <giometti@linux.it>
---
 drivers/serial/8250.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index c3e37c8..48aa0b4 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2413,6 +2413,21 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios,
 }
 
 static void
+serial8250_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;
+		serial8250_enable_ms(port);
+	} else
+		port->flags &= ~UPF_HARDPPS_CD;
+}
+
+static void
 serial8250_pm(struct uart_port *port, unsigned int state,
 	      unsigned int oldstate)
 {
@@ -2626,6 +2641,7 @@ static struct uart_ops serial8250_pops = {
 	.startup	= serial8250_startup,
 	.shutdown	= serial8250_shutdown,
 	.set_termios	= serial8250_set_termios,
+	.set_ldisc	= serial8250_set_ldisc,
 	.pm		= serial8250_pm,
 	.type		= serial8250_type,
 	.release_port	= serial8250_release_port,
-- 
1.6.3.3


  reply	other threads:[~2010-02-25 12:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-25 12:41 (version 3) LinuxPPS new functionalities Rodolfo Giometti
2010-02-25 12:41 ` [PATCH 1/6] pps: LinuxPPS clients support Rodolfo Giometti
2010-02-25 12:41   ` [PATCH 2/6] ldisc: new dcd_change() method for line disciplines Rodolfo Giometti
2010-02-25 12:41     ` [PATCH 3/6] ldisc n_tty: add new method n_tty_inherit_ops() Rodolfo Giometti
2010-02-25 12:41       ` [PATCH 4/6] pps: serial clients support Rodolfo Giometti
2010-02-25 12:41         ` Rodolfo Giometti [this message]
2010-02-25 12:41           ` [PATCH 6/6] serial amba-pl010: enable PPS support Rodolfo Giometti
  -- strict thread matches above, loose matches on Subject: below --
2010-02-23 12:40 (version 2) LinuxPPS new functionalities Rodolfo Giometti
2010-02-23 12:40 ` [PATCH 1/6] pps: LinuxPPS clients support Rodolfo Giometti
2010-02-23 12:40   ` [PATCH 2/6] ldisc: new dcd_change() method for line disciplines Rodolfo Giometti
2010-02-23 12:40     ` [PATCH 3/6] ldisc n_tty: add new method n_tty_inherit_ops() Rodolfo Giometti
2010-02-23 12:40       ` [PATCH 4/6] pps: serial clients support Rodolfo Giometti
2010-02-23 12:40         ` [PATCH 5/6] serial 8250: enable PPS support Rodolfo Giometti

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=1267101671-23575-6-git-send-email-giometti@linux.it \
    --to=giometti@linux.it \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=davej@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=greg@kroah.com \
    --cc=hch@infradead.org \
    --cc=hpa@zytor.com \
    --cc=kay.sievers@vrfy.org \
    --cc=lasaine@lvk.cs.msu.su \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mtk.manpages@gmail.com \
    --cc=randy.dunlap@oracle.com \
    --cc=sam@ravnborg.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox