lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAVeFuKxoT-fvhNAqJYdXgwXiw6LbE1ks_upkWjCYee_YtQPnw@mail.gmail.com>
Date:	Wed, 12 Feb 2014 11:20:47 +0900
From:	Alexandre Courbot <gnurou@...il.com>
To:	David Daney <ddaney.cavm@...il.com>
Cc:	Grant Likely <grant.likely@...aro.org>,
	Rob Herring <robh+dt@...nel.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	Linus Walleij <linus.walleij@...aro.org>,
	"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	David Daney <david.daney@...ium.com>
Subject: Re: [PATCH v2 1/2] of/gpio: Define OF_GPIO_OPEN_DRAIN and
 OF_GPIO_OPEN_SOURCE flags.

On Wed, Feb 12, 2014 at 4:49 AM, David Daney <ddaney.cavm@...il.com> wrote:
> From: David Daney <david.daney@...ium.com>
>
> When we have a GPIO pin connected to an open-drain network, we want a
> standard way of specifying this in the device tree.  So we choose bit
> 1 of the flag field to indicate open drain.
>
> A typical use case would be something like:
>
>         enum of_gpio_flags f;
>         .
>         .
>         .
>         reset_gpio = of_get_named_gpio_flags(node, "reset", 0, &f);
>         .
>         .
>         .
>         ret = gpio_request_one(reset_gpio,
>                 (f & OF_GPIO_OPEN_DRAIN) ? GPIOF_OPEN_DRAIN : 0,
>                  "reset");
>         .
>         .
>         .
>         gpio_direction_output(reset_gpio, 1);
>         gpio_set_value(reset_gpio, 0);
>         msleep(20);
>         gpio_set_value(reset_gpio, 1);
>         .
>         .
>         .
>
> Since the same arguments hold for open-source configurations, add a
> definition for OF_GPIO_OPEN_SOURCE as well.
>
> Signed-off-by: David Daney <david.daney@...ium.com>

Reviewed-by: Alexandre Courbot <acourbot@...dia.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ