Commit Graph

1702 Commits

Author SHA1 Message Date
Darren Hart
802cf2e1e0 samsung-laptop.c: Prefer kstrtoint over single variable sscanf
Replace existing usage of single variable sscanf with kstrtoint for
consistency with checkpatch warnings against such usage.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-02-06 18:53:59 -08:00
Lad, Prabhakar
4e7f09ad5e samsung-laptop: Fix sparse integer as NULL warning
Fix the following sparse warning:

samsung-laptop.c:1365:52: warning: Using plain integer as NULL pointer

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-02-06 18:44:28 -08:00
Julijonas Kikutis
b0dcaf4fbb samsung-laptop: enable better lid handling
Some Samsung laptops with SABI3 delay the sleep for 10 seconds after
the lid is closed and do not wake up from sleep after the lid is opened.
A SABI command is needed to enable the better behavior.

Command = 0x6e, d0 = 0x81 enables this behavior. Returns d0 = 0x01.
Command = 0x6e, d0 = 0x80 disables this behavior. Returns d0 = 0x00.

Command = 0x6d and any d0 queries the state. This returns:
d0 = 0x00000*01, d1 = 0x00, d2 = 0x00, d3 = 0x0* when it is enabled.
d0 = 0x00000*00, d1 = 0x00, d2 = 0x00, d3 = 0x0* when it is disabled.
Where * is 0 - laptop has never slept or hibernated after switch on,
           1 - laptop has hibernated just before,
           2 - laptop has slept just before.

Patch addresses bug https://bugzilla.kernel.org/show_bug.cgi?id=75901 .
It adds a sysfs attribute lid_handling with a description and also an
addition to the quirks structure to enable the mode by default.

A user with another laptop in the bug report says that "power button has
to be pressed twice to wake the machine" when he or she enabled the mode
manually using the SABI command. Therefore, it is enabled by default
only for the single laptop that I have tested.

Signed-off-by: Julijonas Kikutis <julijonas.kikutis@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-02-06 18:33:55 -08:00
Azael Avalos
fa465739d4 toshiba_acpi: Add a check for TOS_NOT_SUPPORTED in the sci_open function
This was "toshiba_acpi: Change sci_open function return value"

Some Toshiba laptops have "poorly implemented" SCI calls on their
BIOSes and are not checking for sci_{open, close} calls, therefore,
the sci_open function is failing and making some of the supported
features unavailable (kbd backlight, touchpad, illumination, etc.).

This patch checks whether we receive TOS_NOT_SUPPORTED and returns
1, making the supported features work on such laptops.

In the case that some laptops really do not support the SCI, all the
SCI dependent functions check for TOS_NOT_SUPPORTED, and thus, not
registering support for the queried feature.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-01-28 21:55:01 -08:00
Vivien Didelot
ed52ccbce7 asus-laptop: use DEVICE_ATTR_xx macros
Use DEVICE_ATTR_{RO,WO,RW} macros to simplify sysfs attributes
declaration.

To declare a "foo" attribute, DEVICE_ATTR_RW() requires foo_show() and
foo_store(), so rename a few functions to satisfy this requirement.

Also put the macro below each related show/store functions for clarity.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-01-28 21:21:11 -08:00
Andy Shevchenko
32d0e4a337 intel_scu_ipc: Read resources from PCI configuration
Read the resources from PCI BAR0 instead of using hardcoded values.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-01-28 21:21:11 -08:00
Andy Shevchenko
f0295a36dc intel_scu_ipc: move error check out of the loop
This is small performance optimization of the busy_loop().

While here, use BIT() macro instead of plain integers when check the status.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-01-28 21:21:10 -08:00
Andy Shevchenko
7c2e3c7476 intel_scu_ipc: fix indentation in few places
While here, do couple of amendments:
 - move platform variable to the function where it's used
 - define intel_scu_ipc_check_status() static

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-01-28 21:21:10 -08:00
Vivien Didelot
03070e7c9d asus-laptop: Fix is_visible return value
With a Lucid platform, asus_sysfs_is_visible() returned a boolean for
ls_switch and ls_level attributes.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-01-23 09:10:22 -08:00
Michael Karcher
e8549e2cf3 fujitsu-laptop: use FB_BLANK_* constants
Replace the magic numbers in fujitsu-laptop.c by the appropriate FB_BLANK
constants, as indicated by the comment for backlight_properties.power in
include/linux/backlight.h.

Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Acked-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-01-23 09:09:25 -08:00
Hans de Goede
4690555e13 samsung-laptop: Add use_native_backlight quirk, and enable it on some models
Since kernel 3.14 the backlight control has been broken on various Samsung
Atom based netbooks. This has been bisected and this problem happens since
commit b35684b8fa ("drm/i915: do full backlight setup at enable time")

This has been reported and discussed in detail here:
http://lists.freedesktop.org/archives/intel-gfx/2014-July/049395.html

Unfortunately no-one has been able to fix this. This only affects Samsung
Atom netbooks, and the Linux kernel and the BIOS of those laptops have never
worked well together. All affected laptops already have a quirk to avoid using
the standard acpi-video interface and instead use the samsung specific SABI
interface which samsung-laptop uses. It seems that recent fixes to the i915
driver have also broken backlight control through the SABI interface.

The intel_backlight driver OTOH works fine, and also allows for finer grained
backlight control. So add a new use_native_backlight quirk, and replace the
broken_acpi_video quirk with this quirk for affected models. This new quirk
disables acpi-video as before and also stops samsung-laptop from registering
the SABI based samsung_laptop backlight interface, leaving only the working
intel_backlight interface.

This commit enables this new quirk for 3 models which are known to be affected,
chances are that it needs to be used on other models too.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1094948 # N145P
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1115713 # N250P
Reported-by: Bertrik Sikken <bertrik@sikken.nl> # N150P
Cc: stable@vger.kernel.org # 3.16
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-01-23 09:09:04 -08:00
Azael Avalos
172ce0a9f6 toshiba_acpi: Add support for USB Sleep and Music
Newer Toshiba laptops now come with a feature called USB Sleep and
Music, where the laptop speakers remain powered and the line-in jack
is used to connect an external device to use the laptop speakers when
the computer is asleep or turned off.

This patchs adds support to such feature, by creating a sysfs entry
named "usb_sleep_music", accepting only two values, 0 to disable and
1 to enable.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-01-23 09:08:26 -08:00
Azael Avalos
bb3fe01ff6 toshiba_acpi: Add support for USB Rapid Charge
Newer Toshiba laptops equipped with USB 3.0 ports now have the
functionality of rapid charging devices connected to their USB hubs.

This patch adds support to use such feature by creating a sysfs entry
named "usb_rapid_charge", accepting only two values, 0 to disable and
1 to enable, however, the machine needs a restart everytime the
function is toggled.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-01-23 09:08:25 -08:00
Azael Avalos
182bcaa5c9 toshiba_acpi: Add support for USB Sleep functions under battery
Toshiba laptops supporting USB Sleep and Charge also come with a
feature called "USB functions under battery", which what it does when
enabled, is allows the USB Sleep functions when the computer is under
battery power.

This patch adds support to that function, creating a sysfs entry
named "sleep_functions_on_battery", accepting values from 0-100,
where zero disables the function and 1-100 sets the battery level at
which point the USB Sleep functions will be disabled, and printing
the current state of the functon and also the battery level currently
set.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-01-23 09:08:25 -08:00
Azael Avalos
e26ffe5124 toshiba_acpi: Add support for USB Sleep and Charge function
Newer Toshiba models now come with a feature called Sleep and Charge,
where the computer USB ports remain powered when the computer is
asleep or turned off.

This patch adds support to such feature, creating a sysfs entry
called "usb_sleep_charge" to set the desired charging mode or to
disable it.

The sysfs entry accepts three parameters, 0, 1 and 2, beign disabled,
alternate and auto respectively.

The auto mode stands for USB conformant devices (which most are), and
the alternate mode stands for those non USB conformant devices that
require more power.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-01-23 09:08:19 -08:00
Linus Torvalds
385336e321 platform-drivers-x86 for 3.19
thinkpad-acpi: Switch to software mute, cleanups
 acerhdf: Bang-bang thermal governor, new models, cleanups
 dell-laptop: New keyboard backlight support and documentation
 toshiba_acpi: Keyboard backlight updates, hotkey handling
 dell-wmi: Keypress filtering, WMI event processing
 eeepc-laptop: Multiple cleanups, improved error handling, documentation
 hp_wireless: Inform the user if hp_wireless_input_setup()/add() fails
 misc: Code cleanups, quirks, various new IDs
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJUkw1OAAoJEKbMaAwKp364N0AH/A/1YQDjiIsrRe7/J65rfna+
 zrH6QoQfEaTbkJX3p8VFElh0Tlx9EO7kYfxhHm45kjWjfuJsyZtEonl+CeZTEe2s
 SGP1v3wSUbHc8MI1sRqqDUSTNihJPWEPjc8jFKqyJ3iOO0r6F/UuYajPwEGpjAjh
 etHY9HBS8FNwaevh6T3tiKeyy+z34OZHsASCnZEYLKWYXRu/0dL3yNY1vIs3Ybux
 bnH+sbBUXSu3rir4V6q/4j6f1B6RnXqirPLq5rsNHhHETGCJUy+phUWZRYMEVzR3
 A3rEuHXcHMgqlVLqa+ph3nN3iyNYXVVkOfENUCp/2WDdagBqpD5isc6YmPCzsJk=
 =1/XE
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v3.19-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86

Pull x86 platform driver update from Darren Hart:
 - thinkpad-acpi: Switch to software mute, cleanups
 - acerhdf: Bang-bang thermal governor, new models, cleanups
 - dell-laptop: New keyboard backlight support and documentation
 - toshiba_acpi: Keyboard backlight updates, hotkey handling
 - dell-wmi: Keypress filtering, WMI event processing
 - eeepc-laptop: Multiple cleanups, improved error handling, documentation
 - hp_wireless: Inform the user if hp_wireless_input_setup()/add() fails
 - misc: Code cleanups, quirks, various new IDs

* tag 'platform-drivers-x86-v3.19-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86: (33 commits)
  platform/x86/acerhdf: Still depends on THERMAL
  Documentation: Add entry for dell-laptop sysfs interface
  acpi: Remove _OSI(Linux) for ThinkPads
  thinkpad-acpi: Try to use full software mute control
  acerhdf: minor clean up
  acerhdf: added critical trip point
  acerhdf: Use bang-bang thermal governor
  acerhdf: Adding support for new models
  acerhdf: Adding support for "manual mode"
  dell-smo8800: Add more ACPI ids and change description of driver
  platform: x86: dell-laptop: Add support for keyboard backlight
  toshiba_acpi: Add keyboard backlight mode change event
  toshiba_acpi: Change notify funtion to handle more events
  toshiba_acpi: Move hotkey enabling code to its own function
  dell-wmi: Don't report keypresses on keybord illumination change
  dell-wmi: Don't report keypresses for radio state changes
  hp_wireless: Inform the user if hp_wireless_input_setup()/add() fails
  toshiba-acpi: Add missing ID (TOS6207)
  Sony-laptop: Deletion of an unnecessary check before the function call "pci_dev_put"
  platform: x86: Deletion of checks before backlight_device_unregister()
  ...
2014-12-18 20:24:55 -08:00
Randy Dunlap
200db64711 platform/x86/acerhdf: Still depends on THERMAL
acerhdf uses thermal interfaces so it should depend on THERMAL.
It also should not select a thermal driver without checking that
THERMAL is enabled.

This fixes the following build errors when THERMAL=m and
ACERHDF=y.

drivers/built-in.o: In function `acerhdf_set_mode':
acerhdf.c:(.text+0x3e02e1): undefined reference to `thermal_zone_device_update'
drivers/built-in.o: In function `acerhdf_unbind':
acerhdf.c:(.text+0x3e052d): undefined reference to `thermal_zone_unbind_cooling_device'
drivers/built-in.o: In function `acerhdf_bind':
acerhdf.c:(.text+0x3e0593): undefined reference to `thermal_zone_bind_cooling_device'
drivers/built-in.o: In function `acerhdf_init':
acerhdf.c:(.init.text+0x1c2f5): undefined reference to `thermal_cooling_device_register'
acerhdf.c:(.init.text+0x1c360): undefined reference to `thermal_zone_device_register'
drivers/built-in.o: In function `acerhdf_unregister_thermal':
acerhdf.c:(.text.unlikely+0x3c67): undefined reference to `thermal_cooling_device_unregister'
acerhdf.c:(.text.unlikely+0x3c91): undefined reference to `thermal_zone_device_unregister'

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Peter Feuerer <peter@piie.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-15 09:29:58 -08:00
Linus Torvalds
e6b5be2be4 Driver core patches for 3.19-rc1
Here's the set of driver core patches for 3.19-rc1.
 
 They are dominated by the removal of the .owner field in platform
 drivers.  They touch a lot of files, but they are "simple" changes, just
 removing a line in a structure.
 
 Other than that, a few minor driver core and debugfs changes.  There are
 some ath9k patches coming in through this tree that have been acked by
 the wireless maintainers as they relied on the debugfs changes.
 
 Everything has been in linux-next for a while.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlSOD20ACgkQMUfUDdst+ylLPACg2QrW1oHhdTMT9WI8jihlHVRM
 53kAoLeteByQ3iVwWurwwseRPiWa8+MI
 =OVRS
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core update from Greg KH:
 "Here's the set of driver core patches for 3.19-rc1.

  They are dominated by the removal of the .owner field in platform
  drivers.  They touch a lot of files, but they are "simple" changes,
  just removing a line in a structure.

  Other than that, a few minor driver core and debugfs changes.  There
  are some ath9k patches coming in through this tree that have been
  acked by the wireless maintainers as they relied on the debugfs
  changes.

  Everything has been in linux-next for a while"

* tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
  Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
  fs: debugfs: add forward declaration for struct device type
  firmware class: Deletion of an unnecessary check before the function call "vunmap"
  firmware loader: fix hung task warning dump
  devcoredump: provide a one-way disable function
  device: Add dev_<level>_once variants
  ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
  ath: use seq_file api for ath9k debugfs files
  debugfs: add helper function to create device related seq_file
  drivers/base: cacheinfo: remove noisy error boot message
  Revert "core: platform: add warning if driver has no owner"
  drivers: base: support cpu cache information interface to userspace via sysfs
  drivers: base: add cpu_device_create to support per-cpu devices
  topology: replace custom attribute macros with standard DEVICE_ATTR*
  cpumask: factor out show_cpumap into separate helper function
  driver core: Fix unbalanced device reference in drivers_probe
  driver core: fix race with userland in device_add()
  sysfs/kernfs: make read requests on pre-alloc files use the buffer.
  sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
  fs: sysfs: return EGBIG on write if offset is larger than file size
  ...
2014-12-14 16:10:09 -08:00
Darren Hart
cc888de2c3 Merge branch 'thinkpad-acpi' into for-next
thinkpad-acpi:
  acpi: Remove _OSI(Linux) for ThinkPads
  thinkpad-acpi: Try to use full software mute control

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-10 20:53:08 -08:00
Andy Lutomirski
9a417ec0c9 thinkpad-acpi: Try to use full software mute control
ThinkPads have hardware volume controls and three buttons to control
them.  (These are separate from the standard mixer.)  By default,
the buttons are:

 - Mute: Mutes the hardware volume control and, on some models,
   generates KEY_MUTE.

 - Up: Unmutes, generates KEY_VOLUMEUP, and increases volume if
   applicable.  (Newer thinkpads only have hardware mute/unmute.)

 - Down: Unmutes, generates KEY_VOLUMEDOWN, and decreases volume
   if applicable.

This behavior is unfortunate, since modern userspace will also
handle the hotkeys and change the other mixer.  If the software
mixer is muted and the hardware mixer is unmuted and you push mute,
hilarity ensues as they both switch state.

Rather than adding a lot of complex ALSA integration to fix this,
just disable the special ThinkPad volume controls when possible.
This turns the mute and volume buttons into regular buttons, and
standard software controls will work as expected.

ALSA already knows about the mute light on models with a mute light,
so everything should just work.

This should also allow us to remove _OSI(Linux) for all ThinkPads.

For future reference: It turns out that we can ask ACPI for one of
three behaviors directly on very new models.  They are "latch" (the
default), "none" (no automatic control), and "toggle" (mute unmutes
when muted).  All of the modes besides "none" seem to be a bit
buggy, though, and there doesn't seem to be a consistent way to get
any notification when the HW mute state is changed.

Signed-off-by: Andy Lutomirski <luto@mit.edu>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-04 04:03:22 -08:00
Peter Feuerer
f587f07fef acerhdf: minor clean up
* renamed bios_settings_t to bios_settings, as it is no typedef
  * replaced "unsigned char" by u8 in bios_settings struct for better
    readability.

Cc: platform-driver-x86@vger.kernel.org
Cc: Darren Hart <dvhart@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andreas Mohr <andi@lisas.de>
Acked-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Peter Feuerer <peter@piie.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-04 03:24:56 -08:00
Peter Feuerer
7e8b6d737d acerhdf: added critical trip point
added critical trip point which represents the temperature limit.
Added return -EINVAL in case wrong trip point is provided.

Cc: platform-driver-x86@vger.kernel.org
Cc: Darren Hart <dvhart@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andreas Mohr <andi@lisas.de>
Cc: Borislav Petkov <bp@suse.de>
Cc: Javi Merino <javi.merino@arm.com>
Signed-off-by: Peter Feuerer <peter@piie.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-04 03:24:55 -08:00
Peter Feuerer
48c8dd6434 acerhdf: Use bang-bang thermal governor
acerhdf has been doing an on-off fan control using hysteresis by
post-manipulating the outcome of thermal subsystem trip point handling.
This patch enables acerhdf to use the bang-bang governor, which is
intended for on-off controlled fans.

Cc: platform-driver-x86@vger.kernel.org
Cc: Darren Hart <dvhart@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
CC: Zhang Rui <rui.zhang@intel.com>
Cc: Andreas Mohr <andi@lisas.de>
Cc: Javi Merino <javi.merino@arm.com>
Acked-and-tested-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Peter Feuerer <peter@piie.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-04 03:24:55 -08:00
Peter Feuerer
7438d9905a acerhdf: Adding support for new models
added following new models:
   * Aspire 5755G
   * AO521
   * AO751h
   * Aspire One 753
   * Extensa 5420
   * Aspire 5315
   * Aspire 5739G
   * TravelMate TM8573T

Cc: platform-driver-x86@vger.kernel.org
Cc: Darren Hart <dvhart@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andreas Mohr <andi@lisas.de>
Acked-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Peter Feuerer <peter@piie.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-04 03:24:55 -08:00
Peter Feuerer
5ef6578c02 acerhdf: Adding support for "manual mode"
Some Acer models require an additional command to turn off the fan after
bios mode has been enabled.  Adding new section in bios table to allow
support for those models, by writing an extra "manual mode" register.

Cc: platform-driver-x86@vger.kernel.org
Cc: Darren Hart <dvhart@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andreas Mohr <andi@lisas.de>
Acked-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Peter Feuerer <peter@piie.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-04 03:24:55 -08:00
Pali Rohár
e4da91427f dell-smo8800: Add more ACPI ids and change description of driver
This patch adds other ACPI ids from Windows inf driver which should be handled
by dell-smo8800 driver. ACPI devices have same structure -- one IRQ number.

This patch also updates description of module.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-03 10:10:19 -08:00
Pali Rohár
02b2aaaa57 platform: x86: dell-laptop: Add support for keyboard backlight
This patch adds support for configuring keyboard backlight settings on supported
Dell laptops. It exports kernel leds interface and uses Dell SMBIOS tokens or
keyboard class interface.

With this patch it is possible to set:
* keyboard backlight level
* timeout after which will be backlight automatically turned off
* input activity triggers (keyboard, touchpad, mouse) which enable backlight
* ambient light settings

Settings are exported via sysfs:
/sys/class/leds/dell::kbd_backlight/

Code is based on newly released documentation by Dell in libsmbios project.

Thanks to Dan Carpenter who reported bug about unpredictable results in
quirks->kbd_timeouts for loop. His fix adds needs_kbd_timeouts flag to
quirk structure to indicate if kbd_timeouts array is empty or not.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Minor English corrections to comments.
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-03 10:10:18 -08:00
Azael Avalos
805469053b toshiba_acpi: Add keyboard backlight mode change event
A previous patch added support to handle more events.

This patch adds support to update the sysfs group whenever we receive
a 0x92 event, which indicates a change in the keyboard backlight mode,
removing the update group code from toshiba_kbd_bl_mode_store, as it is
no longer needed there.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-03 10:10:18 -08:00
Azael Avalos
71454d78d3 toshiba_acpi: Change notify funtion to handle more events
Currently the function toshiba_acpi_notify only takes care of hotkeys,
however, the TOSXXXX devices receive more events that can be useful.

This patch changes the function to be able to handle more events,
and in the process, move all hotkey related code residing in it to
a new function called toshiba_acpi_process_hotkeys.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-03 10:10:17 -08:00
Azael Avalos
1f28f2908e toshiba_acpi: Move hotkey enabling code to its own function
The hotkey enabling code is being used by *_setup_keyboard and also by
*_resume.

This patch creates a new function called toshiba_acpi_enable_hotkeys to
be used by these two functions to avoid duplicating code.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-03 10:10:17 -08:00
Gabriele Mazzotta
8cb8e63b56 dell-wmi: Don't report keypresses on keybord illumination change
Keyboard illumination level changes are performed by the BIOS, so no
events should be reported on keypress. This is already done on systems
using the legacy keymap, do it also for systems that don't use it.

Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
2014-12-03 10:10:16 -08:00
Gabriele Mazzotta
8f8d75ebf0 dell-wmi: Don't report keypresses for radio state changes
The WMI events associated to KEY_WLAN are for all the radio devices
available. Use KEY_RFKILL instead since it's more appropriate.

The state of radio devices is changed directly by the BIOS when hotkeys
are pressed, so no events should be reported.

Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Merged two patches modifying this one line
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-03 10:10:16 -08:00
Giedrius Statkevicius
abe0b77558 hp_wireless: Inform the user if hp_wireless_input_setup()/add() fails
In hpwl_add() there is a unused variable err to which we assign the
result of hp_wireless_input_setup() but we don't do anything depending
on the result so print out a message that informs the user if add()
(hp_wireless_input_setup()) fails since acpi_device_probe() doesn't
print anything in this case.

Signed-off-by: Giedrius Statkevicius <giedriuswork@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-03 10:10:15 -08:00
Ondrej Zary
63a9e016e8 toshiba-acpi: Add missing ID (TOS6207)
toshiba-acpi was always missing TOS6207 ID so it did not load automatically
on some laptops (such as Portege R100). But it worked fine if loaded manually.
Commit 135740de77 ("toshiba_acpi: Convert to use acpi_driver") broke that
and the driver does not work even when loaded manually since then.

Add TOS6207 ID to fix it.

Tested on Toshiba Portege R100.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-03 10:10:15 -08:00
Markus Elfring
c6b7ef2109 Sony-laptop: Deletion of an unnecessary check before the function call "pci_dev_put"
The pci_dev_put() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call
is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-03 10:10:14 -08:00
Markus Elfring
0098181016 platform: x86: Deletion of checks before backlight_device_unregister()
The backlight_device_unregister() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
For msi-wmi.c:
Acked-by: Anisse Astier <anisse@astier.eu>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-03 10:10:14 -08:00
Azael Avalos
a39f46df33 toshiba_acpi: Fix regression caused by backlight extra check code
Bug 86521 uncovered that some TOS6208 devices also return
non zero values on a write call to the backlight method,
thus getting caught and bailed out by the extra check code.

This patch changes the set_lcd_brightness function to its
"original" state by just adapting it to the new function
format.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-03 10:10:14 -08:00
Hans de Goede
841e11ccdf asus-nb-wmi: Add another wapf=4 quirk
Wifi on this laptop does not work unless asus-nb-wmi.wapf=4 is specified on
the kerne commandline, add a quirk for this.

Cc: stable@vger.kernel.org
BugLink: https://bugs.launchpad.net/bugs/1173681
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-03 10:10:13 -08:00
Dominique Leuenberger
6583659e0f hp_accel: Add support for HP ZBook 15
HP ZBook 15 laptop needs a non-standard mapping (x_inverted).

BugLink: http://bugzilla.opensuse.org/show_bug.cgi?id=905329
Signed-off-by: Dominique Leuenberger <dimstar@opensuse.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-03 10:10:12 -08:00
Masatake YAMATO
078014dd36 intel_ips: fix a type in error message
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-11-20 15:02:50 +01:00
Pali Rohár
83fc44c32a dell-wmi: Update code for processing WMI events
The WMI buffer can contain multiple events. First value in buffer is
length of event followed by data of specified length. After that is next
length and next data.  When length is zero then there is no more events
in bufffer.

This patch adds support for processing all events in buffer (not only
first) and parse more event types (not only hotkey events). Because of
variable length of events sometimes BIOS fills more hotkeys (or other
values) into single WMI event. In this case this patch also processes
these multiple hotkeys (and not only first one).

Some event types are just ignored because kernel is not interested in
them (e.g. NIC Link status, battery unplug, ...).

This patch is based on DSDT table from Dell Latitude E6440. Code should
be backward compatible so will process other events of old types same as
before this patch.

This patch also fixes a problem with unknown WMI event messages being
written to the log. Now all known events are parsed and those which are
not interesting to the kernel are dropped without an unknown WMI event
message.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Tested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-11-19 09:25:31 -08:00
Frans Klaver
fb1d97a2c7 eeepc-laptop: clean up control flow in eeepc_acpi_notify
eeepc_acpi_notify increases the indentation level to a whopping four. If
we revise the conditions a bit, we can reduce that to a more soothing
two and satisfy the indentation guidelines in Documentation/CodingStyle.

Remove an unwanted space while we're in the neighbourhood.

Signed-off-by: Frans Klaver <fransklaver@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-11-19 09:07:08 -08:00
Chen Hanxiao
049db626be intel_ips: fix a comment typo
s/tempurature/temperature/

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-11-19 09:07:08 -08:00
Frans Klaver
efef87296e eeepc-laptop: don't assume get_acpi succeeds
In eeepc_hotk_thaw, we assume that get_acpi() will effectively return a
bool. However, it is possible that get_acpi() returns an error instead.
We should not be writing error values to the ACPI device, even though
it's quite possible that we couldn't contact the ACPI device in the
first place.

Signed-off-by: Frans Klaver <fransklaver@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-11-19 09:07:08 -08:00
Frans Klaver
148a5dd5cc eeepc-laptop: document fan_pwm conversions
eeepc_get_fan_pwm and eeepc_set_fan_pwm convert the PWM value read from
the fan to a range lmsensors understands. Unfortunately this is only
clear if you are familiar with how lmsensors handles duty cycles.

Introduce two conversion functions that document the goal of these
conversions.

Signed-off-by: Frans Klaver <fransklaver@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-11-19 09:07:08 -08:00
Frans Klaver
a5de681c0c eeepc-laptop: replace magic numbers with defines
eeepc_[gs]et_fan_ctrl uses some magic numbers. These numbers mean
something more than just the number. Describe them with macros instead
of comments in one of the functions.

Signed-off-by: Frans Klaver <fransklaver@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-11-19 09:07:08 -08:00
Frans Klaver
792bd2a58f eeepc-laptop: define rfkill notifier nodes only once
The rfkill notifier node names are used in three different places. As a
matter of style, it is better to store them somewhere and have the
compiler warn us about typos in the function arguments.

Signed-off-by: Frans Klaver <fransklaver@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-11-19 09:07:08 -08:00
Frans Klaver
9f662b20d6 eeepc-laptop: don't break user visible strings
As per Documentation/CodingStyle ch. 2, it is preferred that we don't
break user visible strings, in order to allow users to grep for them.

Signed-off-by: Frans Klaver <fransklaver@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-11-19 09:07:07 -08:00
Frans Klaver
248d490363 eeepc-laptop: flatten control flow
In eeepc_rfkill_hotplug there's an if statement with a big tail that
ends right before the out_unlock label. We might as well invert the
condition and jump to out_unlock in that case, pretty much like the rest
of the code does. This removes an indentation level for a large chunk of
code and also stops suggesting there might be an else clause.

Signed-off-by: Frans Klaver <fransklaver@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-11-19 09:07:07 -08:00
Giedrius Statkevičius
98280374ff drivers: platform: change 0x20 to I8042_STR_AUXDATA in i8042 filters
Instead of using a magic constant 0x20 in some drivers to get data only
from the KBC port we should use the constant defined in i8042.h with
the same value. Also, this makes these drivers uniform with what
constant the only other filter function uses in
drivers/input/misc/ideapad_slidebar.c.

Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-11-19 09:07:07 -08:00