lkml.org 
[lkml]   [2014]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 2/2] of/gpio: Automatically decode OF_GPIO_OPEN_DRAIN and OF_GPIO_OPEN_SOURCE flags in gpiolib.
On Wed, Feb 12, 2014 at 4:50 AM, David Daney <ddaney.cavm@gmail.com> wrote:
> From: David Daney <david.daney@cavium.com>
>
> Just as gpiod_get() automatically interprets the OF_GPIO_ACTIVE_LOW
> flag from the device tree, add handling for OF_GPIO_OPEN_DRAIN and
> OF_GPIO_OPEN_SOURCE.
>
> This keeps the details of handling open-drain GPIOs in the core GPIO
> code, and out of the individual drivers.
>
> Signed-off-by: David Daney <david.daney@cavium.com>
> ---
> drivers/gpio/gpiolib.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index 50c4922..7f596d0 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -2307,6 +2307,12 @@ static struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id,
> if (of_flags & OF_GPIO_ACTIVE_LOW)
> *flags |= GPIO_ACTIVE_LOW;
>
> + if (of_flags & OF_GPIO_OPEN_DRAIN)
> + *flags |= GPIO_OPEN_DRAIN;
> +
> + if (of_flags & OF_GPIO_OPEN_SOURCE)
> + *flags |= GPIO_OPEN_SOURCE;
> +
> return desc;
> }

Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>

Thanks for taking the time to do this!


\
 
 \ /
  Last update: 2014-02-12 03:41    [W:0.224 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site