From: Laxman Dewangan <ldewangan@nvidia.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] regmap: irq: Add support for interrupt type
Date: Thu, 14 Feb 2013 16:31:50 +0530 [thread overview]
Message-ID: <511CC41E.7040608@nvidia.com> (raw)
In-Reply-To: <20130213135440.GI5062@opensource.wolfsonmicro.com>
On Wednesday 13 February 2013 07:24 PM, Mark Brown wrote:
> * PGP Signed by an unknown key
>
> On Wed, Feb 13, 2013 at 06:44:49PM +0530, Laxman Dewangan wrote:
>> Most of the MFD module have the GPIO and gpio interrupt is
>> enabled/disabled through the rising/falling edge type. There
>> is no specific mask enable/disable registers for GPIO submodules.
>>
>> Extend the regmap irq to support the irq_set_type() so that
>> gpio submodule of MFD devices can use the regmap-irq framework
>> for their interrupt registration.
> This commit message needs to be rewritten for comprehensibility, MFD has
> nothing to do with this - it's something to do with your particular
> hardware that you're trying to support. Describe the hardware feature,
> not the subsystem your hardware happens to be used in.
Fine, I will try to write better.
>
>> + switch (type) {
>> + case IRQ_TYPE_EDGE_FALLING:
>> + d->type_buf[reg] |= irq_data->type_falling_mask;
>> + break;
>> +
>> + case IRQ_TYPE_EDGE_RISING:
>> + d->type_buf[reg] |= irq_data->type_rising_mask;
>> + break;
>> +
>> + case IRQ_TYPE_EDGE_BOTH:
>> + d->type_buf[reg] |= (irq_data->type_falling_mask |
>> + irq_data->type_rising_mask);
>> + break;
> This should handle the case where an output type is not supported, for
> example if the device only supports falling edge. It'd also seem
> sensible to have an explicit value to set for each trigger type rather
> than reyling on the device using separate bits for everything - you
> might see an encoding like 0 for falling, 1 for rising, 2 for both and 3
> for level for example.
is this mean we should have variable like
.supported_iflags which capture what it is supported or not.
And then irq_type_val[MAX_REGMAP_IRQ_TYPE] as array and define the
REGMAP_IRQ_TYPE_[FALLING/RISING/BOTH] as index and client can fill this
info as per the hardware or
Or we should have separate variable for each type like:
int irq_type_rising_val;
int irq_type_faling_val;
int ire_type_both_val;
along with
int irq_type_supported;
int irq_type_mask_val;
next prev parent reply other threads:[~2013-02-14 11:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-13 13:14 [PATCH 1/2] regmap: irq: Add support for interrupt type Laxman Dewangan
2013-02-13 13:14 ` [PATCH 2/2] regmap: irq: do not write mask register if it is not supported Laxman Dewangan
2013-02-13 14:20 ` Mark Brown
2013-02-14 11:06 ` Laxman Dewangan
2013-02-14 11:35 ` Mark Brown
2013-02-14 11:55 ` Laxman Dewangan
2013-02-14 11:57 ` Mark Brown
2013-02-14 12:16 ` Laxman Dewangan
2013-02-13 13:54 ` [PATCH 1/2] regmap: irq: Add support for interrupt type Mark Brown
2013-02-14 11:01 ` Laxman Dewangan [this message]
2013-02-14 11:06 ` Mark Brown
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=511CC41E.7040608@nvidia.com \
--to=ldewangan@nvidia.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox