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]
Date:   Mon, 12 Feb 2018 14:59:21 +0000
From:   Lee Jones <lee.jones@...aro.org>
To:     Linus Walleij <linus.walleij@...aro.org>
Cc:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>, linux-kernel@...r.kernel.org,
        linux-gpio@...r.kernel.org
Subject: Re: [PATCH 04/21] regulator: da9055: Pass descriptor instead of GPIO
 number

On Mon, 12 Feb 2018, Linus Walleij wrote:

> When setting up a fixed regulator on the DA9055, pass a descriptor
> instead of a global GPIO number. This facility is not used in the
> kernel so we can easily just say that this should be a descriptor
> if/when put to use.
> 
> Cc: Lee Jones <lee.jones@...aro.org>
> Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
> ---
> Lee: would be nice if you could ACK this smallish patch
> to the MFD header.

Fine, but any sign of a conflict and I'll need a PR.

Acked-by: Lee Jones <lee.jones@...aro.org>

> ---
>  drivers/regulator/da9055-regulator.c | 4 ++--
>  include/linux/mfd/da9055/pdata.h     | 5 +++--
>  2 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/regulator/da9055-regulator.c b/drivers/regulator/da9055-regulator.c
> index d029c941a1e1..f40c3b8644ae 100644
> --- a/drivers/regulator/da9055-regulator.c
> +++ b/drivers/regulator/da9055-regulator.c
> @@ -16,6 +16,7 @@
>  #include <linux/init.h>
>  #include <linux/err.h>
>  #include <linux/gpio.h>
> +#include <linux/gpio/consumer.h>
>  #include <linux/platform_device.h>
>  #include <linux/regulator/driver.h>
>  #include <linux/regulator/machine.h>
> @@ -455,8 +456,7 @@ static int da9055_gpio_init(struct da9055_regulator *regulator,
>  		char name[18];
>  		int gpio_mux = pdata->gpio_ren[id];
>  
> -		config->ena_gpio = pdata->ena_gpio[id];
> -		config->ena_gpio_flags = GPIOF_OUT_INIT_HIGH;
> +		config->ena_gpiod = pdata->ena_gpiods[id];
>  		config->ena_gpio_invert = 1;
>  
>  		/*
> diff --git a/include/linux/mfd/da9055/pdata.h b/include/linux/mfd/da9055/pdata.h
> index 04e092be4b07..1a94fa2ac309 100644
> --- a/include/linux/mfd/da9055/pdata.h
> +++ b/include/linux/mfd/da9055/pdata.h
> @@ -12,6 +12,7 @@
>  #define DA9055_MAX_REGULATORS	8
>  
>  struct da9055;
> +struct gpio_desc;
>  
>  enum gpio_select {
>  	NO_GPIO = 0,
> @@ -47,7 +48,7 @@ struct da9055_pdata {
>  	 * controls the regulator set A/B, 0 if  not available.
>  	 */
>  	enum gpio_select *reg_rsel;
> -	/* GPIOs to enable regulator, 0 if not available */
> -	int *ena_gpio;
> +	/* GPIO descriptors to enable regulator, NULL if not available */
> +	struct gpio_desc **ena_gpiods;
>  };
>  #endif /* __DA9055_PDATA_H */

-- 
Lee Jones
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ