Skip to contentSkip to conversation

Using the SLPB button for MEM state (suspend to ram)

DISCUSSION Petros Kolyvas 3 participants 3 messages Oct 11, 2005 2 messages not in the archive ACPI

lore
Share & tools
lore
#0 lore raw

Hi folks,

I've been using ACPI4Linux's suspend to RAM for some time. Until a recent reinstall of gentoo, I had been using the lid button (LID0), and a script which polled its state (/proc/acpi/button/lid/LID0/state) and consequently, depending on whether the lid was up or down, the laptop would either come out of or go into the "mem" state.

Now the thing is that I've begun to use my laptop in the car quite a bit; got myself an inverter and I keep it tucked under the front passenger seat - anyway, the why and hows don't matter.

Basically I want to keep the screen down and keep the laptop powered up... no problem... just remove the lid button acpi script. The thing is that I would like to be able to put it into the "mem" state when I so desire.

I noticed that the Sleep Button, (/proc/acpi/button/sleep/SLPB) is present but that there is no state (/proc/acpi/button/sleep/SLPB/state) to poll in a script and therefore I'm unsure if I can use the button at all.

If anyone has any idea on how to possibly use this button, if it can be used, or if there's a HOWTO out there that I missed, I'd greatly appreciate it.

All the best for those celebrating Canadian thanksgiving.

Pk

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl

A message that is not in the archive (sent off-list or not yet received): BAYC1-PASMTP03F4CB11CD595EA2BC0C07D6780-NW7P6tAEKYY@public.gmane.org

#2 lore raw
Quoted 22 lines · Petros Kolyvas

Hi folks,

I've been using ACPI4Linux's suspend to RAM for some time. Until a recent reinstall of gentoo, I had been using the lid button (LID0), and a script which polled its state (/proc/acpi/button/lid/LID0/state) and consequently, depending on whether the lid was up or down, the laptop would either come out of or go into the "mem" state.

Now the thing is that I've begun to use my laptop in the car quite a bit; got myself an inverter and I keep it tucked under the front passenger seat - anyway, the why and hows don't matter.

Basically I want to keep the screen down and keep the laptop powered up... no problem... just remove the lid button acpi script. The thing is that I would like to be able to put it into the "mem" state when I so desire.

I noticed that the Sleep Button, (/proc/acpi/button/sleep/SLPB) is present but that there is no state (/proc/acpi/button/sleep/SLPB/state) to poll in a script and therefore I'm unsure if I can use the button at all.

Quoted 7 lines

If anyone has any idea on how to possibly use this button, if it can be used, or if there's a HOWTO out there that I missed, I'd greatly appreciate it.

All the best for those celebrating Canadian thanksgiving.

Pk

One small additional note; I did notice that while I never use my power button to shutdown (opting for my ingrained 'shutdown -h now' procedure) if I do press the power button the system shuts off (of course - but just trying to be as obvious as possible).

Looking further into it, i noticed that /proc/acpi/button/power/PWRF also does not have a 'state' file yet still functions when pressed.

Worst case scenario: maybe I can switch the default behaviour of the power button to go to "mem" state if the sleep button is unavailable.

Sorry for flooding with inane questions/observations...

Pk

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 7 lines · On Monday October 10, [email protected] wrote:

Hi folks,

I've been using ACPI4Linux's suspend to RAM for some time. Until a recent reinstall of gentoo, I had been using the lid button (LID0), and a script which polled its state (/proc/acpi/button/lid/LID0/state) and consequently, depending on whether the lid was up or down, the laptop would either come out of or go into the "mem" state.

That's an interesting approach.
I use acpid which monitors /proc/acpi/events and runs various scripts in /etc/acpi/events when things happen.

Quoted 5 lines

I noticed that the Sleep Button, (/proc/acpi/button/sleep/SLPB) is present but that there is no state (/proc/acpi/button/sleep/SLPB/state) to poll in a script and therefore I'm unsure if I can use the button at all.

SLPB doesn't have a state because it is edge-triggered, not level triggered.
It causes an action as you press it. Holding the button down, or releasing it, aren't interesting at all.
This contrasts with LID0 which is a level. It tells you whether the lid is open or closed. There are two states and both are interesting.

Quoted 5 lines

If anyone has any idea on how to possibly use this button, if it can be used, or if there's a HOWTO out there that I missed, I'd greatly appreciate it.

Looking into acpid.

NeilBrown

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl