linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Requesting different interrupt triggers for the same device type
@ 2014-12-02 16:45 Alexander Stein
  2014-12-03 11:06 ` Grygorii Strashko
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Stein @ 2014-12-02 16:45 UTC (permalink / raw)
  To: linux-gpio

Hi,

I have a board which has two PCA9555 attached. Due to hardware wirings each has a different interrupt trigger. One is active low and one is active high and each has a different interrupt parent.
How can I specify this in the device tree? Do I need to set IRQ_TYPE_LEVEL_LOW and IRQ_TYPE_LEVEL_HIGH approriately? How can this work, when the driver requests the interrupt like this?
> ret = devm_request_threaded_irq(&client->dev,
> 			client->irq,
> 			NULL,
> 			pca953x_irq_handler,
> 			IRQF_TRIGGER_LOW | IRQF_ONESHOT |
> 			IRQF_SHARED,
> 			dev_name(&client->dev), chip);

The interrupt flags seem rather fixed. Any comments/hints?

Best regards,
Alexander
-- 
Dipl.-Inf. Alexander Stein

SYS TEC electronic GmbH
Am Windrad 2
08468 Heinsdorfergrund
Tel.: 03765 38600-1156
Fax: 03765 38600-4100
Email: alexander.stein@systec-electronic.com
Website: www.systec-electronic.com
 
Managing Director: Dipl.-Phys. Siegmar Schmidt
Commercial registry: Amtsgericht Chemnitz, HRB 28082

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Requesting different interrupt triggers for the same device type
  2014-12-02 16:45 Requesting different interrupt triggers for the same device type Alexander Stein
@ 2014-12-03 11:06 ` Grygorii Strashko
  2014-12-04  8:27   ` Alexander Stein
  0 siblings, 1 reply; 4+ messages in thread
From: Grygorii Strashko @ 2014-12-03 11:06 UTC (permalink / raw)
  To: Alexander Stein, linux-gpio

On 12/02/2014 06:45 PM, Alexander Stein wrote:
> Hi,
>
> I have a board which has two PCA9555 attached. Due to hardware wirings each has a different interrupt trigger. One is active low and one is active high and each has a different interrupt parent.
> How can I specify this in the device tree? Do I need to set IRQ_TYPE_LEVEL_LOW and IRQ_TYPE_LEVEL_HIGH approriately? How can this work, when the driver requests the interrupt like this?
>> ret = devm_request_threaded_irq(&client->dev,
>> 			client->irq,
>> 			NULL,
>> 			pca953x_irq_handler,
>> 			IRQF_TRIGGER_LOW | IRQF_ONESHOT |
>> 			IRQF_SHARED,
>> 			dev_name(&client->dev), chip);
>
> The interrupt flags seem rather fixed. Any comments/hints?

See, http://www.spinics.net/lists/linux-gpio/msg02731.html
It may help.

regards,
-grygorii

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Requesting different interrupt triggers for the same device type
  2014-12-03 11:06 ` Grygorii Strashko
@ 2014-12-04  8:27   ` Alexander Stein
  2014-12-04 12:06     ` Grygorii Strashko
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Stein @ 2014-12-04  8:27 UTC (permalink / raw)
  To: Grygorii Strashko; +Cc: linux-gpio

Hello Grygorii,

On Wednesday 03 December 2014 13:06:18, Grygorii Strashko wrote:
> On 12/02/2014 06:45 PM, Alexander Stein wrote:
> > Hi,
> >
> > I have a board which has two PCA9555 attached. Due to hardware wirings each has a different interrupt trigger. One is active low and one is active high and each has a different interrupt parent.
> > How can I specify this in the device tree? Do I need to set IRQ_TYPE_LEVEL_LOW and IRQ_TYPE_LEVEL_HIGH approriately? How can this work, when the driver requests the interrupt like this?
> >> ret = devm_request_threaded_irq(&client->dev,
> >> 			client->irq,
> >> 			NULL,
> >> 			pca953x_irq_handler,
> >> 			IRQF_TRIGGER_LOW | IRQF_ONESHOT |
> >> 			IRQF_SHARED,
> >> 			dev_name(&client->dev), chip);
> >
> > The interrupt flags seem rather fixed. Any comments/hints?
> 
> See, http://www.spinics.net/lists/linux-gpio/msg02731.html
> It may help.

Well, removing that trigger here (and in another driver where INT line is shared) it "works". It seems that each (DT-) driver should remove those explicit flags, no?

Best regards,
Alexander
-- 
Dipl.-Inf. Alexander Stein

SYS TEC electronic GmbH
Am Windrad 2
08468 Heinsdorfergrund
Tel.: 03765 38600-1156
Fax: 03765 38600-4100
Email: alexander.stein@systec-electronic.com
Website: www.systec-electronic.com
 
Managing Director: Dipl.-Phys. Siegmar Schmidt
Commercial registry: Amtsgericht Chemnitz, HRB 28082


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Requesting different interrupt triggers for the same device type
  2014-12-04  8:27   ` Alexander Stein
@ 2014-12-04 12:06     ` Grygorii Strashko
  0 siblings, 0 replies; 4+ messages in thread
From: Grygorii Strashko @ 2014-12-04 12:06 UTC (permalink / raw)
  To: Alexander Stein; +Cc: linux-gpio

On 12/04/2014 10:27 AM, Alexander Stein wrote:
> Hello Grygorii,
> 
> On Wednesday 03 December 2014 13:06:18, Grygorii Strashko wrote:
>> On 12/02/2014 06:45 PM, Alexander Stein wrote:
>>> Hi,
>>>
>>> I have a board which has two PCA9555 attached. Due to hardware wirings each has a different interrupt trigger. One is active low and one is active high and each has a different interrupt parent.
>>> How can I specify this in the device tree? Do I need to set IRQ_TYPE_LEVEL_LOW and IRQ_TYPE_LEVEL_HIGH approriately? How can this work, when the driver requests the interrupt like this?
>>>> ret = devm_request_threaded_irq(&client->dev,
>>>> 			client->irq,
>>>> 			NULL,
>>>> 			pca953x_irq_handler,
>>>> 			IRQF_TRIGGER_LOW | IRQF_ONESHOT |
>>>> 			IRQF_SHARED,
>>>> 			dev_name(&client->dev), chip);
>>>
>>> The interrupt flags seem rather fixed. Any comments/hints?
>>
>> See, http://www.spinics.net/lists/linux-gpio/msg02731.html
>> It may help.
> 
> Well, removing that trigger here (and in another driver where INT line is shared) it "works". It seems that each (DT-) driver should remove those explicit flags, no?

Hm. I think yes, in general. But problem is compatibility with non-DT builds and it
should be solved somehow in per-driver specific way.

probably simplest way would be smth. like this:

unsigned long irqflags = 0;

if (!dev->of_node)
	irqflags = IRQF_TRIGGER_LOW;

devm_request_threaded_irq(..,  irqflags | IRQF_ONESHOT | IRQF_SHARED, ..);

regards,
-grygorii





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-12-04 12:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-02 16:45 Requesting different interrupt triggers for the same device type Alexander Stein
2014-12-03 11:06 ` Grygorii Strashko
2014-12-04  8:27   ` Alexander Stein
2014-12-04 12:06     ` Grygorii Strashko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).