On Thu, Sep 24, 2015 at 11:09 PM, H. Nikolaus Schaller <hns@xxxxxxxxxxxxx> wrote: > Am 25.09.2015 um 00:09 schrieb Linus Walleij <linus.walleij@xxxxxxxxxx>: >> @@ -65,6 +69,13 @@ Example of a node using GPIOs: >> GPIO_ACTIVE_HIGH is 0, so in this example gpio-specifier is "18 0" and encodes >> GPIO pin number, and GPIO flags as accepted by the "qe_pio_e" gpio-controller. >> >> +Optional standard bitfield specifiers for the last cell: >> + >> +- Bit 0: 0 means active high, 1 means active low >> +- Bit 1: 1 means open drain/open collector, see: >> + https://en.wikipedia.org/wiki/Open_collector >> +- Bit 2: 1 means open source/open emitter (...) >> #define GPIO_ACTIVE_HIGH 0 >> #define GPIO_ACTIVE_LOW 1 >> +#define GPIO_OPEN_DRAIN 2 >> +#define GPIO_OPEN_SOURCE 4 > > this would allow to specify open drain and source > in parallel (6) - which would mean a completely floating > output… Is this intended? OK... > Some hardware may also have open_collector > or open_emitter - which is logically the same. > > So I have tried to find a common term covering all > these cases. It appears to be “single-ended” > https://en.wikipedia.org/wiki/Single-ended_triode > as opposite to “push-pull" outputs (and “tri-state"). This is good. > So I would suggest: > > #define GPIO_PUSH_PULL 0 > #define GPIO_SINGLE_ENDED 2 > > and the distinction with pull-down (open drain/collector) > and pull-up (open source/emitter) to be combined with > ACTIVE_HIGH/LOW: > > #define GPIO_OPEN_DRAIN (GPIO_SINGLE_ENDED | GPIO_ACTIVE_LOW) > #define GPIO_OPEN_SOURCE (GPIO_SINGLE_ENDED | GPIO_ACTIVE_HIGH) Makes perfect sense. I'll try to fix the patch. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html