Re: [PATCH v3] gpio: of: make it possible to name GPIO lines

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

 



On Thu, Apr 28, 2016 at 10:12 AM, Markus Pargmann <mpa@xxxxxxxxxxxxxx> wrote:
> On Thursday 21 April 2016 13:08:21 Linus Walleij wrote:

>> +Optionally, a GPIO controller may have a "gpio-line-names" property. This is
>> +an array of strings defining the names of the GPIO lines going out of the
>> +GPIO controller. This name should be the most meaningful producer name
>> +for the system, such as a rail name indicating the usage. Package names
>> +such as pin name are discouraged: such lines have opaque names (since they
>> +are by definition generic purpose) and such names are usually not very
>> +helpful. For example "MMC-CD", "Red LED Vdd" and "ethernet reset" are
>> +reasonable line names as they describe what the line is used for. "GPIO0"
>> +is not a good name to give to a GPIO line. Placeholders are discouraged:
>
> "GPIO0" may not be a good name, but there are plenty of boards out there
> that use just this line name in their schematic for GPIOs that are not
> used otherwise. For example the riotboard has line-names "GPIO_1",
> "GPIO4_31", "GPIO5_05", ...

That is what is referred to as "rail name" above. If they really choose
that name on a schematic, then it is the right name for it.

>> +     gpio-line-names = "MMC-CD", "MMC-WP", "VDD eth", "RST eth", "LED R",
>> +             "LED G", "LED B", "Col A", "Col B", "Col C", "Col D",
>> +             "Row A", "Row B", "Row C", "Row D", "NMI button",
>> +             "poweroff", "reset";
>
> As many GPIO controllers have something like 32 GPIO lines, it can be
> difficult to read which GPIO number the line "reset" is on.
> But I think you can get around that by writing one name per file-line or
> something similar. Also it should be immediately visible by listing all
> gpio names in the userspace.

Yeah well, the problem goes for clk-output-names that it's derived
from as well, it comes from the DT syntactic limitations.

>> +             /* Empty strings are OK */
>> +             if (ret < 0 && ret != -ENODATA)
>> +                     dev_err(&gdev->dev, "unable to name line %d\n",
>> +                             i);
>> +     }
>
> Maybe a warning for nstrings > ngpio here?

Sure. Just waiting for DT maintainers and other stakeholders' input at
this point.

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



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux