aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/asus-laptop.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2007-08-25Pull events into release branchLen Brown1-1/+1
Conflicts: drivers/acpi/video.c Signed-off-by: Len Brown <len.brown@intel.com>
2007-08-24asus-laptop: Fix rmmod of asus_laptopGuillaume Chazarain1-1/+2
The asus laptop driver conditionnaly registers leds in asus_led_register() depending on their availability, but unconditionnaly unregisters them all at exit time or when the module fails to load. Unregistering not registered leds result in the following Oops. So we should check before unregistering. [<c032d2f9>] do_page_fault+0x511/0x5e9 [<c032bae2>] error_code+0x6a/0x70 [<c026abf8>] device_unregister+0x26/0x32 [<f8864218>] led_classdev_unregister+0x58/0x94 [led_class] [<f88a90f8>] asus_led_exit+0x17/0x41 [asus_laptop] [<f88a91c9>] asus_laptop_exit+0xd/0x3f [asus_laptop] [<c013cee1>] sys_delete_module+0x17b/0x1a2 [<c0106eae>] sysenter_past_esp+0x6b/0xa1 EIP: [<c026a9a3>] device_del+0xb/0x23a SS:ESP 0068:f594ef0c Signed-off-by: Guillaume Chazarain <guichaz@yahoo.fr> Signed-off-by: Len Brown <len.brown@intel.com>
2007-08-23ACPI: Schedule /proc/acpi/event for removalLen Brown1-1/+1
Schedule /proc/acpi/event for removal in 6 months. Re-name acpi_bus_generate_event() to acpi_bus_generate_proc_event() to make sure there is no confusion that it is for /proc/acpi/event only. Add CONFIG_ACPI_PROC_EVENT to allow removal of /proc/acpi/event. There is no functional change if CONFIG_ACPI_PROC_EVENT=y Signed-off-by: Len Brown <len.brown@intel.com>
2007-07-25Pull auto-load-modules into release branchLen Brown1-2/+7
2007-07-23ACPI: autoload modules - Create __mod_acpi_device_table symbol for all ACPI driversThomas Renninger1-2/+7
modpost is going to use these to create e.g. acpi:ACPI0001 in modules.alias. Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2007-07-23ACPI: asus-laptop: Fix failure exitsAl Viro1-11/+21
> Subject : drivers/misc/asus-laptop.c:*: error: 'struct led_classdev' has no member named 'class_dev' > References : http://lkml.org/lkml/2007/7/22/299 > Submitter : Gabriel C <nix.or.die@googlemail.com> Fallout from f8a7c6fe14f556ca8eeddce258cb21392d0c3a2f. However, looking at it shows that checks done in ASUS_LED_UNREGISTER() can't trigger at all (we never get to asus_led_exit() if registration fails) and if that registration fails, we actually leak stuff. IOW, it's worse than just replacing class_dev with dev in there - the tests themselves had been papering over the lousy cleanup logics. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2007-07-19some kmalloc/memset ->kzalloc (tree wide)Yoann Padioleau1-2/+1
Transform some calls to kmalloc/memset to a single kzalloc (or kcalloc). Here is a short excerpt of the semantic patch performing this transformation: @@ type T2; expression x; identifier f,fld; expression E; expression E1,E2; expression e1,e2,e3,y; statement S; @@ x = - kmalloc + kzalloc (E1,E2) ... when != \(x->fld=E;\|y=f(...,x,...);\|f(...,x,...);\|x=E;\|while(...) S\|for(e1;e2;e3) S\) - memset((T2)x,0,E1); @@ expression E1,E2,E3; @@ - kzalloc(E1 * E2,E3) + kcalloc(E1,E2,E3) [akpm@linux-foundation.org: get kcalloc args the right way around] Signed-off-by: Yoann Padioleau <padator@wanadoo.fr> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Acked-by: Russell King <rmk@arm.linux.org.uk> Cc: Bryan Wu <bryan.wu@analog.com> Acked-by: Jiri Slaby <jirislaby@gmail.com> Cc: Dave Airlie <airlied@linux.ie> Acked-by: Roland Dreier <rolandd@cisco.com> Cc: Jiri Kosina <jkosina@suse.cz> Acked-by: Dmitry Torokhov <dtor@mail.ru> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org> Acked-by: Pierre Ossman <drzeus-list@drzeus.cx> Cc: Jeff Garzik <jeff@garzik.org> Cc: "David S. Miller" <davem@davemloft.net> Acked-by: Greg KH <greg@kroah.com> Cc: James Bottomley <James.Bottomley@steeleye.com> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-11sysfs: kill unnecessary attribute->ownerTejun Heo1-2/+1
sysfs is now completely out of driver/module lifetime game. After deletion, a sysfs node doesn't access anything outside sysfs proper, so there's no reason to hold onto the attribute owners. Note that often the wrong modules were accounted for as owners leading to accessing removed modules. This patch kills now unnecessary attribute->owner. Note that with this change, userland holding a sysfs node does not prevent the backing module from being unloaded. For more info regarding lifetime rule cleanup, please read the following message. http://article.gmane.org/gmane.linux.kernel/510293 (tweaked by Greg to not delete the field just yet, to make it easier to merge things properly.) Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-05-10asus-laptop: version bump and lindentCorentin Chary1-14/+15
Version bump, lindent, etc .. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-10asus-laptop: fix light sens initCorentin Chary1-1/+1
Fix a stupid light sens detection bug. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-10asus-laptop: add GPS supportCorentin Chary1-1/+54
Just adds GPS support found in R2H thanks to Sam Lin. It will make a "gps" file in /sys/devices/platform/asus-laptop/. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-10asus-laptop: notify ALL eventsCorentin Chary1-2/+2
We need to handle all events, because some dsdt use events >= 0x80 Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-11asus-laptop: version bumpCorentin Chary1-2/+2
Version and copyright bump. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-11asus-laptop: add wapf paramCorentin Chary1-0/+16
Add the "wapf" param. This param allows to define the behavior of the Fn F2 key (wlan switch). Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-11asus-laptop: add GLEDCorentin Chary1-1/+14
Add support for "gaming" led. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-11asus-laptop: clean write_statusCorentin Chary1-19/+29
Clean the write_status function, and implement special case with a switch inside write_status. It also make sure bt and wl status are right when booting with the hardware switch off. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-11asus-laptop: use acpi_evaluate_integer instead of read_acpi_intCorentin Chary1-34/+34
Use acpi_evaluate_integer() instead of read_acpi_int() Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-09asus-laptop: make code staticAdrian Bunk1-1/+1
This patch makes some needlessly global code static. Signed-off-by: Adrian Bunk <bunk@stusta.de> Cc: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-20backlight: Separate backlight properties from backlight ops pointersRichard Purdie1-8/+8
Per device data such as brightness belongs to the indivdual device and should therefore be separate from the the backlight operation function pointers. This patch splits the two types of data and allows simplifcation of some code. Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
2007-02-20backlight: Fix external uses of backlight internal semaphoreRichard Purdie1-15/+5
backlight_device->sem has a very specific use as documented in the header file. The external users of this are using it for a different reason, to serialise access to the update_status() method. backlight users were supposed to implement their own internal serialisation of update_status() if needed but everyone is doing things differently and incorrectly. Therefore add a global mutex to take care of serialisation for everyone, once and for all. Locking for get_brightness remains optional since most users don't need it. Also update the lcd class in a similar way. Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
2007-02-20backlight: Remove unneeded owner fieldRichard Purdie1-1/+0
Remove uneeded owner field from backlight_properties structure. Nothing uses it and it is unlikely that it will ever be used. The backlight class uses other means to ensure that nothing references unloaded code. Based on a patch from Dmitry Torokhov <dtor@insightbb.com> Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
2007-02-16ACPI: hotkey: remove driver, per feature-removal-schedule.txtLen Brown1-5/+0
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-03asus-laptop: merge with ACPICA table updateLen Brown1-6/+1
No longer need a buffer for a copy of the DSDT, just a pointer to the mapped table. Signed-off-by: Len Brown <len.brown@intel.com>
2007-01-30asus-laptop: LindentLen Brown1-124/+123
Signed-off-by: Len Brown <len.brown@intel.com>
2007-01-30asus-laptop: add light sensor supportCorentin Chary1-0/+84
/proc/acpi/asus/lslvl is now /sys/.../asus-laptop/ls_level /proc/acpi/asus/lssw is now /sys/.../asus-laptop/ls_switch nothing else .. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
2007-01-30asus-laptop: add ledd supportCorentin Chary1-0/+38
Ledd is a special led ... /sys/.../asus-laptop/ledd works like /proc/acpi/asus/ledd Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
2007-01-30asus-laptop: add display switching supportCorentin Chary1-0/+82
/sys/.../asus-laptop/display can now be used to switch displays like the old /proc/acpi/asus/disp does Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
2007-01-30asus-laptop: add backlight supportCorentin Chary1-1/+182
Adds backlight support using backlight class. We now change the brightness *and toggle the backlight !* via /sys/class/backlight/asus-laptop/. If the user switchs the backlight using the keyboard, asus_hotk_notify looks for ATKD_LCD_OFF and ATKD_LCD_ON events, and stores the right state into hotk->status and bd->props->power . Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
2007-01-30asus-laptop: add bluetooth and wlan supportCorentin Chary1-2/+113
WLED and BLED are not handled like other leds (MLED, etc ..), because sometime they also control the wlan/bluetooth device. If the method for wireless_status is found, it's used to get the status, otherwise hotk->status is used. We also use the HWRS method, which tell if the bluetooth/wlan device is present or not. This patch show why we need a ASUS_SET_DEVICE_ATTR macro : if there is a bluetooth device, /sys/dev.../asus-laptop/bluetooth is usable, else it's not but it's clean. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
2007-01-30asus-laptop: add led supportCorentin Chary1-0/+145
Add led support, using generic led class. Thomas Tuttle's patch <http://lkml.org/lkml/2006/7/6/247> was very usefull. We use hotk->status to store led status because it's very hard to find acpi method to get the right status... To reduce the code, I use a lot of macro (ASUS_LED, ASUS_LED_REGISTER, etc ...), because the code is the same for all leds ... Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
2007-01-30asus-laptop: add base driverCorentin Chary1-0/+530
Adds the new driver and make ASUS_LAPTOP and ACPI_ASUS incompatible. It may be strange to use ASUS_CREATE_DEVICE_ATTR and ASUS_SET_DEVICE_ATTR now, but these macro will be very usefull in next patchs. ASUS_HANDLE and ASUS_HANDLE_INIT comes from IBM_HANDLE and IBM_HANDLE_INIT, with some modification, and will also be used in next patchs. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>