Re: [PATCH v1] usb: phy: generic: migrate to gpio_desc

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

 



Linus Walleij <linus.walleij@xxxxxxxxxx> writes:

> This definately make things better so:
> Acked-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
Thanks.

> One comment though:
>
>>>       if (dev->of_node) {
> (...)
>>> +             nop->gpiod_reset = devm_gpiod_get(dev, "reset-gpios");
>>> +             err = PTR_ERR(nop->gpiod_reset);
>>>       } else if (pdata) {
> (...)
>>> +             err = devm_gpio_request_one(dev, pdata->gpio_reset, 0,
>>> +                                         dev_name(dev));
>>> +             if (!err)
>>> +                     nop->gpiod_reset = gpio_to_desc(pdata->gpio_reset);
>>> +     }

> So a next step would be to add support for getting the
> devm_gpiod_get(dev, "reset-gpios"); outside of the if (dev->of_node)
> clause, and possibly convert the board files for affected
> platforms to use descriptors, if they will not be replaced by
> device tree only.

OK, if we were to do this, is there a way to build a static platform data with a
gpio descriptor ?
Ie. can I write something like :
struct generic_phy_pdata {
	struct gpio_desc *reset_gpio;
};

And in machine code :
static struct generic_phy_pdata usb_phy __initdata {
       .reset_gpio = XXX(19),
};

What should "XXX" be like to describe reset_gpio as a ACTIVE_HIGH gpio number 19
?

Cheers.

-- 
Robert
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux