Re: [RFC 10/12] staging: media: max96712: add gpiochip functionality

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Laurentiu,

thanks for your patch!

On Fri, Jan 31, 2025 at 5:35 PM Laurentiu Palcu
<laurentiu.palcu@xxxxxxxxxxx> wrote:

> The deserializer has GPIOs that can be used for various purposes. Add
> support for gpiochip.
>
> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@xxxxxxxxxxx>

Since you are using CONFIG_GPIOLIB unconditionally you need
to add

select GPIOLIB

in the Kconfig for this driver, or the autobuilder will soon start to
spam you with compilation errors.

> +static int max96712_gpiochip_probe(struct max96712_priv *priv)
> +{
> +       struct device *dev = &priv->client->dev;
> +       struct gpio_chip *gc = &priv->gpio_chip;
> +       int i, ret = 0;
> +
> +       gc->label = dev_name(dev);
> +       gc->parent = dev;

I don't think you need to assign parent. (Default)

> +       gc->owner = THIS_MODULE;

Or this. (Default)

> +       gc->ngpio = MAX96712_NUM_GPIO;
> +       gc->base = -1;
> +       gc->can_sleep = true;
> +       gc->get_direction = max96712_gpio_get_direction;
> +       gc->direction_input = max96712_gpio_direction_in;
> +       gc->direction_output = max96712_gpio_direction_out;
> +       gc->request = gpiochip_generic_request;
> +       gc->set = max96712_gpiochip_set;
> +       gc->get = max96712_gpiochip_get;
> +       gc->of_gpio_n_cells = 2;

Isn't that the default? Do you need to assign this?

Other than that this looks good, so with the small fix above:
Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

Yours,
Linus Walleij





[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux