summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/asus-laptop.c
AgeCommit message (Collapse)Author
2013-02-27asus-laptop: always report brightness key eventsCorentin Chary
Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24asus-laptop: add all video switch keysAceLan Kao
Fill up all the video switch keys in the map. Signed-off-by: AceLan Kao <acelan.kao@canonical.com> Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24asus-laptop: correct a touchpad hotkey mappingAceLan Kao
0x60 is touchpad enable key, but is misdefined in the keymap. Signed-off-by: AceLan Kao <acelan.kao@canonical.com> Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24asus-{nb-wmi|laptop}.c: sync keymapsCorentin Chary
Maybe this should be shared in another module... Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24asus-laptop: map some new keysCorentin Chary
Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-01-25ACPI: Remove useless type argument of driver .remove() operationRafael J. Wysocki
The second argument of ACPI driver .remove() operation is only used by the ACPI processor driver and the value passed to that driver through it is always available from the given struct acpi_device object's removal_type field. For this reason, the second ACPI driver .remove() argument is in fact useless, so drop it. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Jiang Liu <jiang.liu@huawei.com> Acked-by: Toshi Kani <toshi.kani@hp.com> Acked-by: Yinghai Lu <yinghai@kernel.org>
2013-01-07asus-laptop: Fix potential invalid pointer dereferenceMatthew Garrett
The 0-day build testing backend noticed that a string could be dereferenced without validation. Fix that. Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-01-07asus-laptop: Do not call HWRS on initBen Hutchings
Since commit 8871e99f89b7 ('asus-laptop: HRWS/HWRS typo'), module initialisation is very slow on the Asus UL30A. The HWRS method takes about 12 seconds to run, and subsequent initialisation also seems to be delayed. Since we don't really need the result, don't bother calling it on init. Those who are curious can still get the result through the 'infos' device attribute. Update the comment about HWRS in show_infos(). Reported-by: ryan <draziw+deb@gmail.com> References: http://bugs.debian.org/692436 Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-01-03Drivers: platform: x86: remove __dev* attributes.Greg Kroah-Hartman
CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Cc: Joey Lee <jlee@novell.com> Cc: Matthew Garrett <mjg@redhat.com> Cc: Peter Feuerer <peter@piie.net> Cc: Corentin Chary <corentin.chary@gmail.com> Cc: Cezary Jackiewicz <cezary.jackiewicz@gmail.com> Cc: Robert Gerlach <khnz@gmx.de> Cc: Ike Panhc <ike.pan@canonical.com> Cc: Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-13platform/x86: fix asus_laptop.wled_type descriptionMaxim Nikulin
MODULE_PARM_DESC for wlan_status is further in the same file Signed-off-by: Maxim A. Nikulin <M.A.Nikulin@gmail.com> Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-09-13asus-laptop: HRWS/HWRS typoCorentin Chary
Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=24222 Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20asus-laptop: add some keys found on Lenovo SL500Corentin Chary
Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20asus-laptop: check WLED and BLED presence before adding rfkillCorentin Chary
Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20asus-laptop: add rfkill interfaces for wlan and wwanCorentin Chary
But don't try to do than on pegatron tablets to avoid any conflict. Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20asus-laptop: control how BLED and WLED should be exposedCorentin Chary
Let the user tells if BLED and WLED should be exposed as led or rfkill (the old sysfs are still here, but this adds a standard interface to control the device). For example on my A6JC, with WAPF=1, I would do: $ modprobe asus-laptop wled_type=led bluetooth_type=rfkill There is still no known way to automatically guess what BLED and WLED methods will control, it's why user information is needed. A userspace database could do that automatically, and maybe some DMI matching in the driver. Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20asus-laptop: cleanup rfkill codeCorentin Chary
Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20asus-laptop: log unknown keysCorentin Chary
Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-01-04switch ->is_visible() to returning umode_tAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2011-10-24asus-laptop: Add rfkill support for Pegatron Lucid tabletAnisse Astier
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>
2011-10-24asus-laptop: pega_accel - Report accelerometer orientation change through udevAnisse Astier
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>
2011-10-24asus-laptop: fix module descriptionCorentin Chary
Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24asus-laptop: hide leds on Pegatron LucidCorentin Chary
Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24asus-laptop: Pegatron Lucid accelerometerAndy Ross
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>
2011-10-24asus-laptop: allow boot time control of Pegatron ALS sensorAndy Ross
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>
2011-10-24platform-drivers-x86: asus-laptop: fix wrong test for successful registered ↵Axel Lin
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>
2011-10-24asus-laptop: Pegatron Lucid ALS sensorAndy Ross
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>
2011-10-24asus-laptop: Platform detection for Pegatron LucidAndy Ross
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>
2011-08-05asus-wmi: add CWAP support and clarify the meaning of WAPF bitsCorentin Chary
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>
2011-05-27asus: Add pr_fmt and convert printks to pr_<level>Joe Perches
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>
2011-03-28platform-drivers: x86: fix common misspellingsLucas De Marchi
Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-03-28asus-laptop: remove deprecated interfaces (lcd_switch and display_get)Corentin Chary
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>
2011-03-28asus-laptop: let WLED alone on L1400BCorentin Chary
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>
2011-03-23backlight: add backlight typeMatthew Garrett
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>
2010-12-22Merge branch 'master' into for-nextJiri Kosina
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.
2010-11-24asus-laptop: add wimax and wwan supportCorentin Chary
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>
2010-11-16backlight: constify backlight_opsLionel Debroux
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>
2010-10-21asus-laptop: use attribute group to manage attributesDmitry Torokhov
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>
2010-10-21asus-laptop: remove no longer used keycode_map fieldDmitry Torokhov
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>
2010-10-21asus-laptop: fix gps rfkillCorentin Chary
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>
2010-10-21asus-laptop: Add key found on Asus N61JQCorentin Chary
Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21platform-x86: sync eeepc-laptop and asus-laptopCorentin Chary
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>
2010-08-03asus-laptop: fix asus_input_init error pathAxel Lin
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>
2010-08-03asus-laptop: fix wapf, wlan_status and bluetooth_status module_param permissionsAxel Lin
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>
2010-08-03asus-laptop: return proper error for store_ledd if write_acpi_int failAxel Lin
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>
2010-08-03asus-laptop: fix incorrect return value for write_acpi_int_ret if handle is NULLAxel Lin
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>
2010-08-03asus-laptop: fix a memory leak in asus_laptop_get_info error pathAxel Lin
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>
2010-04-12asus: don't modify bluetooth/wlan on bootDan Carpenter
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>
2010-04-05Merge branch 'master' into export-slabhTejun Heo
2010-03-31asus-laptop: fix warning in asus_handle_initCorentin Chary
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>
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo
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>