1
0
Fork 0
Commit Graph

453 Commits (cbf3d262e0b70652d602b9c072daf1c1f29dccf0)

Author SHA1 Message Date
Henrique de Moraes Holschuh 10cc92759b ACPI: thinkpad-acpi: fluff really minor fix
Fix a minor (nano?) thing that bothered me at exactly at the wrong time.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 09:47:02 -04:00
Henrique de Moraes Holschuh af11610192 ACPI: thinkpad-acpi: add sysfs led class support to thinkpad leds (v3.2)
Add a sysfs led class interface to the led subdriver.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 09:47:02 -04:00
Henrique de Moraes Holschuh e306501d1c ACPI: thinkpad-acpi: add sysfs led class support for thinklight (v3.1)
Add a sysfs led class interface to the thinklight (light subdriver).

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 09:47:01 -04:00
Henrique de Moraes Holschuh 4fa6811b8a ACPI: thinkpad-acpi: prepare light and LED for sysfs support
Do some preparatory work to add sysfs support to the thinklight and
thinkpad leds driver.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 09:47:01 -04:00
Henrique de Moraes Holschuh 95e57ab2cb ACPI: thinkpad-acpi: claim tpacpi as an official short handle (v1.1)
Unfortunately, a lot of stuff in the kernel has size limitations, so
"thinkpad-acpi" ends up eating up too much real estate.  We were using
"tpacpi" in symbols already, but this shorthand was not visible to
userland.

Document that the driver will use tpacpi as a short hand where necessary,
and use it to name the kernel thread for NVRAM polling (now named
"ktpacpi_nvramd").

Also, register a module alias with the shorthand.  One can refer to the
module using the shorthand name.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 09:47:01 -04:00
Henrique de Moraes Holschuh e11aecf137 ACPI: thinkpad-acpi: fix brightness dimming control bug
ibm-acpi and thinkpad-acpi did not know about bit 5 of the EC backlight
level control register (EC 0x31), so it was always forced to zero on
any writes.

This would disable the BIOS option to *not* use a dimmer backlight level
scale while on battery, and who knows what else (there are two other
control bits of unknown function).

Bit 5 controls the "reduce backlight levels when on battery" optional
functionality (active low).  Bits 6 and 7 are better left alone as well,
instead of being forced to zero.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 09:47:01 -04:00
Henrique de Moraes Holschuh 2d5e94d7ca ACPI: thinkpad-acpi: rate-limit CMOS/EC unsynced error messages
If userspace applications mess with the CMOS NVRAM, or something causes
both the ACPI firmware and thinkpad-acpi to try to change the brightness at
the same time, it is possible to have the CMOS and EC registers for the
current brightness go out of sync.

Should that happen, thinkpad-acpi could be really obnoxious when using a
brightness_mode of 3 (both EC and CMOS).  Instead of complaining a massive
number of times, make sure to complain only once until EC and CMOS are back
in sync.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Joerg Platte <lists@naasa.net>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 09:47:00 -04:00
Henrique de Moraes Holschuh 8c74adbc69 ACPI: thinkpad-acpi: enhance box identification output (v2)
During initialization, thinkpad-acpi outputs some messages to make sure
releavant box identification information is easily available in-line with
the rest of the driver messages.

Enhance those messages to output the alfanumeric model number as well.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 09:47:00 -04:00
Henrique de Moraes Holschuh 9288902225 ACPI: thinkpad-acpi: warn once about weird hotkey masks
thinkpad-acpi knows for a while now how to best program the hotkeys by
default, and always enable them by default.  Unfortunately, this
information has not filtered down everywhere it needs to, yet.  Notably,
old ibm-acpi documentation and most "thinkpad setup guides" will have wrong
information on this area.

Warn the local admin once whenever any of the following patterns are met:

1. Attempts to set hotkey mask to 0xffff (artifact from docs and config
   for the old ibm-acpi driver and behaviour).  This mask makes no
   real-world sense;

2. Attempts to set hotkey mask to 0xffffffff, which means the user is
   trying to just have "everything work" without even reading the
   documentation, or that we need to get a bug report, because there
   is a new thinkpad out there with new exciting hot keys :-)

3. Attempts to set hotkey mask to 0xffffff, which is almost never the
   correct way to set up volume and brightness event reporting (and with
   the current state-of-the-art, it is known to never be right way to do
   it).

The driver will perform any and all requested operations, though,
regardless of any warnings.  I hope these warnings can be removed one or
two years from now.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 09:47:00 -04:00
Henrique de Moraes Holschuh b59727965d ACPI: thinkpad-acpi: BIOS backlight mode helper (v2.1)
Lenovo ThinkPads with generic ACPI backlight level control can be easily
set to react to keyboard brightness key presses in a more predictable way
than what they do when in "DOS / bootloader" mode after Linux brings
up the ACPI interface.

The switch to the ACPI backlight mode in the firmware is designed to be
safe to use only as an one way trapdoor.  One is not to force the firmware
to switch back to "DOS/bootloader" mode except by rebooting.  The mode
switch itself is performed by calling any of the ACPI _BCL methods at least
once.

When in ACPI mode, the backlight firmware just issues (standard) events for
the brightness up/down hot key presses along with the non-standard HKEY
events which thinkpad-acpi traps, and doesn't touch the hardware.

thinkpad-acpi will:

1. Place the ThinkPad firmware in ACPI backlight control mode
   if one is available
2. Suppress HKEY backlight change notifications by default
   to avoid double-reporting when ACPI video is loaded when
   the ThinkPad is in ACPI backlight control mode
3. Urge the user to load the ACPI video driver

The user is free to use either the ACPI video driver to get the brightness
key events, or to override the thinkpad-acpi default hotkey mask to get
them from thinkpad-acpi as well (this will result in duplicate events if
ACPI video is loaded, so let's hope distros won't screw this up).

Provided userspace is sane, all should work (and *keep* working), which is
more that can be said about the non-ACPI mode of the new Lenovo ThinkPad
BIOSes when coupled to current userspace and X.org drivers.

Full guidelines for backlight hot key reporting and use of the
thinkpad-acpi backlight interface have been added to the documentation.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 09:46:59 -04:00
David S. Miller 4d7ffa4990 kgdbts: Sparc needs sstep emulation.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-29 01:36:14 -07:00
Julia Lawall 9030062f3d ACPI: elide a non-zero test on a result that is never 0
thermal_cooling_device_register used to return NULL if THERMAL is "n".
As the ACPI fan, processor and video drivers SELECT the generic
thermal in PATCH 01, this is not a problem any more.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 02:52:45 -04:00
Zhang Rui 63c4ec905d thermal: add the support for building the generic thermal as a module
Build the generic thermal driver as module "thermal_sys".

Make ACPI thermal, video, processor and fan SELECT the generic
thermal driver, as these drivers rely on it to build the sysfs I/F.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 02:44:00 -04:00
Linus Torvalds 064922a805 Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (40 commits)
  [SCSI] jazz_esp, sgiwd93, sni_53c710, sun3x_esp: fix platform driver hotplug/coldplug
  [SCSI] aic7xxx: add const
  [SCSI] aic7xxx: add static
  [SCSI] aic7xxx: Update _shipped files
  [SCSI] aic7xxx: teach aicasm to not emit unused debug code/data
  [SCSI] qla2xxx: Update version number to 8.02.01-k2.
  [SCSI] qla2xxx: Correct regression in relogin code.
  [SCSI] qla2xxx: Correct misc. endian and byte-ordering issues.
  [SCSI] qla2xxx: make qla2x00_issue_iocb_timeout() static
  [SCSI] qla2xxx: qla_os.c, make 2 functions static
  [SCSI] qla2xxx: Re-register FDMI information after a LIP.
  [SCSI] qla2xxx: Correct SRB usage-after-completion/free issues.
  [SCSI] qla2xxx: Correct ISP84XX verify-chip response handling.
  [SCSI] qla2xxx: Wakeup DPC thread to process any deferred-work requests.
  [SCSI] qla2xxx: Collapse RISC-RAM retrieval code during a firmware-dump.
  [SCSI] m68k: new mac_esp scsi driver
  [SCSI] zfcp: Add some statistics provided by the FCP adapter to the sysfs
  [SCSI] zfcp: Print some messages only during ERP
  [SCSI] zfcp: Wait for free SBAL during exchange config
  [SCSI] scsi_transport_fc: fc_user_scan correction
  ...
2008-04-27 11:25:00 -07:00
Dean Nelson 2c2b94f93f [IA64] run drivers/misc/sgi-xp through scripts/checkpatch.pl
Addressed issues raised by scripts/checkpatch.pl. Removed unnecessary curly
braces. Eliminated uses of volatiles and use of kernel_thread() and daemonize().

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2008-04-22 15:08:55 -07:00
Dean Nelson 35190506b1 [IA64] run rest drivers/misc/sgi-xp through scripts/Lindent
Ran patches through scripts/Lindent (part 2).

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2008-04-22 15:08:44 -07:00
Dean Nelson 4a3ad2ddc0 [IA64] run some drivers/misc/sgi-xp through scripts/Lindent
Ran patches through scripts/Lindent (part 1).

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2008-04-22 15:08:29 -07:00
Dean Nelson 45d9ca492e [IA64] move XP and XPC to drivers/misc/sgi-xp
Move XPC and XPNET from arch/ia64/sn/kernel to drivers/misc/sgi-xp.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2008-04-22 15:08:17 -07:00
James Bottomley cb6b7f4063 [SCSI] ses: fix up functionality after class_device->device conversion
ses uses an unusual two level class hierarchy which broke in this
conversion.  Fix it up still with a two level hierarchy, but this time
let the ses device manage the links to and from the real device in the
enclosure.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-22 15:16:29 -05:00
Linus Torvalds e9b62693ae Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/juhl/trivial
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/juhl/trivial: (24 commits)
  DOC:  A couple corrections and clarifications in USB doc.
  Generate a slightly more informative error msg for bad HZ
  fix typo "is" -> "if" in Makefile
  ext*: spelling fix prefered -> preferred
  DOCUMENTATION:  Use newer DEFINE_SPINLOCK macro in docs.
  KEYS:  Fix the comment to match the file name in rxrpc-type.h.
  RAID: remove trailing space from printk line
  DMA engine: typo fixes
  Remove unused MAX_NODES_SHIFT
  MAINTAINERS: Clarify access to OCFS2 development mailing list.
  V4L: Storage class should be before const qualifier (sn9c102)
  V4L: Storage class should be before const qualifier
  sonypi: Storage class should be before const qualifier
  intel_menlow: Storage class should be before const qualifier
  DVB: Storage class should be before const qualifier
  arm: Storage class should be before const qualifier
  ALSA: Storage class should be before const qualifier
  acpi: Storage class should be before const qualifier
  firmware_sample_driver.c: fix coding style
  MAINTAINERS: Add ati_remote2 driver
  ...

Fixed up trivial conflicts in firmware_sample_driver.c
2008-04-21 16:36:46 -07:00
Linus Torvalds e80ab411e5 Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6: (36 commits)
  SCSI: convert struct class_device to struct device
  DRM: remove unused dev_class
  IB: rename "dev" to "srp_dev" in srp_host structure
  IB: convert struct class_device to struct device
  memstick: convert struct class_device to struct device
  driver core: replace remaining __FUNCTION__ occurrences
  sysfs: refill attribute buffer when reading from offset 0
  PM: Remove destroy_suspended_device()
  Firmware: add iSCSI iBFT Support
  PM: Remove legacy PM (fix)
  Kobject: Replace list_for_each() with list_for_each_entry().
  SYSFS: Explicitly include required header file slab.h.
  Driver core: make device_is_registered() work for class devices
  PM: Convert wakeup flag accessors to inline functions
  PM: Make wakeup flags available whenever CONFIG_PM is set
  PM: Fix misuse of wakeup flag accessors in serial core
  Driver core: Call device_pm_add() after bus_add_device() in device_add()
  PM: Handle device registrations during suspend/resume
  block: send disk "change" event for rescan_partitions()
  sysdev: detect multiple driver registrations
  ...

Fixed trivial conflict in include/linux/memory.h due to semaphore header
file change (made irrelevant by the change to mutex).
2008-04-21 15:49:58 -07:00
Tobias Klauser f7e8dd5071 intel_menlow: Storage class should be before const qualifier
The C99 specification states in section 6.11.5:

The placement of a storage-class specifier other than at the
beginning of the declaration specifiers in a declaration is an
obsolescent feature.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
2008-04-21 22:28:49 +00:00
Tony Jones ee959b00c3 SCSI: convert struct class_device to struct device
It's big, but there doesn't seem to be a way to split it up smaller...

Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-19 19:10:33 -07:00
Haavard Skinnemoen 03414e57ad Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/tclib into base 2008-04-19 20:38:13 -04:00
Jason Wessel 974460c5bf kgdb: allow static kgdbts boot configuration
This patch adds in the ability to compile the kgdb internal test
string into the kernel so as to run the tests at boot without changing
the kernel boot arguments.  This patch also changes all the error
paths to invoke WARN_ON(1) which will emit the line number of the file
and dump the kernel stack when an error occurs.

You can disable the tests in a kernel that is built this way
using "kgdbts="

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 20:05:43 +02:00
Jason Wessel e8d31c204e kgdb: add kgdb internal test suite
This patch adds regression tests for testing the kgdb core and arch
specific implementation.

The kgdb test suite is designed to be built into the kernel and not as
a module because it uses a number of low level kernel and kgdb
primitives which should not be exported externally.

The kgdb test suite is designed as a KGDB I/O module which
simulates the communications that a debugger would have with kgdb.
The tests are broken up in to a line by line and referenced here as
a "get" which is kgdb requesting input and "put" which is kgdb
sending a response.

The kgdb suite can be invoked from the kernel command line
arguments system or executed dynamically at run time.  The test
suite uses the variable "kgdbts" to obtain the information about
which tests to run and to configure the verbosity level.  The
following are the various characters you can use with the kgdbts=
line:

When using the "kgdbts=" you only choose one of the following core
test types:
A = Run all the core tests silently
V1 = Run all the core tests with minimal output
V2 = Run all the core tests in debug mode

You can also specify optional tests:
N## = Go to sleep with interrupts of for ## seconds
      to test the HW NMI watchdog
F## = Break at do_fork for ## iterations
S## = Break at sys_open for ## iterations

NOTE: that the do_fork and sys_open tests are mutually exclusive.

To invoke the kgdb test suite from boot you use a kernel start
argument as follows:
	kgdbts=V1 kgdbwait
Or if you wanted to perform the NMI test for 6 seconds and do_fork
test for 100 forks, you could use:
	kgdbts=V1N6F100 kgdbwait

The test suite can also be invoked at run time with:
echo kgdbts=V1N6F100 > /sys/module/kgdbts/parameters/kgdbts
Or as another example:
echo kgdbts=V2 > /sys/module/kgdbts/parameters/kgdbts

When developing a new kgdb arch specific implementation or
using these tests for the purpose of regression testing,
several invocations are required.

1) Boot with the test suite enabled by using the kernel arguments
      "kgdbts=V1F100 kgdbwait"
   ## If kgdb arch specific implementation has NMI use
      "kgdbts=V1N6F100

2) After the system boot run the basic test.
echo kgdbts=V1 > /sys/module/kgdbts/parameters/kgdbts

3) Run the concurrency tests.  It is best to use n+1
   while loops where n is the number of cpus you have
   in your system.  The example below uses only two
   loops.

## This tests break points on sys_open
while [ 1 ] ; do find / > /dev/null 2>&1 ; done &
while [ 1 ] ; do find / > /dev/null 2>&1 ; done &
echo kgdbts=V1S10000 > /sys/module/kgdbts/parameters/kgdbts
fg # and hit control-c
fg # and hit control-c
## This tests break points on do_fork
while [ 1 ] ; do date > /dev/null ; done &
while [ 1 ] ; do date > /dev/null ; done &
echo kgdbts=V1F1000 > /sys/module/kgdbts/parameters/kgdbts
fg # and hit control-c

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 20:05:42 +02:00
Kay Sievers d6c238503e misc: fix platform driver hotplug/coldplug
Since 43cc71eed1, the platform modalias is
prefixed with "platform:".  Add MODULE_ALIAS() to the hotpluggable 'misc'
platform drivers, to re-enable auto loading.

[dbrownell@users.sourceforge.net:  bugfix, registration fixes]
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-15 19:35:40 -07:00
Al Viro 5cf83b9b12 NULL noise: drivers/misc
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-03-30 14:18:41 -07:00
Len Brown b4de123a0b Merge branches 'release', 'ejd', 'sony' and 'wmi' into release 2008-03-13 01:59:52 -04:00
Len Brown c523aef0f7 Merge branches 'release', 'button-sysfs', 'misc', 'mismatch', 'randconfig' and 'toshiba' into release 2008-03-13 01:59:49 -04:00
Jiri Kosina 07d31ee559 acer-wmi: build depends on i8042
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-13 00:23:48 -04:00
Carlos Corbacho ed9cfe9805 acer-wmi: Add DMI quirk for mail LED support on Acer Aspire 3610/ 5610
Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-12 16:25:02 -04:00
Carlos Corbacho 8d039bc7f3 acer-wmi: Make device detection error messages more descriptive
The current device detection error messages are all copy & pasted - make
them more descriptive so it's easier to see where in the code a problem
occurs.

Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-12 16:24:12 -04:00
Carlos Corbacho 9b963c4030 acer-wmi: Don't warn if mail LED cannot be detected
This warning confuses users, who think it is an error. Not detecting the
mail LED simply means it isn't there, so let's not unduly panic users.

Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-11 17:58:22 -04:00
Carlos Corbacho 343c00422d acer-wmi: Rename mail LED correctly & remove hardcoded colour
The mail LED name for acer-wmi currently hardcodes in the colour as green.
This is wrong, since many of the newer laptops now come with an orange
LED, and we have no way of telling what colour is used on a given system.

Also, rename the mail LED to be inline with the current recommendations of
the LED class documentation.

Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-11 17:53:24 -04:00
Alex Dubov e4c70e8521 tifm: clear interrupt mask bits before setting them on adapter init
This should improve reliability of detection of cards already in socket on
driver load.

Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-03-10 18:01:18 -07:00
Henrique de Moraes Holschuh cee47f5a32 ACPI: thinkpad-acpi: fix hotkey_get_tablet_mode
I used the wrong return convention on hotkey_get_tablet_mode(), breaking a lot
of stuff.  Bad Henrique!

Fix it to return the status in the parameter-by-reference, and IO status on
the function return value.  Duh.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Lukas Hejtmanek <xhejtman@ics.muni.cz>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-03-04 16:35:16 -08:00
David Brownell 4d243f92e4 atmel_tc clocksource/clockevent code
Clocksource and clockevent device based on the Atmel TC blocks.

The clockevent device handles both periodic and oneshot modes, so this
enables NO_HZ and high res timers on some platforms that previously
couldn't use those mechanisms.

This works on both AVR32 and AT91 chips, given relevant patches for
tclib support (always) and clockevents (or else this will only look
like a higher precision clocksource).  It's an updated and modularized
version of an AT91-only patch that has circulated for some time now.

Changes relative to the original patch:
  * Update to use new tclib API
  * Replace open-coded do-while loop using goto with a real do-while loop
  * Minor irq handler optimization: Load register base address from
    dev_id instead of a global variable.
  * Aggressively turn off clocks when the clockevent isn't being used
  * Include the clockevent code on AT91RM9200 as well. The rating is
    lower than the System Timer, so the clock will usually stay off.
  * Don't assume that the number of clocks is always equal to the
    number of irqs.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-03-04 13:42:24 +01:00
David Brownell 2a341f5cf5 atmel_tc library
Create <linux/atmel_tc.h> based on <asm-arm/arch-at91/at91-tc.h> and the
at91sam9263 and at32ap7000 datasheets.  Most AT91 and AT32 SOCs have one
or two of these TC blocks, which include three 16-bit timers that can be
interconnected in various ways.

These TC blocks can be used for external interfacing (such as PWM and
measurement), or used as somewhat quirky sixteen-bit timers.

Changes relative to the original version:
  * Drop unneeded inclusion of <linux/mutex.h>
  * Support an arbitrary number of TC blocks
  * Return a struct with information about a TC block from
    atmel_tc_alloc() instead of using a combination of return values
    and "out" parameters.
  * ioremap() the I/O registers on allocation
  * Look up clocks and irqs for all channels
  * Add "name" parameter to atmel_tc_alloc() and use this when
    requesting the iomem resource.
  * Check if the platform provided the necessary resources at probe()
    time instead of when the TCB is allocated.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-03-04 13:41:23 +01:00
Adrian Bunk d399d130c8 sony-laptop.c: fix off-by-one
This patch fixes an off-by-one spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-21 04:49:24 -05:00
Sam Ravnborg 7560e38565 acer-wmi: fix section mismatch warnings
Fix following warnings:
WARNING: vmlinux.o(.text+0x672615): Section mismatch in reference from the function acer_platform_remove() to the function .exit.text:acer_backlight_exit()
WARNING: vmlinux.o(.devinit.text+0x1e859): Section mismatch in reference from the function acer_platform_probe() to the function .init.text:acer_led_init()
WARNING: vmlinux.o(.devinit.text+0x1e878): Section mismatch in reference from the function acer_platform_probe() to the function .init.text:acer_backlight_init()

Remove __exit annotation from acer_backlight_exit(). We cannot reference
a __exit annotated function from non __exit functions.

acer_led_init() and acer_backlight_init() where both annotated __init but
used from a __devinit function. This would result in an oops should
gcc drop their inlining and the module are hot plugged.

Fix by annotating acer_led_init() and acer_backlight_init() __devinit.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-21 02:55:53 -05:00
Len Brown 1f1519ef59 Merge branches 'release', 'bugzilla-9916', 'bugzilla-9982', 'bugzilla-9989', 'misc', 'suspend', 'thermal', 'thinkpad' and 'tsc' into release 2008-02-21 02:41:58 -05:00
Carlos Corbacho 262ee35be6 acer-wmi: Add DMI match for mail LED on Acer TravelMate 4200 series
The TM4200 series use the same method as the TM2490 series to control the
mail LED, so add a DMI based quirk for these laptops.

Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-16 00:47:13 -05:00
Henrique de Moraes Holschuh 6c231bd5eb ACPI: thinkpad-acpi: add tablet-mode reporting
A quick study of the 0x5009/0x500A HKEY event on the X61t DSDT revealed the
existence of the EC HTAB register (EC 0x0f, bit 7), and a compare with the
X41t DSDT shows that HKEY.MHKG can be used to verify if the ThinkPad is
tablet-capable (MHKG present), and in tablet mode (bit 3 of MHKG return is
set).

Add an attribute to report this information, "hotkey_tablet_mode".  This
attribute has poll()/select() support, and can be used along with EV_SW
SW_TABLET_MODE to hook userspace to tablet events.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-16 00:34:06 -05:00
Henrique de Moraes Holschuh d147da73c9 ACPI: thinkpad-acpi: minor hotkey_radio_sw fixes
Fixes some minor points in the radio switch code and docs.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-16 00:34:04 -05:00
Henrique de Moraes Holschuh b3ec6f911a ACPI: thinkpad-acpi: issue input events for tablet swivel events
Issue EV_SW SW_TABLET_MODE events for HKEY events 0x5009 and 0x500A on the
X41t/X60t/X61t.  As usual, we suppress the HKEY events on the netlink
interface to avoid sending duplicate events to userspace.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-16 00:34:01 -05:00
Henrique de Moraes Holschuh d7c1d17dfe ACPI: thinkpad-acpi: make the video output feature optional
The video output port control feature is not very useful on many ThinkPads
(especially when a X server is running), and lately userspace is getting
better and better at it, so it makes sense to allow users to stripe out the
thinkpad-acpi video feature from their kernels and save at least 2KB.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-16 00:33:59 -05:00
Henrique de Moraes Holschuh 7526696a01 ACPI: thinkpad-acpi: synchronize input device switches
Issue EV_SW events at module init time to synchronize the input device with
the current state of the switch, otherwise we might lose the first event.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-16 00:33:57 -05:00
Henrique de Moraes Holschuh 1bc6b9cdd5 ACPI: thinkpad-acpi: always track input device open/close
The open() and close() hooks for the input device are useful even when
hotkey NVRAM polling support is not in use, so it is better to always have
them around.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-16 00:33:55 -05:00
Henrique de Moraes Holschuh cbb1484213 ACPI: thinkpad-acpi: trivial fix to module_desc typo
Thanks to Damjan <gdamjan@mail.net.mk> for noticing this one.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-16 00:33:44 -05:00
Thomas Sujith 69f6b8dd6b intel_menlo: extract return values using PTR_ERR
Need to extract errors using PTR_ERR macro and
process accordingly.thermal_cooling_device_register
returning NULL means that CONFIG_THERMAL=n and in that
case no need to create symbolic links.

Signed-off-by: Thomas Sujith <sujith.thomas@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-15 18:29:30 -05:00
Adrian Bunk 1d5a2b54f3 thinkpad_acpi: static
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-14 01:01:28 -05:00
Linus Torvalds acac103e2d Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
  Merge branches 'release' and 'buildfix' into release
  acer-wmi - Add documentation
  sonypi - Move sonypi.txt to Documentation/laptops
  sony-laptop - Move sony-laptop.txt to Documentation/laptops
  thinkpad-acpi - Move thinkpad-acpi.txt to Documentation/laptops
  Documentation - Create laptops sub-directory
  ACPI: thermal: buildfix for CONFIG_THERMAL=n
  cpuidle: build fix for non-x86
  acer-wmi: Fix backlight on AMW0 (V1) laptops
  tc1100-wmi: Mark as experimental
  ACPI: SBS: Host controller must initialize before SBS.
2008-02-09 11:12:31 -08:00
Alex Dubov baf8532a14 memstick: initial commit for Sony MemoryStick support
Sony MemoryStick cards are used in many products manufactured by Sony.
They are available both as storage and as IO expansion cards.  Currently,
only MemoryStick Pro storage cards are supported via TI FlashMedia
MemoryStick interface.

[mboton@gmail.com: biuld fix]
[akpm@linux-foundation.org: build fix]
Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Miguel Boton <mboton@gmail.co>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-09 11:08:34 -08:00
Len Brown a52500c917 Merge branches 'release', 'wmi' and 'laptop-docs' into release 2008-02-09 04:32:55 -05:00
Carlos Corbacho 16111c7979 acer-wmi - Add documentation
Add some initial documentation detailing what acer-wmi is, and how to use
it. Update the Kconfig entry with a reference to the documentation.

Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-09 04:16:07 -05:00
Carlos Corbacho f04b7c402b sony-laptop - Move sony-laptop.txt to Documentation/laptops
Also update references to sony-laptop.txt in Kconfig.

Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
CC: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-09 04:15:40 -05:00
Carlos Corbacho f191dc6b55 thinkpad-acpi - Move thinkpad-acpi.txt to Documentation/laptops
Also update references to thinkpad-acpi.txt in Kconfig.

Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
CC: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-09 04:15:23 -05:00
Carlos Corbacho 4609d029aa acer-wmi: Fix backlight on AMW0 (V1) laptops
There is some leftover cruft from the old quirk infrastructure that causes
us to be unable to set the backlight on older laptops.

Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-09 03:29:33 -05:00
Carlos Corbacho b013682919 tc1100-wmi: Mark as experimental
tc1100-wmi has not undergone as much testing as acer-wmi, so it certainly
should be marked as experimental as well until we get more user feedback.

Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-09 03:29:04 -05:00
Linus Torvalds 7b791d4455 Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
  acer-wmi, tc1100-wmi: select ACPI_WMI
  ACPI: WMI: Improve Kconfig description
  ACPI: DMI: add Panasonic CF-52 and Thinpad X61
  ACPI: thermal: syntax, spelling, kernel-doc
  intel_menlo: build on X86 only
  ACPI: build WMI on X86 only
  ACPI: cpufreq: Print _PPC changes via cpufreq debug layer
  ACPI: add newline to printk
2008-02-08 09:25:58 -08:00
David Brownell 9a1e8eb1f0 Basic PWM driver for AVR32 and AT91
PWM device setup, and a simple PWM driver exposing a programming interface
giving access to each channel's full capabilities.  Note that this doesn't
support starting several channels in synch.

[hskinnemoen@atmel.com: allocate platform device dynamically]
[hskinnemoen@atmel.com: Kconfig fix]
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Andrew Victor <linux@maxim.org.za>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08 09:22:38 -08:00
Len Brown 2e6c4e5101 Merge branches 'release', 'dmi' and 'misc' into release 2008-02-08 01:22:26 -05:00
Len Brown 4a507d93fa acer-wmi, tc1100-wmi: select ACPI_WMI
It is safe for these Kconfig entries to use select because
they select ACPI_WMI, which already has its dependencies
satisfied.  This makes Kconfig more user friendly, since
the user selects the driver they want and the dependency
is met for them.  Otherwise, the user would have to find
and enable ACPI_WMI to make enabling these drivers possible.

Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-08 00:37:16 -05:00
James Bottomley d569d5bb3f [SCSI] enclosure: add support for enclosure services
The enclosure misc device is really just a library providing sysfs
support for physical enclosure devices and their components.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-07 18:04:10 -06:00
Len Brown 9f2eef25e0 intel_menlo: build on X86 only
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-07 16:19:56 -05:00
Linus Torvalds f0f1b3364a Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (112 commits)
  ACPI: fix build warning
  Revert "cpuidle: build fix for non-x86"
  ACPI: update intrd DSDT override console messages
  ACPI: update DSDT override documentation
  ACPI: Add "acpi_no_initrd_override" kernel parameter
  ACPI: its a directory not a folder....
  ACPI: misc cleanups
  ACPI: add missing prink prefix strings
  ACPI: cleanup acpi.h
  ACPICA: fix CONFIG_ACPI_DEBUG_FUNC_TRACE build
  ACPI: video: Ignore ACPI video devices that aren't present in hardware
  ACPI: video: reset brightness on resume
  ACPI: video: call ACPI notifier chain for ACPI video notifications
  ACPI: create notifier chain to get hotkey events to graphics driver
  ACPI: video: delete unused display switch on hotkey event code
  ACPI: video: create "brightness_switch_enabled" modparam
  cpuidle: Add a poll_idle method
  ACPI: cpuidle: Support C1 idle time accounting
  ACPI: enable MWAIT for C1 idle
  ACPI: idle: Fix acpi_safe_halt usages and interrupt enabling/disabling
  ...
2008-02-07 09:45:58 -08:00
Richard Purdie 6c152beefb leds: Standardise LED naming scheme
As discussed on LKML some notion of 'function' is needed in
LED naming. This patch adds this to the documentation and
standardises existing LED drivers.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
2008-02-07 09:47:00 +00:00
Len Brown 060195500e Merge branches 'release' and 'wmi-2.6.25' into release 2008-02-07 03:19:43 -05:00
Len Brown 26b6f22366 Merge branches 'release' and 'menlo' into release
Conflicts:

	drivers/acpi/video.c

Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-07 03:18:04 -05:00
Len Brown dd07a8db72 Merge branches 'release', 'asus', 'sony-laptop' and 'thinkpad' into release 2008-02-07 03:07:35 -05:00
Roel Kluin 547266e46c ACPI: thinkpad-acpi: second TP_EC_FAN_FULLSPEED should be TP_EC_FAN_AUTO
fix bug in safety net for TPEC fan control mode
eaa7571b2d

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-07 01:17:21 -05:00
Roel Kluin e1af14e4b3 asus-laptop: add parentheses
'!' has a higher priority than '&': bitanding has no effect.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-07 00:42:08 -05:00
Corentin CHARY f8d1c94b34 asus-laptop new write_acpi_int
Just a little modification of write_acpi_int

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-07 00:37:37 -05:00
Jiri Slaby 82f560874e phantom: don't grab other devices
Specify also sub pci ids to not grab devices with properly set sub ids.
This devices has these set (unset) to the same as (plx 9050) ids.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Andreas Block <andreas.block@esd-electronics.com>
Cc: Oliver Thimm <oliver.thimm@esd-electronics.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-06 10:41:10 -08:00
Adrian Bunk 2118116e5e drivers/misc/lkdtm.c: cleanups
- make needlessly global functions static
- make lkdtm_module_{init,exit}() as __{init,exit}

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Ankita Garg <ankita@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-06 10:41:03 -08:00
Ralf Baechle 911f21501f Remove inclusions of <linux/autoconf.h>
Nothing should ever include this file.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: "Mike Frysinger" <vapier.adi@gmail.com>
Acked-by: "Bryan Wu" <cooloney.lkml@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-06 10:41:00 -08:00
Carlos Corbacho dd8cd77937 tc1100-wmi: Add driver for HP Compaq TC1100 Tablets
This is based on the 2004 out-of-tree work of Jamey Hicks, to add
support via WMI for controlling the jog dial and wireless on these
tablets.

v1:

Original release

v2:

As per Joshua Wise's comments, change bluetooth to jogdial (an error from
the original driver).

Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
CC: Matthew Garrett <mjg59@srcf.ucam.org>
CC: Jamey Hicks <jamey.hicks@nokia.com>
CC: Joshua Wise <joshua@joshuawise.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-05 15:07:16 -05:00
Carlos Corbacho 745a5d2126 acer-wmi: Add driver for newer Acer laptops
This is a driver for newer Acer (and Wistron) laptops. It adds wireless
radio and bluetooth control, and on some laptops, exposes the mail LED and
LCD backlight.

v1:

* Initial release

v2:

* Replace left over ACPI references with WMI
* Add GUID based autoloading (depends on future work to WMI)
* Add DMI based autoloading (backup solution until WMI sysfs/ class
  work is available)
* Checkpatch fixes

v3:

* Add new EC quirks for Aspire 3100 & 5100, and Extensa 5220

v4:

* Simplified internal handling of WMID and AMW0 devices
* Add autodetection for bluetooth and maximum brightness on AMW0 V2 and
  WMID laptops.

v5:

* Add EC quirk for Medion MD 98000
* Add autodetection for AMW0, and mail LED on AMW0 and AMW0 V2.
* Improve error handling
* Fix AMW0 V2 bluetooth and wireless, by using both WMID and AMW0 methods
  to ensure that the correct value is always set.

v6:

* Fix 'use before initialisation' bug with quirks.

v7

* Fix bug on AMW0 where acer-wmi would exit if a mail LED was not
  detected.
* Add Acer Aspire 9110 mail LED support
* Fix section mismatch warnings

Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
CC: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-05 15:07:00 -05:00
Thomas Sujith cc0573b325 intel_menlo: introduce new platform specific driver
Intel menlow platform specific driver for thermal management extension.

Signed-off-by: Thomas Sujith <sujith.thomas@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 23:20:57 -05:00
Henrique de Moraes Holschuh 1cee5cce97 ACPI: thinkpad-acpi: bump up version to 0.19
The major code reorganization and cleanups, and new HKEY events, plus
poll()/select() support are good reasons to checkpoint a new version...

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 22:26:08 -05:00
Henrique de Moraes Holschuh 6a2e293c34 ACPI: thinkpad-acpi: update copyright dates to 2008
Update the copyright headers to include 2008.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 22:26:08 -05:00
Henrique de Moraes Holschuh 50ebec09f1 ACPI: thinkpad-acpi: add poll() support to some sysfs attributes
Implement poll()/select() support through sysfs_notify() for some key
attributes which userspace might want to poll() or select() on.

In order to let userspace know poll()/select() support is available for an
attribute, the thinkpad-acpi sysfs interface version is also bumped up.
Further changes that add poll()/select() capabilities to any pre-existing
attributes will also increment the sysfs interface version.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 22:26:08 -05:00
Henrique de Moraes Holschuh 013c40e457 ACPI: thinkpad-acpi: silence _sta warning
When both CONFIG_THINKPAD_ACPI_DOCK and CONFIG_THINKPAD_ACPI_BAY are
undefined, _sta is not used and that causes a gcc warning.  Fix it
(and I think this is a regression, I am pretty sure I fixed this once
before, sorry about that).

Issue reported by: Pritt Laes.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Pritt Laes <plaes@plaes.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 22:26:08 -05:00
Henrique de Moraes Holschuh d1edb2b5f1 ACPI: thinkpad-acpi: add X61t HKEY events
Tomas Carnecky reports that events 0x5009 and 0x500a are swivel events, and
that 0x500b/0x500c are tablet pen storage bay events.

Document these events, and avoid nasty messages when they happen.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 22:26:08 -05:00
Henrique de Moraes Holschuh a713b4d7bc ACPI: thinkpad-acpi: wakeup on hotunplug reporting
Handle some HKEY events that the firmware uses to report the reason for a
wake up, and to also notify that the system could go back to sleep (if it
woke up just to eject something from the bay, or to undock).

The driver will report the reason of the last wake up in the sysfs
attribute "wakeup_reason": 0 for "none, unknown, or standard ACPI wake up
event", 1 for "bay ejection request" and 2 for "undock request".

The firmware will also report if the operation that triggered the wake up
has been completed, by issuing an HKEY 0x3003 or 0x4003 event.  If the
operation fails, no event is sent.  When such a hotunplug sucessfull
notification is issued, the driver sets the attribute
"wakeup_hotunplug_complete" to 1.

While the firmware does tell us whether we are waking from a suspend or
hibernation scenario, the Linux way of hibernating makes this information
not reliable, and therefore it is not reported.

The idea is that if any of these attributes are non-zero, userspace might
want to do something at the end of the "wake up from sleep" procedures,
such as offering to send the machine back into sleep as soon as it is safe
to do so.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 22:26:08 -05:00
Henrique de Moraes Holschuh 3b64b51d20 ACPI: thinkpad-acpi: cleanup hotkey_notify and HKEY log messages
Use a generic message on hotkey_notify to log unknown and unhandled events,
and cleanup hotkey_notify a little.

Also, document event 0x5010 (brightness changed notification) and do not
log it as an unknown event (even if we do not use it for anything right
now).

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 22:26:08 -05:00
Henrique de Moraes Holschuh 083f17606f ACPI: thinkpad-acpi: add suspend handler
Add a handler for suspend events.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 22:26:07 -05:00
Henrique de Moraes Holschuh 35ff8b9fa9 ACPI: thinkpad-acpi: some checkpatch.pl fluff
Fix some of the crap reported by checkpatch.pl.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 22:26:07 -05:00
Henrique de Moraes Holschuh e0c7dfe701 ACPI: thinkpad-acpi: rename IBM in defines
Rename defines with IBM in their name that are related to the older
driver name (ibm-acpi) to TPACPI, unless they are specific to IBM
ThinkPads.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 22:26:07 -05:00
Henrique de Moraes Holschuh f68080f86d ACPI: thinkpad-acpi: module glue cleanups
General cleanup of module glue: Do some code reordering, and add
missing parameter help text.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 22:26:07 -05:00
Henrique de Moraes Holschuh 4b45cc076b ACPI: thinkpad-acpi: spring cleanup part 4
Remove dead code, and anything in the old changelog that is not a thank
you credit, or a key point to track down history.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 22:26:07 -05:00
Henrique de Moraes Holschuh b21a15f6d0 ACPI: thinkpad-acpi: spring cleanup part 3
Reorder code in the file to get rid of more of the forward declarations,
and to make things cleaner and more organized.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 22:26:07 -05:00
Henrique de Moraes Holschuh f74a27d4bd ACPI: thinkpad-acpi: spring cleanup part 2
Move most subdriver-related stuff imported from the header file closer to
their subdriver code.  Also, delete unneeded forward declarations.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 22:26:07 -05:00
Henrique de Moraes Holschuh 0c78039fcd ACPI: thinkpad-acpi: spring cleanup part 1
Remove the header file.  Private header files used by a single .c file are
in bad taste, and I know better now.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 22:26:06 -05:00
Henrique de Moraes Holschuh 50efd8310f ACPI: thinkpad-acpi: bump up version to 0.18
The NVRAM polling support for hot keys is reason enough to
bump up the version string.  Do it.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 22:26:06 -05:00
Henrique de Moraes Holschuh 01e88f2598 ACPI: thinkpad-acpi: add CMOS NVRAM polling for hot keys (v9)
Older ThinkPad models do not export some of the hot keys over the
event-based ACPI hot key interface.  For these models, one has to poll
the CMOS NVRAM to check the key state at a rate faster than the expected
rate at which the user might repeatedly press the same hot key.

This patch implements this functionality for many of the hotkeys in a
transparent way: hot keys will now Just Work, and the driver knows the
best approach (events or NVRAM polling) to employ, based on the
HKEY.MHKA ACPI method.

Also, the driver can turn off the polling when there are no users for
the hot keys that need such polling.

The NVRAM-based hot keys of the A3x series that have never been
implemented by later models are not supported, to avoid changes in the
keymap of the input devices that could cause headaches in the future.

There is a Kconfig option to avoid compiling the NVRAM polling code, as
it is not very small, and unlikely to be useful on any ThinkPad newer
than a T40, X31 or R52.

This feature is based on a previous effort by Richard Hughes.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Richard Hughes <hughsient@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 22:26:06 -05:00
Henrique de Moraes Holschuh b7c8c200bf ACPI: thinkpad-acpi: prepare for NVRAM polling support
Make some small internal thinkpad-acpi changes to the hotkey subdriver code
that will make it easier to add NVRAM polling support.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 22:26:06 -05:00
Henrique de Moraes Holschuh b2c985e7eb ACPI: thinkpad-acpi: refactor hotkey_get and hotkey_set (v2)
Refactor and organize the code a bit for the NVRAM polling support:

1. Split hotkey_get/set into hotkey_status_get/set and hotkey_mask_get/set;
2. Cache the status of hot key mask for later driver use;
3. Make sure the cache of hot key mask is refreshed when needed;
4. log a printk notice when the firmware doesn't set the hot key
   mask to exactly what we asked it to;
5. Add proper locking to the data structures.

Only (4) should be user-noticeable, but there is a chance (5) fixes
some unknown/unreported race conditions.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 22:26:06 -05:00
Henrique de Moraes Holschuh 0f089147e6 ACPI: thinkpad-acpi: document keymap gotcha's (v2)
Publish the requirements for keymap changes.  This is a documentation
change, only.

Currently, people look at the thinkpad-acpi default keymaps, and think:
"modifying this is a trivial thing, it can't break systems, and there are
keys defined for foo and bar, but the driver has them as KEY_RESERVED.
Must have been an oversight, let me change it."

And since they never get to see the bug reports, because they are not
really a part of the Linux ThinkPad users community (linux-thinkpad
mailinglist, thinkwiki wiki, thinkpad forums) and laptop users are slow
to complain to distros about any breakages...

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 22:26:06 -05:00