1
0
Fork 0
Commit Graph

2345 Commits (9b87e7a8bfb5098129836757608b3cbbdc11245a)

Author SHA1 Message Date
Mario Limonciello 946da69954 platform/x86: intel-vbtn: match power button on press rather than release
This fixes a problem where the system gets stuck in a loop
unable to wakeup via power button in s2idle.

The problem happens because:
 - press power button:
   - system emits 0xc0 (power press), event ignored
   - system emits 0xc1 (power release), event processed,
     emited as KEY_POWER
   - set wakeup_mode to true
   - system goes to s2idle
 - press power button
   - system emits 0xc0 (power press), wakeup_mode is true,
     system wakes
   - system emits 0xc1 (power release), event processed,
     emited as KEY_POWER
   - system goes to s2idle again

To avoid this situation, process the presses (which matches what
intel-hid does too).

Verified on an Dell XPS 9365

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-08-05 14:37:19 -07:00
Andy Lutomirski 51391caf99 platform/x86: dell-wmi: Fix driver interface version query
When I converted dell-wmi to the new bus infrastructure, I left the
call to dell_wmi_check_descriptor_buffer() in dell_wmi_init().  This
could cause two problems:

 - An error message when loading the driver on a system without
   dell-wmi.  We'd try to read the event descriptor even if the WMI
   GUID wasn't there.

 - A possible race if dell-wmi was loaded manually before wmi was
   fully initialized.

Fix it by moving the call to the probe function where it belongs.

Fixes: bff589be59 ("platform/x86: dell-wmi: Convert to the WMI bus infrastructure")
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-08-01 15:41:43 -07:00
Alexey Khoroshilov 972777171f platform/x86: wmi: Fix error handling in acpi_wmi_init()
The order of resource deallocations is messed up in acpi_wmi_init().
It should be vice versa.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-07-21 16:21:03 -07:00
Arnd Bergmann a00c69632a platform/x86: peaq-wmi: select INPUT_POLLDEV
The new driver fails to build without INPUT_POLLDEV

drivers/platform/x86/peaq-wmi.o: In function `peaq_wmi_exit':
peaq-wmi.c:(.exit.text+0x1c): undefined reference to `input_unregister_polled_device'
drivers/platform/x86/peaq-wmi.o: In function `peaq_wmi_init':
peaq-wmi.c:(.init.text+0x23): undefined reference to `input_allocate_polled_device'
peaq-wmi.c:(.init.text+0x18e): undefined reference to `input_register_polled_device'

For some reason, all other drivers that need this use 'select'
here rather than 'depends on', so I'm doing the same.

Fixes: 13bb0fd551 ("platform/x86: peaq-wmi: Add new peaq-wmi driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-07-20 16:57:51 -07:00
Linus Torvalds 6735a1971a platform-drivers-x86 for v4.13-2
Add new platform matches for silead_dmi and ideapad-laptop. Several
 constify patches for attribute_group structures. Fixes for peaq-wmi and
 intel_telemetry*.
 
 *Note: 74a1eb565c platform/x86: intel_telemetry_debugfs: fix oops when load/unload module
        is a duplicate cherry-picked from the 4.12 RC cycle
        (platform-drivers-x86-v4.12-2).
 
 silead_dmi:
  - Add entry for Ployer Momo7w tablet touchscreen
  - Add touchscreen info for I.T.Works TW891 2-in-1
 
 toshiba_acpi:
  - constify attribute_group structures.
 
 asus-wmi:
  - constify attribute_group structures.
 
 panasonic-laptop:
  - constify attribute_group structures.
 
 alienware-wmi:
  - constify attribute_group structures.
 
 samsung-laptop:
  - constify attribute_group structures.
 
 compal-laptop:
  - constify attribute_group structures.
 
 fujitsu-laptop:
  - constify attribute_group structures.
  - add NULL check on devm_kzalloc() return value
 
 peaq-wmi:
  - Fix peaq_ignore_events_counter handling off by 1
 
 ideapad-laptop:
  - Fix indentation in DMI table
  - Add several models to no_hw_rfkill
  - Add IdeaPad V510-15IKB to no_hw_rfkill
 
 intel_telemetry:
  - Add debugfs entry for S0ix residency
 
 intel_telemetry_debugfs:
  - fix some error codes in init
  - fix oops when load/unload module
 -----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJZZ8I5AAoJEKbMaAwKp364YSgH/2snOmcYjFeI7oTHm021peAd
 n23HcTF623dmfQ2LTddPqhtzOAQH9ZZycEd4oW4MASWlntzPZFoxfKiclunvoyKm
 XuycYDOjAl7DnDnoZ8SD7E2QoNAnmmK9riJIudzyHTKCWdxMpWe0mDcR12Rb5uD8
 kOQ+ctI61zWfDWfZj+Fo7HvQ5HsfmLdS4Itjl38H1QyjzIdp0eNA5pZQP0deQ/0w
 vjhmLVT7KEqfRJ09RNIA1eIikyC1uiePUGe13nGEc3P9CpQ/yAVeYvP7za4W7tsF
 jL9s/6uVHnB69WrtWm8Y4l8h4mHymkBV3BxA/fZwaoNTAILH1O5pDHk8T71Po1E=
 =iVsK
 -----END PGP SIGNATURE-----

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

Pull more x86 platform driver updates from Darren Hart:
 "Add new platform matches for silead_dmi and ideapad-laptop. Several
  constify patches for attribute_group structures. Fixes for peaq-wmi
  and intel_telemetry.

  silead_dmi:
   - Add entry for Ployer Momo7w tablet touchscreen
   - Add touchscreen info for I.T.Works TW891 2-in-1

  toshiba_acpi:
   - constify attribute_group structures.

  asus-wmi:
   - constify attribute_group structures.

  panasonic-laptop:
   - constify attribute_group structures.

  alienware-wmi:
   - constify attribute_group structures.

  samsung-laptop:
   - constify attribute_group structures.

  compal-laptop:
   - constify attribute_group structures.

  fujitsu-laptop:
   - constify attribute_group structures.
   - add NULL check on devm_kzalloc() return value

  peaq-wmi:
   - Fix peaq_ignore_events_counter handling off by 1

  ideapad-laptop:
   - Fix indentation in DMI table
   - Add several models to no_hw_rfkill
   - Add IdeaPad V510-15IKB to no_hw_rfkill

  intel_telemetry:
   - Add debugfs entry for S0ix residency

  intel_telemetry_debugfs:
   - fix some error codes in init
   - fix oops when load/unload module"

* tag 'platform-drivers-x86-v4.13-2' of git://git.infradead.org/linux-platform-drivers-x86:
  platform/x86: silead_dmi: Add entry for Ployer Momo7w tablet touchscreen
  platform/x86: toshiba_acpi: constify attribute_group structures.
  platform/x86: asus-wmi: constify attribute_group structures.
  platform/x86: panasonic-laptop: constify attribute_group structures.
  platform/x86: alienware-wmi: constify attribute_group structures.
  platform/x86: samsung-laptop: constify attribute_group structures.
  platform/x86: compal-laptop: constify attribute_group structures.
  platform/x86: fujitsu-laptop: constify attribute_group structures.
  platform/x86: peaq-wmi: Fix peaq_ignore_events_counter handling off by 1
  platform/x86: fujitsu-laptop: add NULL check on devm_kzalloc() return value
  platform/x86: silead_dmi: Add touchscreen info for I.T.Works TW891 2-in-1
  platform/x86: ideapad-laptop: Fix indentation in DMI table
  platform/x86: ideapad-laptop: Add several models to no_hw_rfkill
  platform/x86: ideapad-laptop: Add IdeaPad V510-15IKB to no_hw_rfkill
  platform/x86: intel_telemetry: Add debugfs entry for S0ix residency
  platform/x86: intel_telemetry_debugfs: fix some error codes in init
  platform/x86: intel_telemetry_debugfs: fix oops when load/unload module
2017-07-13 12:28:06 -07:00
Hans de Goede c3a73ed8a8 platform/x86: silead_dmi: Add entry for Ployer Momo7w tablet touchscreen
This Ployer Momo7w revision has the same hardware as the Trekstor
ST70416-6, so we re-use the surftab_wintron70_st70416_6_data.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-07-12 13:57:42 -07:00
Arvind Yadav 44bd76d0a3 platform/x86: toshiba_acpi: constify attribute_group structures.
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/sysfs.h> work
with const attribute_group. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
  26360	   1072	     24	  27456	   6b40	drivers/platform/x86/toshiba_acpi.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
  26424	   1008	     24	  27456	   6b40	drivers/platform/x86/toshiba_acpi.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-07-11 09:22:55 -07:00
Arvind Yadav e90d9ba837 platform/x86: asus-wmi: constify attribute_group structures.
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/sysfs.h> work
with const attribute_group. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
  13140	    840	      1	  13981	   369d	drivers/platform/x86/asus-wmi.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
  13268	    712	      1	  13981	   368d	drivers/platform/x86/asus-wmi.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-07-11 09:22:54 -07:00
Arvind Yadav 24f584055c platform/x86: panasonic-laptop: constify attribute_group structures.
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/sysfs.h> work
with const attribute_group. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
   2505	    600	      4	   3109	    c25	drivers/platform/x86/panasonic-laptop.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   2569	    536	      4	   3109	    c25	drivers/platform/x86/panasonic-laptop.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-07-11 09:22:53 -07:00
Arvind Yadav 4b7942d8d1 platform/x86: alienware-wmi: constify attribute_group structures.
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/sysfs.h> work
with const attribute_group. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
   6932	   1016	     48	   7996	   1f3c	drivers/platform/x86/alienware-wmi.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   7060	    888	     48	   7996	   1f64	drivers/platform/x86/alienware-wmi.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-07-11 09:22:52 -07:00
Arvind Yadav 8546268e11 platform/x86: samsung-laptop: constify attribute_group structures.
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/sysfs.h> work
with const attribute_group. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
   8710	   5452	     23	  14185	   3769	drivers/platform/x86/samsung-laptop.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   8774	   5388	     23	  14185	   3769	drivers/platform/x86/samsung-laptop.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-07-11 09:22:51 -07:00
Arvind Yadav ab56246bee platform/x86: compal-laptop: constify attribute_group structures.
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/sysfs.h> work
with const attribute_group. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
   6781	   6144	     34	  12959	   329f	drivers/platform/x86/compal-laptop.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   6845	   6080	     34	  12959	   329f	drivers/platform/x86/compal-laptop.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-07-11 09:22:49 -07:00
Arvind Yadav ee56ff71bb platform/x86: fujitsu-laptop: constify attribute_group structures.
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/sysfs.h> work
with const attribute_group. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
   7474	   1205	     24	   8703	   21ff	drivers/platform/x86/fujitsu-laptop.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   7538	   1141	     24	   8703	   21ff	drivers/platform/x86/fujitsu-laptop.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-07-11 09:22:44 -07:00
Hans de Goede c1bda752fd platform/x86: peaq-wmi: Fix peaq_ignore_events_counter handling off by 1
If peaq_ignore_events_counter gets set to 1 we should skip polling 1
time, rather then ignoring it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-07-11 09:08:04 -07:00
Linus Torvalds 6972b007ca Merge (most of) tag 'mfd-next-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
Pull MFD updates from Lee Jones:
 "New Drivers:
   - Intel Cherry Trail Whiskey Cove PMIC
   - TI LP87565 PMIC

  New Device Support:
   - Add support for Cannonlake to intel-lpss-pci
   - Add support for Simatic IOT2000 to intel_quark_i2c_gpio

  New Functionality:
   - Add Regulator support (axp20x)

  Fix-ups:
   - Rework IRQ handling (intel_soc_pmic_bxtwc, rtsx_pcr, cros_ec)
   - Remove unused/unwelcome code (ipaq-micro, wm831x-core, da9062-core)
   - Provide deregistration on unbind (rn5t618)
   - Rework DT code/documentation (arizona)
   - Constify things (fsl-imx25-tsadc)
   - MAINTAINERS updates (DA9062/61)
   - Kconfig configuration adaptions (INTEL_SOC_PMIC, MFD_AXP20X_I2C)
   - Switch to DMI matching (intel_quark_i2c_gpio)
   - Provide an appropriate level of error checking (wm831x-{i2c,spi},
     twl4030-irq, tc6393xb)
   - Make use of devm_* (resource handling) calls (intel_soc_pmic_bxtwc,
     stm32-timers, atmel-flexcom, cros_ec, fsl-imx25-tsadc,
     exynos-lpass, palmas, qcom-spmi-pmic, smsc-ece1099,
     motorola-cpcap)"

[ Skipped the last commit in that series that added eight thousand
  lines of pointless repeated register definitions.  - Linus ]

* tag 'mfd-next-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (38 commits)
  mfd: Add LP87565 PMIC support
  mfd: cros_ec: Free IRQ on exit
  dt-bindings: vendor-prefixes: Add arctic to vendor prefix
  mfd: da9061: Fix to remove BBAT_CONT register from chip model
  mfd: da9061: Fix to remove BBAT_CONT register from chip model
  mfd: axp20x-i2c: Document that this must be builtin on x86
  mfd: Add Cherry Trail Whiskey Cove PMIC driver
  mfd: tc6393xb: Handle return value of clk_prepare_enable
  mfd: intel_quark_i2c_gpio: Add support for SIMATIC IOT2000 platform
  mfd: intel_quark_i2c_gpio: Use dmi_system_id table for retrieving frequency
  mfd: motorola-cpcap: Use devm_of_platform_populate()
  mfd: smsc-ece: Use devm_of_platform_populate()
  mfd: qcom-spmi-pmic: Use devm_of_platform_populate()
  mfd: palmas: Use devm_of_platform_populate()
  mfd: exynos: Use devm_of_platform_populate()
  mfd: fsl-imx25: Use devm_of_platform_populate()
  mfd: cros_ec: Use devm_of_platform_populate()
  mfd: atmel: Use devm_of_platform_populate()
  mfd: stm32-timers: Use devm_of_platform_populate()
  mfd: intel_soc_pmic: Select designware i2c-bus driver
  ...
2017-07-07 13:30:05 -07:00
Gustavo A. R. Silva b77a537207 platform/x86: fujitsu-laptop: add NULL check on devm_kzalloc() return value
Check return value from call to devm_kzalloc()
in order to prevent a NULL pointer dereference.

This issue was detected using Coccinelle and the following semantic patch:

@@
expression x;
identifier fld;
@@

* x = devm_kzalloc(...);
  ... when != x == NULL
  x->fld

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Reviewed-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-07-07 09:58:31 -07:00
Hans de Goede 4edfc5406a platform/x86: silead_dmi: Add touchscreen info for I.T.Works TW891 2-in-1
Add touchscreen info for I.T.Works TW891 2-in-1.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-07-06 15:34:46 -07:00
Linus Torvalds 0dfaeb618f platform-drivers-x86 for v4.13-1
Introduce new bus architecture for WMI and expose BMOF data through
 sysfs. Correct several assumptions about WMI instance number from 1 to
 0. Further fujitsu-laptop cleanups, continuing to prepare for separation
 into two modules. Add support for several new ideapad laptops and
 silead-based tablets. Various minor fixes and const cleanups.
 
 sony-laptop:
  - constify attribute_group and input index array
 
 fujitsu-laptop:
  - rework debugging
  - do not evaluate ACPI _INI methods
  - do not update ACPI device power status
  - sanitize hotkey input device identification
  - use strcpy to set ACPI device names and classes
  - remove redundant safety checks
  - use device-specific data in remaining module code
  - use device-specific data in LED-related code
  - explicitly pass ACPI device to call_fext_func()
  - track the last instantiated FUJ02E3 ACPI device
  - allocate fujitsu_laptop in acpi_fujitsu_laptop_add()
  - use device-specific data in backlight code
  - allocate fujitsu_bl in acpi_fujitsu_bl_add()
  - distinguish current uses of device-specific data
 
 msi-laptop:
  - constify msipf*_attribute_group
 
 eeepc-laptop:
  - constify platform_attribute_group
 
 toshiba_haps:
  - constify haps_attr_group
 
 dell-wmi-led:
  - Adjust instance of wmi_evaluate_method calls to 0
 
 alienware-wmi:
  - Adjust instance of wmi_evaluate_method calls to 0
 
 intel_menlow:
  - Add const to thermal_cooling_device_ops structure
 
 acerhdf:
  - Add const to thermal_cooling_device_ops structure
 
 dell-laptop:
  - Fix bogus keyboard backlight sysfs interface
 
 acer-wmi:
  - Using zero as first WMI instance number
  - Detect RF Button capability
 
 ideapad-laptop:
  - Add Y720-15IKBN to no_hw_rfkill
  - Add Y520-15IKBN to no_hw_rfkill
  - constify rfkill_ops structure
  - Squelch ACPI event 1
  - hide unused 'touchpad_store'
  - Switch touchpad attribute to be RO
  - Add sysfs interface for touchpad state
 
 silead_dmi:
  - Add touchscreen info for PoV mobii wintab p800w
  - Add touchscreen info for Pipo W2S tablet
  - Add touchscreen info for GP-electronic T701
 
 dell-rbtn:
  - constify rfkill_ops structures
  - Improve explanation about DELLABC6
 
 samsung-laptop:
  - constify rfkill_ops structures
 
 panasonic-laptop:
  - remove unused code
 
 samsung-laptop:
  - Initialize loca variable
 
 dell-wmi:
  - Convert to the WMI bus infrastructure
  - Add a better description for "stealth mode"
  - Add a comment explaining the 0xb2 magic number
 
 wmi-bmof:
  - New driver to expose embedded Binary WMI MOF metadata
 
 wmi*:
  - Fix printing info about WDG structure
  - Add recent copyright statements
  - Require query for data blocks, rename writable to setable
  - Add an interface for subdrivers to access sibling devices
  - Bind the platform device, not the ACPI node
  - Add a new interface to read block data
  - Incorporate acpi_install_notify_handler
  - Instantiate all devices before adding them
  - Probe data objects for read and write capabilities
  - Split devices into types and add basic sysfs attributes
  - Fix error handling when creating devices
  - Turn WMI into a bus driver
  - Track wmi devices per ACPI device
  - Clean up acpi_wmi_add
  - Pass the acpi_device through to parse_wdg
  - Drop "Mapper (un)loaded" messages
 
 intel_cht_int33fe:
  - Set supplied-from property on max17047 dev
 
 intel_pmc_ipc:
  - Mark ipc_data_readb() as __maybe_unused
 
 topstar-laptop:
  - Add new device id
 
 peaq-wmi:
  - Add new peaq-wmi driver
 
 thinkpad_acpi:
  - Add a comment about 0 in module_param_call()
  - Join string literals back
 
 toshiba_acpi:
  - use memdup_user_nul
 -----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJZXSzcAAoJEKbMaAwKp364hSEIAKC0xJRZWv1aI1f69JCSZR0+
 5/6tMsps9nK4LtaKQCvPHeOCxmwpE4tZYzyuYHyHW+pfUMquIdRVQRMe3u2FTrKS
 HuvCgmYAkZqCzy/zQIPaVU2K9m7/9HubXYy0Q1qkjlGZp/IYMFoeo7DU65Ajm+HS
 wrRXIYIKSbjAU0pmzW//MFauEi26MWpAHMraw+HCJbXcGwhokSrtTYitqFpQXnhJ
 kdguSkEluW1NoG3Tv7CbfXWXge7zwxlrmI06b4FtkpFK6b2LCZcYeUhIn33yNYT1
 IwhNOsaWlxNw3K3c1IRZSwYoJ6dmBJ+cxmZ0sd3cr8jahgpHB/nJiRElHmTdf2M=
 =PbWU
 -----END PGP SIGNATURE-----

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

Pull x86 platform driver updates from Darren Hart:
 "Introduce new bus architecture for WMI and expose BMOF data through
  sysfs. Correct several assumptions about WMI instance number from 1 to
  0. Further fujitsu-laptop cleanups, continuing to prepare for
  separation into two modules. Add support for several new ideapad
  laptops and silead-based tablets. Various minor fixes and const
  cleanups.

  Detail summary:

  sony-laptop:
   - constify attribute_group and input index array

  fujitsu-laptop:
   - rework debugging
   - do not evaluate ACPI _INI methods
   - do not update ACPI device power status
   - sanitize hotkey input device identification
   - use strcpy to set ACPI device names and classes
   - remove redundant safety checks
   - use device-specific data in remaining module code
   - use device-specific data in LED-related code
   - explicitly pass ACPI device to call_fext_func()
   - track the last instantiated FUJ02E3 ACPI device
   - allocate fujitsu_laptop in acpi_fujitsu_laptop_add()
   - use device-specific data in backlight code
   - allocate fujitsu_bl in acpi_fujitsu_bl_add()
   - distinguish current uses of device-specific data

  msi-laptop:
   - constify msipf*_attribute_group

  eeepc-laptop:
   - constify platform_attribute_group

  toshiba_haps:
   - constify haps_attr_group

  dell-wmi-led:
   - Adjust instance of wmi_evaluate_method calls to 0

  alienware-wmi:
   - Adjust instance of wmi_evaluate_method calls to 0

  intel_menlow:
   - Add const to thermal_cooling_device_ops structure

  acerhdf:
   - Add const to thermal_cooling_device_ops structure

  dell-laptop:
   - Fix bogus keyboard backlight sysfs interface

  acer-wmi:
   - Using zero as first WMI instance number
   - Detect RF Button capability

  ideapad-laptop:
   - Add Y720-15IKBN to no_hw_rfkill
   - Add Y520-15IKBN to no_hw_rfkill
   - constify rfkill_ops structure
   - Squelch ACPI event 1
   - hide unused 'touchpad_store'
   - Switch touchpad attribute to be RO
   - Add sysfs interface for touchpad state

  silead_dmi:
   - Add touchscreen info for PoV mobii wintab p800w
   - Add touchscreen info for Pipo W2S tablet
   - Add touchscreen info for GP-electronic T701

  dell-rbtn:
   - constify rfkill_ops structures
   - Improve explanation about DELLABC6

  samsung-laptop:
   - constify rfkill_ops structures

  panasonic-laptop:
   - remove unused code

  samsung-laptop:
   - Initialize loca variable

  dell-wmi:
   - Convert to the WMI bus infrastructure
   - Add a better description for "stealth mode"
   - Add a comment explaining the 0xb2 magic number

  wmi-bmof:
   - New driver to expose embedded Binary WMI MOF metadata

  wmi*:
   - Fix printing info about WDG structure
   - Add recent copyright statements
   - Require query for data blocks, rename writable to setable
   - Add an interface for subdrivers to access sibling devices
   - Bind the platform device, not the ACPI node
   - Add a new interface to read block data
   - Incorporate acpi_install_notify_handler
   - Instantiate all devices before adding them
   - Probe data objects for read and write capabilities
   - Split devices into types and add basic sysfs attributes
   - Fix error handling when creating devices
   - Turn WMI into a bus driver
   - Track wmi devices per ACPI device
   - Clean up acpi_wmi_add
   - Pass the acpi_device through to parse_wdg
   - Drop "Mapper (un)loaded" messages

  intel_cht_int33fe:
   - Set supplied-from property on max17047 dev

  intel_pmc_ipc:
   - Mark ipc_data_readb() as __maybe_unused

  topstar-laptop:
   - Add new device id

  peaq-wmi:
   - Add new peaq-wmi driver

  thinkpad_acpi:
   - Add a comment about 0 in module_param_call()
   - Join string literals back

  toshiba_acpi:
   - use memdup_user_nul"

* tag 'platform-drivers-x86-v4.13-1' of git://git.infradead.org/linux-platform-drivers-x86: (67 commits)
  platform/x86: sony-laptop: constify attribute_group and input index array
  platform/x86: fujitsu-laptop: rework debugging
  platform/x86: fujitsu-laptop: do not evaluate ACPI _INI methods
  platform/x86: fujitsu-laptop: do not update ACPI device power status
  platform/x86: fujitsu-laptop: sanitize hotkey input device identification
  platform/x86: fujitsu-laptop: use strcpy to set ACPI device names and classes
  platform/x86: fujitsu-laptop: remove redundant safety checks
  platform/x86: msi-laptop: constify msipf*_attribute_group
  platform/x86: eeepc-laptop: constify platform_attribute_group
  platform/x86: toshiba_haps: constify haps_attr_group
  platform/x86: dell-wmi-led: Adjust instance of wmi_evaluate_method calls to 0
  platform/x86: alienware-wmi: Adjust instance of wmi_evaluate_method calls to 0
  platform/x86: intel_menlow: Add const to thermal_cooling_device_ops structure
  platform/x86: acerhdf: Add const to thermal_cooling_device_ops structure
  platform/x86: dell-laptop: Fix bogus keyboard backlight sysfs interface
  platform/x86: acer-wmi: Using zero as first WMI instance number
  platform/x86: ideapad-laptop: Add Y720-15IKBN to no_hw_rfkill
  platform/x86: ideapad-laptop: Add Y520-15IKBN to no_hw_rfkill
  platform/x86: silead_dmi: Add touchscreen info for PoV mobii wintab p800w
  platform/x86: silead_dmi: Add touchscreen info for Pipo W2S tablet
  ...
2017-07-06 15:33:27 -07:00
Andy Shevchenko 5e8f42aa49 platform/x86: ideapad-laptop: Fix indentation in DMI table
There are couple of places where 8 spaces are used instead of tabs.
Replace former by latter. No functional change intended.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-07-05 11:26:55 -07:00
Yang Jiaxun 710c059c24 platform/x86: ideapad-laptop: Add several models to no_hw_rfkill
Some Lenovo ideapad models do not have hardware rfkill switches, but
trying to read the rfkill switches through the ideapad-laptop module.
It caused to always reported blocking breaking wifi.

Fix it by adding those models to no_hw_rfkill_list.

Signed-off-by: Yang Jiaxun <yjx@flygoat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-07-05 11:26:54 -07:00
Sven Eckelmann 0df4b805cb platform/x86: ideapad-laptop: Add IdeaPad V510-15IKB to no_hw_rfkill
Like other Lenovo models the IdeaPad V510-15IKB does not have an hw
rfkill switch. This results in hard-blocked radios after boot, resulting
in always blocked radios rendering them unusable.

Add the IdeaPad V510-15IKB to the no_hw_rfkill DMI list and allows using
the built-in radios.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-07-05 11:26:54 -07:00
Rajneesh Bhardwaj bc8c47abd4 platform/x86: intel_telemetry: Add debugfs entry for S0ix residency
This adds a debugfs consumer for the exported kernel API
intel_pmc_read_s0ix_residency. This debugfs entry reads S0ix residency
directly from the PMC hardware counters.

TEST:
- echo freeze > /sys/power/state
- Wake the system, read the S0ix residency i.e.
  cat /sys/kernel/debug/telemetry/s0ix_residency_usec

Signed-off-by: Shanth Murthy <shanth.murthy@intel.com>
Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-07-05 11:26:35 -07:00
Dan Carpenter 7a3a51ab94 platform/x86: intel_telemetry_debugfs: fix some error codes in init
There are bunch of "goto out;" paths where we don't set the error code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-07-05 11:24:41 -07:00
Priyalee Kushwaha 74a1eb565c platform/x86: intel_telemetry_debugfs: fix oops when load/unload module
This fixes an oops found while testing load/unload of the
intel_telemetry_debugfs module. module_init uses register_pm_notifier
for PM callbacks, but unregister_pm_notifier was missing from
module_exit.

 [ 97.481860] BUG: unable to handle kernel paging request at ffffffffa006f010
 [ 97.489742] IP: blocking_notifier_chain_register+0x3a/0xa0
 [ 97.495898] PGD 2e0a067
 [ 97.495899] PUD 2e0b063
 [ 97.498737] PMD 179e29067
 [ 97.501573] PTE 0

 [ 97.508423] Oops: 0000 1 PREEMPT SMP
 [ 97.512724] Modules linked in: intel_telemetry_debugfs intel_rapl gpio_keys dwc3 udc_core intel_telemetry_pltdrv intel_punit_ipc intel_telemetry_core rtc_cmos efivars x86_pkg_temp_thermal iwlwifi snd_hda_codec_hdmi soc_button_array btusb cfg80211 btrtl mei_me hci_uart btbcm mei btintel i915 bluetooth intel_pmc_ipc snd_hda_intel spi_pxa2xx_platform snd_hda_codec dwc3_pci snd_hda_core tpm_tis tpm_tis_core tpm efivarfs
 [ 97.558453] CPU: 0 PID: 889 Comm: modprobe Not tainted 4.11.0-rc6-intel-dev-bkc #1
 [ 97.566950] Hardware name: Intel Corp. Joule DVT3/SDS, BIOS GTPP181A.X64.0143.B30.1701132137 01/13/2017
 [ 97.577518] task: ffff8801793a21c0 task.stack: ffff8801793f0000
 [ 97.584162] RIP: 0010:blocking_notifier_chain_register+0x3a/0xa0
 [ 97.590903] RSP: 0018:ffff8801793f3c58 EFLAGS: 00010286
 [ 97.596802] RAX: ffffffffa006f000 RBX: ffffffff81e3ea20 RCX: 0000000000000000
 [ 97.604812] RDX: ffff880179eaf210 RSI: ffffffffa0131000 RDI: ffffffff81e3ea20
 [ 97.612821] RBP: ffff8801793f3c68 R08: 0000000000000006 R09: 000000000000005c
 [ 97.620847] R10: 0000000000000000 R11: 0000000000000006 R12: ffffffffa0131000
 [ 97.628855] R13: 0000000000000000 R14: ffff880176e35f48 R15: ffff8801793f3ea8
 [ 97.636865] FS: 00007f7eeba07700(0000) GS:ffff88017fc00000(0000) knlGS:0000000000000000
 [ 97.645948] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 [ 97.652423] CR2: ffffffffa006f010 CR3: 00000001775ef000 CR4: 00000000003406f0
 [ 97.660423] Call Trace:
 [ 97.663166] ? 0xffffffffa0031000
 [ 97.666885] register_pm_notifier+0x18/0x20
 [ 97.671581] telemetry_debugfs_init+0x92/0x1000

Signed-off-by: Priyalee Kushwaha <priyalee.kushwaha@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-07-05 11:24:41 -07:00
Linus Torvalds 408c9861c6 Power management updates for v4.13-rc1
- Rework suspend-to-idle to allow it to take wakeup events signaled
    by the EC into account on ACPI-based platforms in order to properly
    support power button wakeup from suspend-to-idle on recent Dell
    laptops (Rafael Wysocki).
 
    That includes the core suspend-to-idle code rework, support for
    the Low Power S0 _DSM interface, and support for the ACPI INT0002
    Virtual GPIO device from Hans de Goede (required for USB keyboard
    wakeup from suspend-to-idle to work on some machines).
 
  - Stop trying to export the current CPU frequency via /proc/cpuinfo
    on x86 as that is inaccurate and confusing (Len Brown).
 
  - Rework the way in which the current CPU frequency is exported by
    the kernel (over the cpufreq sysfs interface) on x86 systems with
    the APERF and MPERF registers by always using values read from
    these registers, when available, to compute the current frequency
    regardless of which cpufreq driver is in use (Len Brown).
 
  - Rework the PCI/ACPI device wakeup infrastructure to remove the
    questionable and artificial distinction between "devices that
    can wake up the system from sleep states" and "devices that can
    generate wakeup signals in the working state" from it, which
    allows the code to be simplified quite a bit (Rafael Wysocki).
 
  - Fix the wakeup IRQ framework by making it use SRCU instead of
    RCU which doesn't allow sleeping in the read-side critical
    sections, but which in turn is expected to be allowed by the
    IRQ bus locking infrastructure (Thomas Gleixner).
 
  - Modify some computations in the intel_pstate driver to avoid
    rounding errors resulting from them (Srinivas Pandruvada).
 
  - Reduce the overhead of the intel_pstate driver in the HWP
    (hardware-managed P-states) mode and when the "performance"
    P-state selection algorithm is in use by making it avoid
    registering scheduler callbacks in those cases (Len Brown).
 
  - Rework the energy_performance_preference sysfs knob in
    intel_pstate by changing the values that correspond to
    different symbolic hint names used by it (Len Brown).
 
  - Make it possible to use more than one cpuidle driver at the same
    time on ARM (Daniel Lezcano).
 
  - Make it possible to prevent the cpuidle menu governor from using
    the 0 state by disabling it via sysfs (Nicholas Piggin).
 
  - Add support for FFH (Fixed Functional Hardware) MWAIT in ACPI C1
    on AMD systems (Yazen Ghannam).
 
  - Make the CPPC cpufreq driver take the lowest nonlinear performance
    information into account (Prashanth Prakash).
 
  - Add support for hi3660 to the cpufreq-dt driver, fix the
    imx6q driver and clean up the sfi, exynos5440 and intel_pstate
    drivers (Colin Ian King, Krzysztof Kozlowski, Octavian Purdila,
    Rafael Wysocki, Tao Wang).
 
  - Fix a few minor issues in the generic power domains (genpd)
    framework and clean it up somewhat (Krzysztof Kozlowski,
    Mikko Perttunen, Viresh Kumar).
 
  - Fix a couple of minor issues in the operating performance points
    (OPP) framework and clean it up somewhat (Viresh Kumar).
 
  - Fix a CONFIG dependency in the hibernation core and clean it up
    slightly (Balbir Singh, Arvind Yadav, BaoJun Luo).
 
  - Add rk3228 support to the rockchip-io adaptive voltage scaling
    (AVS) driver (David Wu).
 
  - Fix an incorrect bit shift operation in the RAPL power capping
    driver (Adam Lessnau).
 
  - Add support for the EPP field in the HWP (hardware managed
    P-states) control register, HWP.EPP, to the x86_energy_perf_policy
    tool and update msr-index.h with HWP.EPP values (Len Brown).
 
  - Fix some minor issues in the turbostat tool (Len Brown).
 
  - Add support for AMD family 0x17 CPUs to the cpupower tool and fix
    a minor issue in it (Sherry Hurwitz).
 
  - Assorted cleanups, mostly related to the constification of some
    data structures (Arvind Yadav, Joe Perches, Kees Cook, Krzysztof
    Kozlowski).
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJZWrICAAoJEILEb/54YlRxZYMQAIRhfbyDxKq+ByvSilUS8kTA
 AItwJ8FFzykhiwN75Cqabg4rAGyWma7IRs1vzU7zeC1aEQIn+bTQtvk+utZNI+g2
 ANFlDha20q/sXsP/CDMMTIAdW9tSOC0TOvFI9s2V2Y8dJZhoekO4ctx34FAfUS5d
 Ao6rwSAWCMsCXcGaTAlqTA+TEJmBG7u6Iq6hq6ngltoFwOv3mWWBVn52VVaJ7SMp
 9/IPbbLGMFAedrgEBRGCR+MME1xZZpvcZIJaTt1Mgn7Cx3cJaysIUAvqY/SsvFGq
 5FcUTcF2qpK3+AGawiAxZIjvOBsGRtIwqKinNIzYWs/NjiIdzmgVAmTeuPtTqp+5
 HFehUdtkFcnuDnLqSNzAaZUa7tw84cJkwnbVMnesx0MkG6rZ1SeL22E2Sabpcdsh
 3Yo1ThzJSxi59DhiiE92EQnNCEjmCldRy+8q5Ag035muxl6EJYvuNBMnZv/BMCUn
 ltSNOrmps1DlN+Col8ORIeNzQ1YjYzWMqKAYzSbyccm4ug/iSHx0/DuESmQ4GTlF
 YCwkmqyWiHrBwpl51jc+4a7SGlMmKRqU+MJes0CjagaaqoUAb8qeBOpzEJ0yNwjZ
 wtI41l6blE6kbMD3yqGdCfiB2S7GlPVoxa15eX1wRyLH3fLjwwrzJirEaiBS86tI
 1PzHZEOmBlh3DYC6DBKA
 =Wsph
 -----END PGP SIGNATURE-----

Merge tag 'pm-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management updates from Rafael Wysocki:
 "The big ticket items here are the rework of suspend-to-idle in order
  to add proper support for power button wakeup from it on recent Dell
  laptops and the rework of interfaces exporting the current CPU
  frequency on x86.

  In addition to that, support for a few new pieces of hardware is
  added, the PCI/ACPI device wakeup infrastructure is simplified
  significantly and the wakeup IRQ framework is fixed to unbreak the IRQ
  bus locking infrastructure.

  Also, there are some functional improvements for intel_pstate, tools
  updates and small fixes and cleanups all over.

  Specifics:

   - Rework suspend-to-idle to allow it to take wakeup events signaled
     by the EC into account on ACPI-based platforms in order to properly
     support power button wakeup from suspend-to-idle on recent Dell
     laptops (Rafael Wysocki).

     That includes the core suspend-to-idle code rework, support for the
     Low Power S0 _DSM interface, and support for the ACPI INT0002
     Virtual GPIO device from Hans de Goede (required for USB keyboard
     wakeup from suspend-to-idle to work on some machines).

   - Stop trying to export the current CPU frequency via /proc/cpuinfo
     on x86 as that is inaccurate and confusing (Len Brown).

   - Rework the way in which the current CPU frequency is exported by
     the kernel (over the cpufreq sysfs interface) on x86 systems with
     the APERF and MPERF registers by always using values read from
     these registers, when available, to compute the current frequency
     regardless of which cpufreq driver is in use (Len Brown).

   - Rework the PCI/ACPI device wakeup infrastructure to remove the
     questionable and artificial distinction between "devices that can
     wake up the system from sleep states" and "devices that can
     generate wakeup signals in the working state" from it, which allows
     the code to be simplified quite a bit (Rafael Wysocki).

   - Fix the wakeup IRQ framework by making it use SRCU instead of RCU
     which doesn't allow sleeping in the read-side critical sections,
     but which in turn is expected to be allowed by the IRQ bus locking
     infrastructure (Thomas Gleixner).

   - Modify some computations in the intel_pstate driver to avoid
     rounding errors resulting from them (Srinivas Pandruvada).

   - Reduce the overhead of the intel_pstate driver in the HWP
     (hardware-managed P-states) mode and when the "performance" P-state
     selection algorithm is in use by making it avoid registering
     scheduler callbacks in those cases (Len Brown).

   - Rework the energy_performance_preference sysfs knob in intel_pstate
     by changing the values that correspond to different symbolic hint
     names used by it (Len Brown).

   - Make it possible to use more than one cpuidle driver at the same
     time on ARM (Daniel Lezcano).

   - Make it possible to prevent the cpuidle menu governor from using
     the 0 state by disabling it via sysfs (Nicholas Piggin).

   - Add support for FFH (Fixed Functional Hardware) MWAIT in ACPI C1 on
     AMD systems (Yazen Ghannam).

   - Make the CPPC cpufreq driver take the lowest nonlinear performance
     information into account (Prashanth Prakash).

   - Add support for hi3660 to the cpufreq-dt driver, fix the imx6q
     driver and clean up the sfi, exynos5440 and intel_pstate drivers
     (Colin Ian King, Krzysztof Kozlowski, Octavian Purdila, Rafael
     Wysocki, Tao Wang).

   - Fix a few minor issues in the generic power domains (genpd)
     framework and clean it up somewhat (Krzysztof Kozlowski, Mikko
     Perttunen, Viresh Kumar).

   - Fix a couple of minor issues in the operating performance points
     (OPP) framework and clean it up somewhat (Viresh Kumar).

   - Fix a CONFIG dependency in the hibernation core and clean it up
     slightly (Balbir Singh, Arvind Yadav, BaoJun Luo).

   - Add rk3228 support to the rockchip-io adaptive voltage scaling
     (AVS) driver (David Wu).

   - Fix an incorrect bit shift operation in the RAPL power capping
     driver (Adam Lessnau).

   - Add support for the EPP field in the HWP (hardware managed
     P-states) control register, HWP.EPP, to the x86_energy_perf_policy
     tool and update msr-index.h with HWP.EPP values (Len Brown).

   - Fix some minor issues in the turbostat tool (Len Brown).

   - Add support for AMD family 0x17 CPUs to the cpupower tool and fix a
     minor issue in it (Sherry Hurwitz).

   - Assorted cleanups, mostly related to the constification of some
     data structures (Arvind Yadav, Joe Perches, Kees Cook, Krzysztof
     Kozlowski)"

* tag 'pm-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (69 commits)
  cpufreq: Update scaling_cur_freq documentation
  cpufreq: intel_pstate: Clean up after performance governor changes
  PM: hibernate: constify attribute_group structures.
  cpuidle: menu: allow state 0 to be disabled
  intel_idle: Use more common logging style
  PM / Domains: Fix missing default_power_down_ok comment
  PM / Domains: Fix unsafe iteration over modified list of domains
  PM / Domains: Fix unsafe iteration over modified list of domain providers
  PM / Domains: Fix unsafe iteration over modified list of device links
  PM / Domains: Handle safely genpd_syscore_switch() call on non-genpd device
  PM / Domains: Call driver's noirq callbacks
  PM / core: Drop run_wake flag from struct dev_pm_info
  PCI / PM: Simplify device wakeup settings code
  PCI / PM: Drop pme_interrupt flag from struct pci_dev
  ACPI / PM: Consolidate device wakeup settings code
  ACPI / PM: Drop run_wake from struct acpi_device_wakeup_flags
  PM / QoS: constify *_attribute_group.
  PM / AVS: rockchip-io: add io selectors and supplies for rk3228
  powercap/RAPL: prevent overridding bits outside of the mask
  PM / sysfs: Constify attribute groups
  ...
2017-07-04 13:39:41 -07:00
Linus Torvalds 974668417b driver core patches for 4.13-rc1
Here is the big driver core update for 4.13-rc1.
 
 The large majority of this is a lot of cleanup of old fields in the
 driver core structures and their remaining usages in random drivers.
 All of those fixes have been reviewed by the various subsystem
 maintainers.  There's also some small firmware updates in here, a new
 kobject uevent api interface that makes userspace interaction easier,
 and a few other minor things.
 
 All of these have been in linux-next for a long while with no reported
 issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCWVpX4A8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ymobgCfd0d13IfpZoq1N41wc6z2Z0xD7cwAnRMeH1/p
 kEeISGpHPYP9f8PBh9FO
 =Hfqt
 -----END PGP SIGNATURE-----

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

Pull driver core updates from Greg KH:
 "Here is the big driver core update for 4.13-rc1.

  The large majority of this is a lot of cleanup of old fields in the
  driver core structures and their remaining usages in random drivers.
  All of those fixes have been reviewed by the various subsystem
  maintainers. There's also some small firmware updates in here, a new
  kobject uevent api interface that makes userspace interaction easier,
  and a few other minor things.

  All of these have been in linux-next for a long while with no reported
  issues"

* tag 'driver-core-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (56 commits)
  arm: mach-rpc: ecard: fix build error
  zram: convert remaining CLASS_ATTR() to CLASS_ATTR_RO()
  driver-core: remove struct bus_type.dev_attrs
  powerpc: vio_cmo: use dev_groups and not dev_attrs for bus_type
  powerpc: vio: use dev_groups and not dev_attrs for bus_type
  USB: usbip: convert to use DRIVER_ATTR_RW
  s390: drivers: convert to use DRIVER_ATTR_RO/WO
  platform: thinkpad_acpi: convert to use DRIVER_ATTR_RO/RW
  pcmcia: ds: convert to use DRIVER_ATTR_RO
  wireless: ipw2x00: convert to use DRIVER_ATTR_RW
  net: ehea: convert to use DRIVER_ATTR_RO
  net: caif: convert to use DRIVER_ATTR_RO
  TTY: hvc: convert to use DRIVER_ATTR_RW
  PCI: pci-driver: convert to use DRIVER_ATTR_WO
  IB: nes: convert to use DRIVER_ATTR_RW
  HID: hid-core: convert to use DRIVER_ATTR_RO and drv_groups
  arm: ecard: fix dev_groups patch typo
  tty: serdev: use dev_groups and not dev_attrs for bus_type
  sparc: vio: use dev_groups and not dev_attrs for bus_type
  hid: intel-ish-hid: use dev_groups and not dev_attrs for bus_type
  ...
2017-07-03 20:27:48 -07:00
Rafael J. Wysocki 8f8e5c3e27 Merge branch 'acpi-pm'
* acpi-pm:
  PM / core: Drop run_wake flag from struct dev_pm_info
  PCI / PM: Simplify device wakeup settings code
  PCI / PM: Drop pme_interrupt flag from struct pci_dev
  ACPI / PM: Consolidate device wakeup settings code
  ACPI / PM: Drop run_wake from struct acpi_device_wakeup_flags
  ACPI / sleep: EC-based wakeup from suspend-to-idle on recent systems
  platform: x86: intel-hid: Wake up the system from suspend-to-idle
  platform: x86: intel-vbtn: Wake up the system from suspend-to-idle
  ACPI / PM: Ignore spurious SCI wakeups from suspend-to-idle
  platform/x86: Add driver for ACPI INT0002 Virtual GPIO device
  PCI / PM: Restore PME Enable if skipping wakeup setup
  PM / sleep: Print timing information if debug is enabled
  ACPI / PM: Clean up device wakeup enable/disable code
  ACPI / PM: Change log level of wakeup-related message
  USB / PCI / PM: Allow the PCI core to do the resume cleanup
  ACPI / PM: Run wakeup notify handlers synchronously

Conflicts:
	drivers/base/power/main.c
2017-07-03 14:23:09 +02:00
Arvind Yadav d791db9a57 platform/x86: sony-laptop: constify attribute_group and input index array
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/sysfs.h> work with const
attribute_group.

The content of sony_laptop_input_index does not change and is declared
as a static global array.

Constify spic_attribute_group and sony_laptop_input_index.

File size before:
   text	   data	    bss	    dec	    hex	filename
  31273	   5176	    372	  36821	   8fd5	drivers/platform/x86/sony-laptop.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
  31337	   5112	    372	  36821	   8fd5	drivers/platform/x86/sony-laptop.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
[dvhart: updated commit message, includes fix suggested by Arnd Bergmann]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-06-30 20:26:54 -07:00
Michał Kępień eee77da1a7 platform/x86: fujitsu-laptop: rework debugging
Using a dedicated Kconfig option for enabling debugging means the user
may be forced to recompile their kernel in order to gather debugging
information, which is inconvenient.  Replace custom debugging
infrastructure with standard logging functions, taking advantage of
dynamic debug.  Replace a pr_info() call inside an ACPI callback with an
acpi_handle_info() call.

The following mapping was used:

  - FUJLAPTOP_DBG_ERROR -> acpi_handle_err()
  - FUJLAPTOP_DBG_WARN  -> acpi_handle_info() / dev_info()
  - FUJLAPTOP_DBG_INFO  -> acpi_handle_debug()
  - FUJLAPTOP_DBG_TRACE -> acpi_handle_debug() / dev_dbg()

This means that some events which used to only be logged when the user
explicitly requested it will now be logged by default:

  - ACPI method evaluation errors,
  - unknown ACPI notification codes,
  - unknown hotkey scancodes.

The first type of events should happen rarely, if ever at all.  The rest
is interesting from driver development perspective as their presence in
the logs will mean the driver is unaware of certain events, handling of
which should be implemented.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-06-30 20:13:06 -07:00
Michał Kępień 32c28f1f43 platform/x86: fujitsu-laptop: do not evaluate ACPI _INI methods
acpi_ns_initialize_devices(), which is called during system-wide ACPI
initialization, already detects and calls all _INI methods belonging to
objects present in ACPI tables.  There is no need to call these methods
again every time the module is loaded because they only initialize
status flags and hotkey-related variables; status flags are effectively
constants, hotkey-related variables may be assigned non-zero values
before acpi_fujitsu_laptop_add() is called, but that does not really
matter as we drain the scancodes queued in the firmware's ring buffer
before doing anything else.

Remove sections of code which invoke and check evaluation status of the
_INI methods belonging to the ACPI devices handled by the driver.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-06-30 20:13:05 -07:00
Michał Kępień 1c1946269f platform/x86: fujitsu-laptop: do not update ACPI device power status
Calling acpi_bus_update_power() for ACPI devices FUJ02B1 and FUJ02E3 is
pointless as they are not power manageable (neither _PS0 nor _PR0 is
defined for any of them), which causes their power state to be inherited
from their parent devices.  Given the ACPI paths of these two devices
(\_SB.PCI0.LPCB.FJEX, \_SB.FEXT), their parent devices are also not
power manageable.  These parent devices will thus have their power state
initialized to ACPI_STATE_D0, which in turn causes the power state for
both FUJ02B1 and FUJ02E3 to always be ACPI_STATE_D0 ("on").

Remove relevant acpi_bus_update_power() calls along with parts of debug
messages that they were supposed to have an effect on.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-06-30 20:13:05 -07:00
Michał Kępień c1f51f1c49 platform/x86: fujitsu-laptop: sanitize hotkey input device identification
In the case of brightness-related FUJ02B1 ACPI device, initializing the
input device associated with it identically as acpi-video initializes
its input device makes sense.  However, using the same data for the
input device associated with the FUJ02E3 ACPI device makes little sense,
because the latter has nothing to do with video and assigning an
arbitrary product ID to it is redundant.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-06-30 20:13:04 -07:00
Michał Kępień d6a298aea3 platform/x86: fujitsu-laptop: use strcpy to set ACPI device names and classes
No formatting is needed when setting ACPI device name and class, so
switch to using strcpy() for this purpose.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-06-30 20:13:03 -07:00
Michał Kępień 08df5d476f platform/x86: fujitsu-laptop: remove redundant safety checks
Do not check whether the pointer passed to ACPI add callbacks is NULL as
it is earlier dereferenced anyway in the bus-level probe callback,
acpi_device_probe().

Do not check the value of acpi_disabled in fujitsu_init(), because it is
already done by acpi_bus_register_driver(), which is the first function
called by fujitsu_init().

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-06-30 20:13:02 -07:00
Arvind Yadav 79e19ab542 platform/x86: msi-laptop: constify msipf*_attribute_group
File size before:
   text	   data	    bss	    dec	    hex	filename
   5396	   5016	     85	  10497	   2901	drivers/platform/x86/msi-laptop.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   5524	   4888	     85	  10497	   2901	drivers/platform/x86/msi-laptop.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-06-30 20:13:01 -07:00
Arvind Yadav 130bbe6328 platform/x86: eeepc-laptop: constify platform_attribute_group
File size before:
   text	   data	    bss	    dec	    hex	filename
   9934	   1136	      2	  11072	   2b40	drivers/platform/x86/eeepc-laptop.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   9998	   1072	      2	  11072	   2b40	drivers/platform/x86/eeepc-laptop.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-06-30 20:13:01 -07:00
Arvind Yadav 36a1f2c607 platform/x86: toshiba_haps: constify haps_attr_group
File size before:
   text	   data	    bss	    dec	    hex	filename
   1471	    528	      8	   2007	    7d7	drivers/platform/x86/toshiba_haps.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   1519	    464	      8	   1991	    7c7	drivers/platform/x86/toshiba_haps.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-06-28 09:01:37 -07:00
Mario Limonciello 71596f5b0e platform/x86: dell-wmi-led: Adjust instance of wmi_evaluate_method calls to 0
Pali recently noticed that WMI instances are zero indexed.

The only reason that these calls all worked properly is because the ASL
didn't verify the instance number.

Signed-off-by: Louis Davis <louis.davis@dell.com>
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-06-28 09:01:36 -07:00
Mario Limonciello c0e4aa7871 platform/x86: alienware-wmi: Adjust instance of wmi_evaluate_method calls to 0
Pali recently noticed that WMI instances are zero indexed.

The only reason that these calls all worked properly is because the ASL
didn't verify the instance number.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-06-28 09:01:35 -07:00
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 91f9e850d4 platform: x86: intel-vbtn: Wake up the system from suspend-to-idle
Allow the intel-vbtn 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:31 +02:00
Bhumika Goyal 20485a565d platform/x86: intel_menlow: Add const to thermal_cooling_device_ops structure
Declare thermal_cooling_device_ops structure as const as it is only passed
as an argument to the function thermal_cooling_device_register and this
argument is of type const. So, declare the structure as const.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-06-21 14:13:10 -07:00
Bhumika Goyal adee455112 platform/x86: acerhdf: Add const to thermal_cooling_device_ops structure
Declare thermal_cooling_device_ops structure as const as it is only passed
as an argument to the function thermal_cooling_device_register and this
argument is of type const. So, declare the structure as const.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-06-21 14:12:46 -07:00
Kai Heng Feng 1b1ffc57a1 platform/x86: dell-laptop: Fix bogus keyboard backlight sysfs interface
Dell Latitude 3160 does not have keyboard backlight, but there is a
sysfs interface for it, which does nothing at all.

KBD_LED_ON_TOKEN is the only token can be found. Since it doesn't have
KBD_LED_OFF_TOKEN or KBD_LED_AUTO_*_TOKEN, it should be safe to assume
at least two tokens should be present to support keyboard backlight.
Not all models have ON token - they may have multiple AUTO tokens instead.

Models which do not use SMBIOS token to control keyboard backlight, also
have this issue. Brightness level is 0 on these models. Verified on Dell
Inspiron 3565.

Reports keyboard backlight is supported only when at least two modes are
present.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-06-20 20:24:56 +03:00
Lee, Chun-Yi 62fc743caf platform/x86: acer-wmi: Using zero as first WMI instance number
Pali Rohár found that there have some wmi query/evaluation
code that they used 'one' as the first WMI instance number.
But the number is indexed from zero that it's must less than
the instance_count in _WDG.

This patch changes those instance number from one to zero.

Cc: Darren Hart <dvhart@infradead.org>
Cc: Andy Shevchenko <andy@infradead.org>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: "Lee, Chun-Yi" <jlee@suse.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-06-20 20:23:17 +03:00
Kuppuswamy Sathyanarayanan 94d68594a7 platform/x86: intel_bxtwc_tmu: Remove first level IRQ unmask
Currently in WCOVE PMIC MFD driver, all second level IRQ chips
are chained to the respective first level IRQs. So there is no
need for explicitly unmasking the first level IRQ in this
driver. This patches removes this level 1 IRQ unmask support.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reviewed-by: Darren Hart (VMware) <dvhart@infradead.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-06-19 15:45:30 +01:00
Olle Liljenzin b2f2fe205c platform/x86: ideapad-laptop: Add Y720-15IKBN to no_hw_rfkill
Lenovo Legion Y720-15IKBN is yet another Lenovo model that does not
have an hw rfkill switch, resulting in wifi always reported as hard
blocked.

Add the model to the list of models without rfkill switch.

Signed-off-by: Olle Liljenzin <olle@liljenzin.se>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-06-18 15:42:14 +03:00
Olle Liljenzin 5d9f40b566 platform/x86: ideapad-laptop: Add Y520-15IKBN to no_hw_rfkill
Lenovo Legion Y520-15IKBN is yet another Lenovo model that does not
have an hw rfkill switch, resulting in wifi always reported as hard
blocked.

Add the model to the list of models without rfkill switch.

Signed-off-by: Olle Liljenzin <olle@liljenzin.se>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-06-18 15:35:23 +03:00
Hans de Goede f4d342cf90 platform/x86: silead_dmi: Add touchscreen info for PoV mobii wintab p800w
Add touchscreen info for the Point of View mobii wintab p800w tablet.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-06-16 16:43:24 -07:00
Hans de Goede 13fadfa75c platform/x86: silead_dmi: Add touchscreen info for Pipo W2S tablet
Add touchscreen info for Pipo W2S tablet.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-06-15 10:05:10 -07:00