Commit graph

176680 commits

Author SHA1 Message Date
Len Brown 1fc22fad1f Merge branch 'debug-aml' into release 2009-12-16 02:19:59 -05:00
Len Brown 8033c314b9 Merge branch 'bugzilla-14782' into release 2009-12-16 02:19:55 -05:00
Len Brown 8fa79e08f5 Merge branch 'ost' into release
Conflicts:
	include/acpi/processor.h

Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-16 02:18:36 -05:00
Zhao Yakui 13c199c0d0 ACPI: Use the return result of ACPI lid notifier chain correctly
On some laptops it will return NOTIFY_OK(non-zero) when calling the ACPI LID
notifier. Then it is used as the result of ACPI LID resume function, which
will complain the following warning message in course of suspend/resume:

     >PM: Device PNP0C0D:00 failed to resume: error 1

This patch is to eliminate the above warning message.

http://bugzilla.kernel.org/show_bug.cgi?id=14782

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-16 01:12:35 -05:00
Len Brown 7458bbd044 Merge branch 'thinkpad-2.6.33' into release 2009-12-16 00:00:54 -05:00
Henrique de Moraes Holschuh 5d2eb14d36 thinkpad-acpi: bump version to 0.24
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-16 00:00:11 -05:00
Alexey Dobriyan 887965e657 thinkpad-acpi: convert to seq_file
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 23:58:00 -05:00
Henrique de Moraes Holschuh 0d204c34e8 thinkpad-acpi: basic ALSA mixer support (v2)
Add the basic ALSA mixer functionality.  The mixer is event-driven,
and will work fine on IBM ThinkPads.  I expect Lenovo ThinkPads will
cause some trouble with the event interface.

Heavily based on work by Lorne Applebaum <lorne.applebaum@gmail.com>
and ideas from Matthew Garrett <mjg@redhat.com>.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Lorne Applebaum <lorne.applebaum@gmail.com>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 23:57:44 -05:00
Henrique de Moraes Holschuh c7ac6291ea thinkpad-acpi: disable volume control
Disable volume control by default.  It can be enabled at module load
time by a module parameter (volume_control=1).

The audio control mixer that thinkpad-acpi interacts with is fully
functional without any drivers, and operated by hotkeys.

The idea behind the console audio control is that the human operator
is the only one that can interact with it.  The ThinkVantage suite in
Windows does not allow any software-based overrides, and only does OSD
(on-screen-display) functions.

The Linux driver will, with the addition of the ALSA interface, try to
follow and enforce the ThinkVantage UI design:

The user is supposed to use the keyboard hotkeys to interact with the
console audio control.  The kernel and the desktop environment is
supposed to cooperate to provide proper user feedback through
on-screen-display functions.

Distros are urged to not to enable volume control by default.
Enabling this must be a local admin's decision.  This is the reason
why there is no Kconfig option.

Keep in mind that all ThinkPads have a normal, main mixer (AC97 or
HDA) for regular software-based audio control.  We are not talking
about that mixer here.

Advanced users are, of course, free to enable volume control and do as
they please.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Lorne Applebaum <lorne.applebaum@gmail.com>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 23:57:35 -05:00
Henrique de Moraes Holschuh a112ceee67 thinkpad-acpi: support MUTE-only ThinkPads
Lenovo removed the extra mixer since the T61 and thereabouts.
Newer Lenovo models only have the mute gate function, and leave
the volume control to the HDA mixer.

Until a way to automatically query the firmware about its audio
control capabilities is discovered (there might not be any), use a
white/black list.

We will likely need to ask T60 (old and new model) and Z60/Z61 users
whether they have volume control to populate the black/white list.
Meanwhile, provide a volume_capabilities parameter that can be used to
override the defaults.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Lorne Applebaum <lorne.applebaum@gmail.com>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 23:57:26 -05:00
Henrique de Moraes Holschuh 329e4e18df thinkpad-acpi: volume subdriver rewrite
I don't trust the coupled EC writes and SMI calls the current volume
control code does very much, although it is exactly what the IBM DSDTs
seem to do (they never do more than a single step though).

Change the driver to stop issuing SMIs, and just drive the EC directly
to the desired level (DSDTs seem to confirm this will work even on
very old models like the 570 and 600e/x).

We checkpoint directly to NVRAM (this can be turned off) at
suspend/shutdown/driver unload, which from what I can see in tbp,
should also work on every ThinkPad.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Lorne Applebaum <lorne.applebaum@gmail.com>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 23:57:17 -05:00
Henrique de Moraes Holschuh 5451a923bb thinkpad-acpi: log initial state of rfkill switches
We already log the initial state of the hardware rfkill switch (WLSW),
might as well log the state of the softswitches as well.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Josip Rodin <joy+kernel@entuzijast.net>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 23:57:09 -05:00
Henrique de Moraes Holschuh d89a727aff thinkpad-acpi: sync input device EV_SW initial state
Before we register the input device, sync the input layer EV_SW state
through a call to input_report_switch(), to avoid issuing a gratuitous
event for the initial state of these switches.

This fixes some annoyances caused by the interaction with rfkill and
EV_SW SW_RFKILL_ALL events.

Reported-by: Kevin Locke <kevin@kevinlocke.name>
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 23:57:00 -05:00
Zhang Rui 4bab30a041 ACPI: add kernel tainting after overriding an ACPI control method
Add kernel tainting after overriding an ACPI control method successfully.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 22:52:19 -05:00
Len Brown 1667e399a4 Merge branch 'thermal-2.6.33' into release 2009-12-15 22:35:50 -05:00
Len Brown abdef01dac Merge branch 'hp-wmi' into release 2009-12-15 22:35:40 -05:00
Len Brown 6cbef9fd7c Merge branch 'dell-laptop' into release 2009-12-15 22:35:31 -05:00
Len Brown 0ceafc33af Merge branch 'bugzilla-14700' into release 2009-12-15 22:35:21 -05:00
Len Brown 9a3bff236b Merge branch 'asus' into release
Conflicts:
	Documentation/feature-removal-schedule.txt
	drivers/platform/x86/eeepc-laptop.c

Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 22:34:48 -05:00
Len Brown 173cc11a6e Merge branch 'acpica' into release 2009-12-15 22:27:39 -05:00
Corentin Chary d951d4cc84 asus-laptop: change light sens default values.
The light sensor disable brightness key and
/sys/class/backlight/ control. There was a lot of report
from users who didn't understand why they couldn't change their
brightness, including:

https://bugs.launchpad.net/bugs/222171
https://bugzilla.novell.com/show_bug.cgi?id=514747
http://bugzilla.kernel.org/show_bug.cgi?id=13671
http://bugzilla.kernel.org/show_bug.cgi?id=14432

Now the light sensor is disabled, and if the user want to enable
it, the level should be ok.

The funny thing is that comments where ok, not code.

Cc: stable@kernel.org
Cc: Thomas Renninger <trenn@suse.de>
Cc: Peter Küppers <peter-mailbox@web.de>
Cc: Michael Franzl <michaelfranzl@gmx.at>
Cc: Ian Turner <vectro@vectro.org>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 20:01:36 -05:00
Bob Moore 88e5071525 ACPICA: Update version to 20091214
Version 20091214.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 17:29:37 -05:00
Dan Carpenter fbc3be2af3 ACPICA: Move check for valid Thread ID structure
This change moves the check for a valid Thread ID structure up a
few lines to insure that the check is made before the structure
is actually used.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 17:29:37 -05:00
Bob Moore d4085a3ffe ACPICA: Predefined name repair: automatically remove null package elements
This change will automatically remove embedded and trailing NULL
package elements from returned package objects that are defined
to containe a variable number of sub-packages. The driver is then
presented with a package with no null elements to deal with.
ACPICA BZ 819.

http://www.acpica.org/bugzilla/show_bug.cgi?id=819

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 17:29:37 -05:00
Lin Ming e31c32cfe5 ACPICA: Module-level code: enable _REG execution in same scope
This change enables the execution of _REG methods that appear
in the same scope as the module-level code, in resonse to an
operation region declaration within the module-level code.

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 17:29:37 -05:00
Bob Moore 465da9eb75 ACPICA: Conditionally perform complex per-predefined-name repairs
Only attempt the "complex" repairs (package sorting, buffer
expansion) if the previous "generic" validation and repair was
successful.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 17:29:36 -05:00
Bob Moore 43420bbb89 ACPICA: Update function headers and comments, no functional change
Update comments for repair of _FDE and _GTM methods.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 17:29:36 -05:00
Bob Moore 3a58176e4f ACPICA: Remove messages if predefined repair(s) are successful
Repair mechanism was considered too wordy. Now, messages are only
unconditionally emitted if the return object cannot be repaired.
Existing messages for successful repairs were converted to
ACPI_DEBUG_PRINT messages for now. ACPICA BZ 827.

http://www.acpica.org/bugzilla/show_bug.cgi?id=827

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 17:29:36 -05:00
Bob Moore ea7c5ec148 ACPICA: Move Package-to-Buffer repair code into common ToBuffer function
Move code specific to _FDE and _GTM into the generic repair code.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 17:29:36 -05:00
Bob Moore d976591120 ACPICA: Fix mutex errors when running _REG methods
Fixes a problem where mutex errors can occur when running a _REG
method that is in the same scope as a method-defined operation
region or an operation region under a module-level IF block.
This is rare, so the problem has not been seen before.
ACPICA BZ 826.

http://www.acpica.org/bugzilla/show_bug.cgi?id=826

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 17:29:36 -05:00
Bob Moore 90434c1c7c ACPICA: Update function headers, no functional change
Fixed a few errors with the headers in utcopy.c

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 17:29:35 -05:00
Bob Moore 47e11d54d2 ACPICA: Add more conversions to predefined name repair module
This change enhances the automatic repairs/conversions for
predefined name return values to make Integers, Strings, and
Buffers fully interchangeable. Also, a Buffer can be converted
to a Package of Integers if necessary. The nsrepair.c module was
completely restructured.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 17:29:35 -05:00
Bob Moore f24b664dc4 ACPICA: Update internal namespace node/handle interfaces
This change deletes the unnecessary acpi_ns_convert_entry_to_handle
interface and renames the acpi_ns_map_handle_to_node interface to
acpi_ns_validate_handle.  ACPICA BZ 798.

http://www.acpica.org/bugzilla/show_bug.cgi?id=798

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 17:29:35 -05:00
Bob Moore 34c39c7553 ACPICA: Add repair for bad _FDE/_GTM buffers
The expected return value for both names is a Buffer of 5 DWORDS.
This repair fixes two possible problems (both seen in the field):
A package of integers is returned, or a buffer of BYTEs is returned.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 17:29:35 -05:00
Bob Moore ebdca3edd5 ACPICA: Fix two additional Scope override error messages
These messages were using the internal path for the message
instead of using the node name.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 17:29:35 -05:00
Bob Moore f2cb125108 ACPICA: Fix two Scope type error messages
Both messages incorrectly used the internal Path string instead
of the node name.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 17:29:35 -05:00
Lin Ming 583061c59f ACPICA: Fix possible memory leak for module-level code execution
An object can be leaked for each block of executed module-level
code if the interpreter slack mode is enabled. The change deletes
any implicitly returned object in this case.

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-15 17:29:34 -05:00
Stephen Rothwell 8bea8672ed mfd: compile fix for twl4030 renaming
Caused by commit 0b83ddebc6 ("MFD:
twl4030: add twl4030_codec MFD as a new child to the core") interacting
with commit b07682b605 ("mfd: Rename
twl4030* driver files to enable re-use").

This file seems to have been missed in the renaming.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-15 09:33:36 -08:00
Linus Torvalds d180ec5d34 Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
* 'for-linus' of git://oss.sgi.com/xfs/xfs:
  xfs: event tracing support
  xfs: change the xfs_iext_insert / xfs_iext_remove
  xfs: cleanup bmap extent state macros
2009-12-15 09:12:43 -08:00
Linus Torvalds 53365383c4 Merge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm
* git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm: (80 commits)
  dm snapshot: use merge origin if snapshot invalid
  dm snapshot: report merge failure in status
  dm snapshot: merge consecutive chunks together
  dm snapshot: trigger exceptions in remaining snapshots during merge
  dm snapshot: delay merging a chunk until writes to it complete
  dm snapshot: queue writes to chunks being merged
  dm snapshot: add merging
  dm snapshot: permit only one merge at once
  dm snapshot: support barriers in snapshot merge target
  dm snapshot: avoid allocating exceptions in merge
  dm snapshot: rework writing to origin
  dm snapshot: add merge target
  dm exception store: add merge specific methods
  dm snapshot: create function for chunk_is_tracked wait
  dm snapshot: make bio optional in __origin_write
  dm mpath: reject messages when device is suspended
  dm: export suspended state to targets
  dm: rename dm_suspended to dm_suspended_md
  dm: swap target postsuspend call and setting suspended flag
  dm crypt: add plain64 iv
  ...
2009-12-15 09:12:01 -08:00
Linus Torvalds 51b736b851 Merge branch 'for-2.6.33' of git://git.kernel.dk/linux-2.6-block
* 'for-2.6.33' of git://git.kernel.dk/linux-2.6-block:
  cfq: set workload as expired if it doesn't have any slice left
  Fix a CFQ crash in "for-2.6.33" branch of block tree
  cfq: Remove wait_request flag when idle time is being deleted
  cfq-iosched: commenting non-obvious initialization
  cfq-iosched: Take care of corner cases of group losing share due to deletion
  cfq-iosched: Get rid of cfqq wait_busy_done flag
  cfq: Optimization for close cooperating queue searching
  block,xd: Delay allocation of DMA buffers until device is known
  drbd: Following the hmac change to SHASH (see linux commit 8bd1209cff)
  cfq-iosched: reduce write depth only if sync was delayed
2009-12-15 09:11:28 -08:00
Linus Torvalds a8aa1ebdf8 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: ac97_codec - increase timeout for analog sections to 5 second
  ASoC: Correct code taking the size of a pointer
  ALSA: hda - Add PCI IDs for Nvidia G2xx-series
  ALSA: sound/isa/gus: Correct code taking the size of a pointer
  ALSA: hda: Fix max PCM level to 0 dB for AD1981_HP
  ALSA: hda: Use ALC260_WILL quirk for another Acer model (0x1025007f)
2009-12-15 09:11:05 -08:00
Linus Torvalds 8f0ddf91f2 Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (26 commits)
  clockevents: Convert to raw_spinlock
  clockevents: Make tick_device_lock static
  debugobjects: Convert to raw_spinlocks
  perf_event: Convert to raw_spinlock
  hrtimers: Convert to raw_spinlocks
  genirq: Convert irq_desc.lock to raw_spinlock
  smp: Convert smplocks to raw_spinlocks
  rtmutes: Convert rtmutex.lock to raw_spinlock
  sched: Convert pi_lock to raw_spinlock
  sched: Convert cpupri lock to raw_spinlock
  sched: Convert rt_runtime_lock to raw_spinlock
  sched: Convert rq->lock to raw_spinlock
  plist: Make plist debugging raw_spinlock aware
  bkl: Fixup core_lock fallout
  locking: Cleanup the name space completely
  locking: Further name space cleanups
  alpha: Fix fallout from locking changes
  locking: Implement new raw_spinlock
  locking: Convert raw_rwlock functions to arch_rwlock
  locking: Convert raw_rwlock to arch_rwlock
  ...
2009-12-15 09:02:01 -08:00
Linus Torvalds 050cbb09da Merge git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6:
  avr32: update default configurations for ATNGW100, ATSTK1002 and ATSTK1006
  avr32: add default configurations for ATNGW100 mkII and EVKLCD10X
  avr32: add support for ATNGW100 mkII board
  avr32: convert to asm-generic/hardirq.h
  avr32: add two new at91 to cpu.h definition
  avr32: clean up linker script using standard macros.
  avr32: MRMT: correct setup of SPI slaves
  avr32: function for independently setting up SPI slaves
  avr32: re-instate MCI WP/CD pin assignments for ATNGW100
2009-12-15 09:01:00 -08:00
Linus Torvalds 17c330f983 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  sparc64: Fix clock event multiplier printf format.
  sparc64: Use clock{source,events}_calc_mult_shift().
  sparc64: Use free_bootmem_late() in mdesc_lmb_free().
  sparc: Add alignment and emulation fault perf events.
  sparc64: Add syscall tracepoint support.
  sparc: Stop trying to be so fancy and use __builtin_{memcpy,memset}()
  sparc: Use __builtin_object_size() to validate the buffer size for copy_from_user()
  sparc64: Add some missing __kprobes annotations to kernel fault paths.
  sparc64: Use kprobes_built_in() to avoid ifdefs in fault_64.c
  sparc: Validate that kprobe address is 4-byte aligned.
  sparc64: Don't specify IRQF_SHARED for LDC interrupts.
  sparc64: Fix stack debugging IRQ stack regression.
  sparc64: Fix overly strict range type matching for PCI devices.
2009-12-15 09:00:19 -08:00
Linus Torvalds 48e902f0a3 Merge git://git.infradead.org/battery-2.6
* git://git.infradead.org/battery-2.6:
  power_supply_sysfs: Handle -ENODATA in a special way
  wm831x_backup: Remove unused variables
  gta02: Set pcf50633 charger_reference_current_ma
  pcf50633: Query charger status directly
  pcf50633: Properly reenable charging when the supply conditions change
  pcf50633: Get rid of charging restart software auto-triggering
  pcf50633: introduces battery charging current control
  pcf50633: Add ac power supply class to the charger
  wm831x: Factor out WM831x backup battery charger
2009-12-15 08:59:33 -08:00
Linus Torvalds 7f6cd5408a Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6:
  USB: Close usb_find_interface race v3
  Revert "USB: Close usb_find_interface race"
2009-12-15 08:58:13 -08:00
Samu Onkalo e956e6b770 lis3: update documentation to match latest changes
[akpm@linux-foundation.org: s/q/g/ (Randy)]
Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com>
Acked-by: Éric Piel <Eric.Piel@tremplin-utc.net>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-15 08:53:36 -08:00
Samu Onkalo 32496c76b7 lis3: scale output values to mg
Report output values as 1/1000 of earth gravity.

Output values from lis3 can be read from sysfs position entry and from
input device.  Input device can be accessed as event device and as
joystick device.  Joystick device can be in two modes.  Meaning of the
output values varies from case to case depending on the chip type and
configuration (scale).  Only joystick interface in JS_CORR_BROKEN mode
returned somehow similar output values in different configurations.
Joystick device is in that state by default in case of lis3.

Position sysfs entry, input event device and raw joystick device have been
little bit broken since meaning of the output values has been varied
between 12 and 8 bit devices.  Applications which relayed on those methods
failed if the chip is different than the expected one.

This patch converts output values to mean similar thing in different
configurations.  Both 8 and 12 bit devices reports now same acceleration
values.  If somebody implements full scale support to the driver, output
values will still mean the same.  Scaling factor and input device range
must be updated in that case.

Joystick interface in JS_CORR_BROKEN mode is not touched by this patch.
All other interfaces have different scale after this change.  For 12 bit
device scaling factor is 0.977 which keeps scaled and unscaled values are
quite close to each others.  For 8 bit device, scaled values are 18 times
bigger than unscaled values.

Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com>
Acked-by: Éric Piel <Eric.Piel@tremplin-utc.net>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-15 08:53:36 -08:00
Samu Onkalo a253aaef60 lis3: sysfs entry for setting chip measurement rate
It is possible to read position information at the chip measurement rate
via sysfs.  This patch adds possibility to configure chip measurement
rate.

Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com>
Signed-off-by: Éric Piel <Eric.Piel@tremplin-utc.net>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-15 08:53:36 -08:00