compal-laptop: add JHL90, battery & hwmon interface
authorRoald Frederickx <roald.frederickx@gmail.com>
Tue, 20 Jul 2010 22:19:39 +0000 (15:19 -0700)
committerMatthew Garrett <mjg@redhat.com>
Tue, 3 Aug 2010 13:48:57 +0000 (09:48 -0400)
commit9be0fcb5ed46509f859542fb2871ac2d277b5407
tree8b6d8ffd7a6a6dd75b20d4858daed2b4edca4a45
parentc28341455c080356508cc375ba440018e150021c
compal-laptop: add JHL90, battery & hwmon interface

The driver now supports the Compal JHL90 (which I use) and it has some
added features.  The biggest novelties are a battery interface
(power_supply) and a temperature and fan control interface (hmwon).  It
also adds a power-off feature to the backlight subsystem and it exports a
few files that can enable/disable wake_on_XXX events.

Much of the original code of the old features is still there, but I've
changed some names to keep the naming more coherent with the added
functionalities.  (Sorry for the huge patch)

Some technical stuff about the new driver:

First of all, I'm not sure if the extra features also work on the other
Compal boards.  Currently they only get enabled if the DMI data indicates
you are on a JHL90 board.

Secondly, I've noticed a quirk in my fan controller.  I have to re-send
the wanted pwm-level to the controller every so often.  If I don't do
this, the fanspeed will slowly rise until after a couple of minutes it's
at full speed.  (Note that every normal userland application will probably
update the pwm-level every so often anyway, based on temperature readings,
so this might not be an issue in practice) If this turns out to be a
problem with all the controllers, maybe we should implement a kernel timer
and have the driver re-send the pwm level every XX seconds to make this
transparent to userspace?  (However, I couldn't immediately find a way to
do this cleanly.)

Additional information can be found in the source comments.

[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: add missing semicolon]
Signed-off-by: Roald Frederickx <roald.frederickx@gmail.com>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
drivers/platform/x86/compal-laptop.c