Hello again
I have modified the sun50i-h5-orangepi-pc2.dts

        r_gpio_keys {
                compatible = "gpio-keys";

                sw4 {
                        label = "sw4";
---                        linux,code = <0x100>;
+++                        linux,code = <0x74>;
                        gpios = <0x24 0x0 0x3 0x1>;
                };
        };

Now, 5sec long press of the power button generate a button/power ACPI event 
that can be used with acpid to trigger a power off.
Does anyone know why this gpio, that on this specific HW, is used (or shall 
be used) for power down, is bind to BTN_0?

Il giorno domenica 23 aprile 2017 10:29:40 UTC+2, Menion ha scritto:
>
> Hi
> I have tried to monitor the button via evtest, but nothing is detected
> Can you provide guidance on how modify dts for making this switch 
> generating a key_power event?
> Bye
>
>
> Il giorno domenica 23 aprile 2017 06:56:01 UTC+2, Icenowy Zheng ha scritto:
>>
>>
>>
>> 于 2017年4月22日 GMT+08:00 下午8:34:36, Menion <[email protected]> 写到: 
>> >That's wrong. I am currently running a Bananapi (A20) with power and 
>> >reset buttons perfectly working and sending acpi events. Also H3 works 
>> >(Orange pi pc 1) 
>>
>> Banana Pi has PMIC, but Orange Pi PC2 doesn't. 
>>
>> In the default mainline kernel, the power key on OPi PC2 is not mapped to 
>> the KEY_POWER, but a BTN_x code. 
>>
>> You may want to alter the device tree for this (The key is a 
>> GPIO-connected one, and used the gpio-keys dt binding) 
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to