Re: [PATCH] mfd/stmpe: Add support for irq over gpio pin

From: Viresh Kumar
Date: Mon Nov 07 2011 - 22:48:43 EST


On 11/7/2011 5:59 PM, Linus Walleij wrote:
> On Thu, Nov 3, 2011 at 10:26 AM, Viresh Kumar <viresh.kumar@xxxxxx> wrote:

>> +free_gpio:
>> + gpio_free(pdata->irq_gpio);
>
> Will that work if you didn't request irq over GPIO?
>
> If you did not request GPIO and stmpe_chip_init()
> fails this will still be executed.
>
> Maybe:
>
> if (pdata->irq_over_gpio)
> gpio_free(pdata->irq_gpio);
>

:(
Silly mistake.

>> diff --git a/include/linux/mfd/stmpe.h b/include/linux/mfd/stmpe.h
>> index be1af7c..7901351 100644
>> --- a/include/linux/mfd/stmpe.h
>> +++ b/include/linux/mfd/stmpe.h
>> @@ -76,6 +76,7 @@ struct stmpe {
>> struct stmpe_variant_info *variant;
>> const u8 *regs;
>>
>> + int irq;
>> int irq_base;
>> int num_gpios;
>> u8 ier[2];
>> @@ -194,6 +195,8 @@ struct stmpe_platform_data {
>> unsigned int irq_trigger;
>> bool irq_invert_polarity;
>> bool autosleep;
>> + bool irq_over_gpio;
>> + int irq_gpio;
>> int autosleep_timeout;
>
> Please also update the kerneldoc for struct stmpe.

Sure.

--
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/