Re: [PATCH 5/9] iio: humidity: hts221: support active-low interrupts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jonathan,

On 09/07/17 19:39, Jonathan Cameron wrote:
> On Sun,  9 Jul 2017 18:57:00 +0200
> Lorenzo Bianconi <lorenzo.bianconi83@xxxxxxxxx> wrote:
> 
>> Add support for active low interrupts (IRQF_TRIGGER_LOW and
>> IRQF_TRIGGER_FALLING). Configure the device as active high or low
>> according to the requested irq line.
>>
>> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@xxxxxx>
> Hi Lorenzo,
> 
> Sorry, you are getting caught up in a more general question I'd like to 
> pin down an answer for...
> 
> What should we be doing if we have a part that supports both high and
> low interrupts and/or rising and falling?
> 
> We actually have more than one possible thing we are configuring with
> one parameter.  If we are looking at shared interrupts or level
> converters it's more than possible we have an inversion going on between
> the two.   How is this represented to the two ends?
> 
> What's the right way of doing this?
> 
> I've added a few CCs that I think might chip in on this question!
> 
> My personal gut feeling is that the inverter should have explicit
> representation in the kernel.  We should be able to instantiate an
> irq_chip which is responsible for flipping it's sense.
> 
> You request an active high input on one side and it deals with
> the active low that needs to be requested upstream.
> 
> Chances are I'm missing something and this is already well handled!

We already have things like that, such as
drivers/irqchip/irq-mtk-sysirq.c (whose sole purpose in life is to
invert interrupt polarity).

Hope this helps,

	M.
-- 
Jazz is not dead. It just smells funny...
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux