Re: [PATCH v3 4/5] pinctrl: mcp23s08: configure irq polarity using irq data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Tue, Nov 21, 2017 at 9:21 AM, Phil Reid <preid@xxxxxxxxxxxxxxxxx> wrote:

> The irq polarity is already encoded in the irq config. Use that to
> determine the polarity for the mcp32s08 irq output instead of the
> custom microchip,irq-active-high property.
>
> Signed-off-by: Phil Reid <preid@xxxxxxxxxxxxxxxxx>
(...)
>         if (mcp->irq && mcp->irq_controller) {
> -               irq_active_high =
> -                       device_property_read_bool(dev,
> -                                             "microchip,irq-active-high");
> +               if (device_property_present(dev, "microchip,irq-active-high"))
> +                       dev_warn(dev,
> +                                "microchip,irq-active-high is deprecated\n");
> +
> +               irq_trig = irqd_get_trigger_type(irq_get_irq_data(mcp->irq));
> +               if (irq_trig == IRQF_TRIGGER_HIGH)
> +                       irq_active_high = true;

This makes the setting from the interrupt line override the
custom property.

Should it not be the other way around to preserve compatibility
with elder device trees?

I.e. the custom property overrides the line setting?

Otherwise it looks good.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux