Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
uses of irq_to_gpio() in drivers/staging/iio
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ben Dooks  
View profile  
 More options Aug 2 2011, 12:50 pm
Newsgroups: linux.kernel
From: Ben Dooks <bjdo...@googlemail.com>
Date: Tue, 02 Aug 2011 18:50:01 +0200
Local: Tues, Aug 2 2011 12:50 pm
Subject: uses of irq_to_gpio() in drivers/staging/iio
Whilst looking in drivers/staging/iio/accel/lis3l02dq_core.c, I
came across the following lines of code

    708          if (spi->irq && gpio_is_valid(irq_to_gpio(spi->irq)) > 0) {
    709                  ret = request_threaded_irq(st->us->irq,
    710                                             &lis3l02dq_th,
    711
&lis3l02dq_event_handler,
    712                                             IRQF_TRIGGER_RISING,
    713                                             "lis3l02dq",
    714                                             indio_dev);

Which gives rise to the following questions:

1) IRQ0 and GPIO0 are often valid numbers for GPIOs.

2) Not all interrupts are necessarily GPIO interrupts. What happens
    if the device is attached to a hardware interrupt line which is
    not a GPIO?

--
Ben Dooks <bjdo...@googlemail.com> http://www.fluff.org/ben/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Cameron  
View profile  
 More options Aug 2 2011, 1:00 pm
Newsgroups: linux.kernel
From: Jonathan Cameron <ji...@cam.ac.uk>
Date: Tue, 02 Aug 2011 19:00:02 +0200
Local: Tues, Aug 2 2011 1:00 pm
Subject: Re: uses of irq_to_gpio() in drivers/staging/iio
On 08/02/11 17:43, Ben Dooks wrote:
> Whilst looking in drivers/staging/iio/accel/lis3l02dq_core.c, I
> came across the following lines of code

>    708          if (spi->irq && gpio_is_valid(irq_to_gpio(spi->irq)) > 0) {
>    709                  ret = request_threaded_irq(st->us->irq,
>    710                                             &lis3l02dq_th,
>    711 &lis3l02dq_event_handler,
>    712                                             IRQF_TRIGGER_RISING,
>    713                                             "lis3l02dq",
>    714                                             indio_dev);

> Which gives rise to the following questions:

> 1) IRQ0 and GPIO0 are often valid numbers for GPIOs.

Good point - should fix that one.  Any suggestions for a neat way
to do it?

> 2) Not all interrupts are necessarily GPIO interrupts. What happens
>    if the device is attached to a hardware interrupt line which is
>    not a GPIO?

Easy. It doesn't work.  Stupid hardware doesn't necessarily drop
the interrupt line on a read. Hence it sticks high. If one only has
edge triggered interrupt lines that's a pain. Is there an easy way
around this?  When I wrote the relevant code a long time ago I couldn't
get anything else to work.

There may well be a better way but I haven't revisited this recently.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »