diff options
Diffstat (limited to 'meta/packages/linux/linux-omap3-pm-git/zoom2/0004-serial-8250-add-IRQ-trigger-support.patch')
-rw-r--r-- | meta/packages/linux/linux-omap3-pm-git/zoom2/0004-serial-8250-add-IRQ-trigger-support.patch | 143 |
1 files changed, 143 insertions, 0 deletions
diff --git a/meta/packages/linux/linux-omap3-pm-git/zoom2/0004-serial-8250-add-IRQ-trigger-support.patch b/meta/packages/linux/linux-omap3-pm-git/zoom2/0004-serial-8250-add-IRQ-trigger-support.patch new file mode 100644 index 0000000000..05ca90512e --- /dev/null +++ b/meta/packages/linux/linux-omap3-pm-git/zoom2/0004-serial-8250-add-IRQ-trigger-support.patch | |||
@@ -0,0 +1,143 @@ | |||
1 | From 3f819713f3c7ccfd56146f4c007155bc47a170ac Mon Sep 17 00:00:00 2001 | ||
2 | From: Vikram Pandita <vikram.pandita@ti.com> | ||
3 | Date: Mon, 22 Jun 2009 17:58:47 -0500 | ||
4 | Subject: [PATCH 4/8] serial: 8250: add IRQ trigger support | ||
5 | |||
6 | There is currently no provision for passing IRQ trigger flags for | ||
7 | serial IRQs with triggering requirements (such as GPIO IRQs) | ||
8 | |||
9 | This patch adds irqflags to plat_serial8250_port that can be passed | ||
10 | from board file to reqest_irq() of 8250 driver | ||
11 | |||
12 | Changes are backward compatible with boards passing UPF_SHARE_IRQ flag | ||
13 | |||
14 | Tested on Zoom2 board that has IRQF_TRIGGER_RISING requirement for 8250 irq | ||
15 | |||
16 | Signed-off-by: Vikram Pandita <vikram.pandita@ti.com> | ||
17 | --- | ||
18 | drivers/serial/8250.c | 14 +++++++++----- | ||
19 | drivers/serial/8250.h | 1 + | ||
20 | include/linux/serial_8250.h | 1 + | ||
21 | include/linux/serial_core.h | 1 + | ||
22 | 4 files changed, 12 insertions(+), 5 deletions(-) | ||
23 | |||
24 | diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c | ||
25 | index 606fabb..6474fe4 100644 | ||
26 | --- a/drivers/serial/8250.c | ||
27 | +++ b/drivers/serial/8250.c | ||
28 | @@ -1681,7 +1681,7 @@ static int serial_link_irq_chain(struct uart_8250_port *up) | ||
29 | INIT_LIST_HEAD(&up->list); | ||
30 | i->head = &up->list; | ||
31 | spin_unlock_irq(&i->lock); | ||
32 | - | ||
33 | + irq_flags |= up->port.irqflags; | ||
34 | ret = request_irq(up->port.irq, serial8250_interrupt, | ||
35 | irq_flags, "serial", i); | ||
36 | if (ret < 0) | ||
37 | @@ -2030,7 +2030,7 @@ static int serial8250_startup(struct uart_port *port) | ||
38 | * allow register changes to become visible. | ||
39 | */ | ||
40 | spin_lock_irqsave(&up->port.lock, flags); | ||
41 | - if (up->port.flags & UPF_SHARE_IRQ) | ||
42 | + if (up->port.irqflags & IRQF_SHARED) | ||
43 | disable_irq_nosync(up->port.irq); | ||
44 | |||
45 | wait_for_xmitr(up, UART_LSR_THRE); | ||
46 | @@ -2043,7 +2043,7 @@ static int serial8250_startup(struct uart_port *port) | ||
47 | iir = serial_in(up, UART_IIR); | ||
48 | serial_out(up, UART_IER, 0); | ||
49 | |||
50 | - if (up->port.flags & UPF_SHARE_IRQ) | ||
51 | + if (up->port.irqflags & IRQF_SHARED) | ||
52 | enable_irq(up->port.irq); | ||
53 | spin_unlock_irqrestore(&up->port.lock, flags); | ||
54 | |||
55 | @@ -2688,6 +2688,7 @@ static void __init serial8250_isa_init_ports(void) | ||
56 | i++, up++) { | ||
57 | up->port.iobase = old_serial_port[i].port; | ||
58 | up->port.irq = irq_canonicalize(old_serial_port[i].irq); | ||
59 | + up->port.irqflags = old_serial_port[i].irqflags; | ||
60 | up->port.uartclk = old_serial_port[i].baud_base * 16; | ||
61 | up->port.flags = old_serial_port[i].flags; | ||
62 | up->port.hub6 = old_serial_port[i].hub6; | ||
63 | @@ -2696,7 +2697,7 @@ static void __init serial8250_isa_init_ports(void) | ||
64 | up->port.regshift = old_serial_port[i].iomem_reg_shift; | ||
65 | set_io_from_upio(&up->port); | ||
66 | if (share_irqs) | ||
67 | - up->port.flags |= UPF_SHARE_IRQ; | ||
68 | + up->port.irqflags |= IRQF_SHARED; | ||
69 | } | ||
70 | } | ||
71 | |||
72 | @@ -2886,6 +2887,7 @@ int __init early_serial_setup(struct uart_port *port) | ||
73 | p->iobase = port->iobase; | ||
74 | p->membase = port->membase; | ||
75 | p->irq = port->irq; | ||
76 | + p->irqflags = port->irqflags; | ||
77 | p->uartclk = port->uartclk; | ||
78 | p->fifosize = port->fifosize; | ||
79 | p->regshift = port->regshift; | ||
80 | @@ -2959,6 +2961,7 @@ static int __devinit serial8250_probe(struct platform_device *dev) | ||
81 | port.iobase = p->iobase; | ||
82 | port.membase = p->membase; | ||
83 | port.irq = p->irq; | ||
84 | + port.irqflags = p->irqflags; | ||
85 | port.uartclk = p->uartclk; | ||
86 | port.regshift = p->regshift; | ||
87 | port.iotype = p->iotype; | ||
88 | @@ -2971,7 +2974,7 @@ static int __devinit serial8250_probe(struct platform_device *dev) | ||
89 | port.serial_out = p->serial_out; | ||
90 | port.dev = &dev->dev; | ||
91 | if (share_irqs) | ||
92 | - port.flags |= UPF_SHARE_IRQ; | ||
93 | + port.irqflags |= IRQF_SHARED; | ||
94 | ret = serial8250_register_port(&port); | ||
95 | if (ret < 0) { | ||
96 | dev_err(&dev->dev, "unable to register port at index %d " | ||
97 | @@ -3113,6 +3116,7 @@ int serial8250_register_port(struct uart_port *port) | ||
98 | uart->port.iobase = port->iobase; | ||
99 | uart->port.membase = port->membase; | ||
100 | uart->port.irq = port->irq; | ||
101 | + uart->port.irqflags = port->irqflags; | ||
102 | uart->port.uartclk = port->uartclk; | ||
103 | uart->port.fifosize = port->fifosize; | ||
104 | uart->port.regshift = port->regshift; | ||
105 | diff --git a/drivers/serial/8250.h b/drivers/serial/8250.h | ||
106 | index 5202603..9b34b04 100644 | ||
107 | --- a/drivers/serial/8250.h | ||
108 | +++ b/drivers/serial/8250.h | ||
109 | @@ -20,6 +20,7 @@ struct old_serial_port { | ||
110 | unsigned int baud_base; | ||
111 | unsigned int port; | ||
112 | unsigned int irq; | ||
113 | + unsigned long irqflags; | ||
114 | unsigned int flags; | ||
115 | unsigned char hub6; | ||
116 | unsigned char io_type; | ||
117 | diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h | ||
118 | index d4d2a78..fb46aba 100644 | ||
119 | --- a/include/linux/serial_8250.h | ||
120 | +++ b/include/linux/serial_8250.h | ||
121 | @@ -22,6 +22,7 @@ struct plat_serial8250_port { | ||
122 | void __iomem *membase; /* ioremap cookie or NULL */ | ||
123 | resource_size_t mapbase; /* resource base */ | ||
124 | unsigned int irq; /* interrupt number */ | ||
125 | + unsigned long irqflags; /* request_irq flags */ | ||
126 | unsigned int uartclk; /* UART clock rate */ | ||
127 | void *private_data; | ||
128 | unsigned char regshift; /* register shift */ | ||
129 | diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h | ||
130 | index 23d2fb0..3cd255f 100644 | ||
131 | --- a/include/linux/serial_core.h | ||
132 | +++ b/include/linux/serial_core.h | ||
133 | @@ -265,6 +265,7 @@ struct uart_port { | ||
134 | unsigned int (*serial_in)(struct uart_port *, int); | ||
135 | void (*serial_out)(struct uart_port *, int, int); | ||
136 | unsigned int irq; /* irq number */ | ||
137 | + unsigned long irqflags; /* irq flags */ | ||
138 | unsigned int uartclk; /* base uart clock */ | ||
139 | unsigned int fifosize; /* tx fifo size */ | ||
140 | unsigned char x_char; /* xon/xoff char */ | ||
141 | -- | ||
142 | 1.6.3.2 | ||
143 | |||