Commit graph

460 commits

Author SHA1 Message Date
Linus Torvalds
b037bba71b Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86: (45 commits)
  compal-laptop: Make it depend on CONFIG_RFKILL
  classmate-laptop: Added some keys present in other devices
  MAINTAINERS: Add git tree to x86 Platform Drivers
  asus-acpi: remove duplicate comparison of asus_model strings
  toshiba-acpi: fix multimedia keys on some machines
  dell-laptop: Fix errors on failure and exit paths
  dell-laptop: Fix build error by making buffer_mutex static
  asus-laptop: fix style problems reported by checkpath.pl
  asus-laptop: use device_create_file() instead of platform_group
  asus-laptop: clean led code
  asus-laptop: add gps rfkill
  asus-laptop: set initial lcd state
  asus-laptop: leds, remove dead code and fix asus_led_exit()/asus_led_init()
  asus-laptop: add backlight changes notifications
  asus-laptop: add bluetooth keys found on M9V
  asus-laptop: switch to sparse keymap library
  asus-laptop: rename wireless_status to wlan_status to avoid confusion
  asus-laptop: add error check for write_acpi_int calls
  asus-laptop: stop using ASUS_HANDLE and use relative methods instead
  asus-laptop: rename function talking directly to acpi with asus_xxx scheme
  ...
2010-03-03 07:41:24 -08:00
Ingo Molnar
51c1410bd6 compal-laptop: Make it depend on CONFIG_RFKILL
-tip testing found this build failure (x86 randconfig):

 drivers/built-in.o: In function `setup_rfkill':
 compal-laptop.c:(.text+0x36abe8): undefined reference to `rfkill_alloc'
 compal-laptop.c:(.text+0x36abfc): undefined reference to `rfkill_register'
 compal-laptop.c:(.text+0x36ac30): undefined reference to `rfkill_alloc'
 compal-laptop.c:(.text+0x36ac44): undefined reference to `rfkill_register'

Which can happen with CONFIG_COMPAL_LAPTOP=y but COMPAL_LAPTOP=m.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
2010-03-02 09:53:45 -05:00
Matthew Garrett
a58db59a26 Merge branch 'for-upstream/platform-x86_tpacpi' of git://repo.or.cz/linux-2.6/linux-acpi-2.6/ibm-acpi-2.6 into x86-platform 2010-03-02 09:51:48 -05:00
Thadeu Lima de Souza Cascardo
881a6c25a8 classmate-laptop: Added some keys present in other devices
Some new devices have extra keys, which we add to our list. Currently,
they all generate events that allow us to use a simple table/array,
without need for the sparse keymap.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
2010-03-01 16:15:58 -05:00
Linus Torvalds
bc53515413 Merge branch 'acpica' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'acpica' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
  ACPI: replace acpi_integer by u64
  ACPICA: Update version to 20100121.
  ACPICA: Remove unused uint32_struct type
  ACPICA: Disassembler: Remove obsolete "Integer64" field in parse object
  ACPICA: Remove obsolete ACPI_INTEGER (acpi_integer) type
  ACPICA: Predefined name repair: fix NULL package elements
  ACPICA: AcpiGetDevices: Eliminate unnecessary _STA calls
  ACPICA: Update all ACPICA copyrights and signons to 2010
  ACPICA: Update for new gcc-4 warning options
2010-03-01 10:36:22 -08:00
Roel Kluin
6268f50df8 asus-acpi: remove duplicate comparison of asus_model strings
These tests already occur elsewhere

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Karol Kozimor <sziwan@users.sourceforge.net>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2010-03-01 13:26:22 -05:00
Matthew Garrett
db38a29111 Merge git://git.iksaif.net/acpi4asus into x86-platform 2010-03-01 09:57:40 -05:00
Frans Pop
b466301b84 toshiba-acpi: fix multimedia keys on some machines
Some Toshibas only send ACPI events on key down, not key release. Ignore
any release events and send key down and key up events on every ACPI key
down event.

Signed-off-by: Frans Pop <elendil@planet.nl>
2010-03-01 09:50:46 -05:00
Matthew Garrett
92e00e47b6 dell-laptop: Fix errors on failure and exit paths
Make sure that work is cancelled after removing the i8042 filter, and
unregister the platform device rather than deleting it.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2010-03-01 09:46:43 -05:00
Ingo Molnar
94d8f785dd dell-laptop: Fix build error by making buffer_mutex static
The following build bug (x86, allyesconfig):

  arch/x86/oprofile/built-in.o:(.data+0x250): multiple definition of `buffer_mutex'

Was triggered in -tip testing, caused by this upstream commit:

  116ee77: dell-laptop: Use buffer with 32-bit physical address

There's multiple buffer_mutex's in the kernel. Make this new one
static.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
2010-03-01 09:43:52 -05:00
Corentin Chary
b1a96e3606 Merge branch 'eeepc-laptop' into acpi4asus 2010-02-28 19:36:06 +01:00
Corentin Chary
060cbce6c4 asus-laptop: fix style problems reported by checkpath.pl
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
2010-02-28 19:35:13 +01:00
Corentin Chary
2a1fd64cb7 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>
2010-02-28 19:35:13 +01:00
Corentin Chary
aee0afb8cb asus-laptop: clean led code
Remove all "templates" and add a generic struct asus_led instead.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
2010-02-28 19:35:13 +01:00
Corentin Chary
18e1311ee7 asus-laptop: add gps rfkill
The rfkill subsystem will enable gps by default.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
2010-02-28 19:35:13 +01:00
Corentin Chary
47ee0e9952 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>
2010-02-28 19:35:13 +01:00
Corentin Chary
75747129a9 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>
2010-02-28 19:35:12 +01:00
Corentin Chary
a539df5e15 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>
2010-02-28 19:35:12 +01:00
Corentin Chary
7f607d7106 asus-laptop: add bluetooth keys found on M9V
Reported by Andrey F. Ilchuk

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
2010-02-28 19:35:12 +01:00
Corentin Chary
66a71dd1f7 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>
2010-02-28 19:35:12 +01:00
Corentin Chary
d0930a2d42 asus-laptop: rename wireless_status to wlan_status to avoid confusion
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
2010-02-28 19:35:12 +01:00
Corentin Chary
e5593bf18b 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>
2010-02-28 19:35:12 +01:00
Corentin Chary
d99b577c72 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>
2010-02-28 19:35:11 +01:00
Corentin Chary
4d44151380 asus-laptop: rename function talking directly to acpi with asus_xxx scheme
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
2010-02-28 19:35:11 +01:00
Corentin Chary
17e78f6260 asus-laptop: removing read_status/store_status/write_status and asus->status
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
2010-02-28 19:35:11 +01:00
Corentin Chary
3e68ae7c2a asus-laptop: stop using read_status for lcd
(anyway lcd code is scheduled for removal)

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
2010-02-28 19:35:11 +01:00
Corentin Chary
6358bf2c4c asus-laptop: stop using read_status and store_status for GPS
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
2010-02-28 19:35:11 +01:00
Corentin Chary
aa9df930d6 asus-laptop: stop using read_status for bluetooth and wlan
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
2010-02-28 19:35:11 +01:00
Corentin Chary
be4ee82d3e 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>
2010-02-28 19:35:10 +01:00
Corentin Chary
9129d14d29 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>
2010-02-28 19:35:10 +01:00
Corentin Chary
7c247645f3 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>
2010-02-28 19:35:10 +01:00
Corentin Chary
50a90c4d95 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>
2010-02-28 19:35:10 +01:00
Corentin Chary
600ad5201d asus-laptop: change initialization order
Clean asus-laptop initialization to match new eeepc-laptop code.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
2010-02-28 19:35:10 +01:00
Corentin Chary
619d8b1187 asus-laptop: remove unecessary hotk != NULL check
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
2010-02-28 19:35:09 +01:00
Corentin Chary
91687cc89a asus-laptop: use tabs to indent macros and remove unused ones
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
2010-02-28 19:35:09 +01:00
Corentin Chary
d8c6732382 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>
2010-02-28 19:35:09 +01:00
Corentin Chary
e5b50f6a2b 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>
2010-02-28 19:35:09 +01:00
Corentin Chary
0e875f4905 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>
2010-02-28 19:35:09 +01:00
Alan Jenkins
bc9d24a3ae eeepc-laptop: check wireless hotplug events
Before we mark the wireless device as unplugged, check PCI config space
to see whether the wireless device is really disabled (and vice versa).
This works around newer models which don't want the hotplug code, where
we end up disabling the wired network device.

My old 701 still works correctly with this.  I can also simulate an
afflicted model by changing the hardcoded PCI bus/slot number in the
driver, and it seems to work nicely (although it is a bit noisy).

In future this type of hotplug support will be implemented by the PCI
core.  The existing blacklist and the new warning message will be
removed at that point.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
2010-02-28 19:30:57 +01:00
Alan Jenkins
ced69c5981 eeepc-laptop: disable wireless hotplug for 1005PE
The wireless hotplug code is not needed on this model, and it disables
the wired ethernet card.  (Like on the 1005HA and 1201N).

References: <http://lists.alioth.debian.org/pipermail/debian-eeepc-devel/2010-February/003281.html>

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Reported-by: Ansgar Burchardt <ansgar@43-1.org>
CC: stable@kernel.org
2010-02-28 19:30:57 +01:00
Henrique de Moraes Holschuh
88cc83772a thinkpad-acpi: fix ALSA callback return status
Clemens Ladisch reports that thinkpad-acpi improperly implements the
ALSA API, and always returns 0 for success for the "put" callbacks
while the API requires it to return "1" when the control value has
been changed in the hardware/firmware.

Rework the volume subdriver to be able to properly implement the ALSA
API.  Based on a patch by Clemens Ladisch <clemens@ladisch.de>.

This fix is also needed on 2.6.33.

Reported-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: stable@kernel.org
2010-02-27 18:45:29 -03:00
Henrique de Moraes Holschuh
b525c06cdb thinkpad-acpi: lock down video output state access
Given the right combination of ThinkPad and X.org, just reading the
video output control state is enough to hard-crash X.org.

Until the day I somehow find out a model or BIOS cut date to not
provide this feature to ThinkPads that can do video switching through
X RandR, change permissions so that only processes with CAP_SYS_ADMIN
can access any sort of video output control state.

This bug could be considered a local DoS I suppose, as it allows any
non-privledged local user to cause some versions of X.org to
hard-crash some ThinkPads.

Reported-by: Jidanni <jidanni@jidanni.org>
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: stable@kernel.org
2010-02-25 22:22:22 -03:00
Henrique de Moraes Holschuh
08fedfc903 thinkpad-acpi: fix bluetooth/wwan resume
Studying the DSDTs of various thinkpads, it looks like bit 3 of the
argument to SBDC and SWAN is not "set radio to last state on resume".
Rather, it seems to be "if this bit is set, enable radio on resume,
otherwise disable it on resume".

So, the proper way to prepare the radios for S3 suspend is: disable
radio and clear bit 3 on the SBDC/SWAN call to to resume with radio
disabled, and enable radio and set bit 3 on the SBDC/SWAN call to
resume with the radio enabled.

Also, for persistent devices, the rfkill core does not restore state,
so we really need to get the firmware to do the right thing.

We don't sync the radio state on suspend, instead we trust the BIOS to
not do anything weird if we never touched the radio state since boot.
Time will tell if that's a wise way of doing things...

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: stable@kernel.org
2010-02-25 22:22:07 -03:00
Henrique de Moraes Holschuh
7f0cf712a7 thinkpad-acpi: make driver events work in NVRAM poll mode
Thadeu Lima de Souza Cascardo reports this:

Brightness notification does not work until the user writes to
hotkey_mask attribute.  That's because the polling thread will only run
if hotkey_user_mask is set and someone is reading the input device or
if hotkey_driver_mask is set.  In this second case, this condition is
not tested after the mask is changed, because the brightness and
volume drivers are started after the hotkey drivers.

Fix tpacpi_hotkey_driver_mask_set() to call hotkey_poll_setup(), so
that the poller kthread will be started when needed.

Reported-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Tested-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: stable@kernel.org
2010-02-25 21:37:23 -03:00
Henrique de Moraes Holschuh
b589ea4c44 thinkpad-acpi: fix poll thread auto-start
The driver was not starting the NVRAM polling thread if the input
device was bound immediately after registration.

This fixes:
http://bugzilla.kernel.org/show_bug.cgi?id=15118

Reported-by: Florian Zumbiehl <florz@florz.de>
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: stable@kernel.org
2010-02-25 21:34:23 -03:00
Henrique de Moraes Holschuh
7d1894d8d1 thinkpad-acpi: R52 brightness_mode has been confirmed
We can stop pestering users for confirmation of the brightness_mode
default for firmware TP-76.

While at it, add a few missing comments in that quirk table.

Reported-by: Whoopie <whoopie79@gmx.net>
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: stable@kernel.org
2010-02-25 21:33:54 -03:00
Henrique de Moraes Holschuh
bf8b29c8f7 thinkpad-acpi: document HKEY event 3006
Event 0x3006 is used to help power management of the ODD in the
UltraBay.  The EC generates this event when the ODD eject button is
pressed (even if the bay is powered down).

Normally, Linux doesn't need this as we keep the SATA link powered
up (which wastes power).  The EC powers up the bay by itself when the
ODD eject button is pressed, and the SATA PHY reports the hotplug.

However, we could also power that SATA link down (and for that matter,
also power down the Ultrabay) if the ODD is left idle for a while with
no disk inside, and use event 0x3006 to know when we need that SATA link
powered back up.

For now, just stop asking for more information when event 0x3006 is
seen, there is no point in pestering users about it anymore.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: stable@kernel.org
2010-02-25 21:28:56 -03:00
Matthew Garrett
6335e4d566 toshiba_acpi: Add full hotkey support
Calling the ENAB method on Toshiba laptops results in notifications being
sent when laptop hotkeys are pressed.  This patch simply calls that method
and sets up an input device if it's successful.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-02-25 15:20:54 -05:00
Matthew Garrett
caeacf59af hp-wmi: Add support for tablet rotation key
The HP touchsmart tablet has a key for rotating the UI from landscape to
portrait. Add support for it.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-02-25 11:50:54 -05:00
Erik Andren
cb6a7937f4 dell-laptop: Add another Dell laptop to the DMI whitelist
The Latitude C640 has another variation of dell in its DMI vendor entry.
Add it to the whitelist in order to enjoy the sweet fruits of software
backlight toggling.

Signed-off-by: Erik Andren <erik.andren@gmail.com>
2010-02-25 11:50:53 -05:00