08-28-2016, 04:49 AM
(08-28-2016, 03:12 AM)MarkHaysHarris777 Wrote: hi, yeah, the power|suspend button and the reset button attach directly to the PMIC (power management integrated circuit). See the schematic diagram here (although its a bit out-of-date).
... I have not tried to see the event from evtest !?! ... also I have tested in both debian and ubuntu, holding the power on button for two seconds will cause the PMIC to signal the GPU ( OS ) to pull up the power off dialogue.
edit: ok... the trick to see the event ( power on ) in evtest, is to select the axp81x option (1).
... the event comes up nicely, code 116 ( key_power ).
( this I tested with evtest on ubuntu mate )
So, if you want to build your own monitor, you need to first tell the OS not to respond to 116, key_power, then map that key for your own purposes.
(08-28-2016, 04:07 AM)pfeerick Wrote: As Mark indicated, it does work... the trick is to to select the right device.
You can see in the code box below the output from running evtest on a ubuntu box, and selecting axp81x-supplyer, which was device event number 1 in that case. Credit goes to xalius for posting it in that thread I linked earlier about the power button. The button was pressed twice, so you can see a 1 when it was pressed, and a 0 when it is released.
Code:ubuntu@pine64:~$ sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: sunxi-keyboard
/dev/input/event1: axp81x-supplyer
/dev/input/event2: sunxi-ths
/dev/input/event3: audiocodec sunxi Audio Jack
/dev/input/event4: sunxi_ir_recv
/dev/input/event5: MCE IR Keyboard/Mouse (sunxi-rc-recv)
Select the device event number [0-5]: 1
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "axp81x-supplyer"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 116 (KEY_POWER)
Event type 2 (EV_REL)
Properties:
Testing ... (interrupt to exit)
Event: time 1466799328.888825, type 1 (EV_KEY), code 116 (KEY_POWER), value 1
Event: time 1466799328.888825, -------------- SYN_REPORT ------------
Event: time 1466799328.999256, type 1 (EV_KEY), code 116 (KEY_POWER), value 0
Event: time 1466799328.999256, -------------- SYN_REPORT ------------
Event: time 1466799329.630542, type 1 (EV_KEY), code 116 (KEY_POWER), value 1
Event: time 1466799329.630542, -------------- SYN_REPORT ------------
Event: time 1466799329.798206, type 1 (EV_KEY), code 116 (KEY_POWER), value 0
Event: time 1466799329.798206, -------------- SYN_REPORT ------------
I am definitely using the apx81x-supplyer device to test and still not getting any output. I followed the example from the xalius link that pfeerick posted. Not sure what's wrong.