public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Markus Pargmann <mpa@pengutronix.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>,
	devicetree@vger.kernel.org, linux-gpio@vger.kernel.org,
	kernel@pengutronix.de
Subject: Re: [PATCH v3 2/2] gpiolib: Add GPIO initialization
Date: Tue, 17 Nov 2015 11:21:32 +0100	[thread overview]
Message-ID: <33694835.x5uTstGuv8@adelgunde> (raw)
In-Reply-To: <1447754878-21099-3-git-send-email-mpa@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 2344 bytes --]

Hi,

On Tuesday 17 November 2015 11:07:58 Markus Pargmann wrote:
[...]
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index a18f00fc1bb8..3b35f2fafeb2 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -2329,6 +2329,30 @@ static void gpiochip_free_hogs(struct gpio_chip *chip)
>  }
>  
>  /**
> + * gpiod_initialize - Initialize a GPIO with a given value
> + * @desc:	gpio whose value will be assigned
> + * @lflags:	gpio_lookup_flags - returned from of_find_gpio() or
> + *		of_get_gpio_hog()
> + * @dflags:	gpiod_flags - optional GPIO initialization flags
> + *
> + * This is used to initialize GPIOs that were defined in DT
> + */
> +int gpiod_initialize(struct gpio_desc *desc, unsigned long lflags,
> +		     enum gpiod_flags dflags)
> +{
> +	int status;
> +

Sorry, this is missing a gpiod_parse_flags(). Will fix this and resend tomorrow.

Best Regards,

Markus

> +	status = gpiod_configure_flags(desc, NULL, dflags);
> +	if (status < 0) {
> +		pr_err("initial setup of GPIO (chip %s, offset %d) failed\n",
> +		       gpiod_to_chip(desc)->label, gpio_chip_hwgpio(desc));
> +		return status;
> +	}
> +
> +	return 0;
> +}
> +
> +/**
>   * gpiod_get_array - obtain multiple GPIOs from a multi-index GPIO function
>   * @dev:	GPIO consumer, can be NULL for system-global GPIOs
>   * @con_id:	function within the GPIO consumer
> diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h
> index 98ab08c0aa2d..4abf53a5e651 100644
> --- a/drivers/gpio/gpiolib.h
> +++ b/drivers/gpio/gpiolib.h
> @@ -107,6 +107,8 @@ int gpiod_request(struct gpio_desc *desc, const char *label);
>  void gpiod_free(struct gpio_desc *desc);
>  int gpiod_hog(struct gpio_desc *desc, const char *name,
>  		unsigned long lflags, enum gpiod_flags dflags);
> +int gpiod_initialize(struct gpio_desc *desc, unsigned long lflags,
> +		     enum gpiod_flags dflags);
>  
>  /*
>   * Return the GPIO number of the passed descriptor relative to its chip
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-11-17 10:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-17 10:07 [PATCH v3 0/2] gpiolib: Initializing GPIOs using DT property gpio-initval Markus Pargmann
     [not found] ` <1447754878-21099-1-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-11-17 10:07   ` [PATCH v3 1/2] dt-bindings: GPIO: Add gpio-initval Markus Pargmann
2015-11-17 20:35     ` Rob Herring
2015-11-18 10:20       ` Linus Walleij
2015-11-17 10:07 ` [PATCH v3 2/2] gpiolib: Add GPIO initialization Markus Pargmann
2015-11-17 10:21   ` Markus Pargmann [this message]
2015-11-29 21:32     ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=33694835.x5uTstGuv8@adelgunde \
    --to=mpa@pengutronix.de \
    --cc=devicetree@vger.kernel.org \
    --cc=gnurou@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox