1
0
Fork 0
Commit Graph

2156 Commits (8f72cb4ef90c63bcb5111c2e3ec7ea2727eab2f8)

Author SHA1 Message Date
Yu, Ong Hock 08a245160b intel_telemetry: Remove Monitor MWAIT feature dependency
Telemetry capability does not depend on Monitor MWAIT feature.

Signed-off-by: "Yu, Ong Hock" <ong.hock.yu@intel.com>
Acked-by: Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-06-28 22:21:15 -07:00
Alex Hung 1d6de071cb intel-hid: Remove duplicated acpi_remove_notify_handler
The second call to acpi_remove_notify_handler does not result in panic
or generate error messages, but it is unnecessary and the function
returns with an error. Remove the duplicate call. Correct two improperly
indented lines.

Signed-off-by: Alex Hung <alex.hung@canonical.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-06-28 22:18:35 -07:00
Nick Leiten 9ee2748712 asus-wmi: Add ambient light sensor toggle key
Ausu laptops issue key 0x7A when the toggle ALS key is pressed (Fn+A on
Asus U38N). Update the key_entry so userspace can handle the event.

Tested on Asus U38N.

Signed-off-by: Nick Leiten <nickleiten@gmail.com>
Reviewed-By: Corentin Chary <corentin.chary@gmail.com>
[dvhart: cleaned up commit message and comment line length]
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-06-28 22:18:35 -07:00
Matej Groma d6b88f64b0 fujitsu-laptop: Add support for eco LED
There is an indicator LED signaling activated power saving mode
on certain Fujitsu laptop models. This has currently no use on Linux.
Export it to userspace.

Signed-off-by: Matej Groma <matejgroma@gmail.com>
Acked-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-06-28 22:18:34 -07:00
Michał Kępień 1879e69f4c fujitsu-laptop: Support touchpad toggle hotkey on Skylake-based models
Haswell-based Fujitsu laptops (Lifebook E734/E744/E754) have a touchpad
toggle hotkey (Fn+F4) which is handled transparently to the operating
system: while an ACPI notification is sent to FUJ02B1 when Fn+F4 is
pressed, touchpad state is properly toggled without any explicit support
for this operation in fujitsu-laptop.

Skylake-based models (Lifebook E736/E746/E756) also have that hotkey,
but the touchpad is not toggled transparently to the operating system.
When Fn+F4 is pressed, an ACPI notification is sent to FUJ02E3.  A
subsequent call to S000 (FUNC_RFKILL) can be used to determine whether
the touchpad toggle hotkey was pressed so that an input event can be
sent to userspace.

Relevant ACPI code:

    Method (_L21, 0, NotSerialized)
    {
        ...
        If (AHKF)
        {
            Notify (\_SB.FEXT, 0x80)
        }
        ...
    }

    Method (S000, 3, Serialized)
    {
        Name (_T_0, Zero)
        Local0 = Zero
        While (One)
        {
            _T_0 = Arg0
            If (_T_0 == Zero)
            {
                Local0 |= 0x04000000
                Local0 |= 0x02000000
                Local0 |= 0x00020000
                Local0 |= 0x0200
                Local0 |= 0x0100
                Local0 |= 0x20
            }
            ElseIf (_T_0 == One)
            {
                ...
                If (AHKF & 0x08)
                {
                Local0 |= 0x04000000
                AHKF ^= 0x08
                }
                ...
            } ...
            Break
        }
        Return (Local0)
    }

Pressing Fn+F4 raises GPE 0x21 and sets bit 3 in AHKF.  This in turn
results in bit 26 being set in the value returned by FUNC_RFKILL called
with 1 as its first argument.  On Skylake-based models, bit 26 is also
set in the value returned by FUNC_RFKILL called with 0 as its first
argument (this value is saved in fujitsu_hotkey->rfkill_supported upon
module initialization), which suggests that this bit is set on models
which do not handle touchpad toggling transparently to the operating
system.

Note that bit 3 is cleared in AHKF once FUNC_RFKILL is called with 1 as
its first argument, which requires fujitsu-laptop to handle this hotkey
in a different manner than the other, GIRB-based hotkeys: two input
events (press and release) are immediately sent once Fn+F4 is pressed.

Reported-and-tested-by: Jan-Marek Glogowski <glogow@fbihome.de>
Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Acked-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-06-28 22:18:34 -07:00
Michał Kępień 00816e1b38 fujitsu-laptop: Remove unused macros
FUJLAPTOP_* macros were introduced by 20b9373, but have never been used
except FUJLAPTOP_DEBUG, which was made redundant by the previous patch.

ACPI_VIDEO_NOTIFY_* macros were also introduced by 20b9373, but they
have not been needed since 1696d9d.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Acked-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-06-28 22:18:33 -07:00
Michał Kępień 98020a4ab0 fujitsu-laptop: Use module name in debug messages
vdbg_printk() always prefixes the log messages it generates with
"FUJ02B1", which can be misleading, because it might have been called
while handling a notify for ACPI device FUJ02E3 or during module
initialization etc.  Employ pr_fmt() to prefix debug messages with the
module name instead and thus avoid confusion.

Reported-by: Jan-Marek Glogowski <glogow@fbihome.de>
Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Acked-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-06-28 22:18:33 -07:00
Alex Hung fc8a601e11 hp-wmi: Fix wifi cannot be hard-unblocked
Several users reported wifi cannot be unblocked as discussed in [1].
This patch removes the use of the 2009 flag by BIOS but uses the actual
WMI function calls - it will be skipped if WMI reports unsupported.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=69131

Signed-off-by: Alex Hung <alex.hung@canonical.com>
Tested-by: Evgenii Shatokhin <eugene.shatokhin@yandex.ru>
Cc: stable@vger.kernel.org
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-06-28 22:18:32 -07:00
Azael Avalos 95d16d816a toshiba_acpi: Bump driver version and update copyright year
After several fixes, and added support for more features (WWAN,
Cooling Method and IIO accelometer axis data), bump the driver
version to 0.24.

Also update the copyright year.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-06-28 22:18:32 -07:00
Azael Avalos 2fd6788445 toshiba_acpi: Remove the position sysfs entry
Now that we have proper support for the acceleromeer under the IIO
subsystem, the _position_ sysfs file is now deprecated.

This patch removes all code related to the position sysfs entry.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-06-28 22:18:31 -07:00
Azael Avalos 98010f1ea0 toshiba_acpi: Add IIO interface for accelerometer axis data
This patch adds the accelerometer axis data to the IIO subsystem.

Currently reporting the X, Y and Z values, as no other data can be
queried given the fact that the accelerometer chip itself is hidden
behind the Toshiba proprietary interface.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-06-28 22:17:51 -07:00
Ingo Molnar 8114e90ea4 Linux 4.7-rc5
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJXcHi9AAoJEHm+PkMAQRiGSJ0H/2o4t9VWYmhyPC1sdIHoCExJ
 P4tBrcZYBmKcsOmIfnJDa5g/+IdhouEUM0v0fHPogS2UUWT9eRuJWYD3sY+HpEQ+
 heKTli8X73gsFB25odeIbIt0jAoSiiMYWDrWqLNsuUV1tjEYVA8rH0SM94FiOC/5
 7WVWXLTuH+Rm7JHP18BnKxmMMbzrTFmwisLMqFKyfZRRSlS+/ix7iLUNO9AFa39B
 YHxNPihLrZ0oONyCOAQoHTIXXrw0cQbxV2utg3vnMcCZdme2xOn+iXMntTSKfZ39
 iC9/T0vsO3R6OrRo2aDZAnCPUAniXnMEIhrKG37WMyXpj6cucZ/2QiNXcXviGV4=
 =iLte
 -----END PGP SIGNATURE-----

Merge tag 'v4.7-rc5' into perf/core, to pick up fixes

Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-06-27 11:20:46 +02:00
Alex Hung ab9bb11ccb dell-wmi: Add a WMI event code for display on/off
Some new Dell AIO systems have a button that generates a WMI event to
turn the LCD on/off.

Signed-off-by: Alex Hung <alex.hung@canonical.com>
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-06-21 09:24:01 -07:00
Pali Rohár e075b3c898 dell-wmi: Generate one sparse keymap for all machines
This patch reworks code for generating sparse keymap and processing WMI
events. It unifies procedure for generating sparse keymap and also unifies
big switch code for processing WMI events of different types. After this
patch dell-wmi driver does not differ between "old" and "new" hotkey type.

It constructs sparse keymap table with all WMI codes. It is because on some
laptops (e.g. Dell Latitude E6440) ACPI/firmware send both event types (old
and new).

Each WMI code in sparse keymap table is prefixed by 16bit event type, so it
does not change functionality on laptops with "old" hotkey support (those
without scancodes in DMI).

This allow us to distinguish between same WMI codes with different types in
sparse keymap. Thanks to this WMI events of type 0x0011 were moved from big
switch into sparse keymap table too.

This patch also fixes possible bug in parsing WMI event buffer introduced
in commit 5ea2559726 ("dell-wmi: Add support for new Dell systems"). That
commit changed buffer type from int* to u16* without fixing code. More at:
http://lkml.iu.edu/hypermail/linux/kernel/1507.0/01950.html

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Tested-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Michał Kępień <kernel@kempniu.pl>
Tested-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-06-17 11:13:35 -07:00
Pali Rohár 3237a86104 dell-wmi: Add information about other WMI event codes
ACPI DSDT tables have defined other WMI codes, but does not contain any
description when those codes are emitted. Some other codes can be found in
logs on internet. In this patch are all which I saw, but lot of them are
not tested properly (e.g. for duplicate events with AT keyboard). Now we
have all WMI event codes at one place and in future after proper testing
those codes can be correctly enabled or disabled...

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Tested-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Michał Kępień <kernel@kempniu.pl>
Tested-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-06-17 11:13:29 -07:00
Pali Rohár 6a4d260a63 dell-wmi: Sort WMI event codes and update comments
For better readability of keymap table, sort events by codes and also
update comments for events to be more informative.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Tested-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Michał Kępień <kernel@kempniu.pl>
Tested-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-06-17 11:12:44 -07:00
Pali Rohár 3de59bcd3b dell-wmi: Ignore WMI event code 0xe045
>From Dell we know that WMI event code 0xe045 is for Num Lock key, but it is
unclear due to message in commit 0b3f6109f0 ("dell-wmi: new driver for
hotkey control").

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Tested-by: Michał Kępień <kernel@kempniu.pl>
Tested-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Reviewed-by: Michał Kępień <kernel@kempniu.pl>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Mario Limonciello <mario_limonciello@dell.com>
Link: https://lkml.org/lkml/2015/7/7/830
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-06-17 11:12:25 -07:00
Jean Delvare 25789f95a8 platform/x86: Drop duplicate dependencies on X86
The whole menu depends on X86 so there is no point in repeating this
dependency on individual driver entries.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-06-08 13:21:37 -07:00
Dennis Wassenberg 0118c2d3ea thinkpad_acpi: Add support for HKEY version 0x200
Lenovo Thinkpad devices T460, T460s, T460p, T560, X260 use
HKEY version 0x200 without adaptive keyboard.

HKEY version 0x200 has method MHKA with one parameter value.
Passing parameter value 1 will get hotkey_all_mask (the same like
HKEY version 0x100 without parameter). Passing parameter value 2 to
MHKA method will retrieve hotkey_all_adaptive_mask. If 0 is returned in
that case there is no adaptive keyboard available.

Signed-off-by: Dennis Wassenberg <dennis.wassenberg@secunet.com>
Signed-off-by: Lyude <cpaul@redhat.com>
Tested-by: Lyude <cpaul@redhat.com>
Tested-by: Marco Trevisan <marco@ubuntu.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
[dvhart: Keep MHKA error string on one line in new and existing pr_err calls]
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-06-08 13:01:56 -07:00
Alex Hung 48f67d6219 ideapad_laptop: Add an event for mic mute hotkey
Newer ideapads support a new mic hotkey implemented via an ACPI
interface. This patch converts the mic mute event to a keycode
KEY_MICMUTE.

Signed-off-by: Alex Hung <alex.hung@canonical.com>
Acked-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-06-08 13:01:34 -07:00
Dave Hansen 678dec00a4 x86/intel_telemetry: Use Intel family name macros for telemetry driver
Another straightforward replacement of magic numbers.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Darren Hart <dvhart@infradead.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dave Hansen <dave@sr71.net>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: jacob.jun.pan@intel.com
Cc: platform-driver-x86@vger.kernel.org
Link: http://lkml.kernel.org/r/20160603001947.05102C3E@viggo.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-06-08 13:03:26 +02:00
Dave Hansen 70e0d117f2 x86/pmc_core: Use Intel family name macros for pmc_core driver
Another straightforward replacement of magic numbers.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Darren Hart <dvhart@infradead.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dave Hansen <dave@sr71.net>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vishwanath Somayaji <vishwanath.somayaji@intel.com>
Cc: jacob.jun.pan@intel.com
Cc: platform-driver-x86@vger.kernel.org
Link: http://lkml.kernel.org/r/20160603001949.7D5B9534@viggo.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-06-08 13:02:52 +02:00
Linus Torvalds a1842b2b6f platform/chrome: Driver and binding changes for 4.7
A handful of changes this merge window:
 
  - A few patches to fix probing and configuration of pstore
  - A few patches adding Elan touchpad registration on a few devices
  - EC changes: a security fix dealing with max message sizes and addition
    of compat_ioctl support.
  - Keyboard backlight control support
 
 There was also an accidential duplicate registration of trackpads on 'Leon',
 which was reverted just recently.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXSb5tAAoJEIwa5zzehBx38BsQAI+p6urzboC2+NSsZAq72d4/
 u2SF+ziEdgj4f7n38TjiDaFTqig9nqoQeB2nDCRicyEcHsCiK/ghsdq4ULfkvHIa
 VALn/rBkQWQ7hC+2tfrQn7Rd2VqVnh28+EyhGezhVtrAGRaE2jIbgKnnfD3MS+b5
 lab014HBppP1pDtJQQYCcoCpOUF1a9WEb8jKPWf4DCeCMaSrwFLKxV5VeqDkNtEZ
 a3GFzB+WypN1nwBQ7PEOUxutzsUakSNy+RFoCqGwVppJ+kA/E3MO2BGoEJuQ6LXP
 u7nyabJq6zBQAlrYie4OoiijBWQ+Q759jbOKkmxpBfL/mtMMepV05DIx/16Yi9NY
 j+4A9HsuY+EYUhr0mH7B57CH0RClebixdZ62DtUK0Fe6H66SsMZPYtTKLIzOTzgO
 j+gypQyW8BvcM/XjPYTA/vlYK45IJYB5OUDQzFW0qWQv/nInoYOS3G8IVooKHMDy
 +s2wih/OAxBCDJ+KfDeJUj3U5Avz1YCojRraZWmBsOPpRpsQHVQ02r3uoHeHHZFv
 bI8sTJ7BGxoYX5Kb6+xbtW7SnXoWZN8vlqdCpdNnLWKcwIqHKFirkoZh2N2AqyZB
 7VpQW1HD2WxYBpxMv98KVyPiR+5xCnZnpqcIIvpGrX00KhmJkMgIT4FbWHMf6vVt
 T55Sz5V9z/dsgMSDT3LY
 =bcc4
 -----END PGP SIGNATURE-----

Merge tag 'chrome-platform' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/chrome-platform

Pull chrome platform updates from Olof Johansson
 "A handful of Chrome driver and binding changes this merge window:

   - a few patches to fix probing and configuration of pstore

   - a few patches adding Elan touchpad registration on a few devices

   - EC changes: a security fix dealing with max message sizes and
     addition of compat_ioctl support.

   - keyboard backlight control support

  There was also an accidential duplicate registration of trackpads on
  'Leon', which was reverted just recently"

* tag 'chrome-platform' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/chrome-platform:
  Revert "platform/chrome: chromeos_laptop: Add Leon Touch"
  platform/chrome: chromeos_laptop - Add Elan touchpad for Wolf
  platform/chrome: chromeos_laptop - Add elan trackpad option for C720
  platform/chrome: cros_ec_dev - Populate compat_ioctl
  platform/chrome: cros_ec_lightbar - use name instead of ID to hide lightbar attributes
  platform/chrome: cros_ec_dev - Fix security issue
  platform/chrome: Add Chrome OS keyboard backlight LEDs support
  platform/chrome: use to_platform_device()
  platform/chrome: pstore: Move to larger record size.
  platform/chrome: pstore: probe for ramoops buffer using acpi
  platform/chrome: chromeos_laptop: Add Leon Touch
2016-05-28 12:32:01 -07:00
Benson Leung 8d057e3a18 Revert "platform/chrome: chromeos_laptop: Add Leon Touch"
This reverts commit bff3c624dc.

Board "Leon" is otherwise known as "Toshiba CB35" and we already have
the entry that supports that board as of this commit :
963cb6f platform/chrome: chromeos_laptop - Add Toshiba CB35 Touch

Remove this duplicate.

Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
2016-05-28 08:47:48 -07:00
Linus Torvalds 1e8143db75 platform-drivers-x86 for 4.7-1
Mostly minor updates and cleanups. One new power management controller driver
 for Intel Core SoCs.
 
 platform/x86:
  - Add PMC Driver for Intel Core SoC
 
 dell-rbtn:
  - Ignore ACPI notifications if device is suspended
 
 thinkpad_acpi:
  - save kbdlight state on suspend and restore it on resume
 
 intel_menlow:
  - reduce code duplication
 
 asus-wmi:
  - provide access to ALS control
 
 ideapad-laptop:
  - add a new WMI string for ESC key
 
 surfacepro3_button:
  - Add a warning when switching to tablet mode
 
 sony-laptop:
  - Avoid oops on module unload for older laptops
 
 intel_telemetry:
  - Constify telemetry_core_ops structures
 
 fujitsu-laptop:
  - Use IS_ENABLED() instead of checking for built-in or module
 
 asus-laptop:
  - correct error handling in sysfs_acpi_set
  - remove redundant initializers
  - correct error handling in asus_read_brightness()
 
 fujitsu-laptop:
  - Support radio LED
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJXSJh4AAoJEKbMaAwKp3647kkIAIRi8inUCfPQsvpi7iEfaAW7
 vaLvIOFfRxu+WHzYOrhrAg17yscA18xTRtp32dhjHF3w6zJsbsZ9nEqCcRliQG2+
 /i6EdC1ZnboyWWW82HbFGK8r5PMpPJa2p7wPhrEuPcM3aak+bWfCD96HdjFsoxfT
 Vda/2L9grvQwcUczRARh4k6sHQTsdV+tU5MF5Kefso1l31qMyO8A3PNgCPFWtCht
 St0hlRs4SnZS97Bw7IIbP93AiLBejT1jtRHddvpEnj7GaPaBMpBSUqN3KgZRVnfL
 Bln3iPkq+1TVprcizt60X++czfOAWmce1jF9D4oVS5FGW0yIoog0aik2H1rrY64=
 =m/0/
 -----END PGP SIGNATURE-----

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

Pull x86 platform driver updates from Darren Hart:
 "Mostly minor updates and cleanups.  One new power management
  controller driver for Intel Core SoCs.

  platform/x86:
   - Add PMC Driver for Intel Core SoC

  dell-rbtn:
   - Ignore ACPI notifications if device is suspended

  thinkpad_acpi:
   - save kbdlight state on suspend and restore it on resume

  intel_menlow:
   - reduce code duplication

  asus-wmi:
   - provide access to ALS control

  ideapad-laptop:
   - add a new WMI string for ESC key

  surfacepro3_button:
   - Add a warning when switching to tablet mode

  sony-laptop:
   - Avoid oops on module unload for older laptops

  intel_telemetry:
   - Constify telemetry_core_ops structures

  fujitsu-laptop:
   - Use IS_ENABLED() instead of checking for built-in or module

  asus-laptop:
   - correct error handling in sysfs_acpi_set
   - remove redundant initializers
   - correct error handling in asus_read_brightness()

  fujitsu-laptop:
   - Support radio LED"

* tag 'platform-drivers-x86-v4.7-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86:
  platform/x86: Add PMC Driver for Intel Core SoC
  dell-rbtn: Ignore ACPI notifications if device is suspended
  thinkpad_acpi: save kbdlight state on suspend and restore it on resume
  intel_menlow: reduce code duplication
  asus-wmi: provide access to ALS control
  ideapad-laptop: add a new WMI string for ESC key
  surfacepro3_button: Add a warning when switching to tablet mode
  sony-laptop: Avoid oops on module unload for older laptops
  intel_telemetry: Constify telemetry_core_ops structures
  fujitsu-laptop: Use IS_ENABLED() instead of checking for built-in or module
  asus-laptop: correct error handling in sysfs_acpi_set
  asus-laptop: remove redundant initializers
  asus-laptop: correct error handling in asus_read_brightness()
  fujitsu-laptop: Support radio LED
2016-05-27 13:56:02 -07:00
Rajneesh Bhardwaj b740d2e923 platform/x86: Add PMC Driver for Intel Core SoC
This patch adds the Power Management Controller driver as a PCI driver
for Intel Core SoC architecture.

This driver can utilize debugging capabilities and supported features
as exposed by the Power Management Controller.

Please refer to the below specification for more details on PMC features.
http://www.intel.in/content/www/in/en/chipsets/100-series-chipset-datasheet-vol-2.html

The current version of this driver exposes SLP_S0_RESIDENCY counter.
This counter can be used for detecting fragile SLP_S0 signal related
failures and take corrective actions when PCH SLP_S0 signal is not
asserted after kernel freeze as part of suspend to idle flow
(echo freeze > /sys/power/state).

Intel Platform Controller Hub (PCH) asserts SLP_S0 signal when it
detects favorable conditions to enter its low power mode. As a
pre-requisite the SoC should be in deepest possible Package C-State
and devices should be in low power mode. For example, on Skylake SoC
the deepest Package C-State is Package C10 or PC10. Suspend to idle
flow generally leads to PC10 state but PC10 state may not be sufficient
for realizing the platform wide power potential which SLP_S0 signal
assertion can provide.

SLP_S0 signal is often connected to the Embedded Controller (EC) and the
Power Management IC (PMIC) for other platform power management related
optimizations.

In general, SLP_S0 assertion == PC10 + PCH low power mode + ModPhy Lanes
power gated + PLL Idle.

As part of this driver, a mechanism to read the SLP_S0_RESIDENCY is exposed
as an API and also debugfs features are added to indicate SLP_S0 signal
assertion residency in microseconds.

echo freeze > /sys/power/state
wake the system
cat /sys/kernel/debug/pmc_core/slp_s0_residency_usec

Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
Signed-off-by: Vishwanath Somayaji <vishwanath.somayaji@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-05-27 11:47:56 -07:00
Gabriele Mazzotta ff8651237f dell-rbtn: Ignore ACPI notifications if device is suspended
Some BIOSes unconditionally send an ACPI notification to RBTN when the
system is resuming from suspend. This makes dell-rbtn send an input
event to userspace as if a function key was pressed. Prevent this by
ignoring all the notifications received while the device is suspended.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=106031
Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Tested-by: Alex Hung <alex.hung@canonical.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-05-27 11:47:56 -07:00
Marco Trevisan (Treviño) afcedebc6a thinkpad_acpi: save kbdlight state on suspend and restore it on resume
Override default LED class suspend/resume handles, by keeping track of
the brightness level before suspending so that it can be automatically
restored on resume by calling default resume handler.

Signed-off-by: Marco Trevisan (Treviño) <mail@3v1n0.net>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-05-27 11:47:55 -07:00
Rasmus Villemoes a29ccf6ff3 intel_menlow: reduce code duplication
aux0_show and aux1_show consists of almost identical code. Pull that
into a common helper and make them thin wrappers. Similarly for
_store.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-05-27 11:47:55 -07:00
Oleksij Rempel aca234f637 asus-wmi: provide access to ALS control
Asus Zenbook ux31a is providing ACPI0008 interface for ALS
(Ambient Light Sensor), which is accessible for OS => Win 7.
This sensor can be used with iio/acpi-als driver.
Since it is disabled by default, we should use asus-wmi
interface to enable it.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-05-27 11:47:54 -07:00
Arnd Bergmann 2d98e0b942 ideapad-laptop: add a new WMI string for ESC key
My patch to the ideapad-laptop driver to get the ESC key working on the
Yoga 1170 (Yoga 3) failed to do the same for the following model, the
Lenovo Yoga 700.

Denis Gordienko managed to get it working by adding another GUID for the
new WMI interface. I have adapted his patch to normal coding style
and simplified it a bit for inclusion, but this patch is currently
untested.

Link: https://forums.lenovo.com/t5/Lenovo-Yoga-Series-Notebooks/YOGA-3-14-How-to-reclaim-my-Esc-key-and-permanently-disable/m-p/3317499
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Denis Gordienko <denis.gordienko.mail@gmail.com>
[dvhart: Whitespace cleanup, static const char *const array declaration]
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-05-27 11:47:54 -07:00
Andy Shevchenko e27ffe7e41 surfacepro3_button: Add a warning when switching to tablet mode
Microsoft Surface Book has a tablet mode button. Print another message
once on this event instead of repeating "Unknown event...".

Unfortunately, proper support involves the _DSM method, which is not a
discoverable interface. Just print a warning for now.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-05-27 11:47:53 -07:00
Andy Shevchenko 538d7eb86d drivers/platform/x86/wmi.c: use generic UUID library
Instead of opencoding let's use generic UUID library functions here.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-20 17:58:30 -07:00
Linus Torvalds 07b75260eb Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS updates from Ralf Baechle:
 "This is the main pull request for MIPS for 4.7.  Here's the summary of
  the changes:

   - ATH79: Support for DTB passuing using the UHI boot protocol
   - ATH79: Remove support for builtin DTB.
   - ATH79: Add zboot debug serial support.
   - ATH79: Add initial support for Dragino MS14 (Dragine 2), Onion Omega
            and DPT-Module.
   - ATH79: Update devicetree clock support for AR9132 and AR9331.
   - ATH79: Cleanup the DT code.
   - ATH79: Support newer SOCs in ath79_ddr_ctrl_init.
   - ATH79: Fix regression in PCI window initialization.
   - BCM47xx: Move SPROM driver to drivers/firmware/
   - BCM63xx: Enable partition parser in defconfig.
   - BMIPS: BMIPS5000 has I cache filing from D cache
   - BMIPS: BMIPS: Add cpu-feature-overrides.h
   - BMIPS: Add Whirlwind support
   - BMIPS: Adjust mips-hpt-frequency for BCM7435
   - BMIPS: Remove maxcpus from BCM97435SVMB DTS
   - BMIPS: Add missing 7038 L1 register cells to BCM7435
   - BMIPS: Various tweaks to initialization code.
   - BMIPS: Enable partition parser in defconfig.
   - BMIPS: Cache tweaks.
   - BMIPS: Add UART, I2C and SATA devices to DT.
   - BMIPS: Add BCM6358 and BCM63268support
   - BMIPS: Add device tree example for BCM6358.
   - BMIPS: Improve Improve BCM6328 and BCM6368 device trees
   - Lantiq: Add support for device tree file from boot loader
   - Lantiq: Allow build with no built-in DT.
   - Loongson 3: Reserve 32MB for RS780E integrated GPU.
   - Loongson 3: Fix build error after ld-version.sh modification
   - Loongson 3: Move chipset ACPI code from drivers to arch.
   - Loongson 3: Speedup irq processing.
   - Loongson 3: Add basic Loongson 3A support.
   - Loongson 3: Set cache flush handlers to nop.
   - Loongson 3: Invalidate special TLBs when needed.
   - Loongson 3: Fast TLB refill handler.
   - MT7620: Fallback strategy for invalid syscfg0.
   - Netlogic: Fix CP0_EBASE redefinition warnings
   - Octeon: Initialization fixes
   - Octeon: Add DTS files for the D-Link DSR-1000N and EdgeRouter Lite
   - Octeon: Enable add Octeon-drivers in cavium_octeon_defconfig
   - Octeon: Correctly handle endian-swapped initramfs images.
   - Octeon: Support CN73xx, CN75xx and CN78xx.
   - Octeon: Remove dead code from cvmx-sysinfo.
   - Octeon: Extend number of supported CPUs past 32.
   - Octeon: Remove some code limiting NR_IRQS to 255.
   - Octeon: Simplify octeon_irq_ciu_gpio_set_type.
   - Octeon: Mark some functions __init in smp.c
   - Octeon: Octeon: Add Octeon III CN7xxx interface detection
   - PIC32: Add serial driver and bindings for it.
   - PIC32: Add PIC32 deadman timer driver and bindings.
   - PIC32: Add PIC32 clock timer driver and bindings.
   - Pistachio: Determine SoC revision during boot
   - Sibyte: Fix Kconfig dependencies of SIBYTE_BUS_WATCHER.
   - Sibyte: Strip redundant comments from bcm1480_regs.h.
   - Panic immediately if panic_on_oops is set.
   - module: fix incorrect IS_ERR_VALUE macro usage.
   - module: Make consistent use of pr_*
   - Remove no longer needed work_on_cpu() call.
   - Remove CONFIG_IPV6_PRIVACY from defconfigs.
   - Fix registers of non-crashing CPUs in dumps.
   - Handle MIPSisms in new vmcore_elf32_check_arch.
   - Select CONFIG_HANDLE_DOMAIN_IRQ and make it work.
   - Allow RIXI to be used on non-R2 or R6 cores.
   - Reserve nosave data for hibernation
   - Fix siginfo.h to use strict POSIX types.
   - Don't unwind user mode with EVA.
   - Fix watchpoint restoration
   - Ptrace watchpoints for R6.
   - Sync icache when it fills from dcache
   - I6400 I-cache fills from dcache.
   - Various MSA fixes.
   - Cleanup MIPS_CPU_* definitions.
   - Signal: Move generic copy_siginfo to signal.h
   - Signal: Fix uapi include in exported asm/siginfo.h
   - Timer fixes for sake of KVM.
   - XPA TLB refill fixes.
   - Treat perf counter feature
   - Update John Crispin's email address
   - Add PIC32 watchdog and bindings.
   - Handle R10000 LL/SC bug in set_pte()
   - cpufreq: Various fixes for Longson1.
   - R6: Fix R2 emulation.
   - mathemu: Cosmetic fix to ADDIUPC emulation, plenty of other small fixes
   - ELF: ABI and FP fixes.
   - Allow for relocatable kernel and use that to support KASLR.
   - Fix CPC_BASE_ADDR mask
   - Plenty fo smp-cps, CM, R6 and M6250 fixes.
   - Make reset_control_ops const.
   - Fix kernel command line handling of leading whitespace.
   - Cleanups to cache handling.
   - Add brcm, bcm6345-l1-intc device tree bindings.
   - Use generic clkdev.h header
   - Remove CLK_IS_ROOT usage.
   - Misc small cleanups.
   - CM: Fix compilation error when !MIPS_CM
   - oprofile: Fix a preemption issue
   - Detect DSP ASE v3 support:1"

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (275 commits)
  MIPS: pic32mzda: fix getting timer clock rate.
  MIPS: ath79: fix regression in PCI window initialization
  MIPS: ath79: make ath79_ddr_ctrl_init() compatible for newer SoCs
  MIPS: Fix VZ probe gas errors with binutils <2.24
  MIPS: perf: Fix I6400 event numbers
  MIPS: DEC: Export `ioasic_ssr_lock' to modules
  MIPS: MSA: Fix a link error on `_init_msa_upper' with older GCC
  MIPS: CM: Fix compilation error when !MIPS_CM
  MIPS: Fix genvdso error on rebuild
  USB: ohci-jz4740: Remove obsolete driver
  MIPS: JZ4740: Probe OHCI platform device via DT
  MIPS: JZ4740: Qi LB60: Remove support for AVT2 variant
  MIPS: pistachio: Determine SoC revision during boot
  MIPS: BMIPS: Adjust mips-hpt-frequency for BCM7435
  mips: mt7620: fallback to SDRAM when syscfg0 does not have a valid value for the memory type
  MIPS: Prevent "restoration" of MSA context in non-MSA kernels
  MIPS: cevt-r4k: Dynamically calculate min_delta_ns
  MIPS: malta-time: Take seconds into account
  MIPS: malta-time: Start GIC count before syncing to RTC
  MIPS: Force CPUs to lose FP context during mode switches
  ...
2016-05-19 10:02:26 -07:00
Linus Torvalds 1eccc6e152 This is the bulk of GPIO changes for kernel cycle v4.7:
Core infrastructural changes:
 
 - Support for natively single-ended GPIO driver stages. This
   means that if the hardware has registers to configure open
   drain or open source configuration, we use that rather than
   (as we did before) try to emulate it by switching the line
   to an input to get high impedance. This is also documented
   throughly in Documentation/gpio/driver.txt for those of you
   who did not understand one word of what I just wrote.
 
 - Start to do away with the unnecessarily complex and
   unitelligible ARCH_REQUIRE_GPIOLIB and
   ARCH_WANT_OPTIONAL_GPIOLIB, another evolutional artifact from
   the time when the GPIO subsystem was unmaintained. Archs can
   now just select GPIOLIB and be done with it, cleanups to
   arches will trickle in for the next kernel. Some minor archs
   ACKed the changes immediately so these are included in this
   pull request.
 
 - Advancing the use of the data pointer inside the GPIO device
   for storing driver data by switching the PowerPC, Super-H
   Unicore and a few other subarches or subsystem drivers in
   ALSA SoC, Input, serial, SSB, staging etc to use it.
 
 - The initialization now reads the input/output state of the
   GPIO lines, so that each GPIO descriptor knows - if this
   callback is implemented - whether the line is input or
   output. This also reflects nicely in userspace "lsgpio".
 
 - It is now possible to name GPIO producer names, line names,
   from the device tree. (Platform data has been supported for
   a while.) I bet we will get a similar mechanism for ACPI
   one of those days. This makes is possible to get sensible
   producer names for e.g. GPIO rails in "lsgpio" in userspace.
 
 New drivers:
 
 - New driver for the Loongson1.
 
 - The XLP driver now supports Broadcom Vulcan ARM64.
 
 - The IT87 driver now supports IT8620 and IT8628.
 
 - The PCA953X driver now supports Galileo Gen2.
 
 Driver improvements:
 
 - MCP23S08 was switched to use the gpiolib irqchip helpers and
   now also suppors level-triggered interrupts.
 
 - 74x164 and RCAR now supports the .set_multiple() callback
 
 - AMDPT was converted to use generic GPIO.
 
 - TC3589x, TPS65218, SX150X, F7188X, MENZ127, VX855, WM831X, WM8994
   support the new single ended callback for open drain
   and in some cases open source.
 
 - Implement the .get_direction() callback for a few more drivers
   like PL061, Xgene.
 
 Cleanups:
 
 - Paul Gortmaker combed through the drivers and de-modularized
   those who are not really modules.
 
 - Move the GPIO poweroff DT bindings to the power subdir where
   they belong.
 
 - Rename gpio-generic.c to gpio-mmio.c, which is much more to the
   point. That's what it is handling, nothing more, nothing less.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXOuJ5AAoJEEEQszewGV1zNXsQAII5wtkP69WRJ3goYBKg1dZN
 DkuLqZyVI4hCgRhptzUW10gDLHKKOCVubfetTJHSpyG/dWDJXPCyH6FHF+pW6lMX
 y+em8kAvWctKpaosy4EM7O55/IohW0/fNCTOfzfrUNivjydFuA2XwPUiPqC7111O
 DeKlC/t+W1JEvZTiKMi83pKq+9wqhiHmD0qxRHhV57S+MT8e7mdlSKOp7uUkKPkg
 LPlerXosnmeFjL2emuSnKl/tq8pOyruU6uaIGG/uwpbo2W86Dok9GY2GWkQ4pANT
 pDtprc4aJ/Clf6Q0CoKwQbmAozqTDeJo+Und9tRs2KuZRly2bWOcyVE0lyK+Y4s0
 544LcKw2q6cB9ARZ6JExEVRJejPISGKMqo9TaHkyNSIJoiiatKYvNS4WVeFtTgbI
 W+1WfM1svPymNRqVPO1PMLV+3m9dalDH2WjtaFF21uCAQ/G0AuPEHjEDbbx0HIpb
 qrvWmYzZ97Rm/LdYROFRO53nEdCp2jh6c3n4/2kGYM8H0suvGxXZsB1g4i+Dm+B+
 qKVTS282azlDuH9ohXeXizeb6atK6s8TC3Rmew97SmXDO00cUQzEQO/ZquRLHY9r
 n83afQ4OL2Z9yruAxAk7pCshVSyheOsHuFPuZ7bwPW31VMdoWNRkhnaTUXMjGfYg
 3y39IHrCKWNMCCVM1iNl
 =z4d6
 -----END PGP SIGNATURE-----

Merge tag 'gpio-v4.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull GPIO updates from Linus Walleij:
 "This is the bulk of GPIO changes for kernel cycle v4.7:

  Core infrastructural changes:

   - Support for natively single-ended GPIO driver stages.

     This means that if the hardware has registers to configure open
     drain or open source configuration, we use that rather than (as we
     did before) try to emulate it by switching the line to an input to
     get high impedance.

     This is also documented throughly in Documentation/gpio/driver.txt
     for those of you who did not understand one word of what I just
     wrote.

   - Start to do away with the unnecessarily complex and unitelligible
     ARCH_REQUIRE_GPIOLIB and ARCH_WANT_OPTIONAL_GPIOLIB, another
     evolutional artifact from the time when the GPIO subsystem was
     unmaintained.

     Archs can now just select GPIOLIB and be done with it, cleanups to
     arches will trickle in for the next kernel.  Some minor archs ACKed
     the changes immediately so these are included in this pull request.

   - Advancing the use of the data pointer inside the GPIO device for
     storing driver data by switching the PowerPC, Super-H Unicore and
     a few other subarches or subsystem drivers in ALSA SoC, Input,
     serial, SSB, staging etc to use it.

   - The initialization now reads the input/output state of the GPIO
     lines, so that each GPIO descriptor knows - if this callback is
     implemented - whether the line is input or output.  This also
     reflects nicely in userspace "lsgpio".

   - It is now possible to name GPIO producer names, line names, from
     the device tree.  (Platform data has been supported for a while).
     I bet we will get a similar mechanism for ACPI one of those days.
     This makes is possible to get sensible producer names for e.g.
     GPIO rails in "lsgpio" in userspace.

  New drivers:

   - New driver for the Loongson1.

   - The XLP driver now supports Broadcom Vulcan ARM64.

   - The IT87 driver now supports IT8620 and IT8628.

   - The PCA953X driver now supports Galileo Gen2.

  Driver improvements:

   - MCP23S08 was switched to use the gpiolib irqchip helpers and now
     also suppors level-triggered interrupts.

   - 74x164 and RCAR now supports the .set_multiple() callback

   - AMDPT was converted to use generic GPIO.

   - TC3589x, TPS65218, SX150X, F7188X, MENZ127, VX855, WM831X, WM8994
     support the new single ended callback for open drain and in some
     cases open source.

   - Implement the .get_direction() callback for a few more drivers like
     PL061, Xgene.

  Cleanups:

   - Paul Gortmaker combed through the drivers and de-modularized those
     who are not really modules.

   - Move the GPIO poweroff DT bindings to the power subdir where they
     belong.

   - Rename gpio-generic.c to gpio-mmio.c, which is much more to the
     point.  That's what it is handling, nothing more, nothing less"

* tag 'gpio-v4.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (126 commits)
  MIPS: do away with ARCH_[WANT_OPTIONAL|REQUIRE]_GPIOLIB
  gpio: zevio: make it explicitly non-modular
  gpio: timberdale: make it explicitly non-modular
  gpio: stmpe: make it explicitly non-modular
  gpio: sodaville: make it explicitly non-modular
  pinctrl: sh-pfc: Let gpio_chip.to_irq() return zero on error
  gpio: dwapb: Add ACPI device ID for DWAPB GPIO controller on X-Gene platforms
  gpio: dt-bindings: add wd,mbl-gpio bindings
  gpio: of: make it possible to name GPIO lines
  gpio: make gpiod_to_irq() return negative for NO_IRQ
  gpio: xgene: implement .get_direction()
  gpio: xgene: Enable ACPI support for X-Gene GFC GPIO driver
  gpio: tegra: Implement gpio_get_direction callback
  gpio: set up initial state from .get_direction()
  gpio: rename gpio-generic.c into gpio-mmio.c
  gpio: generic: fix GPIO_GENERIC_PLATFORM is set to module case
  gpio: dwapb: add gpio-signaled acpi event support
  gpio: dwapb: convert device node to fwnode
  gpio: dwapb: remove name from dwapb_port_property
  gpio/qoriq: select IRQ_DOMAIN
  ...
2016-05-17 17:39:42 -07:00
Linus Torvalds 16bf834805 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
Pull trivial tree updates from Jiri Kosina.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (21 commits)
  gitignore: fix wording
  mfd: ab8500-debugfs: fix "between" in printk
  memstick: trivial fix of spelling mistake on management
  cpupowerutils: bench: fix "average"
  treewide: Fix typos in printk
  IB/mlx4: printk fix
  pinctrl: sirf/atlas7: fix printk spelling
  serial: mctrl_gpio: Grammar s/lines GPIOs/line GPIOs/, /sets/set/
  w1: comment spelling s/minmum/minimum/
  Blackfin: comment spelling s/divsor/divisor/
  metag: Fix misspellings in comments.
  ia64: Fix misspellings in comments.
  hexagon: Fix misspellings in comments.
  tools/perf: Fix misspellings in comments.
  cris: Fix misspellings in comments.
  c6x: Fix misspellings in comments.
  blackfin: Fix misspelling of 'register' in comment.
  avr32: Fix misspelling of 'definitions' in comment.
  treewide: Fix typos in printk
  Doc: treewide : Fix typos in DocBook/filesystem.xml
  ...
2016-05-17 17:05:30 -07:00
Rafael J. Wysocki fc72395780 Merge branches 'acpi-pci', 'acpi-misc' and 'acpi-tools'
* acpi-pci:
  ACPI,PCI,IRQ: remove SCI penalize function
  ACPI,PCI,IRQ: remove redundant code in acpi_irq_penalty_init()
  ACPI,PCI,IRQ: reduce static IRQ array size to 16
  ACPI,PCI,IRQ: reduce resource requirements

* acpi-misc:
  ACPI / sysfs: fix error code in get_status()
  ACPI / device_sysfs: Clean up checkpatch errors
  ACPI / device_sysfs: Change _SUN and _STA show functions error return to EIO
  ACPI / device_sysfs: Add sysfs support for _HRV hardware revision
  arm64: defconfig: Enable ACPI
  ACPI / ARM64: Remove EXPERT dependency for ACPI on ARM64
  ACPI / ARM64: Don't enable ACPI by default on ARM64
  acer-wmi: Use acpi_dev_found()
  eeepc-wmi: Use acpi_dev_found()
  ACPI / utils: Rename acpi_dev_present()

* acpi-tools:
  tools/power/acpi: close file only if it is open
2016-05-16 16:45:48 +02:00
Huacai Chen b2edcfc814 MIPS: Loongson: Add Loongson-3A R2 basic support
Loongson-3 CPU family:

Code-name       Brand-name       PRId
Loongson-3A R1  Loongson-3A1000  0x6305
Loongson-3A R2  Loongson-3A2000  0x6308
Loongson-3B R1  Loongson-3B1000  0x6306
Loongson-3B R2  Loongson-3B1500  0x6307

Features of R2 revision of Loongson-3A:

  - Primary cache includes I-Cache, D-Cache and V-Cache (Victim Cache).
  - I-Cache, D-Cache and V-Cache are 16-way set-associative, linesize is
     64 bytes.
  - 64 entries of VTLB (classic TLB), 1024 entries of FTLB (8-way
     set-associative).
  - Supports DSP/DSPv2 instructions, UserLocal register and Read-Inhibit/
     Execute-Inhibit.

[ralf@linux-mips.org: Resolved merge conflicts.]

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Steven J . Hill <sjhill@realitydiluted.com>
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/12751/
Patchwork: https://patchwork.linux-mips.org/patch/13136/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2016-05-13 14:02:14 +02:00
Huacai Chen d051472824 MIPS: Loongson-3: Move chipset ACPI code from drivers to arch
SB700/SB710/SB800 chipset ACPI code is mostly Loongson-3 specific
routines rather than a "platform driver".

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Cc: John Crispin <john@phrozen.org>
Cc: Steven J. Hill <sjhill@realitydiluted.com>
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11273/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2016-05-13 14:02:13 +02:00
Charlie Mooney 9e96aa70e9 platform/chrome: chromeos_laptop - Add Elan touchpad for Wolf
The upcoming Elan Wolf (Dell Chromebook 11) devices need to know to look
for Elan touchpads on the i2c bus so that they will be functional.

Based on the chromeos-kernel commit :
https://chromium-review.googlesource.com/198283

Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
2016-05-11 11:55:48 -07:00
Benson Leung 9bd9a90b01 platform/chrome: chromeos_laptop - Add elan trackpad option for C720
Add the elan trackpad to the Acer C720 (peppy) list, as it is an alternate
trackpad option. It may exist at i2c address 0x15.

Based on this change from the chromeos kernel :
https://chromium-review.googlesource.com/186253

Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
2016-05-11 11:55:48 -07:00
Guenter Roeck 2521ea3e0d platform/chrome: cros_ec_dev - Populate compat_ioctl
compat_ioctl has to be populated for 32 bit userspace applications to work
with 64 bit kernels.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
2016-05-11 11:55:48 -07:00
Clinton Sprain d940f3065c platform/chrome: cros_ec_lightbar - use name instead of ID to hide lightbar attributes
Lightbar attributes are hidden if the ID of the device is not 0 (the
assumption being that 0 = cros_ec = might have a lightbar, 1 = cros_pd =
hide); however, sometimes these devices get IDs 1 and 2 (or something
else) instead of IDs 0 and 1. This prevents the lightbar attributes from
appearing when they should.

Proposed change is to instead check whether the name assigned to the
device is CROS_EC_DEV_NAME (true for cros_ec, false for cros_pd).

Signed-off-by: Clinton Sprain <clintonsprain@gmail.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2016-05-11 11:55:47 -07:00
Gwendal Grignou 5d749d0bbe platform/chrome: cros_ec_dev - Fix security issue
Prevent memory scribble by checking that ioctl buffer size parameters
are sane.
Without this check, on 32 bits system, if .insize = 0xffffffff - 20 and
.outsize the amount to scribble, we would overflow, allocate a small
amounts and be able to write outside of the malloc'ed area.
Adding a hard limit allows argument checking of the ioctl. With the
current EC, it is expected .insize and .outsize to be at around 512 bytes
or less.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
2016-05-11 11:55:47 -07:00
Simon Que 492ef7829d platform/chrome: Add Chrome OS keyboard backlight LEDs support
This is a driver for ACPI-based keyboard backlight LEDs found on
Chromebooks. The driver locates \\_SB.KBLT ACPI device and exports
backlight as "chromeos::kbd_backlight" LED class device in sysfs.

Signed-off-by: Simon Que <sque@chromium.org>
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Tested-by: Evan McClain <aeroevan@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
2016-05-11 11:55:47 -07:00
Geliang Tang 48b9b6d469 platform/chrome: use to_platform_device()
Use to_platform_device() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2016-05-11 11:55:47 -07:00
Olof Johansson f929efb065 platform/chrome: pstore: Move to larger record size.
Accidentally specified a smaller record size, bring it back
to the same size as we had when we used the config file.

Signed-off-by: Olof Johansson <olofj@chromium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
2016-05-11 11:55:47 -07:00
Aaron Durbin 59a356d2f1 platform/chrome: pstore: probe for ramoops buffer using acpi
In order to handle the firmware placing the ramoops buffer
in a different location than the kernel is configured to look
probe for an ACPI device specified by GOOG9999 acpi id. If
no device is found or the first memory resource is not defined
properly fall back to the configured base and length.

Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Ben Zhang <benzh@chromium.org>
Signed-off-by: Filipe Brandenburger <filbranden@chromium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
2016-05-11 11:55:46 -07:00
Gene Chen bff3c624dc platform/chrome: chromeos_laptop: Add Leon Touch
Add support for Leon touch devices, which is the same as
slippy/falco/peppy/wolf on the same buses using the LynxPoint-LP I2C via
the i2c-designware-pci driver.

Based on the following patch:
https://chromium-review.googlesource.com/#/c/168351/

Signed-off-by: Gene Chen <gene.chen@intel.com>
Reviewed-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2016-05-11 11:55:46 -07:00
Lawrence Yiu ddd9357f60 sony-laptop: Avoid oops on module unload for older laptops
Older VAIO laptops without the SN00 ACPI method will have the "handles"
variable unset. Return early from sony_nc_function_cleanup when "handles"
is null.

Signed-off-by: Lawrence Yiu <lawyiu.dev@gmail.com>
Acked-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-05-05 16:32:32 -07:00
Julia Lawall 775d054aba intel_telemetry: Constify telemetry_core_ops structures
The telemetry_core_ops structures are never modified, so declare them as
const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-05-05 13:58:55 -07:00
Javier Martinez Canillas 575b245d90 fujitsu-laptop: Use IS_ENABLED() instead of checking for built-in or module
The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-05-05 13:52:18 -07:00
Masanari Iida c01e01597c treewide: Fix typos in printk
This patch fix spelling typos in printk from various part
of the codes.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2016-04-28 10:52:28 +02:00
Linus Torvalds 9453203bf8 platform-drivers-x86 for 4.6-3
toshiba_acpi:
  - Fix regression caused by hotkey enabling value
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJXIEZSAAoJEKbMaAwKp364mLwH/3j01EDn0JF1FIIP+kxVgeeL
 g8xI+0tlFzxmdcBqW3n4q0apzVuCmHr0pbOik289l3dv7hQ5PEvdmK/VhVPYmJDL
 2u/4EWmW7cvYMUAVhGB499pKac38fMUN5y97dkmoikiTQO6VaWsvdczvXuhuz/dP
 OcQzRR/UttCLMe/ERxz3xh4R9kbY5Hzh4slW8Ay/sGDRrgOUFRLT8Zg3Uo7MY27i
 Kq++SrH96edL1dW6XkWFIqO7NzWGlbBxTMlTlh+xmGUkOtVxUyzAID3NEDIaw6zC
 7QU61eyfIJToa2SxHZ/mT9bEFNHNbJR4KoLREG6K2LbRyMhsQfMxaTym8MNzT/Q=
 =+IXa
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v4.6-3' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86

Pull x86 platform driver fix from Darren Hart:
 "Fix regression caused by hotkey enabling value in toshiba_acpi"

* tag 'platform-drivers-x86-v4.6-3' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86:
  toshiba_acpi: Fix regression caused by hotkey enabling value
2016-04-27 08:57:11 -07:00
Linus Walleij 3769a895b4 platform: x86: intel-pmic: use gpiochip data pointer
This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Feng Tang <feng.tang@intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-04-26 15:34:41 +02:00
Giedrius Statkevičius 19d46ee1ae asus-laptop: correct error handling in sysfs_acpi_set
Properly return rv back to the caller in the case of an error in
parse_arg. In the process remove a unused variable 'out'.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-04-25 10:42:54 -07:00
Giedrius Statkevičius 2ce6d9932d asus-laptop: remove redundant initializers
Initializing rv to AE_OK is pointless because later function results are
assigned to them and only then the variable is used

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-04-25 10:42:40 -07:00
Giedrius Statkevičius 198b618ab1 asus-laptop: correct error handling in asus_read_brightness()
It is possible that acpi_evaluate_integer might fail and value would not be
set to any value so correct this defect by returning 0 in case of an
error. This is also the correct thing to return because the backlight
subsystem will print the old value of brightness in this case.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-04-25 10:39:58 -07:00
Azael Avalos a30b8f81d9 toshiba_acpi: Fix regression caused by hotkey enabling value
Commit 52cbae0127 ("toshiba_acpi: Change default Hotkey enabling value")
changed the hotkeys enabling value, as it was the same value Windows uses,
however, it turns out that the value tells the EC that the driver will now
take care of the hardware events like the physical RFKill switch or the
pointing device toggle button.

This patch reverts such commit by changing the default hotkey enabling
value to 0x09, which enables hotkey events only, making the hardware
buttons working again.

Fixes bugs 113331 and 114941.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-04-25 10:31:59 -07:00
Linus Torvalds b9358b2472 platform-drivers-x86 for 4.6-2
An S4 fix for intel-hid, new platform "quirk" for hp_accel, a fix for broader
 support of ACPI resources for the Intel Punit, and a few uninitialized variable
 fixes.
 
 intel punit:
  - decouple telemetry driver from the optional IPC resources
 
 thinkpad_acpi:
  - Silence an uninitialized variable warning
 
 intel_telemetry_pltdrv:
  - Silence an uninitialized variable warning
 
 hp_accel:
  - Silence an uninitialized variable warning
  - Add support for HP ProBook 440 G3
 
 intel-hid:
  - add a workaround to ignore an event after waking up from S4.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJXGBt9AAoJEKbMaAwKp364Z9UIAJof9EYpiTf6Z8CXlHvxjhhL
 O3MZRxhIel4ZePlOyZQ/IgLfkE7UIGO1k+3f6Mw0zNUadx2pN7qZ6QUlAGbC9Goz
 KQp0YzfIHcY0d5jLqE/bzIv8Eb41xS9DzutZW6YEUAq/C24Y3wwJm3eqiQzv+Mxh
 lYDtqnl8+seDB9dhsoAjucW2u988yAvE1oFtFzYxIyibQedBy8/rZUbTVwUPqsWO
 eKl5KTzxulbF2kcohzSAAi+kLbr+4vV/YJgU2NDfGFzSQ9hp6SckU9CVei67G4Ca
 08OrhprxP/5/ejPx6fx0gVPAVgCwMAB9MMKSz1oMYxWBMtM5r0DyuE9korA/PNs=
 =FuS3
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v4.6-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86

Pull x86 platform driver fixes from Darren Hart:
 "An S4 fix for intel-hid, new platform 'quirk' for hp_accel, a fix for
  broader support of ACPI resources for the Intel P-unit, and a few
  uninitialized variable fixes.

  intel p-unit:
   - decouple telemetry driver from the optional IPC resources

  thinkpad_acpi:
   - Silence an uninitialized variable warning

  intel_telemetry_pltdrv:
   - Silence an uninitialized variable warning

  hp_accel:
   - Silence an uninitialized variable warning
   - Add support for HP ProBook 440 G3

  intel-hid:
   - add a workaround to ignore an event after waking up from S4"

* tag 'platform-drivers-x86-v4.6-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86:
  platform:x86 decouple telemetry driver from the optional IPC resources
  thinkpad_acpi: Silence an uninitialized variable warning
  intel_telemetry_pltdrv: Silence an uninitialized variable warning
  hp_accel: Silence an uninitialized variable warning
  hp_accel: Add support for HP ProBook 440 G3
  intel-hid: add a workaround to ignore an event after waking up from S4.
2016-04-21 08:23:59 -07:00
Aubrey Li 5d07163334 platform:x86 decouple telemetry driver from the optional IPC resources
Currently the optional IPC resources prevent telemetry driver from
probing if these resources are not in ACPI table. This patch decouples
telemetry driver from these optional resources, so that telemetry driver
has dependency only on the necessary ACPI resources.

Signed-off-by: Aubrey Li <aubrey.li@linux.intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-04-19 13:51:41 -07:00
Dan Carpenter a7718360d9 thinkpad_acpi: Silence an uninitialized variable warning
If fan_get_status() fails then "s" is not initialized.  Tweak the error
handling a bit to silence this warning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-04-15 08:27:15 -07:00
Dan Carpenter d0192dca2d intel_telemetry_pltdrv: Silence an uninitialized variable warning
Presumably "pss_period" and "ioss_period" can't both be zero, but this
function is never called so we can't infer that using static analysis
alone.

Silence the warning by setting "ret" to zero.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-04-15 08:26:41 -07:00
Dan Carpenter ff22b4806d hp_accel: Silence an uninitialized variable warning
If acpi_evaluate_integer() fails then "lret" isn't initialized.  I've
tweaked the error handling to avoid this issue.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-04-15 08:26:25 -07:00
Michał Kępień 4f62568c1f fujitsu-laptop: Support radio LED
Lifebook E734/E744/E754 has a LED which the manual calls "radio
components indicator".  It should be lit when any radio transmitter is
enabled.  Its state can be read and set using ACPI (FUNC interface,
RFKILL method).

Since the Lifebook E734/E744/E754 only has a button (as compared to a
slider) for enabling/disabling radio transmitters, I believe the LED in
question is meant to indicate whether all radio transmitters are
currently on or off.  However, pressing the radio toggle button does not
automatically change the hardware state of the transmitters: it looks
like this machine relies on soft rfkill.

As for detecting whether the LED is present on a given machine, I had to
resort to educated guesswork.  I assumed this LED is present on all
devices which have a radio toggle button instead of a slider.  My
Lifebook E744 holds 0x01010001 in BTNI.  By comparing the bits and
buttons with those of a Lifebook E8420 (BTNI=0x000F0101, has a slider),
I put my money on bit 24 as the indicator of the radio toggle button
being present.  Furthermore, bit 24 is also clear on the S7020 which
does not have the toggle button or an RF LED.

Figuring out how the LED is controlled was more deterministic as all it
took was decompiling the DSDT and taking a look at method S000 (the
RFKILL method of the FUNC interface).

The LED control method implemented here is unsuitable for use with
"heavy" LED triggers, like phy0rx.  Once blinking frequency achieves a
certain level, the system hangs.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
[jwoithe: Comment on bit 24 in BTNI, expanded commit msg]
Signed-off-by: Jonathan Woithe <jwoithe@just42.net>
[dvhart: Minor style and commit log adjustments]
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-04-15 00:31:09 -07:00
Martin Vajnar 330a106508 hp_accel: Add support for HP ProBook 440 G3
HP ProBook 440 G3 laptop needs a non-standard mapping (x_inverted_usd).

Signed-off-by: Martin Vajnar <martin.vajnar@gmail.com>
Acked-by: Éric Piel <eric.piel@tremplin-utc.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-04-14 20:32:13 -07:00
Lukas Wunner 8c92a75e50 acer-wmi: Use acpi_dev_found()
Use shiny new acpi_dev_found() and remove all the boilerplate
to search for a particular ACPI device. No functional change.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Lee, Chun-Yi <jlee@suse.com>
Acked-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-04-09 03:12:59 +02:00
Lukas Wunner 9f9de69d75 eeepc-wmi: Use acpi_dev_found()
Use shiny new acpi_dev_found() and remove all the boilerplate
to search for a particular ACPI device. No functional change.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Acked-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-04-09 03:12:58 +02:00
Linus Torvalds cb107161df Convert straggling drivers to new six-argument get_user_pages()
Commit d4edcf0d56 ("mm/gup: Switch all callers of get_user_pages() to
not pass tsk/mm") switched get_user_pages() callers to the simpler model
where they no longer pass in the thread and mm pointer.  But since then
we've merged changes to a few drivers that re-introduce use of the old
interface.  Let's fix them up.

They continued to work fine (thanks to the truly disgusting macros
introduced in commit cde70140fed8: "mm/gup: Overload get_user_pages()
functions"), but cause unnecessary build noise.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-04-02 18:35:05 -05:00
Alex Hung 45aa56cd0f intel-hid: add a workaround to ignore an event after waking up from S4.
This is the same as the original workaround from S3 but for S4.  Without
this workaround, a rfkill event will be received and it will toggle
wireless devices when radio hotkey is not pressed.

Signed-off-by: Alex Hung <alex.hung@canonical.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-28 10:00:47 -07:00
Linus Torvalds 5a010c73cd platform-drivers-x86 for 4.6-1
Significant refactoring of Dell laptop drivers, modularizing the smbios code.
 Multiple new platforms added for ideapad, asus, dell, and alienware using
 existing quirks. A few fixes and cleanups.
 
 hp-wmi:
  - Remove GPS rfkill support via pre-2009 interface
  - fix unregister order in hp_wmi_rfkill_setup() once again
 
 ideapad-laptop:
  - Add ideapad Y700 (15) to the no_hw_rfkill DMI list
 
 fujitsu-laptop:
  - Support radio toggle button
 
 intel-hid:
  - allocate correct amount of memory for private struct
 
 platform/x86:
  - Make intel_scu_ipc explicitly non-modular
 
 intel_pmc_ipc:
  - Avoid pending IPC1 command during legacy suspend
  - Fix GCR register base address and length
 
 asus-nb-wmi:
  - add wapf=4 quirk for ASUS X75VD
 
 intel_telemetry_pltdrv:
  - Change verbosity control bits
 
 dell-rbtn:
  - Add a comment about the XPS 13 9350
 
 dell-wmi, dell-laptop:
  - depends DMI
 
 dell-wmi:
  - support Dell Inspiron M5110
  - properly process Dell Instant Launch hotkey
  - enable receiving WMI events on Dell Vostro V131
  - Support new hotkeys on the XPS 13 9350 (Skylake)
  - Clean up hotkey table size check
  - Stop storing pointers to DMI tables
 
 dell-laptop:
  - move dell_smi_error() to dell-smbios
  - use dell_smbios_find_token() instead of find_token_location()
  - use dell_smbios_find_token() instead of find_token_id()
  - extract SMBIOS-related code to a separate module
 
 dell-smbios:
  - rename dell_smi_error() to dell_smbios_error()
  - make da_tokens static
  - remove find_token_{id,location}()
  - implement new function for finding DMI table 0xDA tokens
  - make the SMBIOS buffer static
  - return the SMBIOS buffer from dell_smbios_get_buffer()
  - don't return an SMBIOS buffer from dell_smbios_send_request()
  - don't pass an SMBIOS buffer to dell_smbios_send_request()
  - rename dell_send_request() to dell_smbios_send_request()
  - rename release_buffer() to dell_smbios_release_buffer()
  - rename clear_buffer() to dell_smbios_clear_buffer()
  - rename get_buffer() to dell_smbios_get_buffer()
 
 dell-led:
  - use dell_smbios_send_request() for performing SMBIOS calls
  - use dell_smbios_find_token() for finding mic DMI tokens
 
 toshiba_acpi:
  - Add a module parameter to disable hotkeys registration
  - Add sysfs entries for the Cooling Method feature
  - Add support for cooling method feature
 
 Documentation/ABI:
  - Update sysfs-driver-toshiba_acpi file
 
 thinkpad_acpi:
  - Remove ambiguous logging for "Unsupported brightness interface"
 
 alienware-wmi:
  - whitespace improvements
  - Add support for two new systems: ASM200 and ASM201.
  - Add support for deep sleep control.
  - Add initial support for alienware graphics amplifier.
  - Add support for new platform: X51-R3
  - Clean up whitespace for ASM100 platform
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJW8s77AAoJEKbMaAwKp364iVgH/18Tpefbc7uOrNak4zfTmvVO
 CQjLdbnbCYoeNjwgdYSZNlaR+E2TuMdqmBXXLEr3kqicpmX15l+V5y8xJkDmGpxw
 0RmwJnkdIpmkZcjb3/2abOtIuOj1Y/tXCp5mY1FoaDYBQVzO+ZsPEGNQcMu5uJpa
 qZTw9UwiSPUspTrHHbS7/Bzv7yFnxlWC1nmt6G5zL4OMEv2AGbuVSstXVGySIML5
 TfFdisUBIXQplzwpDytHGqtGUJMc0NnT1s66beuo1oBdEFTFtBNpFySW3goV2nrZ
 JPbvyaV3tD24NYNmU9WH653InX4KuaGiJRWVT31a/I5HVVlx7mZdUYRI+EYAnmE=
 =e0E4
 -----END PGP SIGNATURE-----

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

Pull x86 platform driver updates from Darren Hart:
 "Significant refactoring of Dell laptop drivers, modularizing the
  smbios code.  Multiple new platforms added for ideapad, asus, dell,
  and alienware using existing quirks.  A few fixes and cleanups.

  hp-wmi:
   - Remove GPS rfkill support via pre-2009 interface
   - fix unregister order in hp_wmi_rfkill_setup() once again

  ideapad-laptop:
   - Add ideapad Y700 (15) to the no_hw_rfkill DMI list

  fujitsu-laptop:
   - Support radio toggle button

  intel-hid:
   - allocate correct amount of memory for private struct

  platform/x86:
   - Make intel_scu_ipc explicitly non-modular

  intel_pmc_ipc:
   - Avoid pending IPC1 command during legacy suspend
   - Fix GCR register base address and length

  asus-nb-wmi:
   - add wapf=4 quirk for ASUS X75VD

  intel_telemetry_pltdrv:
   - Change verbosity control bits

  dell-rbtn:
   - Add a comment about the XPS 13 9350

  dell-wmi, dell-laptop:
   - depends DMI

  dell-wmi:
   - support Dell Inspiron M5110
   - properly process Dell Instant Launch hotkey
   - enable receiving WMI events on Dell Vostro V131
   - Support new hotkeys on the XPS 13 9350 (Skylake)
   - Clean up hotkey table size check
   - Stop storing pointers to DMI tables

  dell-laptop:
   - move dell_smi_error() to dell-smbios
   - use dell_smbios_find_token() instead of find_token_location()
   - use dell_smbios_find_token() instead of find_token_id()
   - extract SMBIOS-related code to a separate module

  dell-smbios:
   - rename dell_smi_error() to dell_smbios_error()
   - make da_tokens static
   - remove find_token_{id,location}()
   - implement new function for finding DMI table 0xDA tokens
   - make the SMBIOS buffer static
   - return the SMBIOS buffer from dell_smbios_get_buffer()
   - don't return an SMBIOS buffer from dell_smbios_send_request()
   - don't pass an SMBIOS buffer to dell_smbios_send_request()
   - rename dell_send_request() to dell_smbios_send_request()
   - rename release_buffer() to dell_smbios_release_buffer()
   - rename clear_buffer() to dell_smbios_clear_buffer()
   - rename get_buffer() to dell_smbios_get_buffer()

  dell-led:
   - use dell_smbios_send_request() for performing SMBIOS calls
   - use dell_smbios_find_token() for finding mic DMI tokens

  toshiba_acpi:
   - Add a module parameter to disable hotkeys registration
   - Add sysfs entries for the Cooling Method feature
   - Add support for cooling method feature

  Documentation/ABI:
   - Update sysfs-driver-toshiba_acpi file

  thinkpad_acpi:
   - Remove ambiguous logging for "Unsupported brightness interface"

  alienware-wmi:
   - whitespace improvements
   - Add support for two new systems: ASM200 and ASM201.
   - Add support for deep sleep control.
   - Add initial support for alienware graphics amplifier.
   - Add support for new platform: X51-R3
   - Clean up whitespace for ASM100 platform"

* tag 'platform-drivers-x86-v4.6-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86: (47 commits)
  hp-wmi: Remove GPS rfkill support via pre-2009 interface
  hp-wmi: fix unregister order in hp_wmi_rfkill_setup() once again
  dell-wmi: support Dell Inspiron M5110
  dell-wmi: properly process Dell Instant Launch hotkey
  dell-wmi: enable receiving WMI events on Dell Vostro V131
  dell-smbios: rename dell_smi_error() to dell_smbios_error()
  dell-laptop: move dell_smi_error() to dell-smbios
  ideapad-laptop: Add ideapad Y700 (15) to the no_hw_rfkill DMI list
  fujitsu-laptop: Support radio toggle button
  intel-hid: allocate correct amount of memory for private struct
  platform/x86: Make intel_scu_ipc explicitly non-modular
  intel_pmc_ipc: Avoid pending IPC1 command during legacy suspend
  intel_pmc_ipc: Fix GCR register base address and length
  asus-nb-wmi: add wapf=4 quirk for ASUS X75VD
  intel_telemetry_pltdrv: Change verbosity control bits
  dell-rbtn: Add a comment about the XPS 13 9350
  dell-wmi: Support new hotkeys on the XPS 13 9350 (Skylake)
  dell-wmi: Clean up hotkey table size check
  dell-wmi, dell-laptop: depends DMI
  dell-wmi: Stop storing pointers to DMI tables
  ...
2016-03-23 17:20:59 -07:00
Maciej S. Szmigiero fffcad87d4 hp-wmi: Remove GPS rfkill support via pre-2009 interface
GPS rfkill support via pre-2009 WMI interface uses hp_wmi_get_sw_state()
and hp_wmi_get_hw_state() to query its current hard and soft block state,
respectively.

In hp_wmi_get_sw_state() a mask is calculated which bit should be checked
in an int value returned by firmware to get current block state: 0x200 <<
(r * 8) which with r being 3 for GPS results in overflow and mask of zero.
The same goes for hp_wmi_get_hw_state().

This effectively means that GPS rfkill on this WMI interface is considered
always both hard and soft blocked.

Unfortunately, later when rfkill subsystem calls hp_wmi_set_block() to sync
this block to hardware firmware at least on my old nc6400 gets confused and
sets both hard and soft blocks on WiFi and BT.

This happens for example on hp-wmi module load.

Since due to overflow described above it is dubious that this ever worked
correctly and HP laptops with modems having GPS support seem to all have
been released well past year 2009 let's just remove GPS rfkill support via
pre-2009 WMI interface.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:51 -07:00
Maciej S. Szmigiero c7805e5459 hp-wmi: fix unregister order in hp_wmi_rfkill_setup() once again
rfkill registration order in hp_wmi_rfkill_setup() is:
1) WiFi,
2) BT,
3) WWAN,
5) GPS.

Unregistration when cleaning up on error return should happen in reverse
order.

This means that: If BT rfkill fails to be allocated we possibly need to
first unregister WiFi rfkill before destroying it.

The same goes with (WWAN, BT) and (GPS, WWAN) pairs.

Also, if WWAN rfkill fails to register we need to (possibly) unregister BT
not the GPS one.  And if GPS rfkill fails to register we need to unregister
WWAN not the BT one.

We never need to unregister GPS rfkill here since if GPS rfkill
registration succeeds this function returns without error so no cleanup is
necessary.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:51 -07:00
Michał Kępień aaf3a5e775 dell-wmi: support Dell Inspiron M5110
Similarly to Dell Vostro V131, Dell Inspiron M5110 also requires an
SMBIOS request to be issued in order for WMI events to be generated and
does not raise an i8042 interrupt when the Dell Instant Launch hotkey is
pressed.  However, the event code for that hotkey on this machine is
0xe029, so add it to the legacy keymap.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Tested-by: Darek Stojaczyk <darek.stojaczyk@gmail.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:51 -07:00
Michał Kępień 13f5059ac5 dell-wmi: properly process Dell Instant Launch hotkey
On models on which an SMBIOS request needs to be issued in order for WMI
events to be generated, pressing the Dell Instant Launch hotkey does not
raise an i8042 interrupt - only a WMI event is generated (0xe025 on Dell
Vostro V131).  As that WMI event is the only way the kernel will be
notified about pressing the Dell Instant Launch hotkey on such machines,
the relevant keymap entry has to be changed to a KE_KEY one.  However,
the same WMI event should still be ignored on machines which do not
require an SMBIOS request for enabling WMI, so filter it conditionally
in dell_wmi_process_key().

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:50 -07:00
Michał Kępień e09c4d5b15 dell-wmi: enable receiving WMI events on Dell Vostro V131
On some laptop models (e.g. Dell Vostro V131), WMI events are not
generated until a specific SMBIOS request is issued to register an event
listener [1].  As there seems to be no ACPI method or SMBIOS request to
determine without possible side effects whether a given machine needs to
issue this SMBIOS request in order to receive WMI events, DMI matching
is used to whitelist the models which need it.

[1] https://lists.us.dell.com/pipermail/libsmbios-devel/2015-July/000612.html

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:50 -07:00
Michał Kępień 0db2180fce dell-smbios: rename dell_smi_error() to dell_smbios_error()
As dell_smi_error() is exported by dell-smbios, its prefix should be
consistent with other exported symbols, so change function name to
dell_smbios_error().

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:49 -07:00
Michał Kępień e8edf53b19 dell-laptop: move dell_smi_error() to dell-smbios
The dell_smi_error() method could be used by modules other than
dell-laptop for convenient translation of SMBIOS request errors into
errno values.  Thus, move it to dell-smbios.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:49 -07:00
John Dahlstrom 4db9675d92 ideapad-laptop: Add ideapad Y700 (15) to the no_hw_rfkill DMI list
Some Lenovo ideapad models lack a physical rfkill switch.
On Lenovo models ideapad Y700 Touch-15ISK and ideapad Y700-15ISK,
ideapad-laptop would wrongly report all radios as blocked by
hardware which caused wireless network connections to fail.

Add these models without an rfkill switch to the no_hw_rfkill list.

Signed-off-by: John Dahlstrom <jodarom@sdf.org>
Cc: <stable@vger.kernel.org> # 3.17.x-: 4fa9dab: ideapad_laptop: Lenovo G50-30 fix rfkill reports wireless blocked
Cc: <stable@vger.kernel.org>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:49 -07:00
Michał Kępień b5df36cf47 fujitsu-laptop: Support radio toggle button
Lifebook E734/E744/E754 has a radio toggle button which uses code 0x420.
Map it to KEY_RFKILL.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Acked-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:48 -07:00
Wolfram Sang e8b69a51b4 intel-hid: allocate correct amount of memory for private struct
We want the size of the struct, not of a pointer to it. To be future
proof, just dereference the pointer to get the desired type.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:48 -07:00
Paul Gortmaker f52ab44fb7 platform/x86: Make intel_scu_ipc explicitly non-modular
The Kconfig currently controlling compilation of this code is:

drivers/platform/x86/Kconfig:config INTEL_SCU_IPC
drivers/platform/x86/Kconfig:   bool "Intel SCU IPC Support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_pci_driver() uses the same init level priority as
builtin_pci_driver() the init ordering remains unchanged with
this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We don't replace module.h with init.h since the file already has that.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: platform-driver-x86@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:47 -07:00
Qipeng Zha 1f1ae997fd intel_pmc_ipc: Avoid pending IPC1 command during legacy suspend
During legacy suspend flow, IPC1 commands are being requested
from opregion driver. But the PMC_IPC1 command will timeout as example:

[  281.444600] ipc_debug##: ipc_send_command: cmd=0x201ff,
[  281.444648] wbuf[0]=0x4ea6
[  281.444668] wbuf[1]=0x0
[  281.444674] wbuf[2]=0x0
[  281.444676] wbuf[3]=0x0
[  284.446467] pmc-ipc-plat INT34D2:00: IPC timed out, TS=0x4, CMD=0x200ff

This is because before the opregion driver could send IPC1 commands,
the PMC_IPC irq is already suspended. Which makes the IPC command to
timeout.

Solution: register pmc_ipc irq as IRQF_NO_SUSPEND

Signed-off-by: Ananth Krishna R <ananth.krishna.r@intel.com>
Signed-off-by: Bharath K Veera <bharath.k.veera@intel.com>
Signed-off-by: Qipeng Zha <qipeng.zha@intel.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:47 -07:00
Qipeng Zha 1a2f25d5e7 intel_pmc_ipc: Fix GCR register base address and length
GCR register (pmc_cfg register) is at offset 0x1008, and
remapping of 0x4 bytes is enough.

Signed-off-by: Francois-Nicolas Muller <francois-nicolas.muller@intel.com>
Signed-off-by: Qipeng Zha <qipeng.zha@intel.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:47 -07:00
Oleksandr Natalenko 4670768779 asus-nb-wmi: add wapf=4 quirk for ASUS X75VD
Wi-Fi on ASUS X75VD laptop does not work unless asus_nb_wmi module
is loaded with wapf=4 option. Add quirk for this.

Signed-off-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:46 -07:00
Souvik Kumar Chakravarty 479f3b62d6 intel_telemetry_pltdrv: Change verbosity control bits
Due to a recent fix in the firmware, the Punit verbosity control bits
now adhere to the correct pattern. Hence remove the workaround and
do a read-modify-write of the register.

Signed-off-by: Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:46 -07:00
Andy Lutomirski 4d340c6b9c dell-rbtn: Add a comment about the XPS 13 9350
On the XPS 13 9350, the dell-rbtn mechanism has a new device id, and
the DSDT turns it off if a new enough _OSI is supported.  Add a
comment about why we don't bother supporting it.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:46 -07:00
Andy Lutomirski a464afb958 dell-wmi: Support new hotkeys on the XPS 13 9350 (Skylake)
The XPS 13 9350 sends WMI keypress events that aren't enumerated in
the DMI table.  Add a table listing them.  To avoid breaking things
that worked before, these un-enumerated hotkeys won't be used if the
DMI table maps them to something else.

FWIW, it appears that the DMI table may be a legacy thing and we
might want to rethink how we handle events in general.  As an
example, a whole lot of things map to KEY_PROG3 via the DMI table.

This doesn't send keypress events for any of the new events.  They
appear to all be handled by other means (keyboard illumination is
handled automatically and rfkill is handled by intel-hid).

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:45 -07:00
Andy Lutomirski b13de7019c dell-wmi: Clean up hotkey table size check
Checking the table for a minimum size of 7 bytes makes no sense: any valid
hotkey table has a size that's a multiple of 4.

Clean this up: replace the hardcoded header length with a sizeof and
change the check to ignore an empty hotkey table.  The only behavior
change is that a 7-byte table (which is nonsensical) will now be
treated as absent instead of as valid but empty.

Reported-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:45 -07:00
Andy Lutomirski a570af4850 dell-wmi, dell-laptop: depends DMI
dell-wmi and dell-laptop will compile but won't work right if DMI
isn't selected.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Acked-by: Pali Rohár <pali.rohar@gmail.com>

[arnd: Use depends instead of selects to avoid recursive dependencies]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:44 -07:00
Andy Lutomirski 18b6f80f50 dell-wmi: Stop storing pointers to DMI tables
The dmi_walk function maps the DMI table, walks it, and unmaps it.
This means that the dell_bios_hotkey_table that find_hk_type stores
points to unmapped memory by the time it gets read.

I've been able to trigger crashes caused by the stale pointer a
couple of times, but never on a stock kernel.

Fix it by generating the keymap in the dmi_walk callback instead of
storing a pointer.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:44 -07:00
Michał Kępień b7bca2d7ff dell-smbios: make da_tokens static
As dell-laptop has been changed to use dell_smbios_find_token() instead
of directly accessing members of the da_tokens table, the latter can be
marked static.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:43 -07:00
Michał Kępień 73511ff30c dell-smbios: remove find_token_{id,location}()
As dell-laptop has been changed to use dell_smbios_find_token() instead
of find_token_id() and find_token_location(), these functions can be
safely removed.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:42 -07:00
Michał Kępień f951d6e6fa dell-laptop: use dell_smbios_find_token() instead of find_token_location()
Replace all uses of find_token_location() with dell_smbios_find_token()
to avoid directly accessing the da_tokens table.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:42 -07:00
Michał Kępień 63c4029bdf dell-laptop: use dell_smbios_find_token() instead of find_token_id()
Replace all uses of find_token_id() with dell_smbios_find_token() to
avoid directly accessing the da_tokens table.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:42 -07:00
Michał Kępień 96f7ef90cc dell-smbios: implement new function for finding DMI table 0xDA tokens
Ultimately, the da_tokens table should not be exported from dell-smbios.
Currently, in some cases, dell-laptop accesses that table's members
directly, so implement a new function, dell_smbios_find_token(), which
returns a pointer to an entry inside the da_tokens table with the given
token ID (or NULL if it is not found).

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:41 -07:00
Michał Kępień 92ebd0d1a8 dell-smbios: make the SMBIOS buffer static
As dell-laptop has been changed to always retrieve a pointer to the
SMBIOS buffer using dell_smbios_get_buffer(), the SMBIOS buffer can be
marked static.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:41 -07:00
Michał Kępień bc2104c27a dell-smbios: return the SMBIOS buffer from dell_smbios_get_buffer()
Ultimately, the SMBIOS buffer should not be exported from dell-smbios.
Currently, dell-laptop accesses it directly using a global variable, so
make dell_smbios_get_buffer() return a pointer to the SMBIOS buffer and
replace all uses of the global variable with local variables.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:40 -07:00
Michał Kępień c42831c8a9 dell-smbios: don't return an SMBIOS buffer from dell_smbios_send_request()
An SMBIOS buffer pointer does not need to be returned by
dell_smbios_send_request(), because SMBIOS call results are stored in
the buffer exported by the module.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:40 -07:00
Michał Kępień 17070f242a dell-smbios: don't pass an SMBIOS buffer to dell_smbios_send_request()
Passing an SMBIOS buffer pointer to dell_smbios_send_request() is
redundant as it should always operate on the SMBIOS buffer exported from
the module.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:40 -07:00