Kernel module for Compal laptops

Changelog:
    2010-06-01 v0.2.10 Added patch for latest kernel
    2009-07-16 v0.2.10 Added support for HL91/JHL91 (reported by Julius Schwartzenberg, thanks!)
    2008-12-31 v0.2.9 Solution to the problem of hanging on charging battery level (by Michał Żarłok, thanks!)
    2008-10-10 Compal-laptop module v0.2.6 included into kernel 2.6.27
    2008-09-05 v0.2.8 Added support for battery charging level
    2008-08-07 v0.2.7 Added support for JHL90 (reported by Radosław Gierwiało, thanks!)
    2008-07-29 Compal-laptop module v0.2.6 included into mainline tree (2.6.27-rc1)
    2008-06-12 v0.2.6 Remove unnecessary attribute (lcd_level)
    2008-04-17 Compal-laptop module v0.2.5 included into -mm tree (2.6.25-mm1)
    2008-04-15 v0.2.5 Added support for IFL91 (reported by Marc Vinyals, thanks!) and IFT00 (reported by Wiktor Stasiak, thanks!).
    2008-04-09 v0.2.3 Added support for JFL92 (reported by Piotr Budny, thanks!).
    2008-02-21 Compal-laptop module included into Mandriva kernel (cooker - 2.6.24.2-4mdv2008.1)
    2008-02-15 Compal-laptop module v0.2.2 included into -mm tree
    2008-02-05 v0.2.2 Added new board and info about raw value taken from ec register
    2008-01-21 Qt4 based Compal Laptop control
    2008-01-19 v0.2.1 Fixed little bug (thanks to Stephan Wezel).
    2008-01-18 v0.2 Allow enable or disable wlan/bluetooth subsystem.
    2008-01-17 v0.1 Initial version.

Download:
kernel >= 2.6.34
    - (0.2.10) patch & source

kernel >= 2.6.29
    - (0.2.10) patch & source
kernel 2.6.28
    - (0.2.9) patch
    - (0.2.9) source

THIS IS VERY MUCH A WORK IN PROGRESS. NO WARRANTY GIVEN.

This is a driver for laptops built by Compal:

Compal FL90/IFL90
Compal FL90/IFL90
Compal FL91/IFL91
Compal FL92/JFL92
Compal FT00/IFT00
Compal JHL90
Compal JHL91
Dell Mini 9
Dell Mini 10
Dell Mini 10v
Dell Inspiron 11z
Dell Mini 12

It adds support for:
- bluetooth, WLAN and lcd brightness control (via backlight control/rfkill)
- change battery charging level

This driver exports a few files in /sys/devices/platform/compal-laptop/:
    
    wlan - wlan subsystem state


    current state
    cat /sys/devices/platform/compal-laptop/rfkill0/state
    
    disable wlan
    echo 0 > /sys/devices/platform/compal-laptop/rfkill0/state
    
    enable wlan
    echo 1 > /sys/devices/platform/compal-laptop/rfkill0/state

or better - use some tools like rfkill
    
    bluetooth - bluetooth subsystem state


    current state
    cat /sys/devices/platform/compal-laptop/rfkill1/state
    
    disable bluetooth
    echo 0 > /sys/devices/platform/compal-laptop/rfkill1/state
    
    enable bluetooth
    echo 1 > /sys/devices/platform/compal-laptop/rfkill1/state

or better - use some tools like rfkill

    charging level - change battery charging level


    current state
    cat /sys/devices/platform/compal-laptop/charging_level
    
    set charging level to 50%
    echo 50 > /sys/devices/platform/compal-laptop/charging_level
    
    set charging level to 75%
    echo 75 > /sys/devices/platform/compal-laptop/charging_level
    
    set charging level to 100%
    echo 100 > /sys/devices/platform/compal-laptop/charging_level
    or
    echo 0 > /sys/devices/platform/compal-laptop/charging_level


    controling backlight


    get current backlight level
    cat /sys/class/backlight/compal-laptop/actual_brightness
    
    set backlight level to 4 (0-7, 4 mean 50%)
    echo 4 > /sys/class/backlight/compal-laptop/brightness


This driver might work on other laptops produced by Compal. If you want to try it you can pass force=1 as argument to the module which will force it to load even when the DMI data doesn't identify the laptop as IFL90.

Tested on Compal FL90+ PM2, bluetooth, Intel PRO/Wireless 4965 AGN, kernel 2.6.34, debian unstable.

See also Compal Laptop control.

(c) 2008/2009/2010 Cezary Jackiewicz (cezary.jackiewicz (at) gmail.com) Any suggestion?