All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Stein <alexander.stein@systec-electronic.com>
To: "Jan Kundrát" <jan.kundrat@cesnet.cz>
Cc: Phil Reid <preid@electromag.com.au>,
	linus.walleij@linaro.org, robh+dt@kernel.org,
	mark.rutland@arm.com, sre@kernel.org, linux-gpio@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v4 3/3] pinctrl: mcp23s08: add open drain configuration for irq output
Date: Wed, 21 Feb 2018 08:11:25 +0100	[thread overview]
Message-ID: <6667369.B4Kk5zL0O4@ws-stein> (raw)
In-Reply-To: <ef0b68d3-3e3e-4957-8ab4-7d4613a9538c@cesnet.cz>

On Tuesday, February 20, 2018, 6:15:46 PM CET Jan Kundrát wrote:
> I was told that the appropriate way forward are device drivers which do not
> specify the IRQ polarity. Apparently, people are supposed to do that in
> their DT.
> 
> So, in this context:
> 
> - pinctrl-mcp23s08.c should only specify IRQF_ONESHOT | IRQF_SHARED
> - the DT should use an appropriate IRQ_TYPE_LEVEL_LOW or
> IRQ_TYPE_LEVEL_HIGH based on what the CPU expects to see on its IRQ pins
> - the DT must also set a property to configure the MCP23xxx device to
> *generate* an IRQ by the active-high flag, or another flag for an
> open-drain active-low IRQ output suitable for connecting directly to an
> interrupt line which gets shared by several open-drain IRQ producers
> - whoever supplies the DT must now check that their settings "make sense"
> 
> Yes, this means that people might have to update their DTs. To me, that
> makes sense. If you ask me, the DT is already sort-of broken because it's
> using IRQF_SHARED with a push-pull IRQ output. Yes, one can fix that with
> extra transistors, but that sounds quite ugly, doesn't it. 

Well, that is the exact situation on the board I had to deal with. The MCP was 
attached to a transisitor inverting the signal. The output on MCP has to be 
push-pull as there was no pull-up oder -down. But the line connecting the 
inverter to the CPU was an open-drain one and this line was actually a shared 
IRQ line. So of course the line bewteen MCP and inverter cannot be shared, but 
the IRQ used on CPU is actually shared. How can this be respresented in DT?

Best reagrds,
Alexander

  parent reply	other threads:[~2018-02-21  7:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-19  9:25 [PATCH v4 0/3] pinctrl: mcp32s08: add open drain config for irq Phil Reid
2018-02-19  9:25 ` [PATCH v4 1/3] pinctrl: mcp23s08: fix probing of mcp23s18 Phil Reid
2018-02-19 21:24   ` Jan Kundrát
2018-02-22 15:05   ` Linus Walleij
2018-02-19  9:25 ` [PATCH v4 2/3] dt-bindings: pinctrl: mcp23s08: add documentation for drive-open-drain Phil Reid
2018-02-22 15:06   ` Linus Walleij
2018-02-19  9:25 ` [PATCH v4 3/3] pinctrl: mcp23s08: add open drain configuration for irq output Phil Reid
2018-02-19 21:43   ` Jan Kundrát
2018-02-20  1:12     ` Phil Reid
2018-02-20 17:15       ` Jan Kundrát
2018-02-21  0:51         ` Phil Reid
2018-02-21  7:11         ` Alexander Stein [this message]
2018-02-21  8:19           ` Phil Reid
2018-02-21 11:55           ` Jan Kundrát
2018-02-22 15:10   ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6667369.B4Kk5zL0O4@ws-stein \
    --to=alexander.stein@systec-electronic.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jan.kundrat@cesnet.cz \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=preid@electromag.com.au \
    --cc=robh+dt@kernel.org \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.