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]
Message-ID: <CAMuHMdUa8Hp-FP8iqKAEKbeEvbd34NjaDyxpNedV_QjvV+mivg@mail.gmail.com>
Date:   Mon, 14 May 2018 13:49:33 +0200
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Linus Walleij <linus.walleij@...aro.org>
Cc:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Alexander Shiyan <shc_work@...l.ru>,
        Haojian Zhuang <haojian.zhuang@...il.com>,
        Aaro Koskinen <aaro.koskinen@....fi>,
        Tony Lindgren <tony@...mide.com>,
        Mike Rapoport <rppt@...ux.vnet.ibm.com>,
        Robert Jarzmik <robert.jarzmik@...e.fr>,
        Philipp Zabel <philipp.zabel@...il.com>,
        Daniel Mack <zonque@...il.com>,
        Marc Zyngier <marc.zyngier@....com>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Russell King <rmk+kernel@...linux.org.uk>,
        Jacopo Mondi <jacopo@...ndi.org>
Subject: Re: [PATCH 01/19 v3] regulator: fixed: Convert to use GPIO descriptor only

Hi Linus,

On Mon, May 14, 2018 at 10:06 AM, Linus Walleij
<linus.walleij@...aro.org> wrote:
> As we augmented the regulator core to accept a GPIO descriptor instead
> of a GPIO number, we can augment the fixed GPIO regulator to look up
> and pass that descriptor directly from device tree or board GPIO
> descriptor look up tables.
>
> Some boards just auto-enumerate their fixed regulator platform devices
> and I have assumed they get names like "fixed-regulator.0" but it's
> pretty hard to guess this. I need some testing from board maintainers to
> be sure. Other boards are straight forward, using just plain
> "fixed-regulator" (ID -1) or "fixed-regulator.1" hammering down the
> device ID.
>
> The OMAP didn't have proper label names on its GPIO chips so I have fixed
> this with a separate patch to the GPIO tree, see
> commit 088413bc0bd5f5fb66ca22a19d66a49d7154ba4c
> "gpio: omap: Give unique labels to each GPIO bank/chip"
>
> It seems the da9055 and da9211 has never got around to actually passing
> any enable gpio into its platform data (not the in-tree code anyway) so we
> can just decide to simply pass a descriptor instead.
>
> The fixed GPIO-controlled regulator in mach-pxa/ezx.c was confusingly named
> "*_dummy_supply_device" while it is a very real device backed by a GPIO
> line. There is nothing dummy about it at all, so I renamed it with the
> infix *_regulator_* as part of this patch set.
>
> For the patch hunk hitting arch/blackfin I would say I do not expect
> testing, review or ACKs anymore so if it works, it works.
>
> The hunk hitting the x86 BCM43xx driver is especially tricky as the number
> comes out of SFI which is a mystery to me. I definately need someone to
> look at this. (Hi Andy.)

Thanks for your patch!

> Cc: Geert Uytterhoeven <geert+renesas@...der.be> # SuperH pinctrl/GPIO maintainer

IIRC, Jacopo (CC) has an Ecovec24.

> --- a/arch/sh/boards/mach-ecovec24/setup.c
> +++ b/arch/sh/boards/mach-ecovec24/setup.c
> @@ -633,7 +633,6 @@ static struct regulator_init_data cn12_power_init_data = {
>  static struct fixed_voltage_config cn12_power_info = {
>         .supply_name = "CN12 SD/MMC Vdd",
>         .microvolts = 3300000,
> -       .gpio = GPIO_PTB7,
>         .enable_high = 1,
>         .init_data = &cn12_power_init_data,
>  };
> @@ -646,6 +645,16 @@ static struct platform_device cn12_power = {
>         },
>  };
>
> +static struct gpiod_lookup_table cn12_power_gpiod_table = {
> +       .dev_id = "reg-fixed-voltage.0",
> +       .table = {
> +               /* Offset 7 on port B */
> +               GPIO_LOOKUP("sh7724_pfc", GPIO_PTB7,
> +                           "enable", GPIO_ACTIVE_HIGH),
> +               { },
> +       },
> +};
> +
>  #if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
>  /* SDHI0 */
>  static struct regulator_consumer_supply sdhi0_power_consumers[] =
> @@ -665,7 +674,6 @@ static struct regulator_init_data sdhi0_power_init_data = {
>  static struct fixed_voltage_config sdhi0_power_info = {
>         .supply_name = "CN11 SD/MMC Vdd",
>         .microvolts = 3300000,
> -       .gpio = GPIO_PTB6,
>         .enable_high = 1,
>         .init_data = &sdhi0_power_init_data,
>  };
> @@ -678,6 +686,16 @@ static struct platform_device sdhi0_power = {
>         },
>  };
>
> +static struct gpiod_lookup_table sdhi0_power_gpiod_table = {
> +       .dev_id = "reg-fixed-voltage.1",
> +       .table = {
> +               /* Offset 6 on port B */
> +               GPIO_LOOKUP("sh7724_pfc", GPIO_PTB6,
> +                           "enable", GPIO_ACTIVE_HIGH),
> +               { },
> +       },
> +};
> +
>  static struct tmio_mmc_data sdhi0_info = {
>         .chan_priv_tx   = (void *)SHDMA_SLAVE_SDHI0_TX,
>         .chan_priv_rx   = (void *)SHDMA_SLAVE_SDHI0_RX,

No calls to gpiod_add_lookup_table() to add to arch_setup()?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ