public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: Tony Lindgren <tony@atomide.com>, Thierry Reding <treding@nvidia.com>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>,
	Belisko Marek <marek.belisko@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-omap@vger.kernel.org,
	"Dr. H. Nikolaus Schaller" <hns@goldelico.com>,
	Laxman Dewangan <ldewangan@nvidia.com>
Subject: Re: omap5 fixing palmas IRQ_TYPE_NONE warning leads to gpadc timeouts
Date: Mon, 26 Nov 2018 20:17:20 +0000	[thread overview]
Message-ID: <149b3b6b-e52e-4942-151b-6df4358f5a7a@nvidia.com> (raw)
In-Reply-To: <20181126193212.GN53235@atomide.com>


On 26/11/2018 19:32, Tony Lindgren wrote:
> * Thierry Reding <treding@nvidia.com> [181126 10:25]:
>> On Mon, Nov 26, 2018 at 11:49:54AM +0200, Peter Ujfalusi wrote:
>>> The register map documentation I have states the following:
>>> bit7 INT_POLARITY Select the polarity of the INT output line
>>> 0: Interrupt line (INT) is low when interrupt is pending (default) RW
>>> 1: Interrupt line (INT) is high when interrupt is pending
>>>
>>> By default the Palmas irq is active low.
>>
>> That would confirm that the driver code is correct. My understanding is
>> that the PMC on Tegra expects a low-active IRQ from the PMIC, so we need
>> to invert the interrupt again in the PMC.
> 
> But then why Tegra need to set PALMAS_POLARITY_CTRL_INT_POLARITY
> if dts has IRQ_TYPE_LEVEL_HIGH? Shouldn't the Palmas default low
> setting be correct for Tegra if PMC expects active-low interrupt
> and then inverts it for GIC?

So I think what is going on here is ...

1. For Tegra, the interrupt parent the palmas interrupt in DT is the GIC
   not the PMC. The PMC does not register an interrupt controller
   (although to be correct probably should have. I think it had been
    discussed in the past and Stephen W may know the history here). So
   the interrupt polarity has to be HIGH otherwise setting the trigger
   type in the GIC will fail (as it only supports rising edge or level
   high IIRC).
2. However, as Thierry mentioned the Tegra PMC wants an active low
   interrupt and so the PMC inverts it on entering the PMC. However,
   given that the GIC interrupts must be active high, the PMC must
   invert again between the PMC and GIC.

So looking back my description in the change 7e9d474954f4 was not quite
accurate because the interrupt from palmas is active high but the PMC
inverts it. I think that this is quite confusing because we don't have a
good way to describe this in the DT. If we made the PMC an interrupt
controller then it would probably be a lot clearer. However, for
historical reasons this was not done.

Cheers
Jon

-- 
nvpublic

  reply	other threads:[~2018-11-26 20:17 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-20 16:37 omap5 fixing palmas IRQ_TYPE_NONE warning leads to gpadc timeouts Belisko Marek
2018-07-03  8:45 ` Tony Lindgren
2018-07-03 18:31   ` Belisko Marek
2018-11-13 18:06     ` Tony Lindgren
2018-11-14 17:03       ` Tony Lindgren
2018-11-14 17:26         ` Tony Lindgren
2018-11-19 10:18       ` Peter Ujfalusi
2018-11-19 16:19         ` Tony Lindgren
2018-11-19 17:14           ` Tony Lindgren
2018-11-20 11:14             ` Jon Hunter
2018-11-23 16:48               ` Tony Lindgren
2018-11-26  9:36                 ` Thierry Reding
2018-11-26  9:49                   ` Peter Ujfalusi
2018-11-26 10:25                     ` Thierry Reding
2018-11-26 19:32                       ` Tony Lindgren
2018-11-26 20:17                         ` Jon Hunter [this message]
2018-11-27 17:55                           ` Tony Lindgren
2018-11-27 18:17                             ` Tony Lindgren
2018-11-26 10:13                 ` Jon Hunter
2018-11-20 12:22             ` Laxman Dewangan
2018-11-26 10:14             ` Thierry Reding
2018-11-26 19:14               ` Tony Lindgren
2018-11-26 19:19                 ` Santosh Shilimkar
2018-11-27 18:03               ` Tony Lindgren
2018-11-20  7:36           ` Peter Ujfalusi

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=149b3b6b-e52e-4942-151b-6df4358f5a7a@nvidia.com \
    --to=jonathanh@nvidia.com \
    --cc=hns@goldelico.com \
    --cc=ldewangan@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=marek.belisko@gmail.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=tony@atomide.com \
    --cc=treding@nvidia.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox