From: Laxman Dewangan <ldewangan@nvidia.com>
To: Mark Brown <broonie@kernel.org>
Cc: <gregkh@linuxfoundation.org>, <linux-kernel@vger.kernel.org>,
<swarren@wwwdotorg.org>
Subject: Re: [PATCH 2/2] regmap: irq: add support to have callback pre/post irq handling
Date: Wed, 6 Jan 2016 11:34:21 +0530 [thread overview]
Message-ID: <568CAE65.9030001@nvidia.com> (raw)
In-Reply-To: <20160105174334.GJ6588@sirena.org.uk>
Resending as previous response was denied by linux-kernel due to html
format.
On Tuesday 05 January 2016 11:13 PM, Mark Brown wrote:
> * PGP Signed by an unknown key
>
> On Tue, Dec 22, 2015 at 06:25:27PM +0530, Laxman Dewangan wrote:
>> Some of devices like MAXIM MAX77620 required to have the chip
>> specific configuration before processing interrupt and after
>> interrupt handling is done.
> I'd like to see the user for this...
>
This will be there in my next coming patches for PMIC driver from Maxim
Semiconductor MAX77620/MAX20024.
Per datasheet:
Upon the interrupt hardware line going low (nIRQ=0), the software is
switched to the priority decoder which decides in what order all
interrupts to the processor are serviced and therefore, will transfer
control to the PMIC interrupt service routine appropriately.
* The first task for the processor is to mask the PMIC interrupt by
setting GLBLM.
o This forces nIRQ to go high-impedance in which case it will be
pulled high by the external pull-up resistor.
o Forcing nRIQ to go high-impedance ensures that any interrupts
that occur within the PMIC while the PMIC interrupt service routine is
being executed will cause a subsequent falling edge on the processor
interrupt line.
* The next task is to read the IRQTOP register and maintain a local
copy. Note that IRQTOP is cleared when read.
// Handle all interrupts which occurred from PMIC.
* Once all interrupts have been checked and serviced, the interrupt
service routine un-masks the hardware interrupt line by clearing (GLBLM).
And typical code will be:
int max77620_top_irq_chip_pre_irq(void *data)
{
struct max77620_chip *chip = data;
ret = max77620_reg_update(chip->dev, MAX77620_PWR_SLAVE,
MAX77620_REG_INTENLBT, MAX77620_GLBLM_MASK,
MAX77620_GLBLM_MASK);
::::
}
int max77620_top_irq_chip_post_irq(void *data)
{
struct max77620_chip *chip = data;
ret = max77620_reg_update(chip->dev, MAX77620_PWR_SLAVE,
MAX77620_REG_INTENLBT, MAX77620_GLBLM_MASK, 0);
::::
}
static struct regmap_irq_chip max77620_top_irq_chip = {
.pre_irq = max77620_top_irq_chip_pre_irq,
.post_irq = max77620_top_irq_chip_post_irq,
};
next prev parent reply other threads:[~2016-01-06 6:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-22 12:55 [PATCH 1/2] regmap: irq: add support for configuration of trigger type Laxman Dewangan
2015-12-22 12:55 ` [PATCH 2/2] regmap: irq: add support to have callback pre/post irq handling Laxman Dewangan
2016-01-05 17:43 ` Mark Brown
2016-01-06 6:04 ` Laxman Dewangan [this message]
2016-01-05 17:41 ` [PATCH 1/2] regmap: irq: add support for configuration of trigger type Mark Brown
2016-01-06 5:48 ` Laxman Dewangan
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=568CAE65.9030001@nvidia.com \
--to=ldewangan@nvidia.com \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=swarren@wwwdotorg.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.