Commit graph

17 commits

Author SHA1 Message Date
Rafael J. Wysocki ef884112e5 platform: x86: intel-hid: Wake up the system from suspend-to-idle
Allow the intel-hid driver to wake up the system from suspend-to-idle
by configuring its platform device as a wakeup one by default and
switching it over to a system wakeup events triggering mode during
system suspend transitions.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-06-23 02:09:49 +02:00
Rafael J. Wysocki b899830506 platform/x86: intel-hid: Add missing ->thaw callback
The intel-hid driver is missing a PM ->thaw callback allowing the
device to go back to the operational state after creating a
hibernation image or when there is an image restoration error during
resume.

The lack of the ->thaw callback basically means that all events
signaled by the device are discarded after a hibernation image has
been created which may be problematic, for example, if the image
cannot be saved (eg. due to an I/O issue with storage).

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-04-18 09:04:03 -07:00
Michał Kępień 1fe5530946 platform/x86: intel-hid: do not set parents of input devices explicitly
devm_input_allocate_device() already causes the supplied struct device
to be set as the parent of the input device, so doing it again is
redundant.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-and-tested-by: Alex Hung <alex.hung@canonical.com>
2017-03-14 22:58:12 -07:00
Michał Kępień faf667efdb platform/x86: intel-hid: remove redundant set_bit() call
Remove redundant set_bit() call for KEY_RFKILL as it is already made by
sparse_keymap_setup() due to KEY_RFKILL being assigned to event code 8
in intel_hid_keymap.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-and-tested-by: Alex Hung <alex.hung@canonical.com>
2017-03-14 22:57:12 -07:00
Michał Kępień 175cc9b72f platform/x86: intel-hid: use devm_input_allocate_device() for HID events input device
intel_hid_input_setup() is only called from the platform driver's .probe
callback.  Use the devm variant of input_allocate_device() for
allocating memory for the HID events input device in order to simplify
two error paths and get rid of intel_hid_input_destroy().

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-and-tested-by: Alex Hung <alex.hung@canonical.com>
2017-03-14 22:57:11 -07:00
Michał Kępień 99a75e7b05 platform/x86: intel-hid: make intel_hid_set_enable() take a boolean argument
As the integer value passed to intel_hid_set_enable() is always
explicitly passed and is used solely as a boolean value, make it a bool.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-and-tested-by: Alex Hung <alex.hung@canonical.com>
2017-03-14 22:57:10 -07:00
Michał Kępień 93ed249075 platform/x86: intel-hid: simplify enabling/disabling HID events
ACPI method HDSM takes a single integer argument.  Use
acpi_execute_simple_method() instead of acpi_evaluate_object() for
calling that ACPI method to simplify code and reduce the number of local
variables inside intel_hid_set_enable().

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-and-tested-by: Alex Hung <alex.hung@canonical.com>
2017-03-14 22:57:09 -07:00
Alex Hung bd5762a0c1 platform/x86: intel-hid: Support 5 button array
New firmwares include a feature called 5 button array that supports
super key, volume up/down, rotation lock and power button. Support
for this feature is required to fix power button on some recent
systems.

This patch was tested on a Dell Latitude 7480.

Signed-off-by: Alex Hung <alex.hung@canonical.com>
Reviewed-by: Michał Kępień <kernel@kempniu.pl>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2017-02-24 23:48:53 -08:00
Linus Torvalds e18bf801f1 platform-drivers-x86 for 4.10-1
Introduce one new driver for Mellanox platforms. Add support for various new
 models to existing drivers via quirks, hotkeys, etc. Significant updates to
 intel_pmc_core in support of Kabylake and Sunrise Point PCH power management
 debug. Some cleanup and refactoring across various drivers.
 
 dell-laptop:
  - Use brightness_set_blocking for kbd_led_level_set
 
 thinkpad_acpi:
  - Initialize local in_tablet_mode and type
  - Fix old style declaration GCC warning
  - Adding new hotkey ID for Lenovo thinkpad
  - Add support for X1 Yoga (2016) Tablet Mode
  - Move tablet detection into separate function
 
 asus-nb-wmi:
  - Add X45U quirk
  - Make use of dmi->ident
 
 asus-wmi:
  - Set specified XUSB2PR value for X550LB
 
 intel_mid_thermal:
  - Fix suspend handlers unused warning
 
 intel-vbtn:
  - Switch to use devm_input_allocate_device
 
 dell-wmi:
  - Add events created by Dell Rugged 2-in-1s
  - Adjust wifi catcher to emit KEY_WLAN
 
 intel_pmc_core:
  - Add KBL CPUID support
  - Add LTR IGNORE debug feature
  - Add MPHY PLL clock gating status
  - ModPhy core lanes pg status
  - Add PCH IP Power Gating Status
  - Fix PWRMBASE mask and mmio reg len
 
 acer-wmi:
  - Only supports AMW0_GUID1 on acer family
 
 mlx-platform:
  - Introduce support for Mellanox hotplug driver
 
 platform/x86:
  - Use ACPI_FAILURE at appropriate places
 -----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJYUwFxAAoJEKbMaAwKp3645GkH/RjsE8jubyerhlKqgG4UZaRA
 2a2NnCOI1fuDqSV0bgIo4rzMHeHHjR8Hosz6HXkb3cC67QNfae3Xasr2+vqzqqKd
 hJFUL/y6JmAhLUcPVp49HWOLrYLKM12iLyEidPOor4r/qWrarLtVEyvX5O8VEy01
 +cM29+KcZnHjtQQoDaVwWZ1bEbLVNRlSrQ/YZivGBPXJBsvnz1Wq5xPuGHDm660X
 rVw8h1GojPwctiNWTpw2VlMUz8Ho0yXMBAPTpEJOzlFR8FTaSD6XQqm/uZ5w8ToJ
 Sn12XavaKeQSki7VVTmouL+L4Ams0Ygz8pgDd3ynhN6U/hFfTWbGhdRCILxmSRk=
 =iHwp
 -----END PGP SIGNATURE-----

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

Pull x86 platform driver updates from Darrent Hart:
 "Introduce one new driver for Mellanox platforms. Add support for
  various new models to existing drivers via quirks, hotkeys, etc.
  Significant updates to intel_pmc_core in support of Kabylake and
  Sunrise Point PCH power management debug. Some cleanup and refactoring
  across various drivers.

  Detailed summary:

  dell-laptop:
   - Use brightness_set_blocking for kbd_led_level_set

  thinkpad_acpi:
   - Initialize local in_tablet_mode and type
   - Fix old style declaration GCC warning
   - Adding new hotkey ID for Lenovo thinkpad
   - Add support for X1 Yoga (2016) Tablet Mode
   - Move tablet detection into separate function

  asus-nb-wmi:
   - Add X45U quirk
   - Make use of dmi->ident

  asus-wmi:
   - Set specified XUSB2PR value for X550LB

  intel_mid_thermal:
   - Fix suspend handlers unused warning

  intel-vbtn:
   - Switch to use devm_input_allocate_device

  dell-wmi:
   - Add events created by Dell Rugged 2-in-1s
   - Adjust wifi catcher to emit KEY_WLAN

  intel_pmc_core:
   - Add KBL CPUID support
   - Add LTR IGNORE debug feature
   - Add MPHY PLL clock gating status
   - ModPhy core lanes pg status
   - Add PCH IP Power Gating Status
   - Fix PWRMBASE mask and mmio reg len

  acer-wmi:
   - Only supports AMW0_GUID1 on acer family

  mlx-platform:
   - Introduce support for Mellanox hotplug driver

  platform/x86:
   - Use ACPI_FAILURE at appropriate places"

* tag 'platform-drivers-x86-v4.10-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86: (22 commits)
  platform/x86: thinkpad_acpi: Initialize local in_tablet_mode and type
  platform/x86: dell-laptop: Use brightness_set_blocking for kbd_led_level_set
  platform/x86: thinkpad_acpi: Fix old style declaration GCC warning
  platform/x86: thinkpad_acpi: Adding new hotkey ID for Lenovo thinkpad
  platform/x86: thinkpad_acpi: Add support for X1 Yoga (2016) Tablet Mode
  platform/x86: thinkpad_acpi: Move tablet detection into separate function
  platform/x86: asus-nb-wmi.c: Add X45U quirk
  platform/x86: asus-nb-wmi: Make use of dmi->ident
  platform/x86: asus-wmi: Set specified XUSB2PR value for X550LB
  platform/x86: intel_mid_thermal: Fix suspend handlers unused warning
  platform/x86: intel-vbtn: Switch to use devm_input_allocate_device
  platform/x86: Use ACPI_FAILURE at appropriate places
  platform/x86: dell-wmi: Add events created by Dell Rugged 2-in-1s
  platform/x86: dell-wmi: Adjust wifi catcher to emit KEY_WLAN
  platform/x86: intel_pmc_core: Add KBL CPUID support
  platform/x86: intel_pmc_core: Add LTR IGNORE debug feature
  platform/x86: intel_pmc_core: Add MPHY PLL clock gating status
  platform/x86: intel_pmc_core: ModPhy core lanes pg status
  platform/x86: intel_pmc_core: Add PCH IP Power Gating Status
  platform/x86: intel_pmc_core: Fix PWRMBASE mask and mmio reg len
  ...
2016-12-15 13:31:25 -08:00
Axel Lin 3526ecadc8 platform/x86: Use ACPI_FAILURE at appropriate places
Use ACPI_FAILURE() to replace !ACPI_SUCCESS(), this avoid !! operations.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2016-12-13 09:29:01 -08:00
Heikki Krogerus 1571875bee ACPI / platform: Add support for build-in properties
We have a couple of drivers, acpi_apd.c and acpi_lpss.c,
that need to pass extra build-in properties to the devices
they create. Previously the drivers added those properties
to the struct device which is member of the struct
acpi_device, but that does not work. Those properties need
to be assigned to the struct device of the platform device
instead in order for them to become available to the
drivers.

To fix this, this patch changes acpi_create_platform_device
function to take struct property_entry pointer as parameter.

Fixes: 20a875e2e8 (serial: 8250_dw: Add quirk for APM X-Gene SoC)
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Tested-by: Yazen Ghannam <yazen.ghannam@amd.com>
Tested-by: Jérôme de Bretagne <jerome.debretagne@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-11-10 00:30:29 +01: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
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
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
Alex Hung 1c319e781e intel-hid: fix incorrect entries in intel_hid_keymap
intel_hid_keymap contains a duplicate entry for KEY_HOME and an
incorrect HID index for KEY_PAGEDOWN

Reported-by: Pavel Bludov <pbludov@gmail.com>
Signed-off-by: Alex Hung <alex.hung@canonical.com>
2016-01-30 09:10:25 -08:00
Alex Hung ecc83e52b2 intel-hid: new hid event driver for hotkeys
This driver supports various HID events including hotkeys.
Dell XPS 13 9350 requires it for the wireless hotkey.

Signed-off-by: Alex Hung <alex.hung@canonical.com>
Reviewed-and-tested-by: Andy Lutomirski <luto@kernel.org>

[dvhart: Kconfig help typo fix and INPUT_SPARSEKMAP fix from Sedat Dilek]

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-01-19 17:35:36 -08:00