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: <CAHp75VdQ6VooLVAfA1z98-bBcfQuR7AomaO8F19AGRjeBtByEQ@mail.gmail.com>
Date:   Wed, 4 Dec 2019 14:43:16 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Clement Leger <cleger@...ray.eu>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linus Walleij <linus.walleij@...aro.org>,
        Hoan Tran <hoan@...amperecomputing.com>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>
Subject: Re: [PATCH 4/5] pinctrl: dw: add pinctrl support for dwapb gpio driver

On Wed, Dec 4, 2019 at 12:12 PM Clement Leger <cleger@...ray.eu> wrote:
>
> Synopsys designware gpio controller also has pinmuxing functionnality.

DesignWare
pin muxing
functionality

(Please, run a spell checker)

> Pinmuxing allows to choose between software and hardware mode. When

Pin muxing

> using hardware mode, an external signal controls the pin output.
>
> This patch adds support for pinctrl framework in the gpio driver. This

GPIO

> support is conditionned by the snps,has-pinctrl device tree property.

conditioned

> Indeed, the functionnality can be detected only if the gpio IP has been

functionality

> configured using paremeters encoding which is not always present. If

parameters

> property is present, then the pinctrl will be registered and will

> allow switching to the "hw" functionnality and hence enable the

functionality

> alternate function.

> +static const struct pinctrl_pin_desc dwapb_pins[] = {
...
> +       DWAPB_PINCTRL_PIN(31)

Keep comma in such cases.

> +};

Can't you split adding pin control data to a separate patch?

> +/* One pin per group */
> +static const char * const dwapb_gpio_groups[] = {
...
> +       "pin31"

Keep comma here.

> +};

Can't we generate these lists dynamically?

> +       dev_info(gpio->dev, "Setting func %s on pin %d",
> +               dwapb_gpio_functions[selector], group);

Noise!

> +       ret = pinctrl_enable(port->pctl);
> +       if (ret) {
> +               dev_err(gpio->dev, "pinctrl enable failed\n");
> +               return ret;
> +       }

Not sure why it's needed at all.

> +       range = &port->range;
> +       range->name = dev_name(gpio->dev);
> +       range->id = port->idx;
> +       range->pin_base = 0;
> +       range->base = port->gc.base;
> +       range->npins = pp->ngpio;
> +       range->gc = &port->gc;
> +
> +       pinctrl_add_gpio_range(port->pctl, range);

Can you use new callback for this?

> -               .name   = "gpio-dwapb",
> +               .name   = "pinctrl-dwapb",

This will break existing users.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ