lkml.org 
[lkml]   [2018]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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@opensource.cirrus.com
    > Cc: Charles Keepax <ckeepax@opensource.cirrus.com>
    > Cc: Lee Jones <lee.jones@linaro.org>
    > Signed-off-by: Linus Walleij <linus.walleij@linaro.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

    \
     
     \ /
      Last update: 2018-02-13 12:12    [W:4.254 / U:0.108 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site