Re: [PATCH] gpio: add export with name from dts

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

 




On Fri, Oct 11, 2013 at 3:10 PM, Jiří Prchal <jiri.prchal@xxxxxxxxxxx> wrote:
> Dne 11.10.2013 14:49, Linus Walleij napsal(a):

>> If the GPIOs are actually connected to LEDs you should be
>> using drivers/leds/leds-gpio.c and not export the GPIOs.
>
> I know that, just don't like /sys/class/leds/out15/brightness.

Hm, then you might want to modify the way names are set
on leds rather ... this is the way we handle LEDs in the kernel
so any problems need to be discussed with Bryan Wu,
the LED maintainer.

>>> And what for inputs?
>>
>> Depends on what input. For simple buttons:
>>
>> drivers/input/keyboard/gpio_keys.c
>> drivers/input/keyboard/gpio_keys_polled.c
>>
>> Then you get the input events from /dev/input/eventN
>> just like any other key press.
>>
>> extcon-gpio.c is for e.g. headphone insertion on mobile
>> phones etc.
>
> Hm, my inputs are simple digital inputs from real world, like "door open",
> "somewhere is voltage", "some switch is on". And more than one app is
> reading them.
> So what to use for it?

This is actually a valid case for using userspace GPIO, because
of course the kernel cannot model the entire world :-D

What makes me suspicious is mostly when some system
(board with GPIO used in an electronic design) is modeled
from userspace.

So this seems to be OK.

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




[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