Thread (13 messages) 13 messages, 5 authors, 2014-07-08

[PATCH V5 2/3] Documentation: gpio: Add APM X-Gene SoC GPIO controller DTS binding

From: Anton Vorontsov <hidden>
Date: 2014-07-07 21:54:47
Also in: linux-devicetree, linux-gpio

On Mon, Jul 07, 2014 at 11:26:18PM +0200, Linus Walleij wrote:
...
quoted
There was another reason for this as well, part of the gpio code I read
was confusing me. So I look through the other gpio documentations and
found an example that did this as well.

int of_gpio_simple_xlate(struct gpio_chip *gc,
                         const struct of_phandle_args *gpiospec, u32 *flags)
{
        /*
         * We're discouraging gpio_cells < 2, since that way you'll have to
         * write your own xlate function (that will have to retrive the GPIO
         * number and the flags from a single gpio cell -- this is possible,
         * but not recommended).
         */
Hm yeah that's right.

This check was added by Anton in 2008. Anton why did we discourage
onecell GPIOs?
Yup, the check was there from the very beginning. Think of
OF_GPIO_ACTIVE_LOW flag (it is widely used in drivers.)

The documentation in Feng's driver says "second cell is used to specify
optional parameters (unused)," which is not entirely correct. With the
standard xlate call it is used for active-low flag. You can implement
active-low flag w/o using the second cell, but it will be ugly.

Thanks,

Anton
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help