Re: [PATCH V12 2/2] gpio: max77620: add gpio driver for MAX77620/MAX20024

From: Linus Walleij
Date: Tue May 24 2016 - 07:15:28 EST


On Fri, May 13, 2016 at 7:19 AM, Laxman Dewangan <ldewangan@xxxxxxxxxx> wrote:

> MAXIM Semiconductor's PMIC, MAX77620/MAX20024 has 8 GPIO
> pins. It also supports interrupts from these pins.
>
> Add GPIO driver for these pins to control via GPIO APIs.
>
> Signed-off-by: Laxman Dewangan <ldewangan@xxxxxxxxxx>
> Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

PS, please add these optional features:

> + mgpio->gpio_chip.direction_input = max77620_gpio_dir_input;
> + mgpio->gpio_chip.direction_output = max77620_gpio_dir_output;

Any chance you could send a patch to add a .get_direction() callback?

This is really useful for debugfs and the userspace ABI and I started
to add it to drivers all over the place.

Also you have this:

#define MAX77620_CNFG_GPIO_DRV_MASK BIT(0)
#define MAX77620_CNFG_GPIO_DRV_PUSHPULL BIT(0)
#define MAX77620_CNFG_GPIO_DRV_OPENDRAIN 0

So it seems possible to add .set_single_ended() to this driver
as well so it supports native open drain. Please consider this!

I am possibly adding .get_single_ended() to the API this next
kernel cycle as well, but that is for later.

Yours,
Linus Walleij