public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson-VXdhtT5mjnY@public.gmane.org>
To: linux-kernel <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: acpi-devel
	<acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: [RFC] dev_acpi: support for userspace access to acpi
Date: Tue, 26 Oct 2004 14:55:00 -0600	[thread overview]
Message-ID: <1098824100.6861.46.camel@tdi> (raw)
In-Reply-To: <1097879998.5971.69.camel@tdi>


   Announcing the next revision of dev_acpi.  The dev_acpi module
provides userspace access to ACPI namespace using a simple character
device file.  For further discussion of the interface, see the README
file in the tarball.  The current release is available here:

http://free.linux.hp.com/~awilliam/acpi/dev_acpi/dev_acpi-20041026.tar.bz2

(it's a little big to post here raw, but if requested I'd be happy to
post the driver by itself)

   I've been tossing around sysfs and device file interfaces to the ACPI
namespace for a while now.  The idea is that there's way too much
information in namespace to not provide a userspace interface to it.
Examples include projects springing up to support ACPI features on
various laptops, increasing dependence on developing code using ACPI,
extracting system/platform information from ACPI namespace.  In short,
there are a lot of really simple things that userspace could use ACPI
namespace for, but there's currently no way to get to it.

   Previous iterations using sysfs looked pretty, but never really
achieved the full potential of the interface (no ioctl, read issues on
files, complex data for sysfs, file per operation, etc...).  The device
file interface provides a more comprehensive yet compact interface,
along with a 32bit compatibility layer, and sane read semantics on the
file.

   This revision cleans up quite a bit of code, adds some documentation
in the README file, adds a number of interfaces, and adds several more
example program, with the intent of sparking more interest.  I've
updated the acpitree program to list a bit more data, but it's basically
the same.  For anyone trying to wrap their head around ACPI namespace,
it's a great tool for getting a simple visual representation of the data
available.  I added a tool called acpivideo that will hopefully be
interesting to laptop users.  It's able to set the active video output
device, much like the hotkey on most laptops (but from command line).
It also has a daemon mode that sets up a notify handler (yes, from
userspace) and listens for events on the VGA device.  When an event is
received, it evaluates the requested state change and pokes ACPI to do
it.  See the README for more info.  If anyone knows how to poke X to not
block the switch it'd be interesting to add the hooks (currently only
seems to work from a vt).

   I added another simple program called acpiundock.  If you have a
laptop docking station with an electo-mechanical eject (like the
omnibook 500), this one should be fun.  There are no option, just run it
and see what happens (please be prepared for it to work... it just
might).

   Another fun developer tool/hack is eventwatch.  This program is
simply a version of acpitree that tries to install notify handlers on
every device in namespace.  It then sits and waits for something to
happen.  If you've wondered if that hotkey on your box does something,
try this, it just might.

   I skimmed though the ibm-acpi module and tried to provide enough
interfaces in this version of dev_acpi that the entire ibm-acpi could
potentially be done in userspace.  I don't have an IBM laptop to
experiment with, but I'd be interested to hear if someone tries.

   Anyway, please give this interface a shot.  It builds as a standalone
module and should work on any 2.6 kernel with headers available.  I've
tested this version quite a bit more than the version I posted a couple
weeks ago, especially the 32bit app on 64bit kernel code (ia64 and
x86_64).  Bug reports, feedback, opinions gladly welcomed.  Thanks,

	Alex

-- 
Alex Williamson                             HP Linux & Open Source Lab



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click

  reply	other threads:[~2004-10-26 20:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-20 21:41 [PATCH/RFC] exposing ACPI objects in sysfs Alex Williamson
2004-09-21 12:24 ` Pavel Machek
2004-09-21 14:18   ` Alex Williamson
2004-09-21 16:48   ` Alex Williamson
2004-09-21 17:26     ` Pavel Machek
2004-09-21 18:00       ` Alex Williamson
2004-09-21 19:31         ` Pavel Machek
2004-09-21 19:06       ` [ACPI] " Andi Kleen
2004-09-21 19:13         ` Alex Williamson
2004-09-21 19:18           ` Andi Kleen
2004-09-21 19:45             ` Alex Williamson
2004-09-21 19:58               ` Pavel Machek
2004-09-21 20:40                 ` Alex Williamson
2004-09-21 21:02                   ` Pavel Machek
     [not found]                     ` <20040921210218.GJ30425-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-10-15 22:39                       ` Alex Williamson
2004-10-26 20:55                         ` Alex Williamson [this message]
2004-09-21 19:21           ` [ACPI] " Arjan van de Ven
  -- strict thread matches above, loose matches on Subject: below --
2004-10-27  2:30 [RFC] dev_acpi: support for userspace access to acpi Yu, Luming
2004-10-27  3:27 ` Alex Williamson
2004-10-27 17:17 Yu, Luming
2004-10-27 23:31 ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1098824100.6861.46.camel@tdi \
    --to=alex.williamson-vxdhtt5mjny@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox