Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data
be setup before gluing PDE to main tree.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Peter Osterlund <petero2@telia.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Neil Brown <neilb@suse.de>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Remove proc_root export. Creation and removal works well if parent PDE is
supplied as NULL -- it worked always that way.
So, one useless export removed and consistency added, some drivers created
PDEs with &proc_root as parent but removed them as NULL and so on.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The function thermal_cooling_device_register always returns either a valid
pointer or a value made with ERR_PTR, so a test for non-zero on the result
will always succeed.
The problem was found using the following semantic match.
(http://www.emn.fr/x-info/coccinelle/)
//<smpl>
@a@
expression E, E1;
statement S,S1;
position p;
@@
E = thermal_cooling_device_register(...)
... when != E = E1
if@p (E) S else S1
@n@
position a.p;
expression E,E1;
statement S,S1;
@@
E = NULL
... when != E = E1
if@p (E) S else S1
@depends on !n@
expression E;
statement S,S1;
position a.p;
@@
* if@p (E)
S else S1
//</smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Thomas Sujith <sujith.thomas@intel.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
__FUNCTION__ is gcc-specific, use __func__
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Return ERR even if there are pending data, but hw is not running. Do not
decrement count in poll, do it in ioctl, where data are actually read.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Openhaptics uses pointers in _IOC() macros, implement compat for them. Also
add _IOC alternatives which are not 32/64 bit dependent (structures
passed through aren't yet) -- libphantom will use them.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
randconfig testing in x86.git found the following upstream build bug:
drivers/built-in.o: In function `acer_led_exit':
acer-wmi.c:(.text+0xdc76e): undefined reference to `led_classdev_unregister'
drivers/built-in.o: In function `acer_platform_probe':
acer-wmi.c:(.devinit.text+0x63e6): undefined reference to `led_classdev_register'
which was due to acer-wmi.o only depending on CONFIG_LEDS_CLASS, while
also using a symbol offered by CONFIG_NEW_LEDS. Also fix a similar bug
in CONFIG_ASUS_LAPTOP.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
Add backlight class support to the eeepc-laptop driver.
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
This patch is based on Eric Cooper's work to clean the original asus_acpi
given by Asus. It's a platform driver (/sys/devices/platform/eeepc/)
wich support:
- hotkeys - wlan on/off - camera on/off - cardr on/off
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
Full LED sysfs support, and the rest of the assorted minor fixes and
enhancements are a good reason 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>
Add missing select for BACKLIGHT_LCD_SUPPORT, as select doesn't select the
dependencies of a symbol for us.
Also, "select INPUT" in Kconfig. We are not an Input device, nor are we
anywhere close to the input subsystem in the Kconfig tree, so using
"depends on INPUT" is not user-friendly at all.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
Switch all task workers to a private thinkpad-acpi workqueue.
This way, we don't risk causing trouble for other tasks scheduled to the
default work queue, as our workers end up needing to access the ACPI EC,
run ACPI AML code, trigger SMI traps... and none of those are exactly known
to be fast, simple operations.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
* '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
* 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).
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
'!' 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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>