[U-Boot] [PATCH] gpio: vybrid: Use proper parameter name for gpio offset

Axel Lin axel.lin at ingics.com
Wed Jun 10 02:39:02 CEST 2015


2015-06-09 22:37 GMT+08:00 Bhuvanchandra DV <bhuvanchandra.dv at toradex.com>:
> On 06/09/2015 07:54 PM, Axel Lin wrote:
>>
>> It's confusing to use gpio as gpio offset parameter so rename it to offset
>> for better readability.
>
> Agreed, but IMHO these offsets any way at the end are the gpio numbers of
> individual gpio chip instances. e.g: gpio 2 of gpio chip 1 which is gpio 34.

struct dm_gpio_ops {
        int (*request)(struct udevice *dev, unsigned offset, const char *label);
        int (*free)(struct udevice *dev, unsigned offset);
        int (*direction_input)(struct udevice *dev, unsigned offset);
        int (*direction_output)(struct udevice *dev, unsigned offset,
int value);
        int (*get_value)(struct udevice *dev, unsigned offset);
        int (*set_value)(struct udevice *dev, unsigned offset, int value);
        int (*get_function)(struct udevice *dev, unsigned offset);

All the callbacks of struct dm_gpio_ops takes offset rather than gpio number,
had better use offset here.

The gpio numbers of individual gpio chip instances actually means offset, don't
mix it with the actually gpio number.


More information about the U-Boot mailing list