[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180213111147.kr4kecqbhmcoq6w2@localhost.localdomain>
Date: Tue, 13 Feb 2018 11:11:47 +0000
From: Charles Keepax <ckeepax@...nsource.cirrus.com>
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>,
<patches@...nsource.cirrus.com>, Lee Jones <lee.jones@...aro.org>
Subject: Re: [PATCH 16/21] regulator: wm8994: Pass descriptor instead of GPIO
number
On Mon, Feb 12, 2018 at 02:17:12PM +0100, Linus Walleij wrote:
> Instead of passing a global GPIO number for the enable GPIO, pass
> a descriptor looked up from the device tree node or the board file
> decriptor table for the regulator.
>
> There is a single board file passing the GPIOs for LDO1 and LDO2
> through platform data, so augment this to pass descriptors
> associated with the i2c device as well.
>
> Cc: patches@...nsource.cirrus.com
> Cc: Charles Keepax <ckeepax@...nsource.cirrus.com>
> Cc: Lee Jones <lee.jones@...aro.org>
> Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
> ---
> Lee: this patch is touching the MFD core driver for WM8994,
> but as with all other patches we just change the regulator
> parts. Would be nice if you could ACK it.
> ---
> arch/arm/mach-s3c64xx/mach-crag6410-module.c | 18 ++++++++++++++++--
> drivers/mfd/wm8994-core.c | 9 ---------
> drivers/regulator/wm8994-regulator.c | 19 +++++++++++--------
> include/linux/mfd/wm8994/pdata.h | 3 ---
> 4 files changed, 27 insertions(+), 22 deletions(-)
>
> +static struct gpiod_lookup_table wm8994_gpiod_table = {
> + .dev_id = "i2c-wm8958", /* I2C device name */
> + .table = {
> + GPIO_LOOKUP("GPION", 6,
> + "wlf,ldo1ena", GPIO_ACTIVE_HIGH),
> + GPIO_LOOKUP("GPION", 4,
> + "wlf,ldo2ena", GPIO_ACTIVE_HIGH),
> + { },
> },
> };
>
> @@ -366,6 +379,7 @@ static int wlf_gf_module_probe(struct i2c_client *i2c,
> rev == gf_mods[i].rev))
> break;
>
> + gpiod_add_lookup_table(&wm8994_gpiod_table);
Would it be nicer to add this as a new member of gf_mods and
register it inside the loop? Since eventually we will need tables
for wm5102, wm8994, wm2200, wm8996, wm5100 and wm0010.
Thanks,
Charles
Powered by blists - more mailing lists