[U-Boot] [PATCH 03/21] sunxi: usbc: Fix vbus gpio handling to work with the device-model

Simon Glass sjg at chromium.org
Sat Apr 25 01:23:58 CEST 2015


On 24 April 2015 at 12:15, Hans de Goede <hdegoede at redhat.com> wrote:
> Hi,
>
>
> On 24-04-15 20:10, Fabio Estevam wrote:
>>
>> On Fri, Apr 24, 2015 at 10:48 AM, Hans de Goede <hdegoede at redhat.com>
>> wrote:
>>
>>>          sunxi_usbc->gpio_vbus = get_vbus_gpio(index);
>>> -       if (sunxi_usbc->gpio_vbus != -1) {
>>> +       if (sunxi_usbc->gpio_vbus >= 0) {
>>
>>
>> What about using dm_gpio_is_valid() instead?
>
>
> dm_gpio_is_valid takes a struct gpio_desc *, where as this code is using
> good old gpio indexes (int). We will likely want to convert this to getting
> the gpio from devicetree directly in the future, but first we need this
> patch-set to convert all sunxi boards to the device-model, so that we can
> make such changes without the need to introduce a whole lot of #ifdef-s
>

I think this is a good first step, but have the same concern.

Reviewed-by: Simon Glass <sjg at chromium.org>

> Regards,
>
> Hans


More information about the U-Boot mailing list