Re: [PATCH 2/2] input: gpio-keys: add support to name the gpio-keys

From: Linus Walleij
Date: Thu Jan 14 2016 - 04:18:58 EST


On Tue, Jan 12, 2016 at 4:24 PM, Laxman Dewangan <ldewangan@xxxxxxxxxx> wrote:
> On Tuesday 12 January 2016 08:53 PM, Rob Herring wrote:
>> On Tue, Jan 12, 2016 at 8:55 AM, Laxman Dewangan <ldewangan@xxxxxxxxxx>
>> wrote:
>>>
>>> On Tuesday 12 January 2016 08:13 PM, Rob Herring wrote:
>>>>
>>>> On Tue, Jan 12, 2016 at 05:02:50PM +0530, Laxman Dewangan wrote:
>
>
>> So label is exactly for this purpose of defining user meaningful names.
>>
> Yes, I can use the label for name. I will update the patch.
>
> Just for understanding, is "label" is better property name to pass the
> specific name?

Yes, look at this from
arch/arm64/boot/dts/arm/juno-motherboard.dtsi:

gpio_keys {
compatible = "gpio-keys";
#address-cells = <1>;
#size-cells = <0>;

button@1 {
debounce_interval = <50>;
wakeup-source;
linux,code = <116>;
label = "POWER";
gpios = <&iofpga_gpio0 0 0x4>;
};
button@2 {
debounce_interval = <50>;
wakeup-source;
linux,code = <102>;
label = "HOME";
gpios = <&iofpga_gpio0 1 0x4>;
};
(...)

Currently these names (POWER, HOME etc) appear nicely in
/proc/interrupts, so I guess the same should be used for input?

Yours,
Linus Walleij