On 7/02/2018 21:45, Linus Walleij wrote:
On Thu, Jan 25, 2018 at 4:08 PM, Jan Kundrát <jan.kundrat@xxxxxxxxx> 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 <jan.kundrat@xxxxxxxxx>
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@xxxxxxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html