Re: [PATCH v2 2/2] Support NVIDIA BlueField-3 pinctrl driver

From: Linus Walleij
Date: Thu Feb 09 2023 - 06:01:20 EST


Hi Asmaa,

thanks for your patch!

(Adding my colleague Niyas so he can have a look at this quite typical ACPI
embedded pinctrl driver.)

On Wed, Feb 8, 2023 at 7:57 PM Asmaa Mnebhi <asmaa@xxxxxxxxxx> wrote:

> This patch adds support to the BlueField-3 SoC pin controller.
> It allows muxing individual GPIOs to switch from the default
> hardware mode to software controlled mode.
>
> Signed-off-by: Asmaa Mnebhi <asmaa@xxxxxxxxxx>

(...)
> +config PINCTRL_MLXBF
> + tristate "NVIDIA BlueField-3 SoC Pinctrl driver"
> + depends on (MELLANOX_PLATFORM && ARM64 && ACPI)
> + select PINMUX
> + select GPIOLIB
> + select GPIOLIB_IRQCHIP

Since you're selecting these you could as well
select GPIO_MLXBF3
too.

> +#include <linux/acpi.h>

Oh ACPI, I hope Andy has time to look at this.

> +#include <linux/err.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
> +#include <linux/property.h>
> +#include <linux/regmap.h>
> +#include <linux/slab.h>
> +#include <linux/gpio.h>

Drop this include, this is a legacy API, also this is not a GPIO driver.

Go through the list and see if there are some more unnecessary headers.

> +#include <linux/pinctrl/machine.h>

Why?

> +#include <linux/pinctrl/pinctrl.h>
> +#include <linux/pinctrl/pinmux.h>
> +#include <linux/pinctrl/pinconf.h>
> +#include <linux/pinctrl/pinconf-generic.h>
> +
> +#include "core.h"

Do you need this? (I'm uncertain myself, so try without.)

Yours,
Linus Walleij