[U-Boot] [PATCH v8 13/14] dm: Enable gpio command to support driver model

Simon Glass sjg at chromium.org
Wed Feb 26 18:21:15 CET 2014


Hi Tom,

On 26 February 2014 09:34, Tom Rini <trini at ti.com> wrote:

> On Mon, Feb 17, 2014 at 03:06:47PM -0700, Simon Glass wrote:
>
> > Now that named GPIO banks are supported, along with a way of obtaining
> > the status of a GPIO (input or output), we can provide an enhanced
> > GPIO command for driver model. Where the driver provides its own
> operation
> > for obtaining the GPIO state, this is used, otherwise a generic version
> > is sufficient.
> [snip]
> > +#if defined(CONFIG_DM_GPIO)
> > +     /*
> > +      * TODO(sjg at chromium.org): Convert this code over to use the GPIO
> > +      * uclass interface instead of the numbered GPIO compatibility
> > +      * layer.
> > +      */
> > +     ret = gpio_lookup_name(str_gpio, NULL, NULL, &gpio);
> > +     if (ret)
> > +             return cmd_process_error(cmdtp, ret);
>
> Since this is part of the initial "lets show DM code" shouldn't we do
> this TODO before merging?
>

The problem is that this is generic code, which must work with and without
driver model. So we can't move the command code over to exclusively use
driver model until all GPIO drivers use driver model.

Regards,
Simon


More information about the U-Boot mailing list