On Fri, Aug 16, 2013 at 11:46 PM, Linus Walleij <linus.walleij@xxxxxxxxxx> wrote: > On Fri, Aug 16, 2013 at 5:06 PM, Loh Tien Hock <thloh@xxxxxxxxxx> wrote: >>> On Mon, Jul 29, 2013 at 6:24 PM, Loh Tien Hock <thloh@xxxxxxxxxx> wrote: >>>> On Tue, Jul 30, 2013 at 12:11 AM, Linus Walleij > >>>> We still need to compare the altera_gc->edge_type to the expected ones >>>> (so that we don't allow incorrect configuration, eg. the GPIO is >>>> configured as rising, but set_type tries to set falling). >>>> So we should compare it with magic numbers, instead of custom defines >>>> like the example below? >>>> if (type == IRQ_TYPE_EDGE_RISING && >>>> altera_gc->edge_type == 0) >>>> return 0; >>> >>> And why can't altera_gc->edge_type use exactly the same enumerators so it becomes: >>> >>> (type == IRQ_TYPE_EDGE_RISING && >>> altera_gc->edge_type == IRQ_TYPE_EDGE_RISING) >>> >>> ? >> >> We're unable to do that because the tool that generates the dts file >> had the number that way, and if we were to change to code to your >> suggestion, the tool needs to be changed and it will break backward >> compatibility. > > Sorry? The values used in DTS bindings are decided on the mailing > list devicetree@xxxxxxxxxxxxxxx, not by your proprietary tools. This > should have been discussed with the apropriate authorities *before* > implementing funny tools, DT bindings are not owned or defined by > any one company. > > Please study this binding include: > include/dt-bindings/interrupt-controller/irq.h: > > #define IRQ_TYPE_NONE 0 > #define IRQ_TYPE_EDGE_RISING 1 > #define IRQ_TYPE_EDGE_FALLING 2 > #define IRQ_TYPE_EDGE_BOTH (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING) > #define IRQ_TYPE_LEVEL_HIGH 4 > #define IRQ_TYPE_LEVEL_LOW 8 > > Please use this binding, nothing else. > OK, I'll see to it. > Yours, > Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html