Commit Graph

1324 Commits

Author SHA1 Message Date
Benson Leung 2ef392042d Platform: x86: chromeos_laptop : Add basic platform data for atmel devices
Add basic platform data to get the current upstream driver working
with the 224s touchpad and 1664s touchscreen.
We will be using NULL config so we will use the settings from the
devices' NVRAMs.

Signed-off-by: Benson Leung <bleung@chromium.org>
Tested-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-03-08 16:03:29 -08:00
Linus Torvalds 23caaeea27 Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86
Pull x86 platform driver updates from Matthew Garrett:
 "Mostly relatively small updates, along with some hardware enablement
  for Sony hardware and a pile of updates to Google's Chromebook driver"

* 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86: (49 commits)
  ideapad-laptop: Depend on BACKLIGHT_CLASS_DEVICE instead of selecting it
  ideapad: depends on backlight subsystem and update comment
  Platform: x86: chromeos_laptop - add i915 gmbuses to adapter names
  Platform: x86: chromeos_laptop - Add isl light sensor for Pixel
  Platform: x86: chromeos_laptop - Add a more general add_i2c_device
  Platform: x86: chromeos_laptop - Add Pixel Touchscreen
  Platform: x86: chromeos_laptop - Add support for probing devices
  Platform: x86: chromeos_laptop - Add Pixel Trackpad
  hp-wmi: fix handling of platform device
  sony-laptop: leak in error handling sony_nc_lid_resume_setup()
  hp-wmi: Add support for SMBus hotkeys
  asus-wmi: Fix unused function build warning
  acer-wmi: avoid the warning of 'devices' may be used uninitialized
  drivers/platform/x86/thinkpad_acpi.c: Handle HKEY event 0x6040
  Platform: x86: chromeos_laptop - Add HP Pavilion 14
  Platform: x86: chromeos_laptop - Add Taos tsl2583 device
  Platform: x86: chromeos_laptop - Add Taos tsl2563 device
  Platform: x86: chromeos_laptop - Add Acer C7 trackpad
  Platform: x86: chromeos_laptop - Rename setup_lumpy_tp to setup_cyapa_smbus_tp
  asus-laptop: always report brightness key events
  ...
2013-03-03 10:16:19 -08:00
Matthew Garrett 445e8d007c ideapad-laptop: Depend on BACKLIGHT_CLASS_DEVICE instead of selecting it
Selecting BACKLIGHT_CLASS_DEVICE doesn't guarantee that any of its
dependencies are enabled, and these are complicated. Depending isn't ideal
for configuration UI purposes, but is probably more appropriate here.

Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:47 -05:00
Ike Panhc 16fd91e062 ideapad: depends on backlight subsystem and update comment
I've got a report of build failure on ideapad-laptop, which shows

drivers/built-in.o: In function `ideapad_acpi_notify':
ideapad-laptop.c:(.text+0x63876a): undefined reference to `backlight_force_update'
drivers/built-in.o: In function `ideapad_acpi_remove':
ideapad-laptop.c:(.devexit.text+0x64a7): undefined reference to `backlight_device_unregister'
drivers/built-in.o: In function `ideapad_acpi_add':
ideapad-laptop.c:(.devinit.text+0x45e28): undefined reference to `backlight_device_register'

To select backlight subsystem can prevent this error from happening.

Also update comment for this driver.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:47 -05:00
Benson Leung 741bf0c7be Platform: x86: chromeos_laptop - add i915 gmbuses to adapter names
Add the two other i2c buses (vga and panel) from i915.
Chromebook Pixel has input and light sensor devices on these busses.

Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:46 -05:00
Benson Leung cc5c3985a3 Platform: x86: chromeos_laptop - Add isl light sensor for Pixel
The Chromebook Pixel uses an isl29023 ambient light sensor on the PANEL
GMBus.

Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:46 -05:00
Benson Leung e7b28845d7 Platform: x86: chromeos_laptop - Add a more general add_i2c_device
This will allow us to assign devices to buses by the type enum.

Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:45 -05:00
Yufeng Shen 33a84f8a76 Platform: x86: chromeos_laptop - Add Pixel Touchscreen
Instantiate the atmel mxt1664s touchscreen on this system.
The touchscreen may appear at two possible addresses:
0x4a in operational mode.
0x26 in bootloader mode.

Signed-off-by: Yufeng Shen <miletus@chromium.org>
Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:45 -05:00
Benson Leung bcaf089c51 Platform: x86: chromeos_laptop - Add support for probing devices
This will allow support for devices that may appear at more than
one i2c address at boot time. The specific example is the atmel_mxt touch
devices, which may appear at a different address if it comes up
in bootloader mode.

Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:44 -05:00
Benson Leung 8e1ad4c4bf Platform: x86: chromeos_laptop - Add Pixel Trackpad
Instantiate the atmel mxt224s trackpad on this system.
The trackpad may appear at two possible addresses:
0x4b in operational mode.
0x25 in bootloader mode.

Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:44 -05:00
Dmitry Torokhov c165b80cfe hp-wmi: fix handling of platform device
The driver will not quite work if someone unbinds the platform device
from the platform driver via sysfs (moreover it will bomb is the driver
built into the kernel as hp_wmi_bios_remove is marked as __exit and will
not be present in the kernel).

To fix it let's use platform_driver_probe() instead of
platform_driver_register(), which disables binding/unbinding via sysfs.
This also allows us to mark hp_wmi_bios_setup as __init and discard it
once module is initialized.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:43 -05:00
Dan Carpenter 34cf1df34a sony-laptop: leak in error handling sony_nc_lid_resume_setup()
We need to decrement "i" first because the current "i" was not allocated
succesfully.  Also we should go free the way down to zero to avoid a
leak.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:43 -05:00
Kyle Evans fabf85e3ca hp-wmi: Add support for SMBus hotkeys
Several models of HP laptops using the same DSDT have hotkey buttons
that do not work until the EC is configured to enable them.

Signed-off-by: Kyle Evans <kvans32@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:42 -05:00
Shuah Khan 2adb95d83f asus-wmi: Fix unused function build warning
Fix the following build warning

CC [M]  drivers/platform/x86/asus-wmi.o
drivers/platform/x86/asus-wmi.c:1356:13: warning: ‘do_nothing’ defined but not used [-Wunused-function]

Signed-off-by: Shuah Khan <shuah.khan@hp.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:42 -05:00
Lee, Chun-Yi f24c96eae5 acer-wmi: avoid the warning of 'devices' may be used uninitialized
Fengguang Wu run kernel build test to platform-drivers-x86/linux-next git tree
on x86_64 architecture and found a warning that was introduced by
727651bf738b6b917335025d09323d0962eda114 commit:

drivers/platform/x86/acer-wmi.c: In function ‘WMID_set_capabilities’:
drivers/platform/x86/acer-wmi.c:1211: warning: ‘devices’ may be used
uninitialized in this function

This patch fixes the above warning message.

Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:41 -05:00
Richard Hartmann 6f62bc3e8d drivers/platform/x86/thinkpad_acpi.c: Handle HKEY event 0x6040
Handle HKEY event generated on AC power change. The current message
asks users to submit data related to this event which leads to
a lot of confusion and noise on the mailing list.

The following is a list affected models and 'Message-Id'
from ibm-acpi-devel@lists.sourceforge.net of people who saw this
event when either plugging or unplugging the AC adapter or
docking or undocking their laptop.

X120e - CAAAujb5v9dHdbdxDVvhNJoG4UrZC1TgKqeB_zGpAy7q8kZHMEQ@mail.gmail.com
X121e - 20120817143459.GB3462@x1.osrc.amd.com
X220  - Confirmed by Richard Hartmann
X220i - 4F406274.7070807@gmail.com
X220t - 4F489F5B.9040705@cs.tu-berlin.de
X230  - CAKx4u7kqvVH0-gstomsiVYdGC0i6=bGxzaQ8sq9gbg76TGme3w@mail.gmail.com
T420  - 9c848ee30b006737d0534d906bab0cf6@niklaas-baudet.net
T420s - 20120608080824.GS25324@hexapodia.org
W520  - 20121008181050.GF2549@ericlaptop.home.christensenplace.us

Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:41 -05:00
Benson Leung e65a624b86 Platform: x86: chromeos_laptop - Add HP Pavilion 14
Add support for the HP Pavilion 14 Chromebook's trackpad, which is a reuse
of the Samsung Series 5 550 trackpad.

Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:40 -05:00
Benson Leung 8016bcbc38 Platform: x86: chromeos_laptop - Add Taos tsl2583 device
The Samsung Series 5 Chromebook is equipped with  a Taos tsl2583
light sensor. Instatiate it here.

Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:40 -05:00
Benson Leung aabf3f442b Platform: x86: chromeos_laptop - Add Taos tsl2563 device
Two legacy Chromebooks, the Cr-48, and the Acer AC700,
are equipped with a Taos tsl2563 light sensor.
This will instantiate the sensor on those laptops.

Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:39 -05:00
Benson Leung 261f171f57 Platform: x86: chromeos_laptop - Add Acer C7 trackpad
Add support for the Acer C7's trackpad, which is a reuse
of the Samsung Series 5 550 trackpad.

Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:39 -05:00
Benson Leung 6e71094d98 Platform: x86: chromeos_laptop - Rename setup_lumpy_tp to setup_cyapa_smbus_tp
The Cypress trackpad on smbus is used on other systems
as well. Lets make the name more generic.

Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:38 -05:00
Corentin Chary 2740e1bd52 asus-laptop: always report brightness key events
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:38 -05:00
Corentin Chary 3ba0302bdd asus-wmi: always report brightness key events
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:37 -05:00
Mattia Dongili 7517a17c1a sony-laptop: support basic functions for handle 0x14B and 0x14C
Z series and other recent models have 0x14? for lid and keyboard
backlight.

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:37 -05:00
Mattia Dongili 3a7abcd809 sony-laptop: allow reading the status of gfx switch
Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27 08:30:36 -05:00
Mattia Dongili 3ec1c3983d sony-laptop: fully enable SNY controlled modems
The call to handlers 0x124 and 0x135 (rfkill control) seems to take a
bitmask to control various states of the device. For our rfkill we need
a fully on/off. SVZ1311Z9R/X's LTE modem needs more bits up.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=47751
Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Cc: stable@kernel.org
2013-02-27 08:30:30 -05:00
Linus Torvalds d895cb1af1 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs pile (part one) from Al Viro:
 "Assorted stuff - cleaning namei.c up a bit, fixing ->d_name/->d_parent
  locking violations, etc.

  The most visible changes here are death of FS_REVAL_DOT (replaced with
  "has ->d_weak_revalidate()") and a new helper getting from struct file
  to inode.  Some bits of preparation to xattr method interface changes.

  Misc patches by various people sent this cycle *and* ocfs2 fixes from
  several cycles ago that should've been upstream right then.

  PS: the next vfs pile will be xattr stuff."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (46 commits)
  saner proc_get_inode() calling conventions
  proc: avoid extra pde_put() in proc_fill_super()
  fs: change return values from -EACCES to -EPERM
  fs/exec.c: make bprm_mm_init() static
  ocfs2/dlm: use GFP_ATOMIC inside a spin_lock
  ocfs2: fix possible use-after-free with AIO
  ocfs2: Fix oops in ocfs2_fast_symlink_readpage() code path
  get_empty_filp()/alloc_file() leave both ->f_pos and ->f_version zero
  target: writev() on single-element vector is pointless
  export kernel_write(), convert open-coded instances
  fs: encode_fh: return FILEID_INVALID if invalid fid_type
  kill f_vfsmnt
  vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op
  nfsd: handle vfs_getattr errors in acl protocol
  switch vfs_getattr() to struct path
  default SET_PERSONALITY() in linux/elf.h
  ceph: prepopulate inodes only when request is aborted
  d_hash_and_lookup(): export, switch open-coded instances
  9p: switch v9fs_set_create_acl() to inode+fid, do it before d_instantiate()
  9p: split dropping the acls from v9fs_set_create_acl()
  ...
2013-02-26 20:16:07 -08:00
Benson Leung d1381f45ad Platform: x86: Add Chrome OS Laptop driver
This adds the chromeos_laptop driver. It supports
the Cypress APA SMBUS touchpad as well as the isl29018 i2c ambient
light sensor on the Samsung Series 5 550 Chromebook.

Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:57 -08:00
Manoj Iyer 16a3d9f5aa thinkpad-acpi: enable loading module with new B-series Lenovo BIOS
The new B series BIOS has version string 43CN46WW. The driver
requires that 2nd and 3rd characters be 'E' and 'T' respectively,
where as the newer BIOS has 'C' and 'N' respectively. Failing to
load the module causes some of the hotkeys to not work.

Before the patch
================
sudo modprobe thinkpad_acpi
FATAL: Error inserting thinkpad_acpi (/lib/modules/3.5.0-15-generic/kernel/drivers/platform/x86/thinkpad_acpi.ko): No such device

After the patch
===============
[44937.265438] thinkpad_acpi: ThinkPad ACPI Extras v0.24
[44937.265445] thinkpad_acpi: http://ibm-acpi.sf.net/
[44937.265449] thinkpad_acpi: ThinkPad BIOS 43CN46WW, EC unknown
[44937.265453] thinkpad_acpi: Lenovo Lenovo B470e, model HuronRiver Platform
[44937.266479] thinkpad_acpi: detected a 8-level brightness capable ThinkPad
[44937.266557] thinkpad_acpi: Standard ACPI backlight interface available, not loading native one
[44937.267846] thinkpad_acpi: Console audio control enabled, mode: monitor (read only)
[44937.268131] input: ThinkPad Extra Buttons as /devices/platform/thinkpad_acpi/input/input17

Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Tested-by: James Ferguson <james.ferguson@canonical.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:56 -08:00
Trepák Vilmos 4fca7ce39f Platform: hp-wmi: add rfkill support for integrated GPS
Add rfkill support for the GPS radio found in HP laptops (HP Elitebook 2170p and the like)
using the Ericsson F5321/H5321 Mobile Broadband Module.

Signed-off-by: Viliam Trepák <trepo@netcomga.sk>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:56 -08:00
Lee, Chun-Yi 5f3511d2a6 acer-wmi: support Lenovo ideapad S205 1038DPG wifi switch
Found another Lenovo ideapad S205 the product name is 1038DPG, it has
a 0x78 EC register exposes the state of wifi hardware switch on the machine.

So, add this patch to support Lenovo ideapad S205-1038DPG wifi hardware
switch in acer-wmi driver.

Evidently the Ideapad S205 is just a model name on the market, but they have
totally different product name in DMI table.

Reference: bko#43007
        https://bugzilla.kernel.org/show_bug.cgi?id=43007

Tested-by: Colin <colin.newell@gmail.com>
Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Thomas Renninger <trenn@suse.de>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:56 -08:00
Lee, Chun-Yi e6c33f1fe7 acer-wmi: support Lenovo ideapad S205 10382JG wifi switch
Found another Lenovo ideapad S205 the product name is 10382JG, it has
a 0x78 EC register exposes the state of wifi hardware switch on the machine.

So, add this patch to support Lenovo ideapad S205-10382JG wifi hardware
switch in acer-wmi driver.

Evidently the Ideapad S205 is just a model name on the market, but they have
totally different product name in DMI table.

Reference: bko#43007
        https://bugzilla.kernel.org/show_bug.cgi?id=43007

Tested-by: Ivo Anjo <knuckles@gmail.com>
Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Thomas Renninger <trenn@suse.de>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:56 -08:00
AceLan Kao 24c8a4c4ba asus-nb-wmi: add all video switch keys
Fill up all the video switch keys in the map.

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:56 -08:00
AceLan Kao a2a96f0c72 asus-wmi: add display toggle quirk
For machines with AMD graphic chips, it will send out WMI event and ACPI
interrupt at the same time while hitting the hotkey. BIOS will notify the
system the next display output mode throught WMI event code, so that
windows' application can show an OSD to tell the user which mode will be
taken effect. User can hit the display toggle key many times within 2
seconds to choose the mode they want. After 2 seconds, WMI dirver should
send a WMIMethod(SDSP) command to tell the BIOS which mode the user chose.
And then BIOS will raise another ACPI interrupt to tell the system to
really switch the display mode.

In Linux desktop, we don't have this kind of OSD to let users to choose
the mode they want, so we don't need to call WMIMethod(SDSP) to have
another ACPI interrupt. To simplify the problem, we just have to ignore
the WMI event, and let the first ACPI interrupt to send out the key event.

For the need, here comes another quirk to add machines with this kind of
behavior. When the WMI driver receives the display toggle WMI event, and
found the machin is in the list, it will do nothing and let ACPI video
driver to report the key event.

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:55 -08:00
AceLan Kao 3da4cd2015 asus-laptop: add all video switch keys
Fill up all the video switch keys in the map.

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:55 -08:00
AceLan Kao 98bfcb8e99 asus-nb-wmi: correct a touchpad hotkey mapping
0x60 is touchpad enable key, but is misdefined in the keymap.

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:55 -08:00
AceLan Kao 19d3ab12e8 asus-laptop: correct a touchpad hotkey mapping
0x60 is touchpad enable key, but is misdefined in the keymap.

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:55 -08:00
Corentin Chary a935eaecef asus-{nb-wmi|laptop}.c: sync keymaps
Maybe this should be shared in another module...

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:55 -08:00
Corentin Chary 982d385ad1 asus-laptop: map some new keys
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:55 -08:00
Maxim Mikityanskiy c11ac2aa52 msi-wmi: Add MSI Wind support
Add MSI Wind support to msi-wmi driver. MSI Wind has different GUID for
key events, different WMI key scan codes, it does not need filtering
consecutive identical events and it does not support backlight control
via MSIWMI_BIOS_GUID WMI. Tested on MSI Wind U100.

Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:54 -08:00
Maxim Mikityanskiy fedda8e738 msi-wmi: Introduced quirk_last_pressed
Introduced quirk_last_pressed variable that would indicate if
last_pressed is used or not. Also converted last_pressed to simple
variable in order to allow keymap to be non-contiguous.

Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:54 -08:00
Maxim Mikityanskiy da8506288f msi-wmi: Make keys and backlight independent
Introduced function msi_wmi_backlight_setup() that initializes backlight
device. Made driver load and work if only one WMI (only for hotkeys or
only for backlight) is present.

Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:54 -08:00
Maxim Mikityanskiy b0d3bb53be msi-wmi: Use enums for scancodes
Use enums for consecutive scancodes, rename key names from MSI_WMI_* to
MSI_KEY_* and use tabs for whitespace in msi_wmi_keymap.

Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Acked-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:54 -08:00
Maxim Mikityanskiy dd2b025157 msi-wmi: Avoid repeating constants
Use UUID defines in MODULE_ALIAS strings to avoid repeating strings.

Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Acked-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:54 -08:00
Maxim Mikityanskiy 51c94491c8 msi-wmi: Fix memory leak
Fix memory leak - don't forget to kfree ACPI object when returning from
msi_wmi_notify() after suppressing key event.

Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Acked-by: Anisse Astier <anisse@astier.eu>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:54 -08:00
Maxim Mikityanskiy 03696e51d7 msi-laptop: Disable brightness control for new EC
It seems that existing brightness control works only for old EC models.
On newer ones auto_brightness access always timeouts and lcd_level
always shows 0. So disable brightness control for new EC models. It
works fine with ACPI video driver anyway.

Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:53 -08:00
Maxim Mikityanskiy 0de6575ad0 msi-laptop: Add MSI Wind U90/U100 support
Add MSI Wind U90/U100 to DMI table and add some missing EC features
support such as basic fan control, turbo and ECO modes and touchpad
state. Tested on MSI Wind U100.

Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:53 -08:00
Lee, Chun-Yi 0816392b97 msi-laptop: merge quirk tables to one
This patch introduced a quirk_entry struct, then we merged all quirk
tables to msi_dmi_table. Then we can more easily to set different quirk
attributes for different machine.

Signed-off-by: Lee, Chun-Yi <jlee@suse.com>

Changed this patch so that it could be applied before MSI Wind U100
support patch. Changed rfkill logic for ec_read_only quirk support.
Removed delays if ec_delay = false.

Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Acked-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:53 -08:00
Maxim Mikityanskiy 1b6517a0a9 msi-laptop: Work around gcc warning
Assign initial value to variable in order to prevent gcc warning about
uninitialized variable.

Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:53 -08:00
Maxim Mikityanskiy 27eb9e7f12 msi-laptop: Use proper return codes instead of -1
Use proper function return codes instead of -1

Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-24 14:49:53 -08:00