public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* display interface?
@ 2002-09-04 11:57 joerg.beyer-htSm2yLGOjU
  2002-09-05  2:54 ` John Belmonte
  0 siblings, 1 reply; 6+ messages in thread
From: joerg.beyer-htSm2yLGOjU @ 2002-09-04 11:57 UTC (permalink / raw)
  To: acpilist

Hi,

this may be a dump question: is there a acpi interface to the laptop display?
Is it possible to make the display darker/lighter depending on the state of battery?

     Joerg



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: display interface?
  2002-09-04 11:57 joerg.beyer-htSm2yLGOjU
@ 2002-09-05  2:54 ` John Belmonte
       [not found]   ` <3D76C770.40807-ZFKsivP1bGvOQU1ULcgDhA@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: John Belmonte @ 2002-09-05  2:54 UTC (permalink / raw)
  To: acpi-devel

> this may be a dump question: is there a acpi interface to the laptop display?
> Is it possible to make the display darker/lighter depending on the state of battery?
> 
>      Joerg

There is no standard interface under ACPI for this.  Vendors implement 
the control in a variety of ways.  You'll have to first find a way to 
set the brightness for your model laptop (try searching the internet for 
utilities or info).  Then you'll have to hook into the ACPI event system 
for the battery or AC adapter and trigger the brightness accordingly. 
Not a nice task to request of your average computer user.

In an ideal world, someone would spell out an interface for common 
functions like this (I don't know if it should be in the kernel or not), 
and implementations could be plugged into this interface at a fine 
grain.  There would also be a "power management contruction kit", a very 
general and configurable application, providing functionality similar to 
the proprietary tools that come with laptops under Windows.  You'd also 
have laptop vendors caring if all functionality of their products can be 
accessed from Linux...

-John



-- 
http:// i      .   /



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: display interface?
       [not found]   ` <3D76C770.40807-ZFKsivP1bGvOQU1ULcgDhA@public.gmane.org>
@ 2002-09-05  3:21     ` takawata-l7ZBCLq5RC066kwqclu8Pg
  0 siblings, 0 replies; 6+ messages in thread
From: takawata-l7ZBCLq5RC066kwqclu8Pg @ 2002-09-05  3:21 UTC (permalink / raw)
  To: John Belmonte
  Cc: takawata-yzSWc4HAx5xL9jVzuh4AOg,
	acpi-devel-pyega4qmqnRoyOMFzWx49A

In message <3D76C770.40807-ZFKsivP1bGvOQU1ULcgDhA@public.gmane.org>, John Belmonte wrote:
>> this may be a dump question: is there a acpi interface to the laptop display
>?
>> Is it possible to make the display darker/lighter depending on the state of 
>battery?
>> 
>>      Joerg
>
>There is no standard interface under ACPI for this.  Vendors implement 

There is a spec for Display control on ACPI at ACPI spec 2.0 Appendex B,
though it seems to be  not so widely accepted.

But My ThinkPad i1620 AML code implements this, and I'm writing a driver
for acpi vga spec on FreeBSD.


-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: display interface?
@ 2002-09-05  8:26 joerg.beyer-htSm2yLGOjU
       [not found] ` <200209050826.g858QYX07834-pb599fR3TxVkExQqqHjIK3sFFmKitW5W@public.gmane.org>
  2002-09-05 14:31 ` John Belmonte
  0 siblings, 2 replies; 6+ messages in thread
From: joerg.beyer-htSm2yLGOjU @ 2002-09-05  8:26 UTC (permalink / raw)
  To: acpi-devel, JohnBelmonte

John Belmonte <jvb-ZFKsivP1bGvOQU1ULcgDhA@public.gmane.org> schrieb am 05.09.02 04:56:15:
...
> utilities or info).  Then you'll have to hook into the ACPI event system 
> for the battery or AC adapter and trigger the brightness accordingly. 

I assume, that is done via acpid configuration. Where can I lookup
what events are sended on which conditiion ("use the source"
combined with a filename (and maybe a function/struct/...) is
of course considered a valid answer :-)

If my assumtion is correct: has anybody an example of how
to configure acpid to do "something" when the AC adapter is plugged
in or out?

> Not a nice task to request of your average computer user.
> 
> In an ideal world, someone would spell out an interface for common 
> functions like this (I don't know if it should be in the kernel or not), 
> and implementations could be plugged into this interface at a fine 
> grain.  There would also be a "power management contruction kit", a very 
> general and configurable application, providing functionality similar to 
> the proprietary tools that come with laptops under Windows.  You'd also 
> have laptop vendors caring if all functionality of their products can be 
> accessed from Linux...

    I share your dreams...
    Joerg



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: display interface?
       [not found] ` <200209050826.g858QYX07834-pb599fR3TxVkExQqqHjIK3sFFmKitW5W@public.gmane.org>
@ 2002-09-05  8:47   ` Charl P. Botha
  0 siblings, 0 replies; 6+ messages in thread
From: Charl P. Botha @ 2002-09-05  8:47 UTC (permalink / raw)
  To: acpi-devel-pyega4qmqnRoyOMFzWx49A

> John Belmonte <jvb-ZFKsivP1bGvOQU1ULcgDhA@public.gmane.org> schrieb am 05.09.02 04:56:15:
> > the proprietary tools that come with laptops under Windows.  You'd also 
> > have laptop vendors caring if all functionality of their products can be 
> > accessed from Linux...

Amen.  I think Linux's progress on the desktop is simply *brilliant*, but
it's DEFINITELY not a good laptop OS.

-- 
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/


-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: display interface?
  2002-09-05  8:26 Re: display interface? joerg.beyer-htSm2yLGOjU
       [not found] ` <200209050826.g858QYX07834-pb599fR3TxVkExQqqHjIK3sFFmKitW5W@public.gmane.org>
@ 2002-09-05 14:31 ` John Belmonte
  1 sibling, 0 replies; 6+ messages in thread
From: John Belmonte @ 2002-09-05 14:31 UTC (permalink / raw)
  To: acpi-devel

[-- Attachment #1: Type: text/plain, Size: 471 bytes --]

joerg.beyer-htSm2yLGOjU@public.gmane.org wrote:
> If my assumtion is correct: has anybody an example of how
> to configure acpid to do "something" when the AC adapter is plugged
> in or out?

On battery power, I slow down the cpu, set the hard disk to spin down 
quickly, and lower the LCD brightness.  Attached are the scripts involved:

     /etc/acpi/events/default
     /etc/acpi/default.sh
     /usr/local/sbin/libretto-ac_adapter

-John



-- 
http:// i      .   /

[-- Attachment #2: default --]
[-- Type: text/plain, Size: 630 bytes --]

# This is the ACPID default configuration, it takes all
# events and passes them to /etc/acpi/default.sh for further
# processing.

# event keeps a regular expression matching the event. To get
# power events only, just use something like "event=button power.*"
# to catch it.
# action keeps the command to be executed after an event occurs
# In case of the power event above, your entry may look this way:
#event=button power.*
#action=/sbin/init 0

# Optionally you can specify the placeholder %e. It will pass
# through the whole kernel event message to the program you've
# specified.

event=.*
action=/etc/acpi/default.sh %e

[-- Attachment #3: default.sh --]
[-- Type: application/x-sh, Size: 342 bytes --]

[-- Attachment #4: libretto-ac_adapter --]
[-- Type: text/plain, Size: 951 bytes --]

#!/usr/bin/python

# call longrun and hdparm based on acpi ac adapter status
# John Belmonte <jvb-ZFKsivP1bGvOQU1ULcgDhA@public.gmane.org>

import sys
import re
import commands

device_num = sys.argv[1]
status_name = "/proc/acpi/ac_adapter/%s/status" % device_num

status_file = open(status_name)
status = status_file.read()
status_file.close()

def command(s):
    commands.getstatusoutput(s)

is_off_line = re.search("off-line", status)
# NOTE: hdparm sleep settings seem to trump noflushd
# ISSUE: longrun doesn't like -f and -s at the same time
if is_off_line:
    command("longrun -s 0 30")
    command("longrun -f economy")
    command("hdparm -S 4 /dev/hda") # 20 second sleep timeout
    command("echo 'brightness:1' > /proc/acpi/toshiba/lcd")
else:
    command("longrun -s 0 100")
    command("longrun -f performance")
    command("hdparm -S 48 /dev/hda") # 4 minute sleep timeout
    command("echo 'brightness:6' > /proc/acpi/toshiba/lcd")


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-09-05 14:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-05  8:26 Re: display interface? joerg.beyer-htSm2yLGOjU
     [not found] ` <200209050826.g858QYX07834-pb599fR3TxVkExQqqHjIK3sFFmKitW5W@public.gmane.org>
2002-09-05  8:47   ` Charl P. Botha
2002-09-05 14:31 ` John Belmonte
  -- strict thread matches above, loose matches on Subject: below --
2002-09-04 11:57 joerg.beyer-htSm2yLGOjU
2002-09-05  2:54 ` John Belmonte
     [not found]   ` <3D76C770.40807-ZFKsivP1bGvOQU1ULcgDhA@public.gmane.org>
2002-09-05  3:21     ` takawata-l7ZBCLq5RC066kwqclu8Pg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox