Re: [PATCH v2] gpio: add support for FTDI's MPSSE as GPIO

From: Linus Walleij
Date: Sun Sep 22 2024 - 18:44:39 EST


On Thu, Sep 19, 2024 at 4:10 PM Mary Strodl <mstrodl@xxxxxxxxxxx> wrote:

> FTDI FT2232H is a USB to GPIO chip.

Just came to think about:

> + priv->gpio.owner = THIS_MODULE;
> + priv->gpio.parent = interface->usb_dev;
> + priv->gpio.get_direction = gpio_mpsse_get_direction;
> + priv->gpio.direction_input = gpio_mpsse_direction_input;
> + priv->gpio.direction_output = gpio_mpsse_direction_output;
> + priv->gpio.get = gpio_mpsse_gpio_get;
> + priv->gpio.set = gpio_mpsse_gpio_set;
> + priv->gpio.get_multiple = gpio_mpsse_get_multiple;
> + priv->gpio.set_multiple = gpio_mpsse_set_multiple;
> + priv->gpio.base = -1;
> + priv->gpio.ngpio = 16;
> + priv->gpio.offset = priv->intf_id * priv->gpio.ngpio;
> + priv->gpio.can_sleep = 1;

Maybe you want to provide the gpio.names array for this
device?

It makes it easier to use the lines from userspace if they
have meaningful names, it looks like those may be printed
on the board on the Sealevel device.

Yours,
Linus Walleij