# Re: \[PATCH 1/4\] pinctrl: mcp23s08: IRQ behavior for open-drain interrupts

- From: Phil Reid \<hidden\>
- Date: 2018-02-09 03:37:15 
- List: linux-gpio
- Page: https://ratatoskr.run/linux-gpio/2018/02/8507635
- Thread: https://ratatoskr.run/linux-gpio/2018/02/8507635/t.md

```text
On 7/02/2018 21:45, Linus Walleij wrote:
> On Thu, Jan 25, 2018 at 4:08 PM, Jan Kundrát [ref] wrote:
>
>> The hardware supports three different IRQ modes:
>> - open drain, i.e., an active-low output which requires an external
>>    pull-up and supports IRQ line sharing,
>> - active low, with push-pull output,
>> - active high, with push-pull output.
>>
>> My understanding of electronics is limited, but it is "wrong" to connect
>> different push-pull outpus together. It could sort-of work if the
>> chips/board actually have some resistors there, but it's an ugly thing
>> to do.
>>
>> In the past, this driver did not touch the ODR bit (for open-drain)
>> operation. During power-on-reset, it is set to zero. Unless some
>> platform code actually set this bit to one, this means that the code
>> never supported open drain operation.
>>
>> This change makes this handling explicit. If you want sharing of the IRQ
>> line, then use the microchip,irq-open-drain mode and add an external
>> pull-up.
>>
>> There's some risk here. If, e.g., the bootloader sets the ODR bit for
>> some reason, the HW shares the IRQ lines, and nobody changes the DT,
>> then your HW will suddenly use push-pull driver for the IRQ line. If
>> there is any other chip on the same lane, the HW might suffer (my chip
>> survived this when I "tested" this by accident with no bootloader code
>> to set the ODR bit).
>>
>> Signed-off-by: Jan Kundrát <redacted>
>
> I'm holding this patch back pending the discussion with Phil
> and any alternative approach from him.
>
> Just resend it if nothing happens for a while.
>
> I still try to apply the other patches for now (2-4).
>

I tried applying patches 2-4 and a couple of other mcp patches to
https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git/ for-next
before resending mine as for-next is a few days behind by the look,
to make sure it'd apply ok but didn't have much success.

But my git skills are not up to figuring out what I'm doing wrong.
I'll send once I see those patches on a branch.

-- 
Regards
Phil Reid

ElectroMagnetic Imaging Technology Pty Ltd
Development of Geophysical Instrumentation & Software
www.electromag.com.au

3 The Avenue, Midland WA 6056, AUSTRALIA
Ph: +61 8 9250 8100
Fax: +61 8 9250 7100
Email: preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
```
