Home/Support/Support Forum/6UL Express power mode control
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

6UL Express power mode control

0 votes
Dear colleagues,

I'm working with 6UL express module. There is possibility to manage system by pressing power key input which works perfectly as described in documentation here: https://www.digi.com/resources/documentation/digidocs/90002286/#reference/bsp/v4-9_6ul/r_mca_power_key_input_6ul.htm%3FTocPath%3DDigi%2520Embedded%2520Yocto%7CSystem%2520development%7CLinux%2520kernel%7CLinux%2520%2520v4.9%2520Board%2520Support%2520Package%7CDevices%2520and%2520interfaces%7CMicro%2520Controller%2520Assist%2520(MCA)%7C_____5

In my application I would like to get some notification when system goes to sleep (suspend) or wakes up. I couldn't find any tools or events that provide such a notification.

Could you please advise what tools, programs can I use to get notified when systems goes to suspend mode or wakes up?

Thanks and best regards,
Gennady Zubkov
asked Dec 12, 2019 in Linux by gzubkov New to the Community (4 points)

Please log in or register to answer this question.

1 Answer

0 votes
on cc6ul the mca/linux is currently:
o when a short press is done in the power button, it is calling mca_pwrkey_sleep_irq_handler() in drivers/input/misc/pwrkey-mca.c
The implementation that Digi does here signals the KEY_SLEEP press so the system goes to sleep.
o when a long press is done in the power button, it is calling mca_pwrkey_power_off_irq_handler() in drivers/input/misc/pwrkey-mca.c
The implementation that Digi does here signals the KEY_POWER press so the system goes to power-off.

So it looks like you should be able to implement some logic in mca_pwrkey_power_off_irq_handler() in drivers/input/misc/pwrkey-mca-cc6ul.c to do what you want
https://github.com/digi-embedded/linux/blob/v4.9/dey-2.6/maint/drivers/input/misc/pwrkey-mca-cc6ul.c
answered Dec 15, 2019 by LeonidM Veteran of the Digi Community (4,457 points)
Hi Leonid,

thank you for your response. Could you please provide some more details, what should I do in order to fix this?

Is this correct that I have to rebuilt a new yocto image with new driver functionality as you mentioned? Is this possible at all to build this pwrkey-mca-cc6ul driver separately and load it afterwards?

Is there any possibility to obtain the information about KEY_SLEPP and KEY_POWER events from user space application?

Thanks, and best regards,
Gennady Zubkov
...