Re: [PATCHv4 3/4] TPS65910: IRQ: Add interrupt controller
From: Samuel Ortiz
Date: Tue Apr 26 2011 - 10:01:28 EST
Hi Jorge,
On Thu, Apr 21, 2011 at 09:35:49AM -0500, Jorge Eduardo Candelaria wrote:
> From: Graeme Gregory <gg@xxxxxxxxxxxxxxx>
>
> This module controls the interrupt handling for the tps chip. The
> interrupt sources are the following:
>
> - GPIO falling/rising edge detection
> - Battery voltage below/above threshold
> - PWRON signal
> - PWRHOLD signal
> - Temperature detection
> - RTC alarm and periodic event
The patch looks good, except for:
> +int tps65910_irq_init(struct tps65910 *tps65910, int irq,
> + struct tps65910_platform_data *pdata)
> +{
> + int ret, cur_irq;
> + int flags = IRQF_ONESHOT;
> + u8 reg;
> +
> + if (!irq) {
> + dev_warn(tps65910->dev, "No interrupt support, no core IRQ\n");
> + return -EINVAL;
> + }
> +
> + if (!pdata || !pdata->irq_base) {
> + dev_warn(tps65910->dev, "No interrupt support, no IRQ base\n");
> + return -EINVAL;
> + }
> +
> + /* Mask top level interrupts */
> + reg = 0xFF;
> + tps65910->write(tps65910, TPS65910_INT_MSK, 1, ®);
> + reg = 0x03;
> + tps65910->write(tps65910, TPS65910_INT_MSK2, 1, ®);
> +
> + mutex_init(&tps65910->irq_lock);
> + tps65910->chip_irq = irq;
> + tps65910->irq_base = pdata->irq_base;
> +
> + /* Register with genirq */
> + for (cur_irq = tps65910->irq_base;
> + cur_irq < TPS65910_NUM_IRQ + tps65910->irq_base;
> + cur_irq++) {
> + irq_set_chip_data(cur_irq, tps65910);
> + irq_set_chip_and_handler(cur_irq, &tps65910_irq_chip,
> + handle_edge_irq);
> + irq_set_nested_thread(cur_irq, 1);
> +
> + /* ARM needs us to explicitly flag the IRQ as valid
> + * and will set them noprobe when we do so. */
> +#ifdef CONFIG_ARM
> + set_irq_flags(cur_irq, IRQF_VALID);
> +#else
> + set_irq_noprobe(cur_irq);
That should be irq_set_noprobe().
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
--
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/