lkml.org 
[lkml]   [2013]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] regmap: irq: Add support for interrupt type
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.

> + 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.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2013-02-13 15:21    [W:0.128 / U:0.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site