Skip to contentSkip to conversation

How? PM suspend resume code in misc driver?

DISCUSSION TJ 2 participants 2 messages Mar 20, 2009

lore
Share & tools
lore

TJ

author
#0 lore raw

I've been trying to figure out how a misc char driver (in this case acerhk) can link into PM suspend and resume events. I found the patches from 2008-02 that introduced a 'heavy-handed' mechanism to misc that were quickly removed by another set of patches in 2008-04.

In the removal patches there is mention of a 'better way of doing it' but I've not been able to locate any documentation to that end.

The precise requirement is to fix a problem for a user of a laptop that 'forgets' the state of the RF frequency kill switch during suspend. When the PC resumes the radio is off and the hardware button has to be manually activated.

The acerhk module is the only way to enable use of the kill-switch on this PC.

My thought was that if acerhk can link into the PM events it can use the resume event to re-enable the radio if it was enabled on suspend.

In this particular case it seems from the user's description that the hardware switch is a momentary push-to-make type rather than a latching switch that is more common.

#1 lore raw
Quoted 4 lines · TJ

The precise requirement is to fix a problem for a user of a laptop that 'forgets' the state of the RF frequency kill switch during suspend. When the PC resumes the radio is off and the hardware button has to be manually activated.

Port that driver to rfkill, instead. It does PM and will do the right thing across suspend/resume.

Signature · 4 lines
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh