mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@suse.de>
To: linux-kernel@vger.kernel.org
Cc: Vikram Pandita <vikram.pandita@ti.com>,
	Alan Cox <alan@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 27/79] serial: 8250: add IRQ trigger support
Date: Sat, 19 Sep 2009 14:36:32 -0700	[thread overview]
Message-ID: <1253396244-7885-27-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <20090919213345.GB7668@kroah.com>

From: Vikram Pandita <vikram.pandita@ti.com>

There is currently no provision for passing IRQ trigger flags for
serial IRQs with triggering requirements (such as GPIO IRQs)

This patch adds irqflags to plat_serial8250_port that can be passed
from board file to reqest_irq() of 8250 driver

Changes are backward compatible with boards passing UPF_SHARE_IRQ flag

Tested on Zoom2 board that has IRQF_TRIGGER_RISING requirement for 8250 irq

[Moved new flag to end to fix bugs in the original with the old_serial array
	-- Alan]

Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/serial/8250.c       |   14 +++++++++-----
 drivers/serial/8250.h       |    1 +
 include/linux/serial_8250.h |    1 +
 include/linux/serial_core.h |    1 +
 4 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index fb867a9..83168a6 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -1677,7 +1677,7 @@ static int serial_link_irq_chain(struct uart_8250_port *up)
 		INIT_LIST_HEAD(&up->list);
 		i->head = &up->list;
 		spin_unlock_irq(&i->lock);
-
+		irq_flags |= up->port.irqflags;
 		ret = request_irq(up->port.irq, serial8250_interrupt,
 				  irq_flags, "serial", i);
 		if (ret < 0)
@@ -2026,7 +2026,7 @@ static int serial8250_startup(struct uart_port *port)
 		 * allow register changes to become visible.
 		 */
 		spin_lock_irqsave(&up->port.lock, flags);
-		if (up->port.flags & UPF_SHARE_IRQ)
+		if (up->port.irqflags & IRQF_SHARED)
 			disable_irq_nosync(up->port.irq);
 
 		wait_for_xmitr(up, UART_LSR_THRE);
@@ -2039,7 +2039,7 @@ static int serial8250_startup(struct uart_port *port)
 		iir = serial_in(up, UART_IIR);
 		serial_out(up, UART_IER, 0);
 
-		if (up->port.flags & UPF_SHARE_IRQ)
+		if (up->port.irqflags & IRQF_SHARED)
 			enable_irq(up->port.irq);
 		spin_unlock_irqrestore(&up->port.lock, flags);
 
@@ -2671,6 +2671,7 @@ static void __init serial8250_isa_init_ports(void)
 	     i++, up++) {
 		up->port.iobase   = old_serial_port[i].port;
 		up->port.irq      = irq_canonicalize(old_serial_port[i].irq);
+		up->port.irqflags = old_serial_port[i].irqflags;
 		up->port.uartclk  = old_serial_port[i].baud_base * 16;
 		up->port.flags    = old_serial_port[i].flags;
 		up->port.hub6     = old_serial_port[i].hub6;
@@ -2679,7 +2680,7 @@ static void __init serial8250_isa_init_ports(void)
 		up->port.regshift = old_serial_port[i].iomem_reg_shift;
 		set_io_from_upio(&up->port);
 		if (share_irqs)
-			up->port.flags |= UPF_SHARE_IRQ;
+			up->port.irqflags |= IRQF_SHARED;
 	}
 }
 
@@ -2869,6 +2870,7 @@ int __init early_serial_setup(struct uart_port *port)
 	p->iobase       = port->iobase;
 	p->membase      = port->membase;
 	p->irq          = port->irq;
+	p->irqflags     = port->irqflags;
 	p->uartclk      = port->uartclk;
 	p->fifosize     = port->fifosize;
 	p->regshift     = port->regshift;
@@ -2942,6 +2944,7 @@ static int __devinit serial8250_probe(struct platform_device *dev)
 		port.iobase		= p->iobase;
 		port.membase		= p->membase;
 		port.irq		= p->irq;
+		port.irqflags		= p->irqflags;
 		port.uartclk		= p->uartclk;
 		port.regshift		= p->regshift;
 		port.iotype		= p->iotype;
@@ -2954,7 +2957,7 @@ static int __devinit serial8250_probe(struct platform_device *dev)
 		port.serial_out		= p->serial_out;
 		port.dev		= &dev->dev;
 		if (share_irqs)
-			port.flags |= UPF_SHARE_IRQ;
+			port.irqflags |= IRQF_SHARED;
 		ret = serial8250_register_port(&port);
 		if (ret < 0) {
 			dev_err(&dev->dev, "unable to register port at index %d "
@@ -3096,6 +3099,7 @@ int serial8250_register_port(struct uart_port *port)
 		uart->port.iobase       = port->iobase;
 		uart->port.membase      = port->membase;
 		uart->port.irq          = port->irq;
+		uart->port.irqflags     = port->irqflags;
 		uart->port.uartclk      = port->uartclk;
 		uart->port.fifosize     = port->fifosize;
 		uart->port.regshift     = port->regshift;
diff --git a/drivers/serial/8250.h b/drivers/serial/8250.h
index 5202603..6e19ea3 100644
--- a/drivers/serial/8250.h
+++ b/drivers/serial/8250.h
@@ -25,6 +25,7 @@ struct old_serial_port {
 	unsigned char io_type;
 	unsigned char *iomem_base;
 	unsigned short iomem_reg_shift;
+	unsigned long irqflags;
 };
 
 /*
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index d4d2a78..fb46aba 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -22,6 +22,7 @@ struct plat_serial8250_port {
 	void __iomem	*membase;	/* ioremap cookie or NULL */
 	resource_size_t	mapbase;	/* resource base */
 	unsigned int	irq;		/* interrupt number */
+	unsigned long	irqflags;	/* request_irq flags */
 	unsigned int	uartclk;	/* UART clock rate */
 	void            *private_data;
 	unsigned char	regshift;	/* register shift */
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 23d2fb0..3cd255f 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -265,6 +265,7 @@ struct uart_port {
 	unsigned int		(*serial_in)(struct uart_port *, int);
 	void			(*serial_out)(struct uart_port *, int, int);
 	unsigned int		irq;			/* irq number */
+	unsigned long		irqflags;		/* irq flags  */
 	unsigned int		uartclk;		/* base uart clock */
 	unsigned int		fifosize;		/* tx fifo size */
 	unsigned char		x_char;			/* xon/xoff char */
-- 
1.6.4.2


  parent reply	other threads:[~2009-09-19 21:40 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-19 21:33 [GIT PATCH] TTY patches for 2.6.31-git Greg KH
2009-09-19 21:36 ` [PATCH 01/79] tty: gigaset: really fix chars_in_buffer Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 02/79] serial: bfin_5xx: fix building as module when early printk is enabled Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 03/79] tty: serial/pcmcia: add ID for Advantech card Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 04/79] tty-ldisc: make /proc/tty/ldiscs use ldisc_ops instead of ldiscs Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 05/79] tty-ldisc: get rid of tty_ldisc_try_get() helper function Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 06/79] tty: includecheck fix: drivers/char, vt.c Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 07/79] tty: icom: bit and/or confusion? Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 08/79] cyclades: add tty refcounting Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 09/79] cyclades: remove block_til_ready Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 10/79] cyclades: avoid addresses recomputation Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 11/79] cyclades: switch to tty_port_hangup Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 12/79] cyclades: close cleanup Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 13/79] cyclades: overall cleanup Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 14/79] cyclades: sleep instead busy-wait Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 15/79] cyclades: use dtr_rts helpers Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 16/79] cyclades: merge cy_startup tails Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 17/79] cyclades: ioctls cleanup Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 18/79] cyclades: tiocm cleanup Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 19/79] cyclades: introduce cyy_readb/writeb Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 20/79] cyclades: remove more duplicated code Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 21/79] slip: Clean up create and destroy Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 22/79] kfifo: Use "const" definitions Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 23/79] MOS7720 has no tiocmget method Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 24/79] tty: usb_serial_mos7720: Fix get_lsr_info Greg Kroah-Hartman
2010-01-26 11:08   ` Kees Schoenmakers
2010-01-26 11:09   ` Kees Schoenmakers
2009-09-19 21:36 ` [PATCH 25/79] tty: Fix a typo noted in passing Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 26/79] mos7840: remove old dead modem logic Greg Kroah-Hartman
2009-09-19 21:36 ` Greg Kroah-Hartman [this message]
2009-09-19 21:36 ` [PATCH 28/79] 8250: Now honours baud rate lower bounds Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 29/79] tty: Add a full port_close function Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 30/79] riscom8: split open and close methods up Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 31/79] mxser: Split close ready for a standard tty_port_close method Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 32/79] isicom: Split the close hardware bits out Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 33/79] tty: riscom8 kref and tty_port_close Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 34/79] cyclades: use the full port_close function Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 35/79] tty: make the kref destructor occur asynchronously Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 36/79] cdc_acm: Fix to use modern speed interfaces Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 37/79] tty: USB hangup is racy Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 38/79] tty: remove dtr/rts use from the driver open methods Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 39/79] tty: USB can now use the shutdown method for kref based freeing of ports Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 40/79] vt: add an event interface Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 41/79] vt: remove power stuff from kernel/power Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 42/79] vt: move kernel stuff out of vt.h Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 43/79] vt: add an activate and lock Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 44/79] tty: USB does not need the filp argument in the drivers Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 45/79] isicom: split the open method for the isicom device Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 46/79] serial: kill off uart_info Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 47/79] serial: Fold closing_* fields into the tty_port ones Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 48/79] serial: use tty_port pointers in the core code Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 49/79] serial: move count into the tty_port version Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 50/79] serial: move the flags into the tty_port field Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 51/79] serial: kill off uif_t Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 52/79] serial: replace the state mutex with the tty port mutex Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 53/79] serial: move delta_msr_wait into the tty_port Greg Kroah-Hartman
2009-09-19 21:36 ` [PATCH 54/79] serial: move port users helper Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 55/79] serial: kill USF_CLOSING_* definitions Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 56/79] serial: introduce tty krefs Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 57/79] Set proper console speed on resume if console suspend is disabled Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 58/79] tty: USB serial termios bits Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 59/79] n_tty: honor opost flag for echoes Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 60/79] n_tty: move echoctl check and clean up logic Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 61/79] tty: handle VT specific compat ioctls in vt driver Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 62/79] tty: vt: use printk_once Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 63/79] tty: Power: fix suspend vt regression Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 64/79] TTY: fix typos Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 65/79] tty: riscom8, fix shutdown declaration Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 66/79] tty: riscom8, fix tty refcnt Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 67/79] tty: USB: serial/mct_u232, " Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 68/79] uartlite: support shared interrupt lines Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 69/79] tty: Char: mxser, add support for CP112UL Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 70/79] tty: Char: mxser, use THRE for ASPP_OQUEUE ioctl Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 71/79] usb-serial: change referencing of port and serial structures Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 72/79] usb-serial: put subroutines in logical order Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 73/79] usb-serial: change logic of serial lookups Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 74/79] usb-serial: acquire references when a new tty is installed Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 75/79] usb-serial: fix termios initialization logic Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 76/79] usb-serial: rename subroutines Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 77/79] usb-serial: add missing tests and debug lines Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 78/79] usb-serial: straighten out serial_open Greg Kroah-Hartman
2009-09-19 21:37 ` [PATCH 79/79] USB serial: update the console driver Greg Kroah-Hartman
2009-09-30 10:09 ` [origin tree boot crash] Re: [GIT PATCH] TTY patches for 2.6.31-git Ingo Molnar
2009-09-30 10:17   ` Alan Cox
2009-10-01  8:21     ` Ingo Molnar
2009-10-01 10:36       ` Alan Cox

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=1253396244-7885-27-git-send-email-gregkh@suse.de \
    --to=gregkh@suse.de \
    --cc=alan@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vikram.pandita@ti.com \
    /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

Powered by JetHome