1
0
Fork 0
Commit Graph

731 Commits (ce47da742ddd950197c29df6f9f89cf8adb5a0a1)

Author SHA1 Message Date
Zimny Lech 61d8e11e51 Remove duplicate includes from many files
Signed-off-by: Zimny Lech <napohybelskurwysynom2010@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-27 18:03:18 -07:00
Linus Torvalds fbaab1dc19 Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86: (44 commits)
  eeepc-wmi: Add cpufv sysfs interface
  eeepc-wmi: add additional hotkeys
  panasonic-laptop: Simplify calls to acpi_pcc_retrieve_biosdata
  panasonic-laptop: Handle errors properly if they happen
  intel_pmic_gpio: fix off-by-one value range checking
  IBM Real-Time "SMI Free" mode driver -v7
  Add OLPC XO-1 rfkill driver
  Move hdaps driver to platform/x86
  ideapad-laptop: Fix Makefile
  intel_pmic_gpio: swap the bits and mask args for intel_scu_ipc_update_register
  ideapad: Add param: no_bt_rfkill
  ideapad: Change the driver name to ideapad-laptop
  ideapad: rewrite the sw rfkill set
  ideapad: rewrite the hw rfkill notify
  ideapad: use EC command to control camera
  ideapad: use return value of _CFG to tell if device exist or not
  ideapad: make sure we bind on the correct device
  ideapad: check VPC bit before sync rfkill hw status
  ideapad: add ACPI helpers
  dell-laptop: Add debugfs support
  ...
2010-10-25 08:28:13 -07:00
Linus Torvalds 092e0e7e52 Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl
* 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl:
  vfs: make no_llseek the default
  vfs: don't use BKL in default_llseek
  llseek: automatically add .llseek fop
  libfs: use generic_file_llseek for simple_attr
  mac80211: disallow seeks in minstrel debug code
  lirc: make chardev nonseekable
  viotape: use noop_llseek
  raw: use explicit llseek file operations
  ibmasmfs: use generic_file_llseek
  spufs: use llseek in all file operations
  arm/omap: use generic_file_llseek in iommu_debug
  lkdtm: use generic_file_llseek in debugfs
  net/wireless: use generic_file_llseek in debugfs
  drm: use noop_llseek
2010-10-22 10:52:56 -07:00
Chris Bagwell 7f80d734b3 eeepc-wmi: Add cpufv sysfs interface
eeepc-laptop provides a sysfs interface to read and control what it
calls cpufv.  When WMI is enabled, the ACPI interface changes slightly
and becames a write-only control with 3 valid values.

Expose cpufv again to allow for user space utils that can extended battery
life noticably and come a little closer to parity with eeepc-laptop.

Write-only is OK for most user space apps because read status was
mostly used to prevent unneeded mode changes.  Since this same check
to ignore changes to same mode also exists in the DSDT then it was
wasted ACPI call.

acpi_osi="!Windows 2009" can be used for get back eeepc-laptop's
read support of cpufv for debugging things such as behaviour
during resume.

This patch was tested with EEE PC 1005PE by monitoring powertop output while
writing values of "0", "1", and "2" and by reviewing the decompiled DSDT of
an 1201NL and comparing it to 1005PE's DSDT.

Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 10:10:53 -04:00
Chris Bagwell eda1748418 eeepc-wmi: add additional hotkeys
Added 4 hotkeys using same keymap values as eeepc-latop.
These are mousepad toggle, resolution change, screen off,
and task manager.  These were tested on 1005PE and are the
Fn-F3, F4, F7, and F9, respectively.

Also, added a new hot key for power toggles (Fn-Space on 1005PE)
and is meant to drive cpufv interface from userspace.

Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 10:10:51 -04:00
Jean Delvare e253fb944d panasonic-laptop: Simplify calls to acpi_pcc_retrieve_biosdata
Function acpi_pcc_retrieve_biosdata is always called with parameters
(pcc, pcc->sinf), so we can drop the second parameter. It was
dangerous to pass the sinf array separately anyway, as its length is
checked as pcc->num_sifr, which pretty much assumed it was pcc->sinf
(or at least had the same size.)

This change makes the code slightly more compact and thus marginally
faster.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Harald Welte <laforge@gnumonks.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 10:10:50 -04:00
Jean Delvare aa13857f13 panasonic-laptop: Handle errors properly if they happen
acpi_pcc_retrieve_biosdata() returns success instead of error if
HKEY.SINF is invalid. Fix this.

Furthermore, if acpi_pcc_retrieve_biosdata() returns an error
during device addition, initialization is properly reverted but value
0 is returned, which means success. This would cause a crash when
later using or removing the device, so fix this too.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Harald Welte <laforge@gnumonks.org>
Cc: Bruno Premont <bonbons@linux-vserver.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 10:10:49 -04:00
Axel Lin 4119617919 intel_pmic_gpio: fix off-by-one value range checking
In pmic_irq_type(), we use gpio as array index for trigger,
thus the valid value range for gpio should be 0 .. NUM_GPIO - 1.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 10:10:47 -04:00
Vernon Mauery 35f0ce032b IBM Real-Time "SMI Free" mode driver -v7
After a period of RFC for this driver, I think it is ready
for inclusion in the platform-driver-x86 tree, hopefully to
be staged in the next merge window into Linus's tree.

--Vernon

------------------------------------------------------------

IBM Real-Time "SMI Free" mode driver

This driver supports the Real-Time Linux (RTL) BIOS feature.
The RTL feature allows non-fatal System Management Interrupts
(SMIs) to be disabled on supported IBM platforms and is
intended to be coupled with a user-space daemon to monitor
the hardware in a way that can be prioritized and scheduled
to better suit the requirements for the system.

The Device is presented as a special "_RTL_" table to the OS
in the Extended BIOS Data Area.  There is a simple protocol
for entering and exiting the mode at runtime.  This driver
creates a simple sysfs interface to allow a simple entry and
exit from RTL mode in the UFI/BIOS.

Since the driver is specific to IBM SystemX hardware (x86-
based servers) it only builds on x86 builds.  To reduce the
risk of loading on the wrong hardware, the module uses DMI
information and checks a list of servers that are known to
work.

Signed-off-by: Vernon Mauery <vernux@us.ibm.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 10:10:46 -04:00
Daniel Drake 260586d2b4 Add OLPC XO-1 rfkill driver
Add a software rfkill switch for the WLAN interface in the OLPC XO-1
laptop. It uses the OLPC embedded controller to cut/restore power to
the Marvell WLAN chip on the motherboard.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 10:10:44 -04:00
Jean Delvare bd9fc3a723 Move hdaps driver to platform/x86
The hdaps driver isn't a hardware monitoring driver, so it shouldn't
live under driver/hwmon. drivers/platform/x86 seems much more
appropriate, as the driver is only useful on x86 laptops.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Frank Seidel <frank@f-seidel.de>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 10:10:43 -04:00
Matthew Garrett 75b2d09a29 ideapad-laptop: Fix Makefile
The makefile didn't get updated when the driver changed name, which broke
the build.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:51 -04:00
Alek Du ffcfff3a8d intel_pmic_gpio: swap the bits and mask args for intel_scu_ipc_update_register
The intel_scu_ipc_update_register 2nd paramter should the bits and 3rd
paramter should be the mask.

This typo was introduced during IPC function changing...

Reported-by: Ryan Zhou <ryan.zhou@intel.com>
Signed-off-by: Alek Du <alek.du@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:51 -04:00
Ike Panhc bfa97b7dab ideapad: Add param: no_bt_rfkill
Add new module parameter that force module not to register bluetooth rfkill.

There is report that saying using this bluetooth rfkill to enable/disable
bluetooth will let bluetooth device initial failed when enable on Lenovo
ideapad S12. Fortunately there is another rfkill registered by bluetooth
driver for S12 and user can shutdown the bluetooth by either bluetooth driver
or HW RF switch.

For dual OS user, it may have some trouble that using Linux after turning off
bluetooth with another OS if we do not register bluetooth rfkill at all. So
we will force bluetooth enable when no_bt_rfkill=1.

Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Tested-by: Mario 'BitKoenig' Holbe <Mario.Holbe@TU-Ilmenau.DE>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:51 -04:00
Ike Panhc 57ac3b051c ideapad: Change the driver name to ideapad-laptop
Since the platform drivers doing more for laptops than just using specific
ACPI device. It will be good to change the name from *_acpi to *-laptop.

Reference: http://lkml.org/lkml/2010/8/14/154

Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Acked-by: Len Brown <len.brown@intel.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:51 -04:00
Ike Panhc fa08359ee2 ideapad: rewrite the sw rfkill set
Control power of rf modules by ec commands

Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:50 -04:00
Ike Panhc 2b7266bd49 ideapad: rewrite the hw rfkill notify
1. Read hw rfkill status by ec command
2. Not to touch sw status of each rfkill when hw rfkill notify
3. Initial rfkill status when module loaded

Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:50 -04:00
Ike Panhc 26c81d5c9a ideapad: use EC command to control camera
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:50 -04:00
Ike Panhc dfa7f6fe0a ideapad: use return value of _CFG to tell if device exist or not
There are several bits of the return value of _CFG shows if RF/Camera devices
exist or not.

Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:50 -04:00
Ike Panhc 6f8371c05e ideapad: make sure we bind on the correct device
By reading from method _CFG to make sure we bind on the correct VPC2004 device.

Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:49 -04:00
Ike Panhc 8e7d354370 ideapad: check VPC bit before sync rfkill hw status
Check VPC bit to make sure the HW rfkill is touched.

Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:49 -04:00
Ike Panhc 6a09f21dd1 ideapad: add ACPI helpers
There are two methods under VPC2004 which is used to access VDAT/VCMD of EC
register. Add helpers for read and write these two registers.

And add read_method_int for reading the return value from ACPI methods which
requires no parameter.

Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:49 -04:00
Keng-Yu Lin 037accfa14 dell-laptop: Add debugfs support
Export the status of RF killswitch through debugfs.

The killswitch status is obtained by the SMI to BIOS. Exporting this status
through debugfs can help identify the issue with the misbehaving firmware.

Signed-off-by: Keng-Yu Lin <keng-yu.lin@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:49 -04:00
Dmitry Torokhov c64eefd48c WMI: embed struct device directly into wmi_block
Instead of creating wmi_blocks and then register corresponding devices
on a separate pass do it all in one shot, since lifetime rules for both
objects are the same. This also takes care of leaking devices when
device_create fails for one of them.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:48 -04:00
Dmitry Torokhov 614ef43222 WMI: make use of class device's attributres
Instead of adding modalias attribute manually set it up as class's
device attribute so driver core will create and remove it for us.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:48 -04:00
Dmitry Torokhov 8e07514db8 WMI: use pr_err() and friends
This makes source more concise and easier to read.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:48 -04:00
Dmitry Torokhov 762e1a2ff6 WMI: use separate list head for storing wmi blocks
Do not abuse wmi_block structure to hold the head of list
of blocks, use separate list_head for that.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:47 -04:00
Dmitry Torokhov 378306628e WMI: simplify handling of returned WMI blocks in parse_wdg()
There is no reason why we allocate memory and copy data into an
intermediate buffer, it is not like we are working with data coming
from userspace.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:47 -04:00
Dmitry Torokhov 3d2c63eb5e WMI: fix potential NULL pointer dereference
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:47 -04:00
Dmitry Torokhov 64ed0ab8d0 WMI: do not leak memory in parse_wdg()
If we _WDG returned object that is not buffer we were forgetting
to free memory allocated for that object.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:47 -04:00
Dmitry Torokhov 4e4304d749 WMI: fix wmi_gtoa() to actully terminate the string
Courtesy of sparse...

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:46 -04:00
Dmitry Torokhov 2d5ab5551f WMI: free wmi blocks when parse_wdg() fails
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:46 -04:00
Dmitry Torokhov 5212cd678a WMI: remove EC region handler when _WDG parsing fails
Driver initialization was forgetting to remove EC address space handler
in cases when parse_wdg() method failed.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:46 -04:00
Dmitry Torokhov ac9b1e5b63 asus-laptop: use attribute group to manage attributes
Instead of registering (and removing) every attribute individually
switch to using sysfs attribute group. This makes sure that we
properly unwind and do not try to remove non-existent attributes which
may not be safe to do in the future.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:46 -04:00
Alan Cox 209009b2cb scu_ipc: Fix warning caused by include changes
We need to include the SFI headers. This is fine as the SCU is only
relevant to x86 platforms with SFI.

Fixes the -next warning report.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:45 -04:00
Andy Shevchenko 392bd8b584 platform: x86: throw away custom methods
In 2.6.35 the hex_to_bin() was introduced.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: platform-driver-x86@vger.kernel.org
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:45 -04:00
Randy Dunlap 91e5d284a7 acpi_toshiba: fix kconfig error
Fix kconfig recursive dependency error in ACPI_TOSHIBA:
it uses both select and depends on for BACKLIGHT_CLASS_DEVICE.

drivers/video/backlight/Kconfig:117:error: recursive dependency detected!
drivers/video/backlight/Kconfig:117:    symbol BACKLIGHT_CLASS_DEVICE is selected by ACPI_TOSHIBA
drivers/platform/x86/Kconfig:490:       symbol ACPI_TOSHIBA depends on LEDS_CLASS
drivers/leds/Kconfig:12:        symbol LEDS_CLASS is selected by BACKLIGHT_ADP8860
drivers/video/backlight/Kconfig:285:    symbol BACKLIGHT_ADP8860 depends on BACKLIGHT_CLASS_DEVICE

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:45 -04:00
Pascal de Bruijn af9902e130 Don't show error if Acer WMI is not found
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:44 -04:00
Dmitry Torokhov b404ecbf91 asus-laptop: remove no longer used keycode_map field
The driver uses sparse keymap library and does not use this field
anymore.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:44 -04:00
Corentin Chary 23f45c3a76 asus-laptop: fix gps rfkill
The GPS rfkill crappy code. The ops_data argument wasn't
set, and was totally misused. The fix have been tested
on an Asus R2H.

Cc: stable@kernel.org
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:44 -04:00
Corentin Chary b58baecdde asus-laptop: Add key found on Asus N61JQ
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:44 -04:00
Corentin Chary 71e687dc49 platform-x86: sync eeepc-laptop and asus-laptop
Makes asus-laptop and eeepc-laptop _init/_exit functions
looks exactly the same as they do the same thing.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:43 -04:00
Dmitry Torokhov 384a7cd9ac toshiba-acpi - switch to using sparse keymap
Instead of implementing its own version of keymap hanlding switch over
to using sparse keymap library.

Also, install notify handler only after we allocated input device,
otherwise we may risk getting event too early and crash. Similarly,
notify handler should be removed before we unregister input device.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:43 -04:00
Dmitry Torokhov 4d291ed721 Input: hp-wmi - switch to using sparse keymap library
Instead of implementing its own version of keymap hanlding switch over
to using sparse keymap library.

Also make sure that we install notify handler only after we allocated
input device and that we remove notify handler before unregistering
input device.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:43 -04:00
Dmitry Torokhov 890a7c8e8d Input: dell-wmi - switch to using sparse keymap library
Instead of implementing its own version of keymap hanlding switch over to
using sparse keymap library.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:43 -04:00
Dmitry Torokhov 1a765cac9a panasonic-laptop - switch to using sparse keymap library
nstead of implementing its own version of keymap hanlding switch over to
using sparse keymap library.

Cc: Harald Welte <laforge@gnumonks.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:42 -04:00
Dmitry Torokhov 97490f1cf8 topstar-laptop - switch to using sparse keymap library
Instead of implementing its own version of keymap hanlding switch over to
using sparse keymap library.

Acked-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-21 09:36:42 -04:00
Arnd Bergmann 6038f373a3 llseek: automatically add .llseek fop
All file_operations should get a .llseek operation so we can make
nonseekable_open the default for future file operations without a
.llseek pointer.

The three cases that we can automatically detect are no_llseek, seq_lseek
and default_llseek. For cases where we can we can automatically prove that
the file offset is always ignored, we use noop_llseek, which maintains
the current behavior of not returning an error from a seek.

New drivers should normally not use noop_llseek but instead use no_llseek
and call nonseekable_open at open time.  Existing drivers can be converted
to do the same when the maintainer knows for certain that no user code
relies on calling seek on the device file.

The generated code is often incorrectly indented and right now contains
comments that clarify for each added line why a specific variant was
chosen. In the version that gets submitted upstream, the comments will
be gone and I will manually fix the indentation, because there does not
seem to be a way to do that using coccinelle.

Some amount of new code is currently sitting in linux-next that should get
the same modifications, which I will do at the end of the merge window.

Many thanks to Julia Lawall for helping me learn to write a semantic
patch that does all this.

===== begin semantic patch =====
// This adds an llseek= method to all file operations,
// as a preparation for making no_llseek the default.
//
// The rules are
// - use no_llseek explicitly if we do nonseekable_open
// - use seq_lseek for sequential files
// - use default_llseek if we know we access f_pos
// - use noop_llseek if we know we don't access f_pos,
//   but we still want to allow users to call lseek
//
@ open1 exists @
identifier nested_open;
@@
nested_open(...)
{
<+...
nonseekable_open(...)
...+>
}

@ open exists@
identifier open_f;
identifier i, f;
identifier open1.nested_open;
@@
int open_f(struct inode *i, struct file *f)
{
<+...
(
nonseekable_open(...)
|
nested_open(...)
)
...+>
}

@ read disable optional_qualifier exists @
identifier read_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
expression E;
identifier func;
@@
ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
{
<+...
(
   *off = E
|
   *off += E
|
   func(..., off, ...)
|
   E = *off
)
...+>
}

@ read_no_fpos disable optional_qualifier exists @
identifier read_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
@@
ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
{
... when != off
}

@ write @
identifier write_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
expression E;
identifier func;
@@
ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
{
<+...
(
  *off = E
|
  *off += E
|
  func(..., off, ...)
|
  E = *off
)
...+>
}

@ write_no_fpos @
identifier write_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
@@
ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
{
... when != off
}

@ fops0 @
identifier fops;
@@
struct file_operations fops = {
 ...
};

@ has_llseek depends on fops0 @
identifier fops0.fops;
identifier llseek_f;
@@
struct file_operations fops = {
...
 .llseek = llseek_f,
...
};

@ has_read depends on fops0 @
identifier fops0.fops;
identifier read_f;
@@
struct file_operations fops = {
...
 .read = read_f,
...
};

@ has_write depends on fops0 @
identifier fops0.fops;
identifier write_f;
@@
struct file_operations fops = {
...
 .write = write_f,
...
};

@ has_open depends on fops0 @
identifier fops0.fops;
identifier open_f;
@@
struct file_operations fops = {
...
 .open = open_f,
...
};

// use no_llseek if we call nonseekable_open
////////////////////////////////////////////
@ nonseekable1 depends on !has_llseek && has_open @
identifier fops0.fops;
identifier nso ~= "nonseekable_open";
@@
struct file_operations fops = {
...  .open = nso, ...
+.llseek = no_llseek, /* nonseekable */
};

@ nonseekable2 depends on !has_llseek @
identifier fops0.fops;
identifier open.open_f;
@@
struct file_operations fops = {
...  .open = open_f, ...
+.llseek = no_llseek, /* open uses nonseekable */
};

// use seq_lseek for sequential files
/////////////////////////////////////
@ seq depends on !has_llseek @
identifier fops0.fops;
identifier sr ~= "seq_read";
@@
struct file_operations fops = {
...  .read = sr, ...
+.llseek = seq_lseek, /* we have seq_read */
};

// use default_llseek if there is a readdir
///////////////////////////////////////////
@ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier readdir_e;
@@
// any other fop is used that changes pos
struct file_operations fops = {
... .readdir = readdir_e, ...
+.llseek = default_llseek, /* readdir is present */
};

// use default_llseek if at least one of read/write touches f_pos
/////////////////////////////////////////////////////////////////
@ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier read.read_f;
@@
// read fops use offset
struct file_operations fops = {
... .read = read_f, ...
+.llseek = default_llseek, /* read accesses f_pos */
};

@ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier write.write_f;
@@
// write fops use offset
struct file_operations fops = {
... .write = write_f, ...
+	.llseek = default_llseek, /* write accesses f_pos */
};

// Use noop_llseek if neither read nor write accesses f_pos
///////////////////////////////////////////////////////////

@ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier read_no_fpos.read_f;
identifier write_no_fpos.write_f;
@@
// write fops use offset
struct file_operations fops = {
...
 .write = write_f,
 .read = read_f,
...
+.llseek = noop_llseek, /* read and write both use no f_pos */
};

@ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier write_no_fpos.write_f;
@@
struct file_operations fops = {
... .write = write_f, ...
+.llseek = noop_llseek, /* write uses no f_pos */
};

@ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier read_no_fpos.read_f;
@@
struct file_operations fops = {
... .read = read_f, ...
+.llseek = noop_llseek, /* read uses no f_pos */
};

@ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
@@
struct file_operations fops = {
...
+.llseek = noop_llseek, /* no read or write fn */
};
===== End semantic patch =====

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Julia Lawall <julia@diku.dk>
Cc: Christoph Hellwig <hch@infradead.org>
2010-10-15 15:53:27 +02:00
Matthew Garrett d24a9da573 IPS driver: Fix limit clamping when reducing CPU power
Values here are in internal units rather than Watts, so we shouldn't
perform any conversion.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-05 14:59:35 -04:00
Jesse Barnes 96f3823f53 [PATCH 2/2] IPS driver: disable CPU turbo
The undocumented interface we're using for reading CPU power seems to be
overreporting power.  Until we figure out how to correct it, disable CPU
turbo and power reporting to be safe.  This will keep the CPU within default
limits and still allow us to increase GPU frequency as needed.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-05 14:59:28 -04:00
Jesse Barnes 4fd07ac00d IPS driver: apply BIOS provided CPU limit if different from default
The BIOS may hand us a lower CPU power limit than the default for a
given SKU.  We should use it in case the platform isn't designed to
dissapate the full TDP of a given part.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-05 14:59:25 -04:00
Andy Whitcroft 070c0ee1ef intel_ips -- ensure we do not enable gpu turbo mode without driver linkage
Both when polling the current turbo status (in poll_turbo_status mode)
and when handling thermal events (in ips_irq_handler) the current status
of GPU turbo is updated to match the hardware status.  However if during
driver initialisation we were unable aquire linkage to the i915 driver
enabling GPU turbo will lead to an oops on the first attempt to determine
GPU busy status.

Ensure that we do not enable GPU turbo unless we have driver linkage.

BugLink: http://bugs.launchpad.net/bugs/632430
Cc: stable@kernel.org
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-05 14:59:21 -04:00
Tim Gardner a8c096adbd intel_ips: Print MCP limit exceeded values.
Print some interesting values when MCP limits
are exceeded.

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-05 14:59:17 -04:00
Jesse Barnes eceab272fb IPS driver: verify BIOS provided limits
They're optional.  If not present or sane, we should use the CPU
defaults.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-05 14:59:14 -04:00
Jesse Barnes 354aeeb1ca IPS driver: don't toggle CPU turbo on unsupported CPUs
If the CPU doesn't support turbo, don't try to enable/disable it.

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

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-05 14:59:09 -04:00
minskey guo a7abda8d72 NULL pointer might be used in ips_monitor()
The patch is to create ips_adjust thread before ips_monitor begins
 to run  because the latter will kthread_stop() or wake up the former
 via ips->adjust pointer. Without this change, it is possible that
 ips->adjust is NULL when kthread_stop() or wake_up_process() is
 called in ips_monitor().

Signed-off-by: minskey guo <chaohong.guo@intel.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-05 14:59:06 -04:00
minskey guo fed522f7ea Release symbol on error-handling path of ips_get_i915_syms()
In ips_get_i915_syms(), the symbol i915_gpu_busy() is not released
when error occurs.

Signed-off-by: minskey guo <chaohong.guo@intel.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-05 14:59:01 -04:00
minskey guo c21eae4f7c old_cpu_power is wrongly divided by 65535 in ips_monitor()
The variable old_cpu_power is used to save the value of THM_CEC
register. In get_cpu_power(), it will be divided by 65535.

Signed-off-by: minskey guo <chaohong.guo@intel.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-05 14:58:57 -04:00
minskey guo 6230d18cc7 seqno mask of THM_ITV register is 16bit
The mask of sequence number in THM_ITV register is 16bit width instead
of 8bit.

Signed-off-by: minskey guo <chaohong.guo@intel.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-10-05 14:58:54 -04:00
Henrique de Moraes Holschuh fc6e756894 thinkpad-acpi: avoid keymap pitfall
Change the code so that it will use the correct size for keymap entries.
Do it in a way that makes it harder to screw it up in the future.

Reported-by: Jaime Velasco Juan <jsagarribay@gmail.com>
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-09-23 15:42:04 -04:00
Jianwei Yang 32e2f63bcc intel_scu_ipc: fix IPC i2c write bug
We should pass the data to the data register.

Signed-off-by: Jianwei Yang <jianwei.yang@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-24 10:42:09 -07:00
Ossama Othman a9728c9a31 rar: Fix off by one error
It looks like there is an off-by-one error in one of your changes to
drivers/staging/rar_register/rar_register.c:

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-24 10:42:08 -07:00
Matthew Garrett a8ec105c07 hp-wmi: Fix query interface
The machines I have appear to provide their return value in the arguments
structure, not the output structure. Rework the driver to use that again
in order to get rfkill working again.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-23 16:27:08 -04:00
Jonathan Corbet c76a3e1d6c ACPI_TOSHIBA needs LEDS support
Don't ask how ACPI_TOSHIBA got enabled on in desktop system's .config -
I don't know.  But it has silently been there until I tried 2.6.36-rc2,
where it broke the build because I don't have LED support turned on.
Attached patch fixes things up.

(I had to change BACKLIGHT_CLASS_DEVICE to "depends" because otherwise
I get unsightly core dumps out of scripts/kconfig/conf).

jon

--
toshiba: make sure we pull in LED support

The Toshiba extras driver uses the LED module, so make sure we have it
configure in.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-23 15:56:43 -04:00
Victor van den Elzen c3f755e384 platform/x86: move rfkill for Dell Mini 1012 to compal-laptop
Like others in the Mini series, the Dell Mini 1012 does not support
the smbios hook required by dell-laptop.

Signed-off-by: Victor van den Elzen <victor.vde@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-16 11:55:00 -04:00
Jens Taprogge 2b75426282 thinkpad-acpi: Add KEY_CAMERA (Fn-F6) for Lenovo keyboards
On the T410s and most likely other current models, Fn-F6 is labeled as
Camera/Headphone key.  Report key presses as KEY_CAMERA.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Acked-by: Jerone Young <jerone.young@canonical.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-16 11:54:57 -04:00
Henrique de Moraes Holschuh d1e14dca6a thinkpad-acpi: add support for model-specific keymaps
Use the quirks engine to select model-specific keymaps, which makes
it much easier to extend should we need it.

Keycodes are based on the tables at
http://www.thinkwiki.org/wiki/Default_meanings_of_special_keys.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-16 11:54:55 -04:00
Henrique de Moraes Holschuh 34a656d22f thinkpad-acpi: lock down size of hotkey keymap
Use a safer coding style for the hotkey keymap.  This does not fix any
problems, as the current code is correct.  But it might help avoid
mistakes in the future.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-16 11:54:52 -04:00
Henrique de Moraes Holschuh 217f09631a thinkpad-acpi: untangle ACPI/vendor backlight selection
acpi_video_backlight_support() already tells us if ACPI is handling
backlight control through the generic ACPI handle.  It is better to just
trust it.

While at it, adjust down a printk priority, and test earlier for
brightness_enable=0.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-16 11:54:50 -04:00
Henrique de Moraes Holschuh 122f26726b thinkpad-acpi: find ACPI video device by synthetic HID
The Linux ACPI core locates the ACPI video devices for us and marks them
with ACPI_VIDEO_HID.  Use that information to locate the video device
instead of a half-baked hunt for _BCL.

This uncouples the detection of the number of backlight brightness
levels on ThinkPads from the ACPI paths in vid_handle.

With this change, the driver should be able to always detect whether the
ThinkPad uses a 8-level or 16-level brightness scale even on newer
models for which the vid_handle paths have not been updated yet.

It will skip deactivated devices in the ACPI device tree, which is a
change in behaviour.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-16 11:54:47 -04:00
Dan Carpenter 52d7ee558d intel_ips: potential null dereference
There is a potential NULL dereference of "limits."  We can just return
NULL earlier to avoid it.  The caller already handles NULL returns.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-16 11:54:29 -04:00
Julia Lawall 2e0ee69c21 drivers/platform/x86: Adjust confusing if indentation
The assignment of ret to -EIO appears to only make sense if the branch that
it is aligned with is executed, so move it into that branch.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r disable braces4@
position p1,p2;
statement S1,S2;
@@

(
if (...) { ... }
|
if (...) S1@p1 S2@p2
)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@

if (p1[0].column == p2[0].column):
  cocci.print_main("branch",p1)
  cocci.print_secs("after",p2)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-16 11:54:20 -04:00
Kulikov Vasiliy 5629236b31 x86: intel_ips: do not use PCI resources before pci_enable_device()
IRQ and resource[] may not have correct values until
after PCI hotplug setup occurs at pci_enable_device() time.

The semantic match that finds this problem is as follows:

// <smpl>
@@
identifier x;
identifier request ~= "pci_request.*|pci_resource.*";
@@

(
* x->irq
|
* x->resource
|
* request(x, ...)
)
 ...
*pci_enable_device(x)
// </smpl>

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-16 11:53:44 -04:00
David Woodhouse 2016e4a0a1 ideapad: Only allow camera state to be set to 0 or 1
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-08-11 18:00:52 +01:00
David Woodhouse ce326329d7 ideapad: Stop using global variables
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-08-11 18:00:43 +01:00
David Woodhouse 58ac7aa0c3 Add Lenovo ideapad driver
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-08-11 00:01:21 +01:00
Jesse Barnes 1a14703d6b ips driver: make it less chatty
We don't need a dev_warn when we exceed a thermal or power limit as
we'll handle it appropriately by clamping down on the CPU, GPU or both
as needed.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 11:55:15 -04:00
Hong Liu 5aa06930fb intel_scu_ipc: fix size field for intel_scu_ipc_command
Size for PMIC read/write command is byte, while it is DWORD for other
IPC commands.

Signed-off-by: Hong Liu <hong.liu@intel.com>
Signed-off-by: ALan Cox <alan@linux.intel.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:50:33 -04:00
Hong Liu 77e01d6d17 intel_scu_ipc: return -EIO for error condition in busy_loop
Signed-off-by: Hong Liu <hong.liu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:50:33 -04:00
Hong Liu 215c330fe9 intel_scu_ipc: fix data packing of PMIC command on Moorestown
Data is 2-byte per entry for PMIC read-modify-update command.

Signed-off-by: Hong Liu <hong.liu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:50:32 -04:00
Andy Ross 6c8d0fdbe8 Clean up command packing on MRST.
Don't pass more bytes in the command length field than we filled.

Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:50:32 -04:00
Arjan van de Ven ed6f2b4da3 zero the stack buffer before giving random garbage to the SCU
some messages take 4 bytes, but only fill 3 bytes....
this patch makes sure that whatever we send to the SCU is zeroed first

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:50:31 -04:00
Arjan van de Ven 51cd525dce Fix stack buffer size for IPC writev messages
The stack buffer for IPC messages was 16 bytes, limiting messages to a
size of 4 (each message is 32 bit).
However, the touch screen driver is trying to send messages of size 5....

(AC: Set to 20 bytes having checked the max size allowed)

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:50:31 -04:00
Alan Cox 9dd3adeb00 intel_scu_ipc: Use the new cpu identification function
This provides an architecture level board identify function to replace the
cpuid direct usage

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:50:30 -04:00
Sreedhara DS a5b74e69e1 intel_scu_ipc: tidy up unused bits
Delete unused constants IPC_CMD_INDIRECT_RD and IPC_CMD_INDIRECT_WR
Remove multiple inclusion of header file "asm/mrst.h"

Signed-off-by: Sreedhara DS <sreedhara.ds@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:50:30 -04:00
Sreedhara DS 804f8681a9 Remove indirect read write api support.
The firmware of production devices does not support this interface so this
is dead code.

Signed-off-by: Sreedhara DS <sreedhara.ds@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:50:30 -04:00
Sreedhara DS e3359fd5d2 intel_scu_ipc: Support Medfield processors
Changes to work on bothMmoorestown and Medfield
New pci id added for Medfield
Return type of ipc_data_readl chnaged from u8 to u32

Signed-off-by: Sreedhara DS <sreedhara.ds@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:50:29 -04:00
Sreedhara DS 14d10f0a48 intel_scu_ipc: detect CPU type automatically
Intel SCU message formats depend upon the processor type. Replace the
module option with automatic detection of the processor type.

Signed-off-by: Sreedhara DS <sreedhara.ds@intel.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:50:29 -04:00
Jan Engelhardt a00cd11b39 x86 plat: limit x86 platform driver menu to X86
My .config contains ACER_WMI=m. On SPARC. That does not make sense.
Restrict the x86 platform driver menu to x86.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:49:13 -04:00
Thomas Renninger 7a0691c16f hp-wmi: acpi_drivers.h is already included through acpi.h two lines below
Signed-off-by: Thomas Renninger <trenn@suse.de>
CC: linux-acpi@vger.kernel.or
CC: platform-driver-x86@vger.kernel.org
CC: mjg@redhat.com
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:49:12 -04:00
Thomas Renninger c4775062d5 hp-wmi: Fix mixing up of and/or directive
This should have been an "and". Additionally checking for !obj
is even better.

Signed-off-by: Thomas Renninger <trenn@suse.de>
CC: linux-acpi@vger.kernel.or
CC: platform-driver-x86@vger.kernel.org
CC: mjg@redhat.com
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:49:12 -04:00
Axel Lin 4519169b8f dell-laptop: make dell_laptop_i8042_filter() static
Make dell_laptop_i8042_filter() static as it's used only in dell-laptop.c

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:49:11 -04:00
Axel Lin 45036ae14a asus-laptop: fix asus_input_init error path
This patch includes below fixes:
1. return -ENOMEM instead of 0 if input_allocate_device fail.
2. fix wrong goto if sparse_keymap_setup fail.
3. fix wrong goto if input_register_device fail.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:49:11 -04:00
Axel Lin 8700e1612e msi-wmi: make needlessly global symbols static
backlight is needlessly defined global.
This patch makes the symbol static.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Anisse Astier <anisse@astier.eu>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:49:10 -04:00
Pierre Ducroquet 6c3f6e6c57 toshiba-acpi: Add support for Toshiba Illumination.
Add support for Toshiba Illumination. This is a set of LEDs installed on
some Toshiba laptops. It is controlled through ACPI, the commands has been
found through reverse engineering. It has been tested on a Toshiba Qosmio
G50-122.

Signed-off-by: Pierre Ducroquet <pinaraf@pinaraf.info>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:49:10 -04:00
Randy Dunlap 5ca5671891 compal-laptop: depends on POWER_SUPPLY
compal-laptop uses power_supply interfaces so it should depend
on POWER_SUPPLY.

ERROR: "power_supply_register" [drivers/platform/x86/compal-laptop.ko] undefined!
ERROR: "power_supply_unregister" [drivers/platform/x86/compal-laptop.ko] undefined!

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc:	Cezary Jackiewicz <cezary.jackiewicz@gmail.com>
Cc:	Matthew Garrett <mjg@redhat.com>
Cc:	platform-driver-x86@vger.kernel.org
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:49:10 -04:00
Alek Du 8950778704 gpio: Add PMIC GPIO block support
Moorestown has PMIC chip which contains GPIO blocks. The PMIC chip is
connected to Langwell by SPI interface. So this GPIO driver will be regarded
as SPI GPIO expander though the actual GPIO access is through IPC and SRAM.
The SPI master contoller will probe this device driver by parsing SPIB table.

Cleaned up for new IPC, GPE removed and some printk and other tidying by
Alan Cox. Fixes for points noted by Matthew Garrett

Signed-off-by: Alek Du <alek.du@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:49:09 -04:00
Thomas Renninger 925b108918 X86 platform driver: Fix section mismatch in wmi.c
The .add function must not be declared __init.

Signed-off-by: Thomas Renninger <trenn@suse.de>

CC: Alexey Starikovskiy <astarikovskiy@suse.de>
CC: Len Brown <lenb@kernel.org>
CC: linux-kernel@vger.kernel.org
CC: linux-acpi@vger.kernel.org
CC: platform-driver-x86@vger.kernel.org
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:49:07 -04:00
Thomas Renninger a420e46412 X86 platform drivers: Remove EC dump from thinkpad_acpi
There is a general interface for that now (provided by
other patches in this patch series):
/sys/kernel/debug/ec/*/io

Signed-off-by: Thomas Renninger <trenn@suse.de>

CC: Alexey Starikovskiy <astarikovskiy@suse.de>
CC: Len Brown <lenb@kernel.org>
CC: linux-kernel@vger.kernel.org
CC: linux-acpi@vger.kernel.org
CC: platform-driver-x86@vger.kernel.org
CC: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
CC: ibm-acpi-devel@lists.sourceforge.net
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:49:06 -04:00
Axel Lin 9fab10cdf5 panasonic-laptop: fix acpi_pcc_write_sset return value
In current implementation, acpi_pcc_write_sset return 1
if write is successful, 0 if write is failed.
But all the callers consider acpi_pcc_write_sset return 0
if write is successful and return negtive if write is failed.

This patch changes the implementation of acpi_pcc_write_sset to
return 0 if write is successful, -EIO if write is failed.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03 09:49:05 -04:00