Re: RFC v2 GPIO lines

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

 



On 28/04/21 06:54, Alexander Dahl wrote:
> Hello Rodolfo,
> 
> I might have had a similar problem, so if you don't mind me entering
> the discussion …

Welcome. :)

> Am Tue, Apr 27, 2021 at 05:30:34PM +0200 schrieb Rodolfo Giometti:
>> at the moment if a developer wishes to use a GPIO as output or input with a well
>> defined name from userspace via the sysfs interface he/she can use,
>> respectively, the gpio-leds or gpio-uinput devices. However, IMHO, this is not
>> the best nor a proper way to do it, that's why I'm here to propose this really
>> simple interface named GPIO_LINE.
> 
> What's the reason to use the sysfs interface instead of libgpiod and
> the modern character device based interface?

This would not replace libgpiod and the associated character devices but just
allowing developers to easily access some well defined input/output lines as,
for example, sensors, etc.

So, the question is: why a lot of devices can be read/written via the /sys/class
interface and gpio lines can not? :-D

>> Note: This patch has been already discussed on linux-gpio@xxxxxxxxxxxxxxx
>> mail-list (that's why RFC "v2") and, as suggested by Linus Walleij, the
>> discussion has been moved here to see what you think about this proposal. You
>> can see the discussion here: https://www.spinics.net/lists/linux-gpio/msg50482.html
> 
> Then, I think you should still Cc the linux-gpio list.

This mail-list has already discussed about this interface and I whould avoid
cross-posting on mail-lists.

>> # cat /sys/kernel/debug/gpio
>> gpiochip1: GPIOs 446-475, parent: platform/d0018800.pinctrl, GPIO2:
>>  gpio-446 (                    |usb3-vbus           ) out hi
>>  gpio-447 (                    |usb2-vbus           ) out hi
>>  gpio-448 (                    |iso_out2            ) out hi
>>
>> gpiochip0: GPIOs 476-511, parent: platform/d0013800.pinctrl, GPIO1:
>>  gpio-488 (                    |ftdi                ) in  hi
>>
>> The End. :)
> 
> Defining line names for GPIOs is already somewhat possible. We talked
> about this few weeks ago, when I tried to set line names for a SAMA5D2
> based board:
> https://lore.kernel.org/linux-gpio/946021874.11132.1615900079722@xxxxxxxxxxxxxxxxx/

I see, but my idea is also to easily manage these lines.

Ciao,

Rodolfo

-- 
GNU/Linux Solutions                  e-mail: giometti@xxxxxxxxxxxx
Linux Device Driver                          giometti@xxxxxxxx
Embedded Systems                     phone:  +39 349 2432127
UNIX programming                     skype:  rodolfo.giometti



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux