History log of /drivers/platform/x86/asus-laptop.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
587a1f1659e8b330b8738ef4901832a2b63f0bed 24-Jul-2011 Al Viro <viro@zeniv.linux.org.uk> switch ->is_visible() to returning umode_t

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
/drivers/platform/x86/asus-laptop.c
149083996e52c640fdfd73ad92550be4b803f349 14-Oct-2011 Anisse Astier <anisse@astier.eu> asus-laptop: Add rfkill support for Pegatron Lucid tablet

Add three new rfkill switches in this driver that are specific to
Pegatron Lucid tablet.
Please note that you might not need all three switches. For example if
you don't have a 3G module inside your tablet.

Also, on my device, the gpio for the wifi/bt module is connected to the
bluetooth line. Therefore to activate your wireless lan interface, you
need to use the "pega-bt" rfkill switch.

Finally, the rfkill switch only works before the wireless module is
loaded the first time. Unloading ath9k doesn't help, a reboot is
necessary.

Signed-off-by: Anisse Astier <anisse@astier.eu>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
b93f82816c9ee4868c5aa1c8e06259233916d988 14-Oct-2011 Anisse Astier <anisse@astier.eu> asus-laptop: pega_accel - Report accelerometer orientation change through udev

Signed-off-by: Anisse Astier <anisse@astier.eu>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
16cbf93369a8d148316a75c333bb81bbb64a46c4 14-Oct-2011 Corentin Chary <corentin.chary@gmail.com> asus-laptop: fix module description

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
8d38e42c61c53ab63abbb15380b39df4eae8d44e 14-Oct-2011 Corentin Chary <corentin.chary@gmail.com> asus-laptop: hide leds on Pegatron Lucid

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
b23910c2194e0e0ee43e585788085f8e6dd4877e 14-Oct-2011 Andy Ross <andy.ross@windriver.com> asus-laptop: Pegatron Lucid accelerometer

Support the built-in accelerometer on the Lucid tablets as a standard
3-axis input device.

Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
abec04dbc3dbe7577ccd9d5d6e188aa153d464eb 14-Oct-2011 Andy Ross <andy.ross@windriver.com> asus-laptop: allow boot time control of Pegatron ALS sensor

Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
8fcf71aa0032acbd30b3222f9cb238919ab3b984 08-Aug-2011 Axel Lin <axel.lin@gmail.com> platform-drivers-x86: asus-laptop: fix wrong test for successful registered led_classdev

device_create returns &struct device pointer on success, or ERR_PTR() on error.
Thus if led_classdev_register fails, led_cdev->dev is always not NULL.

Thus to unregister a successful registered led_classdev, we should check
IS_ERR_OR_NULL macro for led_cdev->dev instead of checking if led_cdev->dev
is NULL or not.

we use IS_ERR_OR_NULL instead of IS_ERR because if we havn't call
led_classdev_register, the led_cdev->dev is NULL.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
33989ba6f7feb3d03916e42d7775d802d2fdea1e 14-Oct-2011 Andy Ross <andy.ross@windriver.com> asus-laptop: Pegatron Lucid ALS sensor

Ambient light sensor for Pegatron Lucid. Supports pre-existing
ls_switch sysfs interface to en/disable automatic control, and exports
the brightness from the device as "ls_value".

Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
8819de7f988289111cf4c44946f0d8c008b2d9a7 14-Oct-2011 Andy Ross <andy.ross@windriver.com> asus-laptop: Platform detection for Pegatron Lucid

Recognize the Pegatron Lucid tablets by their method signatures.

Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
fddbfed595b307f9dddc7a86ddfbcbcb80141e28 01-Jul-2011 Corentin Chary <corentin.chary@gmail.com> asus-wmi: add CWAP support and clarify the meaning of WAPF bits

ref: http://dev.iksaif.net/projects/3/wiki/Asus-laptop_WAPF

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
5ad77dcfb49a85715bcb9174a133cba140eda1bc 30-Mar-2011 Joe Perches <joe@perches.com> asus: Add pr_fmt and convert printks to pr_<level>

Add pr_fmt, prefixes each log message.
Convert printks to pr_<level>.
Convert pr_warning to pr_warn.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
c8440336fe376036e473554c30f7266987961734 17-Mar-2011 Lucas De Marchi <lucas.de.marchi@gmail.com> platform-drivers: x86: fix common misspellings

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
3b81cf9d558c57406b4ed9b0d2639113d1d428b6 06-Feb-2011 Corentin Chary <corentin.chary@gmail.com> asus-laptop: remove deprecated interfaces (lcd_switch and display_get)

I should have done that one year ago, so it's more than
time to do it.

These two features use non-standard interfaces. There are the
only features that really need multiple path to guess what's
the right method name on a specific laptop.

Removing them allow to remove a lot of code an significantly
clean the driver.

This will affect the backlight code which won't be able to know
if the backlight is on or off.

The platform display file will also be write only (like the one
in eeepc-laptop).

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
af96f87703f33a4dba4b51c7b3f0d6f874aa4853 06-Feb-2011 Corentin Chary <corentin.chary@gmail.com> asus-laptop: let WLED alone on L1400B

Asus took the DSDT from another model (L84F), made some change
to make it work, but forgot to remove WLED method (the laptop
doesn't have a wireless card). They even didn't change the model
name.

ref: https://bugzilla.kernel.org/show_bug.cgi?id=25712

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
bb7ca747f8d6243b3943c5b133048652020f4a50 23-Mar-2011 Matthew Garrett <mjg@redhat.com> backlight: add backlight type

There may be multiple ways of controlling the backlight on a given
machine. Allow drivers to expose the type of interface they are
providing, making it possible for userspace to make appropriate policy
decisions.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: David Airlie <airlied@linux.ie>
Cc: Alex Deucher <alexdeucher@gmail.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/platform/x86/asus-laptop.c
4b7bd364700d9ac8372eff48832062b936d0793b 22-Dec-2010 Jiri Kosina <jkosina@suse.cz> Merge branch 'master' into for-next

Conflicts:
MAINTAINERS
arch/arm/mach-omap2/pm24xx.c
drivers/scsi/bfa/bfa_fcpim.c

Needed to update to apply fixes for which the old branch was too
outdated.
ba1ff5be52163a97ac4ce8bc51beae2c96861a43 14-Nov-2010 Corentin Chary <corentincj@iksaif.net> asus-laptop: add wimax and wwan support

Asus UL30A has a 3G chip, but the radio is disabled by default.
The DSDT also reference a WIMAX device, which is not present on this model.

This patch adds two new files: wwan and wimax to control WWAN and
WIMAX devices. It does not use rfkill, because like WLED and BLED,
we don't know yet that the two ACPI functions will always control the
radio, they may control only the leds on some hardware.

We may add rfkill switchs later.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
acc2472ed33fc5e72482cc3b3b846077d97c2f8b 16-Nov-2010 Lionel Debroux <lionel_debroux@yahoo.fr> backlight: constify backlight_ops

backlight_device_register has been expecting a const "ops" argument, and using
it as such, since 9905a43b2d563e6f89e4c63c4278ada03f2ebb14. Let's make the
remaining backlight_ops instances const.

Inspired by hunks of the grsecurity patch, updated for newer kernels.

Signed-off-by: Lionel Debroux <lionel_debroux@yahoo.fr>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
/drivers/platform/x86/asus-laptop.c
ac9b1e5b63d5d9829ecf2294f0486ccd270c5db4 26-Aug-2010 Dmitry Torokhov <dmitry.torokhov@gmail.com> asus-laptop: use attribute group to manage attributes

Instead of registering (and removing) every attribute individually
switch to using sysfs attribute group. This makes sure that we
properly unwind and do not try to remove non-existent attributes which
may not be safe to do in the future.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
b404ecbf91a5c19c0f448b513aa26696eee09392 25-Aug-2010 Dmitry Torokhov <dmitry.torokhov@gmail.com> asus-laptop: remove no longer used keycode_map field

The driver uses sparse keymap library and does not use this field
anymore.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
23f45c3a76e715217f40ac397c15815c774cad7f 24-Aug-2010 Corentin Chary <corentincj@iksaif.net> asus-laptop: fix gps rfkill

The GPS rfkill crappy code. The ops_data argument wasn't
set, and was totally misused. The fix have been tested
on an Asus R2H.

Cc: stable@kernel.org
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
b58baecddee634903f339b7f7e9db7fc2a1449f1 24-Aug-2010 Corentin Chary <corentincj@iksaif.net> asus-laptop: Add key found on Asus N61JQ

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
71e687dc499819caa0d6ee0f80dcda1d5c24b5b2 24-Aug-2010 Corentin Chary <corentincj@iksaif.net> platform-x86: sync eeepc-laptop and asus-laptop

Makes asus-laptop and eeepc-laptop _init/_exit functions
looks exactly the same as they do the same thing.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
45036ae14a0161e9a0f542b6cb7ed55790f73f5b 05-Jul-2010 Axel Lin <axel.lin@gmail.com> asus-laptop: fix asus_input_init error path

This patch includes below fixes:
1. return -ENOMEM instead of 0 if input_allocate_device fail.
2. fix wrong goto if sparse_keymap_setup fail.
3. fix wrong goto if input_register_device fail.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
c26d85cb90e178d1e3df6a78d064f8731f154a5e 21-Jul-2010 Axel Lin <axel.lin@gmail.com> asus-laptop: fix wapf, wlan_status and bluetooth_status module_param permissions

The wapf module parameters defines the behavior of the Fn+Fx wlan key.
The wlan_status and bluetooth_status module parameters are for setting the
wlan/bluetooth status on boot.

All above module parameters are determinated only at the module load time.
Change the value after the module is loaded does not make sense and has
no effect at all, thus set the permissions to 0444 instead of 0644.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
6a984a06487129f013ee2df6ce98b6cfada1e7b1 21-Jul-2010 Axel Lin <axel.lin@gmail.com> asus-laptop: return proper error for store_ledd if write_acpi_int fail

In current implementation, store_ledd() does not return error if
write_acpi_int fail. This patch fixes it by return -ENODEV if
write_acpi_int fail.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
9fb866f317def195bb794120e13d1d73c2a94bb2 21-Jul-2010 Axel Lin <axel.lin@gmail.com> asus-laptop: fix incorrect return value for write_acpi_int_ret if handle is NULL

According to the comments of write_acpi_int_ret(), write_acpi_int_ret()
should return 0 if write is successful, -1 else. Thus if handle is NULL,
the write does not happen, it should return -1.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
d8eca1105fe2039e102c6a8a915d0af937b1b593 29-Jun-2010 Axel Lin <axel.lin@gmail.com> asus-laptop: fix a memory leak in asus_laptop_get_info error path

The callers of write_acpi_int_ret() pass ACPI_ALLOCATE_BUFFER,
the caller must kfree the returned buffer if AE_OK is returned.

This patch adds a missing kfree(buffer.pointer) before return -ENOMEM
if kstrdup fail.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
668f4a03211ace7aa57dece90bd835b4f9b9dd30 06-Apr-2010 Dan Carpenter <error27@gmail.com> asus: don't modify bluetooth/wlan on boot

We were storing -1 as an unsigned int and as a result the effect of
passing -1 was the same as using 1.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Acked-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
336f5899d287f06d8329e208fc14ce50f7ec9698 05-Apr-2010 Tejun Heo <tj@kernel.org> Merge branch 'master' into export-slabh
167215118a88dd56a1ab8c8d33e279d6d40f57b6 02-Mar-2010 Corentin Chary <corentincj@iksaif.net> asus-laptop: fix warning in asus_handle_init

In function 'asus_laptop_get_info':
warning: passing argument 3 of 'asus_handle_init' from incompatible pointer type
note: expected 'char **' but argument is of type 'const char **'

Introduced by commit c21085108a02e1b838c34f3650c8cc9fbd178615
("asus-laptop: fix style problems reported by checkpath.pl").

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/asus-laptop.c
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
/drivers/platform/x86/asus-laptop.c
a19a6ee6cad2b20292a774c2f56ba8039b0fac9c 17-Feb-2010 Matthew Garrett <mjg@redhat.com> backlight: Allow properties to be passed at registration

Values such as max_brightness should be set before backlights are
registered, but the current API doesn't allow that. Add a parameter to
backlight_device_register and update drivers to ensure that they
set this correctly.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
/drivers/platform/x86/asus-laptop.c
060cbce6c4431465e83907102e1903ecea366db5 28-Jan-2010 Corentin Chary <corentincj@iksaif.net> asus-laptop: fix style problems reported by checkpath.pl

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
2a1fd64cb70a42563d2313eb70c6495d2c88b36d 26-Jan-2010 Corentin Chary <corentincj@iksaif.net> asus-laptop: use device_create_file() instead of platform_group

There is two reason to do that:
- we don't want a "gps" file if the model doesn't have a gps
- we don't want to use global variables anymore

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
aee0afb8cb52178164accfec9cfc58bc27b597b3 26-Jan-2010 Corentin Chary <corentincj@iksaif.net> asus-laptop: clean led code

Remove all "templates" and add a generic struct asus_led instead.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
18e1311ee71a67497a33521be61ddf6562fa22c0 25-Jan-2010 Corentin Chary <corentincj@iksaif.net> asus-laptop: add gps rfkill

The rfkill subsystem will enable gps by default.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
47ee0e99524a7ee0185e3c38423cc17cc1318ddc 24-Jan-2010 Corentin Chary <corentin.chary@gmail.com> asus-laptop: set initial lcd state

There is no way to find the initial lcd state. A quick workaround
is to set it "on" by default. Anyway this feature is scheduled for removal.

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
/drivers/platform/x86/asus-laptop.c
75747129a994463e36c2516e8071771427d8494b 24-Jan-2010 Corentin Chary <corentin.chary@gmail.com> asus-laptop: leds, remove dead code and fix asus_led_exit()/asus_led_init()

These bug where introduced in "asus-laptop: code movement".

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
/drivers/platform/x86/asus-laptop.c
a539df5e1548751e352990c518e88af50e6111b8 25-Jan-2010 Corentin Chary <corentincj@iksaif.net> asus-laptop: add backlight changes notifications

We don't want to send KEY_BRIGHTNESSDOWN or KEY_BRIGHTNESSUP
because it would be a lie to tell userspace that we want
to change the brightness while it's actually done by the
firmware.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
7f607d71065b6b089f59b78b54144c3fb93ad629 17-Jan-2010 Corentin Chary <corentincj@iksaif.net> asus-laptop: add bluetooth keys found on M9V

Reported by Andrey F. Ilchuk

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
66a71dd1f7c4eee636867d381995b7e6ae489dc3 25-Jan-2010 Corentin Chary <corentincj@iksaif.net> asus-laptop: switch to sparse keymap library

This patch is based on Dmitry Torokhov's patch with
some modifications and cleanups.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
d0930a2d42c5a28039d8cc2376a7dff4e59c5f7a 17-Jan-2010 Corentin Chary <corentincj@iksaif.net> asus-laptop: rename wireless_status to wlan_status to avoid confusion

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
e5593bf18be79b4897c7ec8b392dc7f07cbc1b11 17-Jan-2010 Corentin Chary <corentincj@iksaif.net> asus-laptop: add error check for write_acpi_int calls

Also add to helpers for bluetooth and wlan.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
d99b577c729c4a29679fb1f605f9ccace154e0e5 22-Jan-2010 Corentin Chary <corentin.chary@gmail.com> asus-laptop: stop using ASUS_HANDLE and use relative methods instead

Stop using ASUS_HANDLE because most of the time it is not needed.
This macro was introduced to display_get and lcd_switch which are not
part of the interface provided by Asus, and are scheduled for removal.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
4d4415138060870670a18d0768fe1d597f505f98 13-Jan-2010 Corentin Chary <corentincj@iksaif.net> asus-laptop: rename function talking directly to acpi with asus_xxx scheme

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
17e78f6260fbc8f55c279cca081c26c88d96ec00 13-Jan-2010 Corentin Chary <corentincj@iksaif.net> asus-laptop: removing read_status/store_status/write_status and asus->status

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
3e68ae7c2a9076a694e46f49ec26323a7757eaad 13-Jan-2010 Corentin Chary <corentincj@iksaif.net> asus-laptop: stop using read_status for lcd

(anyway lcd code is scheduled for removal)

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
6358bf2c4c309efc7c3cbc36466c32108c12c456 13-Jan-2010 Corentin Chary <corentincj@iksaif.net> asus-laptop: stop using read_status and store_status for GPS

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
aa9df930d6eabbd8f2439eca6b2f77f81ce425f2 13-Jan-2010 Corentin Chary <corentincj@iksaif.net> asus-laptop: stop using read_status for bluetooth and wlan

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
be4ee82d3e44c5940a7f77cae5ed3e942e80a723 06-Dec-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: code movement

The asus-laptop driver implements a number of interfaces like the
backlight class driver. This change makes it easier to examine the
implementation of one interface at at a time, without having to search
through the file to find init() and exit() functions etc.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
9129d14d297e78bc21caffa44d55a5920a74862c 01-Dec-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: callbacks should use "driver data" parameter or field

(Changelog stolen from Alan's patch for eeepc-laptop, but this patch
does the same thing for asus-laptop)

Callback methods should not refer to a variable like "asus" (formally
"hotk"). Instead, they should extract the data they need either from
a "driver data" parameter, or the "driver data" field of the object
which they operate on. The "asus" variable can then be removed.

In practice, drivers under "drivers/platform" can get away without using
driver data, because it doesn't make sense to have more than one
instance of them. However this makes it harder to review them for
correctness. This is especially true for core ACPI developers who have
not previously been exposed to this anti-pattern :-).

This will serve as an example of best practice for new driver writers
(whether they find it themselves, or have it pointed out during review
:-).

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
7c247645f305da2bb309fa439fd6cc0aa26f8722 30-Nov-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: move backlight and dsdt info inside asus_laptop struct

Prepare the use of "driver data" for callbacks.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
50a90c4d953fe4bb5a87ee5207c4243d25278189 30-Nov-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: revise names

asus-laptop now does a lot more than just hotkeys. Replace the "hotk"
names used throughout the driver with some slightly more appropriate
names. The actual strings used in kernel messages and sysfs are left
unchanged.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
600ad5201d3b9b87159ede7359adccb98635fd48 30-Nov-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: change initialization order

Clean asus-laptop initialization to match new eeepc-laptop code.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
619d8b1187f2e13f6f848b1b2a4d83c2c9e2a140 28-Nov-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: remove unecessary hotk != NULL check

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
91687cc89af4c447483ec65097809c38c8622639 28-Nov-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: use tabs to indent macros and remove unused ones

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
d8c6732382a24d2ef23665207263a17f04e3d75a 28-Nov-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: simplify write_acpi_int

We only need a buffer for "INIT". Adds write_acpi_init_ret for it.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
e5b50f6a2b00de266f03c2c7219b798648124ea5 28-Nov-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: no need to check argument of set_brightness()

We already tell the backlight class our maximum brightness value; it
will validate the user requested values for us.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
0e875f4905817c03ba49447b49af093552e66e95 10-Jan-2010 Corentin Chary <corentincj@iksaif.net> asus-laptop: add wireless and bluetooth status parameter

These to parameter allow to set the status of wlan and bluetooth
device when the module load. On some models, the device will
always be down on boot, so the default behavior is to always
enable these devices.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
/drivers/platform/x86/asus-laptop.c
d951d4cc84e8b5ddb8e0ab81cf6a72cc73fdd668 07-Dec-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: change light sens default values.

The light sensor disable brightness key and
/sys/class/backlight/ control. There was a lot of report
from users who didn't understand why they couldn't change their
brightness, including:

https://bugs.launchpad.net/bugs/222171
https://bugzilla.novell.com/show_bug.cgi?id=514747
http://bugzilla.kernel.org/show_bug.cgi?id=13671
http://bugzilla.kernel.org/show_bug.cgi?id=14432

Now the light sensor is disabled, and if the user want to enable
it, the level should be ok.

The funny thing is that comments where ok, not code.

Cc: stable@kernel.org
Cc: Thomas Renninger <trenn@suse.de>
Cc: Peter Küppers <peter-mailbox@web.de>
Cc: Michael Franzl <michaelfranzl@gmx.at>
Cc: Ian Turner <vectro@vectro.org>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
1f0233eee9b385d78fda78626136c43e045082f7 03-Dec-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: Add wlan switch found on V6V

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
14f8af311e7d3e4198cbaade84a34f86505dcb37 03-Dec-2009 Ike Panhc <ike.pan@canonical.com> asus-laptop: add Lenovo SL hotkey support

Lenovo SL series laptop has a very similar DSDT with Asus laptops. We can
easily have the extra ACPI function support with little modification in
asus-laptop.c

Here is the hotkey enablement for Lenovo SL series laptop.

This patch will enable the following hotkey:
- Volumn Up
- Volumn Down
- Mute
- Screen Lock (Fn+F2)
- Battery Status (Fn+F3)
- WLAN switch (Fn+F5)
- Video output switch (Fn+F7)
- Touchpad switch (Fn+F8)
- Screen Magnifier (Fn+Space)

The following function of Lenovo SL laptop is still need to be enabled:
- Hotkey: KEY_SUSPEND (Fn+F4), KEY_SLEEP (Fn+F12), Dock Eject (Fn+F9)
- Rfkill for bluetooth and wlan
- LenovoCare LED
- Hwmon for fan speed
- Fingerprint scanner
- Active Protection System

Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
16851f92a5998bf8880a7401898ecfe351913854 03-Dec-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: use KEY_F13 to map "Disable Touchpad" event

The same key is used in toshiba-laptop, and there is no
reserved key for that.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
edf624522757adec8ceb83a4b97747eba645c454 03-Dec-2009 Alan Jenkins <alan-jenkins@tuffmail.co.uk> asus-laptop: set acpi_driver.owner

The owner field provides the link between drivers and modules in sysfs,
but no ACPI driver was setting it.

After setting the owner field, we can see which module provides which
driver and vice versa by looking at /sys/bus/acpi/driver/*/module and
/sys/module/*/drivers/acpi:*.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
b7fab7a0703a9d3a3b4b59aa2f7b098b2b83b8fe 03-Dec-2009 Alan Jenkins <alan-jenkins@tuffmail.co.uk> asus-laptop: Remove uneccesary acpi_disabled check

acpi_bus_register_driver() already checks acpi_disabled, so acpi bus
drivers don't need to.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
1df8d8d4efb7bce0e44d2aa91c4c0fa7ffe613c0 03-Dec-2009 Alan Jenkins <alan-jenkins@tuffmail.co.uk> asus-laptop: Remove redundant NULL checks

The acpi device callbacks add, start, remove, suspend and resume can
never be called with a NULL acpi_device. Each callsite in acpi/scan.c
has to dereference the device in order to get the ops structure, e.g.

struct acpi_device *acpi_dev = to_acpi_device(dev);
struct acpi_driver *acpi_drv = acpi_dev->driver;

if (acpi_drv && acpi_drv->ops.suspend)
return acpi_drv->ops.suspend(acpi_dev, state);

Remove all checks for acpi_dev == NULL within these callbacks.

Also remove the checks for acpi_driver_data(acpi_dev) == NULL. None of
these checks could fail unless the driver does something strange
(which none of them do), the acpi core did something terribly wrong,
or we have a memory corruption issue. If this does happen then it's
best to dereference the pointer and crash noisily.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
be96666065fd36ccfa09a13903d31d7ff5f4ef91 29-Aug-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: Fix coding style for comments

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
0aa20f7d720ed1feeb74df8c63a6427d9a2d3ebd 28-Aug-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: Add "calculator" hotkey

Found on UX50V.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
4644d0e5bd1412bbaed77e46c0c3376c6d060a74 28-Aug-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: Add suport for another "Media" key

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
dc79526078d2c0f01445e54e1d9fdf7c15ffd63d 28-Aug-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: handle keyboard backlight keys

Add support for the Fn+F3/Fn+F4 keys and map them
as KEY_KBDILLUMUP and KEY_KBDILLUMDOWN.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
b7d3fbc2ed624cc216adda0f2574570e6d6d6aed 28-Aug-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: Add support for Keyboard backlight

Add support for keyboard backlight found in Asus U50VG.

The SMC driver for the Apples does it via LED. To be
consistent with that we create /sys/class/leds/asus::kbd_backlight/
to control the keyboard backlight.

SLKB and GLKB are used to get/set the backlight. On
the U50VG is supports 4 brightness level, but this may
change with other models.

SLKB take a 8 bit integer where the higher bit is used
to toggle the backlight, and the over 7 bits control the
brightness level.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
977c328d81e31fde70c5ba381d9cf7357451dd74 28-Aug-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: set maximum led brightness

Set the right maximum brightness which is one, because
they can only be on or off.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
f641375b65f64e83be8be68ae1ebce21ee4fd578 28-Aug-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: Map X50R hotkeys

Map some new hotkeys found on X50R.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
abfa57e15acaa6e1ec567c250e5212bc55d79e43 28-Aug-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: Add *_led_get() functions

Add support for getting led brightness directly from
the hardware. Currently we don't need it, but it is needed
to support keyboard backlight/led.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
1d4a3800c764d111d67462a14589ed1611b2f55e 28-Aug-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: Show HRWS in infos and fix output format

Show HRWS in /sys/platform/devices/asus-laptop/infos.
HRWS is a bitfield used to get information about Hardware
available in the laptop.
Also change sprintf format from 0x%04x to %#x.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
2fcc23da5522b89677fb0af6043a88e88fdd09a2 19-Jun-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: use pr_fmt and pr_<level>

Convert the unusual printk(ASUS_<level> uses to
the more standard pr_fmt and pr_<level>(.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
116bf2e010a0600371aede450351973821dfd9e2 16-Jun-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: platform dev as parent for led and backlight

Makes asus-laptop platform device the parent device of
backlight and led classes.

With this patch, leds and backlight are also available in
/sys/devices/platform/asus-laptop/ like thinkpad_acpi.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
586ed1604fd6137cae1e8ede8143c3b8897306fd 30-Apr-2009 Bjorn Helgaas <bjorn.helgaas@hp.com> ACPI: asus-laptop: use .notify method instead of installing handler directly

This patch adds a .notify() method. The presence of .notify() causes
Linux/ACPI to manage event handlers and notify handlers on our behalf,
so we don't have to install and remove them ourselves.

This driver apparently relies on seeing ALL notify events, not just
device-specific ones (because it used ACPI_ALL_NOTIFY). We use the
ACPI_DRIVER_ALL_NOTIFY_EVENTS driver flag to request all events.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
CC: Corentin Chary <corentincj@iksaif.net>
CC: acpi4asus-user@lists.sourceforge.net
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
309f5fbda37d5e8f1233e8b80b8e9de77262e864 27-Apr-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: fix input keycode

KEY_STOP is now KEY_STOPCD
It's the correct key to stop a media
BTN_EXTRA is now KEY_SCREENLOCK:
The laptop manual tells us that this key is for screenlock
KEY_TV is now KEY_PROG1
So it can be reported to X server

Ref: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/361505

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
6050c8dd70b21a9d927983aeb6357fecffa7fb23 15-Feb-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: restore acpi_generate_proc_event()

Restore acpi_generate_proc_event() for backward
compatibility with old acpi scripts.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
ed6f44215374d94c35cbe98b582d004b9a3f5fbe 20-Jan-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: fix label indentation

Fix the label indentation

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
034ce90a8d1051deaeb31bae7f26ff1440a5b988 20-Jan-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: hotkeys via the generic input interface

This patch is based on eeepc-laptop.c and the patchs
from Nicolas Trangez and Daniel Nascimento (mainly for the keymap).

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
2a7dc0d8c60325e9bf820900bf919430e5a419ab 20-Jan-2009 Corentin Chary <corentincj@iksaif.net> asus-laptop: use generic netlink interface

To be prepared for /proc/acpi/event removal we export events
also through generic netlink interface.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c
41b16dce390510f550a4d2b12b98e0258bbed6e2 01-Dec-2008 Len Brown <len.brown@intel.com> create drivers/platform/x86/ from drivers/misc/

Move x86 platform specific drivers from drivers/misc/
to a new home under drivers/platform/x86/.

The community has been maintaining x86 vendor-specific
platform specific drivers under /drivers/misc/ for a few years.
The oldest ones started life under drivers/acpi.
They moved out of drivers/acpi/ because they don't actually
implement the ACPI specification, but either simply
use ACPI, or implement vendor-specific ACPI extensions.

In the future we anticipate...
drivers/misc/ will go away.
other architectures will create drivers/platform/<arch>

Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/platform/x86/asus-laptop.c