- Previous thread: [PATCH] powerpc/perf_counter: POWER7 has alternate PR/HV bits
- Next thread: [PATCH resend v3] UART regs: add OMAP wakeup-enable register
- Threads sorted by date: kernel 200906
There is currently no provision for passing IRQ trigger flags for
serial IRQs with triggering requirements (such as GPIO IRQs.)
This patch adds UPF_IRQ_TRIG_* flags which map on to IRQF_TRIGGER_*
flags.
Signed-off-by: Vikram Pandita
Acked-by: Kevin Hilman
---
drivers/serial/8250.c | 10 ++++++++++
include/linux/serial_core.h | 4 ++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index bab115e..8235ef5 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -1641,6 +1641,16 @@ static int serial_link_irq_chain(struct uart_8250_port *up)
struct irq_info *i;
int ret, irq_flags = up->port.flags & UPF_SHARE_IRQ ? IRQF_SHARED : 0;
+ /* Get IRQ Trigger Flag */
+ if (up->port.flags & UPF_IRQ_TRIG_RISING)
+ irq_flags |= IRQF_TRIGGER_RISING;
+ else if (up->port.flags & UPF_IRQ_TRIG_FALLING)
+ irq_flags |= IRQF_TRIGGER_FALLING;
+ else if (up->port.flags & UPF_IRQ_TRIG_HIGH)
+ irq_flags |= IRQF_TRIGGER_HIGH;
+ else if (up->port.flags & UPF_IRQ_TRIG_LOW)
+ irq_flags |= IRQF_TRIGGER_LOW;
+
mutex_lock(&hash_mutex);
h = &irq_lists[up->port.irq % NR_IRQ_HASH];
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 57a97e5..07591d5 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -296,7 +296,11 @@ struct uart_port {
#define UPF_SPD_WARP ((__force upf_t) (0x1010))
#define UPF_SKIP_TEST ((__force upf_t) (1
serial IRQs with triggering requirements (such as GPIO IRQs.)
This patch adds UPF_IRQ_TRIG_* flags which map on to IRQF_TRIGGER_*
flags.
Signed-off-by: Vikram Pandita
Acked-by: Kevin Hilman
---
drivers/serial/8250.c | 10 ++++++++++
include/linux/serial_core.h | 4 ++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index bab115e..8235ef5 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -1641,6 +1641,16 @@ static int serial_link_irq_chain(struct uart_8250_port *up)
struct irq_info *i;
int ret, irq_flags = up->port.flags & UPF_SHARE_IRQ ? IRQF_SHARED : 0;
+ /* Get IRQ Trigger Flag */
+ if (up->port.flags & UPF_IRQ_TRIG_RISING)
+ irq_flags |= IRQF_TRIGGER_RISING;
+ else if (up->port.flags & UPF_IRQ_TRIG_FALLING)
+ irq_flags |= IRQF_TRIGGER_FALLING;
+ else if (up->port.flags & UPF_IRQ_TRIG_HIGH)
+ irq_flags |= IRQF_TRIGGER_HIGH;
+ else if (up->port.flags & UPF_IRQ_TRIG_LOW)
+ irq_flags |= IRQF_TRIGGER_LOW;
+
mutex_lock(&hash_mutex);
h = &irq_lists[up->port.irq % NR_IRQ_HASH];
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 57a97e5..07591d5 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -296,7 +296,11 @@ struct uart_port {
#define UPF_SPD_WARP ((__force upf_t) (0x1010))
#define UPF_SKIP_TEST ((__force upf_t) (1
On Fri, 12 Jun 2009 12:32:51 -0500
Vikram Pandita wrote:
> There is currently no provision for passing IRQ trigger flags for
> serial IRQs with triggering requirements (such as GPIO IRQs.)
>
> This patch adds UPF_IRQ_TRIG_* flags which map on to IRQF_TRIGGER_*
> flags.
>
> Signed-off-by: Vikram Pandita
> Acked-by: Kevin Hilman
Note that this patch doesn't allow the interrupt to trigger on both
edges (not that I have ever seen a 8250 with this behavior, but this
is a valid configuration from an interrupt point of view).
Aside from this remark:
Acked-by: Marc Zyngier
> ---
> drivers/serial/8250.c | 10 ++++++++++
> include/linux/serial_core.h | 4 ++++
> 2 files changed, 14 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
> index bab115e..8235ef5 100644
> --- a/drivers/serial/8250.c
> +++ b/drivers/serial/8250.c
> @@ -1641,6 +1641,16 @@ static int serial_link_irq_chain(struct
> uart_8250_port *up) struct irq_info *i;
> int ret, irq_flags = up->port.flags & UPF_SHARE_IRQ ?
> IRQF_SHARED : 0;
> + /* Get IRQ Trigger Flag */
> + if (up->port.flags & UPF_IRQ_TRIG_RISING)
> + irq_flags |= IRQF_TRIGGER_RISING;
> + else if (up->port.flags & UPF_IRQ_TRIG_FALLING)
> + irq_flags |= IRQF_TRIGGER_FALLING;
> + else if (up->port.flags & UPF_IRQ_TRIG_HIGH)
> + irq_flags |= IRQF_TRIGGER_HIGH;
> + else if (up->port.flags & UPF_IRQ_TRIG_LOW)
> + irq_flags |= IRQF_TRIGGER_LOW;
> +
> mutex_lock(&hash_mutex);
>
> h = &irq_lists[up->port.irq % NR_IRQ_HASH];
> diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
> index 57a97e5..07591d5 100644
> --- a/include/linux/serial_core.h
> +++ b/include/linux/serial_core.h
> @@ -296,7 +296,11 @@ struct uart_port {
> #define UPF_SPD_WARP ((__force upf_t) (0x1010))
> #define UPF_SKIP_TEST ((__force upf_t) (1 #define UPF_AUTO_IRQ ((__force upf_t) (1 +#define UPF_IRQ_TRIG_RISING ((__force upf_t) (1 +#define UPF_IRQ_TRIG_FALLING ((__force upf_t) (1 +#define UPF_IRQ_TRIG_HIGH ((__force upf_t) (1 #define UPF_HARDPPS_CD ((__force upf_t) (1 +#define UPF_IRQ_TRIG_LOW ((__force upf_t) (1 #define UPF_LOW_LATENCY ((__force upf_t) (1 #define UPF_BUGGY_UART ((__force upf_t) (1 #define UPF_NO_TXEN_TEST ((__force upf_t) (1
Vikram Pandita wrote:
> There is currently no provision for passing IRQ trigger flags for
> serial IRQs with triggering requirements (such as GPIO IRQs.)
>
> This patch adds UPF_IRQ_TRIG_* flags which map on to IRQF_TRIGGER_*
> flags.
>
> Signed-off-by: Vikram Pandita
> Acked-by: Kevin Hilman
Note that this patch doesn't allow the interrupt to trigger on both
edges (not that I have ever seen a 8250 with this behavior, but this
is a valid configuration from an interrupt point of view).
Aside from this remark:
Acked-by: Marc Zyngier
> ---
> drivers/serial/8250.c | 10 ++++++++++
> include/linux/serial_core.h | 4 ++++
> 2 files changed, 14 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
> index bab115e..8235ef5 100644
> --- a/drivers/serial/8250.c
> +++ b/drivers/serial/8250.c
> @@ -1641,6 +1641,16 @@ static int serial_link_irq_chain(struct
> uart_8250_port *up) struct irq_info *i;
> int ret, irq_flags = up->port.flags & UPF_SHARE_IRQ ?
> IRQF_SHARED : 0;
> + /* Get IRQ Trigger Flag */
> + if (up->port.flags & UPF_IRQ_TRIG_RISING)
> + irq_flags |= IRQF_TRIGGER_RISING;
> + else if (up->port.flags & UPF_IRQ_TRIG_FALLING)
> + irq_flags |= IRQF_TRIGGER_FALLING;
> + else if (up->port.flags & UPF_IRQ_TRIG_HIGH)
> + irq_flags |= IRQF_TRIGGER_HIGH;
> + else if (up->port.flags & UPF_IRQ_TRIG_LOW)
> + irq_flags |= IRQF_TRIGGER_LOW;
> +
> mutex_lock(&hash_mutex);
>
> h = &irq_lists[up->port.irq % NR_IRQ_HASH];
> diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
> index 57a97e5..07591d5 100644
> --- a/include/linux/serial_core.h
> +++ b/include/linux/serial_core.h
> @@ -296,7 +296,11 @@ struct uart_port {
> #define UPF_SPD_WARP ((__force upf_t) (0x1010))
> #define UPF_SKIP_TEST ((__force upf_t) (1 #define UPF_AUTO_IRQ ((__force upf_t) (1 +#define UPF_IRQ_TRIG_RISING ((__force upf_t) (1 +#define UPF_IRQ_TRIG_FALLING ((__force upf_t) (1 +#define UPF_IRQ_TRIG_HIGH ((__force upf_t) (1 #define UPF_HARDPPS_CD ((__force upf_t) (1 +#define UPF_IRQ_TRIG_LOW ((__force upf_t) (1 #define UPF_LOW_LATENCY ((__force upf_t) (1 #define UPF_BUGGY_UART ((__force upf_t) (1 #define UPF_NO_TXEN_TEST ((__force upf_t) (1
* Marc Zyngier [090612 22:31]:
> On Fri, 12 Jun 2009 12:32:51 -0500
> Vikram Pandita wrote:
>
> > There is currently no provision for passing IRQ trigger flags for
> > serial IRQs with triggering requirements (such as GPIO IRQs.)
> >
> > This patch adds UPF_IRQ_TRIG_* flags which map on to IRQF_TRIGGER_*
> > flags.
> >
> > Signed-off-by: Vikram Pandita
> > Acked-by: Kevin Hilman
>
> Note that this patch doesn't allow the interrupt to trigger on both
> edges (not that I have ever seen a 8250 with this behavior, but this
> is a valid configuration from an interrupt point of view).
To me it sounds like the it would be better to have unsigned
long irqflags in struct uart_port instead of trying to squeeze
the irqflags the flags field. We're already not covering all the
irqflags currently like Marc pointed out.
Regards,
Tony
> Aside from this remark:
> Acked-by: Marc Zyngier
>
> > ---
> > drivers/serial/8250.c | 10 ++++++++++
> > include/linux/serial_core.h | 4 ++++
> > 2 files changed, 14 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
> > index bab115e..8235ef5 100644
> > --- a/drivers/serial/8250.c
> > +++ b/drivers/serial/8250.c
> > @@ -1641,6 +1641,16 @@ static int serial_link_irq_chain(struct
> > uart_8250_port *up) struct irq_info *i;
> > int ret, irq_flags = up->port.flags & UPF_SHARE_IRQ ?
> > IRQF_SHARED : 0;
> > + /* Get IRQ Trigger Flag */
> > + if (up->port.flags & UPF_IRQ_TRIG_RISING)
> > + irq_flags |= IRQF_TRIGGER_RISING;
> > + else if (up->port.flags & UPF_IRQ_TRIG_FALLING)
> > + irq_flags |= IRQF_TRIGGER_FALLING;
> > + else if (up->port.flags & UPF_IRQ_TRIG_HIGH)
> > + irq_flags |= IRQF_TRIGGER_HIGH;
> > + else if (up->port.flags & UPF_IRQ_TRIG_LOW)
> > + irq_flags |= IRQF_TRIGGER_LOW;
> > +
> > mutex_lock(&hash_mutex);
> >
> > h = &irq_lists[up->port.irq % NR_IRQ_HASH];
> > diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
> > index 57a97e5..07591d5 100644
> > --- a/include/linux/serial_core.h
> > +++ b/include/linux/serial_core.h
> > @@ -296,7 +296,11 @@ struct uart_port {
> > #define UPF_SPD_WARP ((__force upf_t) (0x1010))
> > #define UPF_SKIP_TEST ((__force upf_t) (1 > #define UPF_AUTO_IRQ ((__force upf_t) (1 > +#define UPF_IRQ_TRIG_RISING ((__force upf_t) (1 > +#define UPF_IRQ_TRIG_FALLING ((__force upf_t) (1 > +#define UPF_IRQ_TRIG_HIGH ((__force upf_t) (1 > #define UPF_HARDPPS_CD ((__force upf_t) (1 > +#define UPF_IRQ_TRIG_LOW ((__force upf_t) (1 > #define UPF_LOW_LATENCY ((__force upf_t) (1 > #define UPF_BUGGY_UART ((__force upf_t) (1 > #define UPF_NO_TXEN_TEST ((__force upf_t) (1
> --
> 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/
--
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/
> On Fri, 12 Jun 2009 12:32:51 -0500
> Vikram Pandita wrote:
>
> > There is currently no provision for passing IRQ trigger flags for
> > serial IRQs with triggering requirements (such as GPIO IRQs.)
> >
> > This patch adds UPF_IRQ_TRIG_* flags which map on to IRQF_TRIGGER_*
> > flags.
> >
> > Signed-off-by: Vikram Pandita
> > Acked-by: Kevin Hilman
>
> Note that this patch doesn't allow the interrupt to trigger on both
> edges (not that I have ever seen a 8250 with this behavior, but this
> is a valid configuration from an interrupt point of view).
To me it sounds like the it would be better to have unsigned
long irqflags in struct uart_port instead of trying to squeeze
the irqflags the flags field. We're already not covering all the
irqflags currently like Marc pointed out.
Regards,
Tony
> Aside from this remark:
> Acked-by: Marc Zyngier
>
> > ---
> > drivers/serial/8250.c | 10 ++++++++++
> > include/linux/serial_core.h | 4 ++++
> > 2 files changed, 14 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
> > index bab115e..8235ef5 100644
> > --- a/drivers/serial/8250.c
> > +++ b/drivers/serial/8250.c
> > @@ -1641,6 +1641,16 @@ static int serial_link_irq_chain(struct
> > uart_8250_port *up) struct irq_info *i;
> > int ret, irq_flags = up->port.flags & UPF_SHARE_IRQ ?
> > IRQF_SHARED : 0;
> > + /* Get IRQ Trigger Flag */
> > + if (up->port.flags & UPF_IRQ_TRIG_RISING)
> > + irq_flags |= IRQF_TRIGGER_RISING;
> > + else if (up->port.flags & UPF_IRQ_TRIG_FALLING)
> > + irq_flags |= IRQF_TRIGGER_FALLING;
> > + else if (up->port.flags & UPF_IRQ_TRIG_HIGH)
> > + irq_flags |= IRQF_TRIGGER_HIGH;
> > + else if (up->port.flags & UPF_IRQ_TRIG_LOW)
> > + irq_flags |= IRQF_TRIGGER_LOW;
> > +
> > mutex_lock(&hash_mutex);
> >
> > h = &irq_lists[up->port.irq % NR_IRQ_HASH];
> > diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
> > index 57a97e5..07591d5 100644
> > --- a/include/linux/serial_core.h
> > +++ b/include/linux/serial_core.h
> > @@ -296,7 +296,11 @@ struct uart_port {
> > #define UPF_SPD_WARP ((__force upf_t) (0x1010))
> > #define UPF_SKIP_TEST ((__force upf_t) (1 > #define UPF_AUTO_IRQ ((__force upf_t) (1 > +#define UPF_IRQ_TRIG_RISING ((__force upf_t) (1 > +#define UPF_IRQ_TRIG_FALLING ((__force upf_t) (1 > +#define UPF_IRQ_TRIG_HIGH ((__force upf_t) (1 > #define UPF_HARDPPS_CD ((__force upf_t) (1 > +#define UPF_IRQ_TRIG_LOW ((__force upf_t) (1 > #define UPF_LOW_LATENCY ((__force upf_t) (1 > #define UPF_BUGGY_UART ((__force upf_t) (1 > #define UPF_NO_TXEN_TEST ((__force upf_t) (1
> --
> 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/
--
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/
> To me it sounds like the it would be better to have unsigned
> long irqflags in struct uart_port instead of trying to squeeze
> the irqflags the flags field. We're already not covering all the
> irqflags currently like Marc pointed out.
Agreed.
Alan
--
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/
> long irqflags in struct uart_port instead of trying to squeeze
> the irqflags the flags field. We're already not covering all the
> irqflags currently like Marc pointed out.
Agreed.
Alan
--
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/
>-----Original Message-----
>From: Alan Cox [mailto:alan@lxorguk.ukuu.org.uk]
>Sent: Monday, June 22, 2009 8:24 AM
>To: Tony Lindgren
>Cc: Marc Zyngier; Pandita, Vikram; linux-serial@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
>omap@vger.kernel.org; linux-arm-kernel@lists.arm.linux.org.uk
>Subject: Re: [PATCH] serial: 8250: add IRQ trigger support
>
>> To me it sounds like the it would be better to have unsigned
>> long irqflags in struct uart_port instead of trying to squeeze
>> the irqflags the flags field. We're already not covering all the
>> irqflags currently like Marc pointed out.
>
>Agreed.
I can post a patch with new irqflags in uart_port.
Expect a patch today.
>
>Alan
--
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/
Related Threads
- Hendrix - Complaint - firefox
- Hendrix - usless piece of shit!!!!!! - firefox
- SoundBlaster Problem with 8.1R - freebsd
- Hendrix - User Prob - firefox
- help on compile/link flags - openbsd
- users - httpd - suexec for another user - httpd
- Patch, Fortran - F2008: TARGET actual to POINTER dummy with INTENT(IN) - gcc
- svn commit: r985860 - in /ofbiz/branches/release10.04: ./ applications/commonext/data/ProductStoreData.xml specialpurpose/ecomme - ofbiz
- GENERAL - Tool to compare data between tables - pgsql
- Ruby and selenium for a newbie - ruby
- contact your service provider message - firefox
- RE: Kannel and POP3 google SSL - kannel