History

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

Pull x86 platform driver updates from Darren Hart: - Move the Dell dcdbas and dell_rbu drivers into platform/drivers/x86 as they are closely coupled with other drivers in this location. - Improve _init* usage for acerhdf and fix some usage issues with messages and module parameters. - Simplify asus-wmi by calling ACPI/WMI methods directly, eliminating workqueue overhead, eliminate double reporting of keyboard backlight. - Fix wake from USB failure on Bay Trail devices (intel_int0002_vgpio). - Notify intel_telemetry users when IPC1 device is not enabled. - Update various drivers with new laptop model IDs. - Update several intel drivers to use SPDX identifers and order headers alphabetically. * tag 'platform-drivers-x86-v4.20-1' of git://git.infradead.org/linux-platform-drivers-x86: (64 commits) HID: asus: only support backlight when it's not driven by WMI platform/x86: asus-wmi: export function for evaluating WMI methods platform/x86: asus-wmi: Only notify kbd LED hw_change by fn-key pressed platform/x86: wmi: declare device_type structure as constant platform/x86: ideapad: Add Y530-15ICH to no_hw_rfkill platform/x86: Add Intel AtomISP2 dummy / power-management driver platform/x86: touchscreen_dmi: Add min-x and min-y settings for various models platform/x86: touchscreen_dmi: Add info for the Onda V80 Plus v3 tablet platform/x86: touchscreen_dmi: Add info for the Trekstor Primetab T13B tablet platform/x86: intel_telemetry: Get rid of custom macro platform/x86: intel_telemetry: report debugfs failure MAINTAINERS: intel_telemetry: Update maintainers info platform/x86: Add LG Gram laptop special features driver platform/x86: asus-wmi: Simplify the keyboard brightness updating process platform/x86: touchscreen_dmi: Add info for the Trekstor Primebook C11 convertible platform/x86: mlx-platform: Properly use mlxplat_mlxcpld_msn201x_items MAINTAINERS: intel_pmc_core: Update MAINTAINERS firmware: dcdbas: include linux/io.h platform/x86: intel-wmi-thunderbolt: Add dynamic debugging platform/x86: intel-wmi-thunderbolt: Convert to use SPDX identifier ...

Linus Torvalds committed 8 years ago

Commit eb7046e2 parents 5b74498 3b692c547 files · +1587 −494Browse files

Unified · Split

47 files
  1. Documentation/ABI/testing/sysfs-platform-lg-laptop +35 −0
  2. Documentation/laptops/lg-laptop.rst +81 −0
  3. MAINTAINERS +26 −5
  4. drivers/firmware/Kconfig +0 −28
  5. drivers/firmware/Makefile +0 −2
  6. drivers/hid/Kconfig +1 −0
  7. drivers/hid/hid-asus.c +22 −1
  8. drivers/platform/x86/Kconfig +58 −1
  9. drivers/platform/x86/Makefile +4 −0
  10. drivers/platform/x86/acerhdf.c +49 −19
  11. drivers/platform/x86/asus-wmi.c +19 −100
  12. drivers/platform/x86/dcdbas.c +118 −7
  13. drivers/platform/x86/dcdbas.h +10 −0
  14. drivers/platform/x86/dell-smbios-smm.c +1 −1
  15. drivers/platform/x86/dell_rbu.c +8 −0
  16. drivers/platform/x86/ideapad-laptop.c +8 −1
  17. drivers/platform/x86/intel-hid.c +1 −11
  18. drivers/platform/x86/intel-rst.c +2 −21
  19. drivers/platform/x86/intel-smartconnect.c +3 −19
  20. drivers/platform/x86/intel-wmi-thunderbolt.c +7 −11
  21. drivers/platform/x86/intel_atomisp2_pm.c +119 −0
  22. drivers/platform/x86/intel_bxtwc_tmu.c +2 −11
  23. drivers/platform/x86/intel_cht_int33fe.c +2 −5
  24. drivers/platform/x86/intel_chtdc_ti_pwrbtn.c +1 −0
  25. drivers/platform/x86/intel_int0002_vgpio.c +19 −10
  26. drivers/platform/x86/intel_ips.c +2 −13
  27. drivers/platform/x86/intel_ips.h +1 −12
  28. drivers/platform/x86/intel_menlow.c +6 −22
  29. drivers/platform/x86/intel_mid_powerbtn.c +3 −15
  30. drivers/platform/x86/intel_mid_thermal.c +7 −23
  31. drivers/platform/x86/intel_oaktrail.c +9 −23
  32. drivers/platform/x86/intel_pmc_core.c +1 −10
  33. drivers/platform/x86/intel_pmc_core.h +1 −10
  34. drivers/platform/x86/intel_pmc_ipc.c +15 −20
  35. drivers/platform/x86/intel_punit_ipc.c +5 −7
  36. drivers/platform/x86/intel_scu_ipc.c +7 −9
  37. drivers/platform/x86/intel_scu_ipcutil.c +10 −14
  38. drivers/platform/x86/intel_telemetry_core.c +2 −10
  39. drivers/platform/x86/intel_telemetry_debugfs.c +10 −17
  40. drivers/platform/x86/intel_telemetry_pltdrv.c +2 −10
  41. drivers/platform/x86/intel_turbo_max_3.c +5 −13
  42. drivers/platform/x86/lg-laptop.c +700 −0
  43. drivers/platform/x86/mlx-platform.c +1 −1
  44. drivers/platform/x86/touchscreen_dmi.c +99 −8
  45. drivers/platform/x86/wmi.c +3 −3
  46. include/linux/platform_data/x86/asus-wmi.h +101 −0
  47. kernel/trace/trace_printk.c +1 −1
Documentation/ABI/testing/sysfs-platform-lg-laptop+35−0
@@ -0,0 +1,35 @@
1+What: /sys/devices/platform/lg-laptop/reader_mode
2+Date: October 2018
3+KernelVersion: 4.20
4+Contact: "Matan Ziv-Av <matan@svgalib.org>
5+Description:
6+ Control reader mode. 1 means on, 0 means off.
7+
8+What: /sys/devices/platform/lg-laptop/fn_lock
9+Date: October 2018
10+KernelVersion: 4.20
11+Contact: "Matan Ziv-Av <matan@svgalib.org>
12+Description:
13+ Control FN lock mode. 1 means on, 0 means off.
14+
15+What: /sys/devices/platform/lg-laptop/battery_care_limit
16+Date: October 2018
17+KernelVersion: 4.20
18+Contact: "Matan Ziv-Av <matan@svgalib.org>
19+Description:
20+ Maximal battery charge level. Accepted values are 80 or 100.
21+
22+What: /sys/devices/platform/lg-laptop/fan_mode
23+Date: October 2018
24+KernelVersion: 4.20
25+Contact: "Matan Ziv-Av <matan@svgalib.org>
26+Description:
27+ Control fan mode. 1 for performance mode, 0 for silent mode.
28+
29+What: /sys/devices/platform/lg-laptop/usb_charge
30+Date: October 2018
31+KernelVersion: 4.20
32+Contact: "Matan Ziv-Av <matan@svgalib.org>
33+Description:
34+ Control USB port charging when device is turned off.
35+ 1 means on, 0 means off.
Documentation/laptops/lg-laptop.rst+81−0
@@ -0,0 +1,81 @@
1+.. SPDX-License-Identifier: GPL-2.0+
2+LG Gram laptop extra features
3+=============================
4+
5+By Matan Ziv-Av <matan@svgalib.org>
6+
7+
8+Hotkeys
9+-------
10+
11+The following FN keys are ignored by the kernel without this driver:
12+- FN-F1 (LG control panel) - Generates F15
13+- FN-F5 (Touchpad toggle) - Generates F13
14+- FN-F6 (Airplane mode) - Generates RFKILL
15+- FN-F8 (Keyboard backlight) - Generates F16.
16+ This key also changes keyboard backlight mode.
17+- FN-F9 (Reader mode) - Generates F14
18+
19+The rest of the FN key work without a need for a special driver.
20+
21+
22+Reader mode
23+-----------
24+
25+Writing 0/1 to /sys/devices/platform/lg-laptop/reader_mode disables/enables
26+reader mode. In this mode the screen colors change (blue color reduced),
27+and the reader mode indicator LED (on F9 key) turns on.
28+
29+
30+FN Lock
31+-------
32+
33+Writing 0/1 to /sys/devices/platform/lg-laptop/fn_lock disables/enables
34+FN lock.
35+
36+
37+Battery care limit
38+------------------
39+
40+Writing 80/100 to /sys/devices/platform/lg-laptop/battery_care_limit
41+sets the maximum capacity to charge the battery. Limiting the charge
42+reduces battery capacity loss over time.
43+
44+This value is reset to 100 when the kernel boots.
45+
46+
47+Fan mode
48+--------
49+
50+Writing 1/0 to /sys/devices/platform/lg-laptop/fan_mode disables/enables
51+the fan silent mode.
52+
53+
54+USB charge
55+----------
56+
57+Writing 0/1 to /sys/devices/platform/lg-laptop/usb_charge disables/enables
58+charging another device from the USB port while the device is turned off.
59+
60+This value is reset to 0 when the kernel boots.
61+
62+
63+LEDs
64+~~~~
65+
66+The are two LED devices supported by the driver:
67+
68+Keyboard backlight
69+------------------
70+
71+A led device named kbd_led controls the keyboard backlight. There are three
72+lighting level: off (0), low (127) and high (255).
73+
74+The keyboard backlight is also controlled by the key combination FN-F8
75+which cycles through those levels.
76+
77+
78+Touchpad indicator LED
79+----------------------
80+
81+On the F5 key. Controlled by led device names tpad_led.
MAINTAINERS+26−5
@@ -376,7 +376,7 @@ F: drivers/platform/x86/i2c-multi-instantiate.c · 375 unmodified lines
376376 ACPI PMIC DRIVERS
377377 M: "Rafael J. Wysocki" <rjw@rjwysocki.net>
378378 M: Len Brown <lenb@kernel.org>
379−R: Andy Shevchenko <andy@infradead.org>
379+R: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
380380 R: Mika Westerberg <mika.westerberg@linux.intel.com>
381381 L: linux-acpi@vger.kernel.org
382382 Q: https://patchwork.kernel.org/project/linux-acpi/list/
@@ -4207,6 +4207,12 @@ M: Pali Rohár <pali.rohar@gmail.com> · 3824 unmodified lines
42074207 S: Maintained
42084208 F: drivers/platform/x86/dell-rbtn.*
42094209
4210+DELL REMOTE BIOS UPDATE DRIVER
4211+M: Stuart Hayes <stuart.w.hayes@gmail.com>
4212+L: platform-driver-x86@vger.kernel.org
4213+S: Maintained
4214+F: drivers/platform/x86/dell_rbu.c
4215+
42104216 DELL LAPTOP SMM DRIVER
42114217 M: Pali Rohár <pali.rohar@gmail.com>
42124218 S: Maintained
@@ -4214,10 +4220,11 @@ F: drivers/hwmon/dell-smm-hwmon.c · 1 unmodified line
42144220 F: include/uapi/linux/i8k.h
42154221
42164222 DELL SYSTEMS MANAGEMENT BASE DRIVER (dcdbas)
4217−M: Doug Warzecha <Douglas_Warzecha@dell.com>
4223+M: Stuart Hayes <stuart.w.hayes@gmail.com>
4224+L: platform-driver-x86@vger.kernel.org
42184225 S: Maintained
42194226 F: Documentation/dcdbas.txt
4220−F: drivers/firmware/dcdbas.*
4227+F: drivers/platform/x86/dcdbas.*
42214228
42224229 DELL WMI NOTIFICATIONS DRIVER
42234230 M: Matthew Garrett <mjg59@srcf.ucam.org>
@@ -7347,6 +7354,12 @@ L: alsa-devel@alsa-project.org (moderated for non-subscribers) · 3123 unmodified lines
73477354 S: Supported
73487355 F: sound/soc/intel/
73497356
7357+INTEL ATOMISP2 DUMMY / POWER-MANAGEMENT DRIVER
7358+M: Hans de Goede <hdegoede@redhat.com>
7359+L: platform-driver-x86@vger.kernel.org
7360+S: Maintained
7361+F: drivers/platform/x86/intel_atomisp2_pm.c
7362+
73507363 INTEL C600 SERIES SAS CONTROLLER DRIVER
73517364 M: Intel SCU Linux support <intel-linux-scu@intel.com>
73527365 M: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
@@ -7533,7 +7546,6 @@ M: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com> · 180 unmodified lines
75337546 M: Vishwanath Somayaji <vishwanath.somayaji@intel.com>
75347547 L: platform-driver-x86@vger.kernel.org
75357548 S: Maintained
7536−F: arch/x86/include/asm/pmc_core.h
75377549 F: drivers/platform/x86/intel_pmc_core*
75387550
75397551 INTEL PMC/P-Unit IPC DRIVER
@@ -7577,7 +7589,8 @@ F: drivers/infiniband/hw/i40iw/ · 37 unmodified lines
75777589 F: include/uapi/rdma/i40iw-abi.h
75787590
75797591 INTEL TELEMETRY DRIVER
7580−M: Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com>
7592+M: Rajneesh Bhardwaj <rajneesh.bhardwaj@linux.intel.com>
7593+M: "David E. Box" <david.e.box@linux.intel.com>
75817594 L: platform-driver-x86@vger.kernel.org
75827595 S: Maintained
75837596 F: arch/x86/include/asm/intel_telemetry.h
@@ -8310,6 +8323,14 @@ W: http://legousb.sourceforge.net/ · 726 unmodified lines
83108323 S: Maintained
83118324 F: drivers/usb/misc/legousbtower.c
83128325
8326+LG LAPTOP EXTRAS
8327+M: Matan Ziv-Av <matan@svgalib.org>
8328+L: platform-driver-x86@vger.kernel.org
8329+S: Maintained
8330+F: Documentation/ABI/testing/sysfs-platform-lg-laptop
8331+F: Documentation/laptops/lg-laptop.rst
8332+F: drivers/platform/x86/lg-laptop.c
8333+
83138334 LG2160 MEDIA DRIVER
83148335 M: Michael Krufky <mkrufky@linuxtv.org>
83158336 L: linux-media@vger.kernel.org
drivers/firmware/Kconfig+0−28
@@ -145,34 +145,6 @@ config EFI_PCDP · 144 unmodified lines
145145 See DIG64_HCDPv20_042804.pdf available from
146146 <http://www.dig64.org/specifications/>
147147
148−config DELL_RBU
149− tristate "BIOS update support for DELL systems via sysfs"
150− depends on X86
151− select FW_LOADER
152− select FW_LOADER_USER_HELPER
153− help
154− Say m if you want to have the option of updating the BIOS for your
155− DELL system. Note you need a Dell OpenManage or Dell Update package (DUP)
156− supporting application to communicate with the BIOS regarding the new
157− image for the image update to take effect.
158− See <file:Documentation/dell_rbu.txt> for more details on the driver.
159−
160−config DCDBAS
161− tristate "Dell Systems Management Base Driver"
162− depends on X86
163− help
164− The Dell Systems Management Base Driver provides a sysfs interface
165− for systems management software to perform System Management
166− Interrupts (SMIs) and Host Control Actions (system power cycle or
167− power off after OS shutdown) on certain Dell systems.
168−
169− See <file:Documentation/dcdbas.txt> for more details on the driver
170− and the Dell systems on which Dell systems management software makes
171− use of this driver.
172−
173− Say Y or M here to enable the driver for use by Dell systems
174− management software such as Dell OpenManage.
175−
176148 config DMIID
177149 bool "Export DMI identification via sysfs to userspace"
178150 depends on DMI
drivers/firmware/Makefile+0−2
@@ -11,8 +11,6 @@ obj-$(CONFIG_DMI) += dmi_scan.o · 10 unmodified lines
1111 obj-$(CONFIG_DMI_SYSFS) += dmi-sysfs.o
1212 obj-$(CONFIG_EDD) += edd.o
1313 obj-$(CONFIG_EFI_PCDP) += pcdp.o
14−obj-$(CONFIG_DELL_RBU) += dell_rbu.o
15−obj-$(CONFIG_DCDBAS) += dcdbas.o
1614 obj-$(CONFIG_DMIID) += dmi-id.o
1715 obj-$(CONFIG_ISCSI_IBFT_FIND) += iscsi_ibft_find.o
1816 obj-$(CONFIG_ISCSI_IBFT) += iscsi_ibft.o
drivers/hid/Kconfig+1−0
@@ -149,6 +149,7 @@ config HID_APPLEIR · 148 unmodified lines
149149 config HID_ASUS
150150 tristate "Asus"
151151 depends on LEDS_CLASS
152+ depends on ASUS_WMI || ASUS_WMI=n
152153 ---help---
153154 Support for Asus notebook built-in keyboard and touchpad via i2c, and
154155 the Asus Republic of Gamers laptop keyboard special keys.
drivers/hid/hid-asus.c+22−1
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #include <linux/dmi.h>
3030 #include <linux/hid.h>
3131 #include <linux/module.h>
32+#include <linux/platform_data/x86/asus-wmi.h>
3233 #include <linux/input/mt.h>
3334 #include <linux/usb.h> /* For to_usb_interface for T100 touchpad intf check */
3435
@@ -349,6 +350,24 @@ static void asus_kbd_backlight_work(struct work_struct *work) · 314 unmodified lines
349350 hid_err(led->hdev, "Asus failed to set keyboard backlight: %d\n", ret);
350351 }
351352
353+/* WMI-based keyboard backlight LED control (via asus-wmi driver) takes
354+ * precedence. We only activate HID-based backlight control when the
355+ * WMI control is not available.
356+ */
357+static bool asus_kbd_wmi_led_control_present(struct hid_device *hdev)
358+{
359+ u32 value;
360+ int ret;
361+
362+ ret = asus_wmi_evaluate_method(ASUS_WMI_METHODID_DSTS2,
363+ ASUS_WMI_DEVID_KBD_BACKLIGHT, 0, &value);
364+ hid_dbg(hdev, "WMI backlight check: rc %d value %x", ret, value);
365+ if (ret)
366+ return false;
367+
368+ return !!(value & ASUS_WMI_DSTS_PRESENCE_BIT);
369+}
370+
352371 static int asus_kbd_register_leds(struct hid_device *hdev)
353372 {
354373 struct asus_drvdata *drvdata = hid_get_drvdata(hdev);
@@ -436,7 +455,9 @@ static int asus_input_configured(struct hid_device *hdev, struct hid_input *hi) · 81 unmodified lines
436455
437456 drvdata->input = input;
438457
439− if (drvdata->enable_backlight && asus_kbd_register_leds(hdev))
458+ if (drvdata->enable_backlight &&
459+ !asus_kbd_wmi_led_control_present(hdev) &&
460+ asus_kbd_register_leds(hdev))
440461 hid_warn(hdev, "Failed to initialize backlight.\n");
441462
442463 return 0;
drivers/platform/x86/Kconfig+58−1
@@ -60,7 +60,10 @@ config ACERHDF · 59 unmodified lines
6060
6161 After loading this driver the BIOS is still in control of the fan.
6262 To let the kernel handle the fan, do:
63− echo -n enabled > /sys/class/thermal/thermal_zone0/mode
63+ echo -n enabled > /sys/class/thermal/thermal_zoneN/mode
64+ where N=0,1,2... depending on the number of thermal nodes and the
65+ detection order of your particular system. The "type" parameter
66+ in the same node directory will tell you if it is "acerhdf".
6467
6568 For more information about this driver see
6669 <http://piie.net/files/acerhdf_README.txt>
@@ -105,6 +108,22 @@ config ASUS_LAPTOP · 38 unmodified lines
105108
106109 If you have an ACPI-compatible ASUS laptop, say Y or M here.
107110
111+config DCDBAS
112+ tristate "Dell Systems Management Base Driver"
113+ depends on X86
114+ help
115+ The Dell Systems Management Base Driver provides a sysfs interface
116+ for systems management software to perform System Management
117+ Interrupts (SMIs) and Host Control Actions (system power cycle or
118+ power off after OS shutdown) on certain Dell systems.
119+
120+ See <file:Documentation/dcdbas.txt> for more details on the driver
121+ and the Dell systems on which Dell systems management software makes
122+ use of this driver.
123+
124+ Say Y or M here to enable the driver for use by Dell systems
125+ management software such as Dell OpenManage.
126+
108127 #
109128 # The DELL_SMBIOS driver depends on ACPI_WMI and/or DCDBAS if those
110129 # backends are selected. The "depends" line prevents a configuration
@@ -227,6 +246,18 @@ config DELL_RBTN · 116 unmodified lines
227246 To compile this driver as a module, choose M here: the module will
228247 be called dell-rbtn.
229248
249+config DELL_RBU
250+ tristate "BIOS update support for DELL systems via sysfs"
251+ depends on X86
252+ select FW_LOADER
253+ select FW_LOADER_USER_HELPER
254+ help
255+ Say m if you want to have the option of updating the BIOS for your
256+ DELL system. Note you need a Dell OpenManage or Dell Update package (DUP)
257+ supporting application to communicate with the BIOS regarding the new
258+ image for the image update to take effect.
259+ See <file:Documentation/dell_rbu.txt> for more details on the driver.
260+
230261
231262 config FUJITSU_LAPTOP
232263 tristate "Fujitsu Laptop Extras"
@@ -336,6 +367,20 @@ config HP_WMI · 103 unmodified lines
336367 To compile this driver as a module, choose M here: the module will
337368 be called hp-wmi.
338369
370+config LG_LAPTOP
371+ tristate "LG Laptop Extras"
372+ depends on ACPI
373+ depends on ACPI_WMI
374+ depends on INPUT
375+ select INPUT_SPARSEKMAP
376+ select LEDS_CLASS
377+ help
378+ This driver adds support for hotkeys as well as control of keyboard
379+ backlight, battery maximum charge level and various other ACPI
380+ features.
381+
382+ If you have an LG Gram laptop, say Y or M here.
383+
339384 config MSI_LAPTOP
340385 tristate "MSI Laptop Extras"
341386 depends on ACPI
@@ -1231,6 +1276,18 @@ config I2C_MULTI_INSTANTIATE · 889 unmodified lines
12311276 To compile this driver as a module, choose M here: the module
12321277 will be called i2c-multi-instantiate.
12331278
1279+config INTEL_ATOMISP2_PM
1280+ tristate "Intel AtomISP2 dummy / power-management driver"
1281+ depends on PCI && IOSF_MBI && PM
1282+ help
1283+ Power-management driver for Intel's Image Signal Processor found on
1284+ Bay and Cherry Trail devices. This dummy driver's sole purpose is to
1285+ turn the ISP off (put it in D3) to save power and to allow entering
1286+ of S0ix modes.
1287+
1288+ To compile this driver as a module, choose M here: the module
1289+ will be called intel_atomisp2_pm.
1290+
12341291 endif # X86_PLATFORM_DEVICES
12351292
12361293 config PMC_ATOM
drivers/platform/x86/Makefile+4−0
@@ -9,9 +9,11 @@ obj-$(CONFIG_ASUS_NB_WMI) += asus-nb-wmi.o · 8 unmodified lines
99 obj-$(CONFIG_ASUS_WIRELESS) += asus-wireless.o
1010 obj-$(CONFIG_EEEPC_LAPTOP) += eeepc-laptop.o
1111 obj-$(CONFIG_EEEPC_WMI) += eeepc-wmi.o
12+obj-$(CONFIG_LG_LAPTOP) += lg-laptop.o
1213 obj-$(CONFIG_MSI_LAPTOP) += msi-laptop.o
1314 obj-$(CONFIG_ACPI_CMPC) += classmate-laptop.o
1415 obj-$(CONFIG_COMPAL_LAPTOP) += compal-laptop.o
16+obj-$(CONFIG_DCDBAS) += dcdbas.o
1517 obj-$(CONFIG_DELL_SMBIOS) += dell-smbios.o
1618 dell-smbios-objs := dell-smbios-base.o
1719 dell-smbios-$(CONFIG_DELL_SMBIOS_WMI) += dell-smbios-wmi.o
@@ -23,6 +25,7 @@ obj-$(CONFIG_DELL_WMI_AIO) += dell-wmi-aio.o · 5 unmodified lines
2325 obj-$(CONFIG_DELL_WMI_LED) += dell-wmi-led.o
2426 obj-$(CONFIG_DELL_SMO8800) += dell-smo8800.o
2527 obj-$(CONFIG_DELL_RBTN) += dell-rbtn.o
28+obj-$(CONFIG_DELL_RBU) += dell_rbu.o
2629 obj-$(CONFIG_ACER_WMI) += acer-wmi.o
2730 obj-$(CONFIG_ACER_WIRELESS) += acer-wireless.o
2831 obj-$(CONFIG_ACERHDF) += acerhdf.o
@@ -92,3 +95,4 @@ obj-$(CONFIG_MLX_PLATFORM) += mlx-platform.o · 63 unmodified lines
9295 obj-$(CONFIG_INTEL_TURBO_MAX_3) += intel_turbo_max_3.o
9396 obj-$(CONFIG_INTEL_CHTDC_TI_PWRBTN) += intel_chtdc_ti_pwrbtn.o
9497 obj-$(CONFIG_I2C_MULTI_INSTANTIATE) += i2c-multi-instantiate.o
98+obj-$(CONFIG_INTEL_ATOMISP2_PM) += intel_atomisp2_pm.o
drivers/platform/x86/acerhdf.c+49−19
@@ -86,6 +86,7 @@ static unsigned int interval = 10; · 85 unmodified lines
8686 static unsigned int fanon = 60000;
8787 static unsigned int fanoff = 53000;
8888 static unsigned int verbose;
89+static unsigned int list_supported;
8990 static unsigned int fanstate = ACERHDF_FAN_AUTO;
9091 static char force_bios[16];
9192 static char force_product[16];
@@ -104,10 +105,12 @@ module_param(fanoff, uint, 0600); · 12 unmodified lines
104105 MODULE_PARM_DESC(fanoff, "Turn the fan off below this temperature");
105106 module_param(verbose, uint, 0600);
106107 MODULE_PARM_DESC(verbose, "Enable verbose dmesg output");
108+module_param(list_supported, uint, 0600);
109+MODULE_PARM_DESC(list_supported, "List supported models and BIOS versions");
107110 module_param_string(force_bios, force_bios, 16, 0);
108−MODULE_PARM_DESC(force_bios, "Force BIOS version and omit BIOS check");
111+MODULE_PARM_DESC(force_bios, "Pretend system has this known supported BIOS version");
109112 module_param_string(force_product, force_product, 16, 0);
110−MODULE_PARM_DESC(force_product, "Force BIOS product and omit BIOS check");
113+MODULE_PARM_DESC(force_product, "Pretend system is this known supported model");
111114
112115 /*
113116 * cmd_off: to switch the fan completely off and check if the fan is off
@@ -130,7 +133,7 @@ static const struct manualcmd mcmd = { · 16 unmodified lines
130133 .moff = 0xff,
131134 };
132135
133−/* BIOS settings */
136+/* BIOS settings - only used during probe */
134137 struct bios_settings {
135138 const char *vendor;
136139 const char *product;
@@ -141,8 +144,18 @@ struct bios_settings { · 4 unmodified lines
141144 int mcmd_enable;
142145 };
143146
147+/* This could be a daughter struct in the above, but not worth the redirect */
148+struct ctrl_settings {
149+ u8 fanreg;
150+ u8 tempreg;
151+ struct fancmd cmd;
152+ int mcmd_enable;
153+};
154+
155+static struct ctrl_settings ctrl_cfg __read_mostly;
156+
144157 /* Register addresses and values for different BIOS versions */
145−static const struct bios_settings bios_tbl[] = {
158+static const struct bios_settings bios_tbl[] __initconst = {
146159 /* AOA110 */
147160 {"Acer", "AOA110", "v0.3109", 0x55, 0x58, {0x1f, 0x00}, 0},
148161 {"Acer", "AOA110", "v0.3114", 0x55, 0x58, {0x1f, 0x00}, 0},
@@ -233,6 +246,7 @@ static const struct bios_settings bios_tbl[] = { · 84 unmodified lines
233246 {"Gateway", "LT31", "v1.3201", 0x55, 0x58, {0x9e, 0x00}, 0},
234247 {"Gateway", "LT31", "v1.3302", 0x55, 0x58, {0x9e, 0x00}, 0},
235248 {"Gateway", "LT31", "v1.3303t", 0x55, 0x58, {0x9e, 0x00}, 0},
249+ {"Gateway", "LT31", "v1.3307", 0x55, 0x58, {0x9e, 0x00}, 0},
236250 /* Packard Bell */
237251 {"Packard Bell", "DOA150", "v0.3104", 0x55, 0x58, {0x21, 0x00}, 0},
238252 {"Packard Bell", "DOA150", "v0.3105", 0x55, 0x58, {0x20, 0x00}, 0},
@@ -256,8 +270,6 @@ static const struct bios_settings bios_tbl[] = { · 17 unmodified lines
256270 {"", "", "", 0, 0, {0, 0}, 0}
257271 };
258272
259−static const struct bios_settings *bios_cfg __read_mostly;
260−
261273 /*
262274 * this struct is used to instruct thermal layer to use bang_bang instead of
263275 * default governor for acerhdf
@@ -270,7 +282,7 @@ static int acerhdf_get_temp(int *temp) · 6 unmodified lines
270282 {
271283 u8 read_temp;
272284
273− if (ec_read(bios_cfg->tempreg, &read_temp))
285+ if (ec_read(ctrl_cfg.tempreg, &read_temp))
274286 return -EINVAL;
275287
276288 *temp = read_temp * 1000;
@@ -282,10 +294,10 @@ static int acerhdf_get_fanstate(int *state) · 5 unmodified lines
282294 {
283295 u8 fan;
284296
285− if (ec_read(bios_cfg->fanreg, &fan))
297+ if (ec_read(ctrl_cfg.fanreg, &fan))
286298 return -EINVAL;
287299
288− if (fan != bios_cfg->cmd.cmd_off)
300+ if (fan != ctrl_cfg.cmd.cmd_off)
289301 *state = ACERHDF_FAN_AUTO;
290302 else
291303 *state = ACERHDF_FAN_OFF;
@@ -306,13 +318,13 @@ static void acerhdf_change_fanstate(int state) · 14 unmodified lines
306318 state = ACERHDF_FAN_AUTO;
307319 }
308320
309− cmd = (state == ACERHDF_FAN_OFF) ? bios_cfg->cmd.cmd_off
310− : bios_cfg->cmd.cmd_auto;
321+ cmd = (state == ACERHDF_FAN_OFF) ? ctrl_cfg.cmd.cmd_off
322+ : ctrl_cfg.cmd.cmd_auto;
311323 fanstate = state;
312324
313− ec_write(bios_cfg->fanreg, cmd);
325+ ec_write(ctrl_cfg.fanreg, cmd);
314326
315− if (bios_cfg->mcmd_enable && state == ACERHDF_FAN_OFF) {
327+ if (ctrl_cfg.mcmd_enable && state == ACERHDF_FAN_OFF) {
316328 if (verbose)
317329 pr_notice("turning off fan manually\n");
318330 ec_write(mcmd.mreg, mcmd.moff);
@@ -615,10 +627,11 @@ static int str_starts_with(const char *str, const char *start) · 296 unmodified lines
615627 }
616628
617629 /* check hardware */
618−static int acerhdf_check_hardware(void)
630+static int __init acerhdf_check_hardware(void)
619631 {
620632 char const *vendor, *version, *product;
621633 const struct bios_settings *bt = NULL;
634+ int found = 0;
622635
623636 /* get BIOS data */
624637 vendor = dmi_get_system_info(DMI_SYS_VENDOR);
@@ -632,6 +645,17 @@ static int acerhdf_check_hardware(void) · 7 unmodified lines
632645
633646 pr_info("Acer Aspire One Fan driver, v.%s\n", DRV_VER);
634647
648+ if (list_supported) {
649+ pr_info("List of supported Manufacturer/Model/BIOS:\n");
650+ pr_info("---------------------------------------------------\n");
651+ for (bt = bios_tbl; bt->vendor[0]; bt++) {
652+ pr_info("%-13s | %-17s | %-10s\n", bt->vendor,
653+ bt->product, bt->version);
654+ }
655+ pr_info("---------------------------------------------------\n");
656+ return -ECANCELED;
657+ }
658+
635659 if (force_bios[0]) {
636660 version = force_bios;
637661 pr_info("forcing BIOS version: %s\n", version);
@@ -657,30 +681,36 @@ static int acerhdf_check_hardware(void) · 19 unmodified lines
657681 if (str_starts_with(vendor, bt->vendor) &&
658682 str_starts_with(product, bt->product) &&
659683 str_starts_with(version, bt->version)) {
660− bios_cfg = bt;
684+ found = 1;
661685 break;
662686 }
663687 }
664688
665− if (!bios_cfg) {
689+ if (!found) {
666690 pr_err("unknown (unsupported) BIOS version %s/%s/%s, please report, aborting!\n",
667691 vendor, product, version);
668692 return -EINVAL;
669693 }
670694
695+ /* Copy control settings from BIOS table before we free it. */
696+ ctrl_cfg.fanreg = bt->fanreg;
697+ ctrl_cfg.tempreg = bt->tempreg;
698+ memcpy(&ctrl_cfg.cmd, &bt->cmd, sizeof(struct fancmd));
699+ ctrl_cfg.mcmd_enable = bt->mcmd_enable;
700+
671701 /*
672702 * if started with kernel mode off, prevent the kernel from switching
673703 * off the fan
674704 */
675705 if (!kernelmode) {
676706 pr_notice("Fan control off, to enable do:\n");
677− pr_notice("echo -n \"enabled\" > /sys/class/thermal/thermal_zone0/mode\n");
707+ pr_notice("echo -n \"enabled\" > /sys/class/thermal/thermal_zoneN/mode # N=0,1,2...\n");
678708 }
679709
680710 return 0;
681711 }
682712
683−static int acerhdf_register_platform(void)
713+static int __init acerhdf_register_platform(void)
684714 {
685715 int err = 0;
686716
@@ -712,7 +742,7 @@ static void acerhdf_unregister_platform(void) · 25 unmodified lines
712742 platform_driver_unregister(&acerhdf_driver);
713743 }
714744
715−static int acerhdf_register_thermal(void)
745+static int __init acerhdf_register_thermal(void)
716746 {
717747 cl_dev = thermal_cooling_device_register("acerhdf-fan", NULL,
718748 &acerhdf_cooling_ops);
drivers/platform/x86/asus-wmi.c+19−100
@@ -43,6 +43,7 @@ · 42 unmodified lines
4343 #include <linux/hwmon-sysfs.h>
4444 #include <linux/debugfs.h>
4545 #include <linux/seq_file.h>
46+#include <linux/platform_data/x86/asus-wmi.h>
4647 #include <linux/platform_device.h>
4748 #include <linux/thermal.h>
4849 #include <linux/acpi.h>
@@ -69,89 +70,6 @@ MODULE_LICENSE("GPL"); · 20 unmodified lines
6970 #define NOTIFY_KBD_BRTDWN 0xc5
7071 #define NOTIFY_KBD_BRTTOGGLE 0xc7
7172
72−/* WMI Methods */
73−#define ASUS_WMI_METHODID_SPEC 0x43455053 /* BIOS SPECification */
74−#define ASUS_WMI_METHODID_SFBD 0x44424653 /* Set First Boot Device */
75−#define ASUS_WMI_METHODID_GLCD 0x44434C47 /* Get LCD status */
76−#define ASUS_WMI_METHODID_GPID 0x44495047 /* Get Panel ID?? (Resol) */
77−#define ASUS_WMI_METHODID_QMOD 0x444F4D51 /* Quiet MODe */
78−#define ASUS_WMI_METHODID_SPLV 0x4C425053 /* Set Panel Light Value */
79−#define ASUS_WMI_METHODID_AGFN 0x4E464741 /* FaN? */
80−#define ASUS_WMI_METHODID_SFUN 0x4E554653 /* FUNCtionalities */
81−#define ASUS_WMI_METHODID_SDSP 0x50534453 /* Set DiSPlay output */
82−#define ASUS_WMI_METHODID_GDSP 0x50534447 /* Get DiSPlay output */
83−#define ASUS_WMI_METHODID_DEVP 0x50564544 /* DEVice Policy */
84−#define ASUS_WMI_METHODID_OSVR 0x5256534F /* OS VeRsion */
85−#define ASUS_WMI_METHODID_DSTS 0x53544344 /* Device STatuS */
86−#define ASUS_WMI_METHODID_DSTS2 0x53545344 /* Device STatuS #2*/
87−#define ASUS_WMI_METHODID_BSTS 0x53545342 /* Bios STatuS ? */
88−#define ASUS_WMI_METHODID_DEVS 0x53564544 /* DEVice Set */
89−#define ASUS_WMI_METHODID_CFVS 0x53564643 /* CPU Frequency Volt Set */
90−#define ASUS_WMI_METHODID_KBFT 0x5446424B /* KeyBoard FilTer */
91−#define ASUS_WMI_METHODID_INIT 0x54494E49 /* INITialize */
92−#define ASUS_WMI_METHODID_HKEY 0x59454B48 /* Hot KEY ?? */
93−
94−#define ASUS_WMI_UNSUPPORTED_METHOD 0xFFFFFFFE
95−
96−/* Wireless */
97−#define ASUS_WMI_DEVID_HW_SWITCH 0x00010001
98−#define ASUS_WMI_DEVID_WIRELESS_LED 0x00010002
99−#define ASUS_WMI_DEVID_CWAP 0x00010003
100−#define ASUS_WMI_DEVID_WLAN 0x00010011
101−#define ASUS_WMI_DEVID_WLAN_LED 0x00010012
102−#define ASUS_WMI_DEVID_BLUETOOTH 0x00010013
103−#define ASUS_WMI_DEVID_GPS 0x00010015
104−#define ASUS_WMI_DEVID_WIMAX 0x00010017
105−#define ASUS_WMI_DEVID_WWAN3G 0x00010019
106−#define ASUS_WMI_DEVID_UWB 0x00010021
107−
108−/* Leds */
109−/* 0x000200XX and 0x000400XX */
110−#define ASUS_WMI_DEVID_LED1 0x00020011
111−#define ASUS_WMI_DEVID_LED2 0x00020012
112−#define ASUS_WMI_DEVID_LED3 0x00020013
113−#define ASUS_WMI_DEVID_LED4 0x00020014
114−#define ASUS_WMI_DEVID_LED5 0x00020015
115−#define ASUS_WMI_DEVID_LED6 0x00020016
116−
117−/* Backlight and Brightness */
118−#define ASUS_WMI_DEVID_ALS_ENABLE 0x00050001 /* Ambient Light Sensor */
119−#define ASUS_WMI_DEVID_BACKLIGHT 0x00050011
120−#define ASUS_WMI_DEVID_BRIGHTNESS 0x00050012
121−#define ASUS_WMI_DEVID_KBD_BACKLIGHT 0x00050021
122−#define ASUS_WMI_DEVID_LIGHT_SENSOR 0x00050022 /* ?? */
123−#define ASUS_WMI_DEVID_LIGHTBAR 0x00050025
124−
125−/* Misc */
126−#define ASUS_WMI_DEVID_CAMERA 0x00060013
127−
128−/* Storage */
129−#define ASUS_WMI_DEVID_CARDREADER 0x00080013
130−
131−/* Input */
132−#define ASUS_WMI_DEVID_TOUCHPAD 0x00100011
133−#define ASUS_WMI_DEVID_TOUCHPAD_LED 0x00100012
134−
135−/* Fan, Thermal */
136−#define ASUS_WMI_DEVID_THERMAL_CTRL 0x00110011
137−#define ASUS_WMI_DEVID_FAN_CTRL 0x00110012
138−
139−/* Power */
140−#define ASUS_WMI_DEVID_PROCESSOR_STATE 0x00120012
141−
142−/* Deep S3 / Resume on LID open */
143−#define ASUS_WMI_DEVID_LID_RESUME 0x00120031
144−
145−/* DSTS masks */
146−#define ASUS_WMI_DSTS_STATUS_BIT 0x00000001
147−#define ASUS_WMI_DSTS_UNKNOWN_BIT 0x00000002
148−#define ASUS_WMI_DSTS_PRESENCE_BIT 0x00010000
149−#define ASUS_WMI_DSTS_USER_BIT 0x00020000
150−#define ASUS_WMI_DSTS_BIOS_BIT 0x00040000
151−#define ASUS_WMI_DSTS_BRIGHTNESS_MASK 0x000000FF
152−#define ASUS_WMI_DSTS_MAX_BRIGTH_MASK 0x0000FF00
153−#define ASUS_WMI_DSTS_LIGHTBAR_MASK 0x0000000F
154−
15573 #define ASUS_FAN_DESC "cpu_fan"
15674 #define ASUS_FAN_MFUN 0x13
15775 #define ASUS_FAN_SFUN_READ 0x06
@@ -239,7 +157,6 @@ struct asus_wmi { · 81 unmodified lines
239157 int lightbar_led_wk;
240158 struct workqueue_struct *led_workqueue;
241159 struct work_struct tpd_led_work;
242− struct work_struct kbd_led_work;
243160 struct work_struct wlan_led_work;
244161 struct work_struct lightbar_led_work;
245162
@@ -302,8 +219,7 @@ static void asus_wmi_input_exit(struct asus_wmi *asus) · 56 unmodified lines
302219 asus->inputdev = NULL;
303220 }
304221
305−static int asus_wmi_evaluate_method(u32 method_id, u32 arg0, u32 arg1,
306− u32 *retval)
222+int asus_wmi_evaluate_method(u32 method_id, u32 arg0, u32 arg1, u32 *retval)
307223 {
308224 struct bios_args args = {
309225 .arg0 = arg0,
@@ -339,6 +255,7 @@ exit: · 29 unmodified lines
339255
340256 return 0;
341257 }
258+EXPORT_SYMBOL_GPL(asus_wmi_evaluate_method);
342259
343260 static int asus_wmi_evaluate_method_agfn(const struct acpi_buffer args)
344261 {
@@ -456,12 +373,9 @@ static enum led_brightness tpd_led_get(struct led_classdev *led_cdev) · 111 unmodified lines
456373 return read_tpd_led_state(asus);
457374 }
458375
459−static void kbd_led_update(struct work_struct *work)
376+static void kbd_led_update(struct asus_wmi *asus)
460377 {
461378 int ctrl_param = 0;
462− struct asus_wmi *asus;
463−
464− asus = container_of(work, struct asus_wmi, kbd_led_work);
465379
466380 /*
467381 * bits 0-2: level
@@ -471,7 +385,6 @@ static void kbd_led_update(struct work_struct *work) · 3 unmodified lines
471385 ctrl_param = 0x80 | (asus->kbd_led_wk & 0x7F);
472386
473387 asus_wmi_set_devstate(ASUS_WMI_DEVID_KBD_BACKLIGHT, ctrl_param, NULL);
474− led_classdev_notify_brightness_hw_changed(&asus->kbd_led, asus->kbd_led_wk);
475388 }
476389
477390 static int kbd_led_read(struct asus_wmi *asus, int *level, int *env)
@@ -516,7 +429,7 @@ static void do_kbd_led_set(struct led_classdev *led_cdev, int value) · 38 unmodified lines
516429 value = 0;
517430
518431 asus->kbd_led_wk = value;
519− queue_work(asus->led_workqueue, &asus->kbd_led_work);
432+ kbd_led_update(asus);
520433 }
521434
522435 static void kbd_led_set(struct led_classdev *led_cdev,
@@ -525,6 +438,14 @@ static void kbd_led_set(struct led_classdev *led_cdev, · 2 unmodified lines
525438 do_kbd_led_set(led_cdev, value);
526439 }
527440
441+static void kbd_led_set_by_kbd(struct asus_wmi *asus, enum led_brightness value)
442+{
443+ struct led_classdev *led_cdev = &asus->kbd_led;
444+
445+ do_kbd_led_set(led_cdev, value);
446+ led_classdev_notify_brightness_hw_changed(led_cdev, asus->kbd_led_wk);
447+}
448+
528449 static enum led_brightness kbd_led_get(struct led_classdev *led_cdev)
529450 {
530451 struct asus_wmi *asus;
@@ -671,8 +592,6 @@ static int asus_wmi_led_init(struct asus_wmi *asus) · 140 unmodified lines
671592
672593 led_val = kbd_led_read(asus, NULL, NULL);
673594 if (led_val >= 0) {
674− INIT_WORK(&asus->kbd_led_work, kbd_led_update);
675−
676595 asus->kbd_led_wk = led_val;
677596 asus->kbd_led.name = "asus::kbd_backlight";
678597 asus->kbd_led.flags = LED_BRIGHT_HW_CHANGED;
@@ -1746,18 +1665,18 @@ static void asus_wmi_notify(u32 value, void *context) · 1067 unmodified lines
17461665 }
17471666
17481667 if (code == NOTIFY_KBD_BRTUP) {
1749− do_kbd_led_set(&asus->kbd_led, asus->kbd_led_wk + 1);
1668+ kbd_led_set_by_kbd(asus, asus->kbd_led_wk + 1);
17501669 goto exit;
17511670 }
17521671 if (code == NOTIFY_KBD_BRTDWN) {
1753− do_kbd_led_set(&asus->kbd_led, asus->kbd_led_wk - 1);
1672+ kbd_led_set_by_kbd(asus, asus->kbd_led_wk - 1);
17541673 goto exit;
17551674 }
17561675 if (code == NOTIFY_KBD_BRTTOGGLE) {
17571676 if (asus->kbd_led_wk == asus->kbd_led.max_brightness)
1758− do_kbd_led_set(&asus->kbd_led, 0);
1677+ kbd_led_set_by_kbd(asus, 0);
17591678 else
1760− do_kbd_led_set(&asus->kbd_led, asus->kbd_led_wk + 1);
1679+ kbd_led_set_by_kbd(asus, asus->kbd_led_wk + 1);
17611680 goto exit;
17621681 }
17631682
@@ -2291,7 +2210,7 @@ static int asus_hotk_resume(struct device *device) · 527 unmodified lines
22912210 struct asus_wmi *asus = dev_get_drvdata(device);
22922211
22932212 if (!IS_ERR_OR_NULL(asus->kbd_led.dev))
2294− queue_work(asus->led_workqueue, &asus->kbd_led_work);
2213+ kbd_led_update(asus);
22952214
22962215 return 0;
22972216 }
@@ -2327,7 +2246,7 @@ static int asus_hotk_restore(struct device *device) · 29 unmodified lines
23272246 rfkill_set_sw_state(asus->uwb.rfkill, bl);
23282247 }
23292248 if (!IS_ERR_OR_NULL(asus->kbd_led.dev))
2330− queue_work(asus->led_workqueue, &asus->kbd_led_work);
2249+ kbd_led_update(asus);
23312250
23322251 return 0;
23332252 }
drivers/platform/x86/dcdbas.crenamed from drivers/firmware/dcdbas.c+118−7
@@ -21,11 +21,13 @@ · 20 unmodified lines
2121 */
2222
2323 #include <linux/platform_device.h>
24+#include <linux/acpi.h>
2425 #include <linux/dma-mapping.h>
2526 #include <linux/errno.h>
2627 #include <linux/cpu.h>
2728 #include <linux/gfp.h>
2829 #include <linux/init.h>
30+#include <linux/io.h>
2931 #include <linux/kernel.h>
3032 #include <linux/mc146818rtc.h>
3133 #include <linux/module.h>
@@ -36,12 +38,11 @@ · 4 unmodified lines
3638 #include <linux/string.h>
3739 #include <linux/types.h>
3840 #include <linux/mutex.h>
39−#include <asm/io.h>
4041
4142 #include "dcdbas.h"
4243
4344 #define DRIVER_NAME "dcdbas"
44−#define DRIVER_VERSION "5.6.0-3.2"
45+#define DRIVER_VERSION "5.6.0-3.3"
4546 #define DRIVER_DESCRIPTION "Dell Systems Management Base Driver"
4647
4748 static struct platform_device *dcdbas_pdev;
@@ -49,19 +50,23 @@ static struct platform_device *dcdbas_pdev; · 1 unmodified line
4950 static u8 *smi_data_buf;
5051 static dma_addr_t smi_data_buf_handle;
5152 static unsigned long smi_data_buf_size;
53+static unsigned long max_smi_data_buf_size = MAX_SMI_DATA_BUF_SIZE;
5254 static u32 smi_data_buf_phys_addr;
5355 static DEFINE_MUTEX(smi_data_lock);
56+static u8 *eps_buffer;
5457
5558 static unsigned int host_control_action;
5659 static unsigned int host_control_smi_type;
5760 static unsigned int host_control_on_shutdown;
5861
62+static bool wsmt_enabled;
63+
5964 /**
6065 * smi_data_buf_free: free SMI data buffer
6166 */
6267 static void smi_data_buf_free(void)
6368 {
64− if (!smi_data_buf)
69+ if (!smi_data_buf || wsmt_enabled)
6570 return;
6671
6772 dev_dbg(&dcdbas_pdev->dev, "%s: phys: %x size: %lu\n",
@@ -86,7 +91,7 @@ static int smi_data_buf_realloc(unsigned long size) · 18 unmodified lines
8691 if (smi_data_buf_size >= size)
8792 return 0;
8893
89− if (size > MAX_SMI_DATA_BUF_SIZE)
94+ if (size > max_smi_data_buf_size)
9095 return -EINVAL;
9196
9297 /* new buffer is needed */
@@ -169,7 +174,7 @@ static ssize_t smi_data_write(struct file *filp, struct kobject *kobj, · 76 unmodified lines
169174 {
170175 ssize_t ret;
171176
172− if ((pos + count) > MAX_SMI_DATA_BUF_SIZE)
177+ if ((pos + count) > max_smi_data_buf_size)
173178 return -EINVAL;
174179
175180 mutex_lock(&smi_data_lock);
@@ -322,8 +327,20 @@ static ssize_t smi_request_store(struct device *dev, · 146 unmodified lines
322327 ret = count;
323328 break;
324329 case 1:
325− /* Calling Interface SMI */
326− smi_cmd->ebx = (u32) virt_to_phys(smi_cmd->command_buffer);
330+ /*
331+ * Calling Interface SMI
332+ *
333+ * Provide physical address of command buffer field within
334+ * the struct smi_cmd to BIOS.
335+ *
336+ * Because the address that smi_cmd (smi_data_buf) points to
337+ * will be from memremap() of a non-memory address if WSMT
338+ * is present, we can't use virt_to_phys() on smi_cmd, so
339+ * we have to use the physical address that was saved when
340+ * the virtual address for smi_cmd was received.
341+ */
342+ smi_cmd->ebx = smi_data_buf_phys_addr +
343+ offsetof(struct smi_cmd, command_buffer);
327344 ret = dcdbas_smi_request(smi_cmd);
328345 if (!ret)
329346 ret = count;
@@ -482,6 +499,93 @@ static void dcdbas_host_control(void) · 152 unmodified lines
482499 }
483500 }
484501
502+/* WSMT */
503+
504+static u8 checksum(u8 *buffer, u8 length)
505+{
506+ u8 sum = 0;
507+ u8 *end = buffer + length;
508+
509+ while (buffer < end)
510+ sum += *buffer++;
511+ return sum;
512+}
513+
514+static inline struct smm_eps_table *check_eps_table(u8 *addr)
515+{
516+ struct smm_eps_table *eps = (struct smm_eps_table *)addr;
517+
518+ if (strncmp(eps->smm_comm_buff_anchor, SMM_EPS_SIG, 4) != 0)
519+ return NULL;
520+
521+ if (checksum(addr, eps->length) != 0)
522+ return NULL;
523+
524+ return eps;
525+}
526+
527+static int dcdbas_check_wsmt(void)
528+{
529+ struct acpi_table_wsmt *wsmt = NULL;
530+ struct smm_eps_table *eps = NULL;
531+ u64 remap_size;
532+ u8 *addr;
533+
534+ acpi_get_table(ACPI_SIG_WSMT, 0, (struct acpi_table_header **)&wsmt);
535+ if (!wsmt)
536+ return 0;
537+
538+ /* Check if WSMT ACPI table shows that protection is enabled */
539+ if (!(wsmt->protection_flags & ACPI_WSMT_FIXED_COMM_BUFFERS) ||
540+ !(wsmt->protection_flags & ACPI_WSMT_COMM_BUFFER_NESTED_PTR_PROTECTION))
541+ return 0;
542+
543+ /* Scan for EPS (entry point structure) */
544+ for (addr = (u8 *)__va(0xf0000);
545+ addr < (u8 *)__va(0x100000 - sizeof(struct smm_eps_table));
546+ addr += 16) {
547+ eps = check_eps_table(addr);
548+ if (eps)
549+ break;
550+ }
551+
552+ if (!eps) {
553+ dev_dbg(&dcdbas_pdev->dev, "found WSMT, but no EPS found\n");
554+ return -ENODEV;
555+ }
556+
557+ /*
558+ * Get physical address of buffer and map to virtual address.
559+ * Table gives size in 4K pages, regardless of actual system page size.
560+ */
561+ if (upper_32_bits(eps->smm_comm_buff_addr + 8)) {
562+ dev_warn(&dcdbas_pdev->dev, "found WSMT, but EPS buffer address is above 4GB\n");
563+ return -EINVAL;
564+ }
565+ /*
566+ * Limit remap size to MAX_SMI_DATA_BUF_SIZE + 8 (since the first 8
567+ * bytes are used for a semaphore, not the data buffer itself).
568+ */
569+ remap_size = eps->num_of_4k_pages * PAGE_SIZE;
570+ if (remap_size > MAX_SMI_DATA_BUF_SIZE + 8)
571+ remap_size = MAX_SMI_DATA_BUF_SIZE + 8;
572+ eps_buffer = memremap(eps->smm_comm_buff_addr, remap_size, MEMREMAP_WB);
573+ if (!eps_buffer) {
574+ dev_warn(&dcdbas_pdev->dev, "found WSMT, but failed to map EPS buffer\n");
575+ return -ENOMEM;
576+ }
577+
578+ /* First 8 bytes is for a semaphore, not part of the smi_data_buf */
579+ smi_data_buf_phys_addr = eps->smm_comm_buff_addr + 8;
580+ smi_data_buf = eps_buffer + 8;
581+ smi_data_buf_size = remap_size - 8;
582+ max_smi_data_buf_size = smi_data_buf_size;
583+ wsmt_enabled = true;
584+ dev_info(&dcdbas_pdev->dev,
585+ "WSMT found, using firmware-provided SMI buffer.\n");
586+ return 1;
587+}
588+
485589 /**
486590 * dcdbas_reboot_notify: handle reboot notification for host control
487591 */
@@ -548,6 +652,11 @@ static int dcdbas_probe(struct platform_device *dev) · 60 unmodified lines
548652
549653 dcdbas_pdev = dev;
550654
655+ /* Check if ACPI WSMT table specifies protected SMI buffer address */
656+ error = dcdbas_check_wsmt();
657+ if (error < 0)
658+ return error;
659+
551660 /*
552661 * BIOS SMI calls require buffer addresses be in 32-bit address space.
553662 * This is done by setting the DMA mask below.
@@ -635,6 +744,8 @@ static void __exit dcdbas_exit(void) · 81 unmodified lines
635744 */
636745 if (dcdbas_pdev)
637746 smi_data_buf_free();
747+ if (eps_buffer)
748+ memunmap(eps_buffer);
638749 platform_device_unregister(dcdbas_pdev_reg);
639750 platform_driver_unregister(&dcdbas_driver);
640751 }
drivers/platform/x86/dcdbas.hrenamed from drivers/firmware/dcdbas.h+10−0
@@ -53,6 +53,7 @@ · 52 unmodified lines
5353 #define EXPIRED_TIMER (0)
5454
5555 #define SMI_CMD_MAGIC (0x534D4931)
56+#define SMM_EPS_SIG "$SCB"
5657
5758 #define DCDBAS_DEV_ATTR_RW(_name) \
5859 DEVICE_ATTR(_name,0600,_name##_show,_name##_store);
@@ -103,5 +104,14 @@ struct apm_cmd { · 44 unmodified lines
103104
104105 int dcdbas_smi_request(struct smi_cmd *smi_cmd);
105106
107+struct smm_eps_table {
108+ char smm_comm_buff_anchor[4];
109+ u8 length;
110+ u8 checksum;
111+ u8 version;
112+ u64 smm_comm_buff_addr;
113+ u64 num_of_4k_pages;
114+} __packed;
115+
106116 #endif /* _DCDBAS_H_ */
107117
drivers/platform/x86/dell-smbios-smm.c+1−1
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818 #include <linux/module.h>
1919 #include <linux/mutex.h>
2020 #include <linux/platform_device.h>
21−#include "../../firmware/dcdbas.h"
21+#include "dcdbas.h"
2222 #include "dell-smbios.h"
2323
2424 static int da_command_address;
drivers/platform/x86/dell_rbu.crenamed from drivers/firmware/dell_rbu.c+8−0
@@ -45,6 +45,7 @@ · 44 unmodified lines
4545 #include <linux/moduleparam.h>
4646 #include <linux/firmware.h>
4747 #include <linux/dma-mapping.h>
48+#include <asm/set_memory.h>
4849
4950 MODULE_AUTHOR("Abhay Salunke <abhay_salunke@dell.com>");
5051 MODULE_DESCRIPTION("Driver for updating BIOS image on DELL systems");
@@ -181,6 +182,11 @@ static int create_packet(void *data, size_t length) · 130 unmodified lines
181182 packet_data_temp_buf = NULL;
182183 }
183184 }
185+ /*
186+ * set to uncachable or it may never get written back before reboot
187+ */
188+ set_memory_uc((unsigned long)packet_data_temp_buf, 1 << ordernum);
189+
184190 spin_lock(&rbu_data.lock);
185191
186192 newpacket->data = packet_data_temp_buf;
@@ -349,6 +355,8 @@ static void packet_empty_list(void) · 162 unmodified lines
349355 * to make sure there are no stale RBU packets left in memory
350356 */
351357 memset(newpacket->data, 0, rbu_data.packetsize);
358+ set_memory_wb((unsigned long)newpacket->data,
359+ 1 << newpacket->ordernum);
352360 free_pages((unsigned long) newpacket->data,
353361 newpacket->ordernum);
354362 kfree(newpacket);
drivers/platform/x86/ideapad-laptop.c+8−1
@@ -212,7 +212,7 @@ static int read_ec_data(acpi_handle handle, int cmd, unsigned long *data) · 211 unmodified lines
212212 return 0;
213213 }
214214 }
215− pr_err("timeout in read_ec_cmd\n");
215+ pr_err("timeout in %s\n", __func__);
216216 return -1;
217217 }
218218
@@ -1146,6 +1146,13 @@ static const struct dmi_system_id no_hw_rfkill_list[] = { · 927 unmodified lines
11461146 DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Y520-15IKBM"),
11471147 },
11481148 },
1149+ {
1150+ .ident = "Lenovo Legion Y530-15ICH",
1151+ .matches = {
1152+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
1153+ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Legion Y530-15ICH"),
1154+ },
1155+ },
11491156 {
11501157 .ident = "Lenovo Legion Y720-15IKB",
11511158 .matches = {
drivers/platform/x86/intel-hid.c+1−11
@@ -1,19 +1,9 @@
1+// SPDX-License-Identifier: GPL-2.0+
12 /*
23 * Intel HID event & 5 button array driver
34 *
45 * Copyright (C) 2015 Alex Hung <alex.hung@canonical.com>
56 * Copyright (C) 2015 Andrew Lutomirski <luto@kernel.org>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License as published by
9− * the Free Software Foundation; either version 2 of the License, or
10− * (at your option) any later version.
11− *
12− * This program is distributed in the hope that it will be useful,
13− * but WITHOUT ANY WARRANTY; without even the implied warranty of
14− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15− * GNU General Public License for more details.
16− *
177 */
188
199 #include <linux/acpi.h>
drivers/platform/x86/intel-rst.c+2−21
@@ -1,26 +1,11 @@
1+// SPDX-License-Identifier: GPL-2.0+
12 /*
23 * Copyright 2013 Matthew Garrett <mjg59@srcf.ucam.org>
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; either version 2 of the License, or
7− * (at your option) any later version.
8− *
9− * This program is distributed in the hope that it will be useful,
10− * but WITHOUT ANY WARRANTY; without even the implied warranty of
11− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12− * GNU General Public License for more details.
13− *
14− * You should have received a copy of the GNU General Public License along
15− * with this program; if not, write to the Free Software Foundation, Inc.,
16− * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
174 */
185
19−
20−#include <linux/init.h>
6+#include <linux/acpi.h>
217 #include <linux/module.h>
228 #include <linux/slab.h>
23−#include <linux/acpi.h>
249
2510 MODULE_LICENSE("GPL");
2611
@@ -53,12 +38,10 @@ static ssize_t irst_store_wakeup_events(struct device *dev, · 26 unmodified lines
5338 acpi = to_acpi_device(dev);
5439
5540 error = kstrtoul(buf, 0, &value);
56−
5741 if (error)
5842 return error;
5943
6044 status = acpi_execute_simple_method(acpi->handle, "SFFS", value);
61−
6245 if (ACPI_FAILURE(status))
6346 return -EINVAL;
6447
@@ -99,12 +82,10 @@ static ssize_t irst_store_wakeup_time(struct device *dev, · 34 unmodified lines
9982 acpi = to_acpi_device(dev);
10083
10184 error = kstrtoul(buf, 0, &value);
102−
10385 if (error)
10486 return error;
10587
10688 status = acpi_execute_simple_method(acpi->handle, "SFTV", value);
107−
10889 if (ACPI_FAILURE(status))
10990 return -EINVAL;
11091
drivers/platform/x86/intel-smartconnect.c+3−19
@@ -1,25 +1,10 @@
1+// SPDX-License-Identifier: GPL-2.0+
12 /*
23 * Copyright 2013 Matthew Garrett <mjg59@srcf.ucam.org>
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; either version 2 of the License, or
7− * (at your option) any later version.
8− *
9− * This program is distributed in the hope that it will be useful,
10− * but WITHOUT ANY WARRANTY; without even the implied warranty of
11− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12− * GNU General Public License for more details.
13− *
14− * You should have received a copy of the GNU General Public License along
15− * with this program; if not, write to the Free Software Foundation, Inc.,
16− * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
174 */
185
19−
20−#include <linux/init.h>
21−#include <linux/module.h>
226 #include <linux/acpi.h>
7+#include <linux/module.h>
238
249 MODULE_LICENSE("GPL");
2510
@@ -44,6 +29,7 @@ static const struct acpi_device_id smartconnect_ids[] = { · 18 unmodified lines
4429 {"INT33A0", 0},
4530 {"", 0}
4631 };
32+MODULE_DEVICE_TABLE(acpi, smartconnect_ids);
4733
4834 static struct acpi_driver smartconnect_driver = {
4935 .owner = THIS_MODULE,
@@ -56,5 +42,3 @@ static struct acpi_driver smartconnect_driver = { · 6 unmodified lines
5642 };
5743
5844 module_acpi_driver(smartconnect_driver);
59−
60−MODULE_DEVICE_TABLE(acpi, smartconnect_ids);
drivers/platform/x86/intel-wmi-thunderbolt.c+7−11
@@ -1,16 +1,8 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * WMI Thunderbolt driver
34 *
45 * Copyright (C) 2017 Dell Inc. All Rights Reserved.
5− *
6− * This program is free software; you can redistribute it and/or modify it
7− * under the terms of the GNU General Public License version 2 as published
8− * by the Free Software Foundation.
9− *
10− * This program is distributed in the hope that it will be useful,
11− * but WITHOUT ANY WARRANTY; without even the implied warranty of
12− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13− * GNU General Public License for more details.
146 */
157
168 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -38,12 +30,16 @@ static ssize_t force_power_store(struct device *dev, · 21 unmodified lines
3830 input.length = sizeof(u8);
3931 input.pointer = &mode;
4032 mode = hex_to_bin(buf[0]);
33+ dev_dbg(dev, "force_power: storing %#x\n", mode);
4134 if (mode == 0 || mode == 1) {
4235 status = wmi_evaluate_method(INTEL_WMI_THUNDERBOLT_GUID, 0, 1,
4336 &input, NULL);
44− if (ACPI_FAILURE(status))
37+ if (ACPI_FAILURE(status)) {
38+ dev_dbg(dev, "force_power: failed to evaluate ACPI method\n");
4539 return -ENODEV;
40+ }
4641 } else {
42+ dev_dbg(dev, "force_power: unsupported mode\n");
4743 return -EINVAL;
4844 }
4945 return count;
@@ -95,4 +91,4 @@ module_wmi_driver(intel_wmi_thunderbolt_driver); · 45 unmodified lines
9591 MODULE_ALIAS("wmi:" INTEL_WMI_THUNDERBOLT_GUID);
9692 MODULE_AUTHOR("Mario Limonciello <mario.limonciello@dell.com>");
9793 MODULE_DESCRIPTION("Intel WMI Thunderbolt force power driver");
98−MODULE_LICENSE("GPL");
94+MODULE_LICENSE("GPL v2");
drivers/platform/x86/intel_atomisp2_pm.c+119−0
@@ -0,0 +1,119 @@
1+// SPDX-License-Identifier: GPL-2.0
2+/*
3+ * Dummy driver for Intel's Image Signal Processor found on Bay and Cherry
4+ * Trail devices. The sole purpose of this driver is to allow the ISP to
5+ * be put in D3.
6+ *
7+ * Copyright (C) 2018 Hans de Goede <hdegoede@redhat.com>
8+ *
9+ * Based on various non upstream patches for ISP support:
10+ * Copyright (C) 2010-2017 Intel Corporation. All rights reserved.
11+ * Copyright (c) 2010 Silicon Hive www.siliconhive.com.
12+ */
13+
14+#include <linux/delay.h>
15+#include <linux/module.h>
16+#include <linux/mod_devicetable.h>
17+#include <linux/pci.h>
18+#include <linux/pm_runtime.h>
19+#include <asm/iosf_mbi.h>
20+
21+/* PCI configuration regs */
22+#define PCI_INTERRUPT_CTRL 0x9c
23+
24+#define PCI_CSI_CONTROL 0xe8
25+#define PCI_CSI_CONTROL_PORTS_OFF_MASK 0x7
26+
27+/* IOSF BT_MBI_UNIT_PMC regs */
28+#define ISPSSPM0 0x39
29+#define ISPSSPM0_ISPSSC_OFFSET 0
30+#define ISPSSPM0_ISPSSC_MASK 0x00000003
31+#define ISPSSPM0_ISPSSS_OFFSET 24
32+#define ISPSSPM0_ISPSSS_MASK 0x03000000
33+#define ISPSSPM0_IUNIT_POWER_ON 0x0
34+#define ISPSSPM0_IUNIT_POWER_OFF 0x3
35+
36+static int isp_probe(struct pci_dev *dev, const struct pci_device_id *id)
37+{
38+ unsigned long timeout;
39+ u32 val;
40+
41+ pci_write_config_dword(dev, PCI_INTERRUPT_CTRL, 0);
42+
43+ /*
44+ * MRFLD IUNIT DPHY is located in an always-power-on island
45+ * MRFLD HW design need all CSI ports are disabled before
46+ * powering down the IUNIT.
47+ */
48+ pci_read_config_dword(dev, PCI_CSI_CONTROL, &val);
49+ val |= PCI_CSI_CONTROL_PORTS_OFF_MASK;
50+ pci_write_config_dword(dev, PCI_CSI_CONTROL, val);
51+
52+ /* Write 0x3 to ISPSSPM0 bit[1:0] to power off the IUNIT */
53+ iosf_mbi_modify(BT_MBI_UNIT_PMC, MBI_REG_READ, ISPSSPM0,
54+ ISPSSPM0_IUNIT_POWER_OFF, ISPSSPM0_ISPSSC_MASK);
55+
56+ /*
57+ * There should be no IUNIT access while power-down is
58+ * in progress HW sighting: 4567865
59+ * Wait up to 50 ms for the IUNIT to shut down.
60+ */
61+ timeout = jiffies + msecs_to_jiffies(50);
62+ while (1) {
63+ /* Wait until ISPSSPM0 bit[25:24] shows 0x3 */
64+ iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ, ISPSSPM0, &val);
65+ val = (val & ISPSSPM0_ISPSSS_MASK) >> ISPSSPM0_ISPSSS_OFFSET;
66+ if (val == ISPSSPM0_IUNIT_POWER_OFF)
67+ break;
68+
69+ if (time_after(jiffies, timeout)) {
70+ dev_err(&dev->dev, "IUNIT power-off timeout.\n");
71+ return -EBUSY;
72+ }
73+ usleep_range(1000, 2000);
74+ }
75+
76+ pm_runtime_allow(&dev->dev);
77+ pm_runtime_put_sync_suspend(&dev->dev);
78+
79+ return 0;
80+}
81+
82+static void isp_remove(struct pci_dev *dev)
83+{
84+ pm_runtime_get_sync(&dev->dev);
85+ pm_runtime_forbid(&dev->dev);
86+}
87+
88+static int isp_pci_suspend(struct device *dev)
89+{
90+ return 0;
91+}
92+
93+static int isp_pci_resume(struct device *dev)
94+{
95+ return 0;
96+}
97+
98+static UNIVERSAL_DEV_PM_OPS(isp_pm_ops, isp_pci_suspend,
99+ isp_pci_resume, NULL);
100+
101+static const struct pci_device_id isp_id_table[] = {
102+ { PCI_VDEVICE(INTEL, 0x22b8), },
103+ { 0, }
104+};
105+MODULE_DEVICE_TABLE(pci, isp_id_table);
106+
107+static struct pci_driver isp_pci_driver = {
108+ .name = "intel_atomisp2_pm",
109+ .id_table = isp_id_table,
110+ .probe = isp_probe,
111+ .remove = isp_remove,
112+ .driver.pm = &isp_pm_ops,
113+};
114+
115+module_pci_driver(isp_pci_driver);
116+
117+MODULE_DESCRIPTION("Intel AtomISP2 dummy / power-management drv (for suspend)");
118+MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>");
119+MODULE_LICENSE("GPL v2");
drivers/platform/x86/intel_bxtwc_tmu.c+2−11
@@ -1,21 +1,12 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
2− * intel_bxtwc_tmu.c - Intel BXT Whiskey Cove PMIC TMU driver
3+ * Intel BXT Whiskey Cove PMIC TMU driver
34 *
45 * Copyright (C) 2016 Intel Corporation. All rights reserved.
56 *
67 * This driver adds TMU (Time Management Unit) support for Intel BXT platform.
78 * It enables the alarm wake-up functionality in the TMU unit of Whiskey Cove
89 * PMIC.
9− *
10− * This program is free software; you can redistribute it and/or
11− * modify it under the terms of the GNU General Public License version
12− * 2 as published by the Free Software Foundation.
13− *
14− * This program is distributed in the hope that it will be useful,
15− * but WITHOUT ANY WARRANTY; without even the implied warranty of
16− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17− * GNU General Public License for more details.
18− *
1910 */
2011
2112 #include <linux/module.h>
drivers/platform/x86/intel_cht_int33fe.c+2−5
@@ -1,12 +1,9 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Intel Cherry Trail ACPI INT33FE pseudo device driver
34 *
45 * Copyright (C) 2017 Hans de Goede <hdegoede@redhat.com>
56 *
6− * This program is free software; you can redistribute it and/or modify
7− * it under the terms of the GNU General Public License version 2 as
8− * published by the Free Software Foundation.
9− *
107 * Some Intel Cherry Trail based device which ship with Windows 10, have
118 * this weird INT33FE ACPI device with a CRS table with 4 I2cSerialBusV2
129 * resources, for 4 different chips attached to various i2c busses:
@@ -257,4 +254,4 @@ module_platform_driver(cht_int33fe_driver); · 244 unmodified lines
257254
258255 MODULE_DESCRIPTION("Intel Cherry Trail ACPI INT33FE pseudo device driver");
259256 MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>");
260−MODULE_LICENSE("GPL");
257+MODULE_LICENSE("GPL v2");
drivers/platform/x86/intel_chtdc_ti_pwrbtn.c+1−0
@@ -1,3 +1,4 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Power-button driver for Dollar Cove TI PMIC
34 * Copyright (C) 2014 Intel Corp
drivers/platform/x86/intel_int0002_vgpio.c+19−10
@@ -1,3 +1,4 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Intel INT0002 "Virtual GPIO" driver
34 *
@@ -9,10 +10,6 @@ · 5 unmodified lines
910 *
1011 * Author: Dyut Kumar Sil <dyut.k.sil@intel.com>
1112 *
12− * This program is free software; you can redistribute it and/or modify
13− * it under the terms of the GNU General Public License version 2 as
14− * published by the Free Software Foundation.
15− *
1613 * Some peripherals on Bay Trail and Cherry Trail platforms signal a Power
1714 * Management Event (PME) to the Power Management Controller (PMC) to wakeup
1815 * the system. When this happens software needs to clear the PME bus 0 status
@@ -57,11 +54,7 @@ · 38 unmodified lines
5754 #define ICPU(model) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, }
5855
5956 static const struct x86_cpu_id int0002_cpu_ids[] = {
60−/*
61− * Limit ourselves to Cherry Trail for now, until testing shows we
62− * need to handle the INT0002 device on Baytrail too.
63− * ICPU(INTEL_FAM6_ATOM_SILVERMONT), * Valleyview, Bay Trail *
64− */
57+ ICPU(INTEL_FAM6_ATOM_SILVERMONT), /* Valleyview, Bay Trail */
6558 ICPU(INTEL_FAM6_ATOM_AIRMONT), /* Braswell, Cherry Trail */
6659 {}
6760 };
@@ -110,6 +103,21 @@ static void int0002_irq_mask(struct irq_data *data) · 42 unmodified lines
110103 outl(gpe_en_reg, GPE0A_EN_PORT);
111104 }
112105
106+static int int0002_irq_set_wake(struct irq_data *data, unsigned int on)
107+{
108+ struct gpio_chip *chip = irq_data_get_irq_chip_data(data);
109+ struct platform_device *pdev = to_platform_device(chip->parent);
110+ int irq = platform_get_irq(pdev, 0);
111+
112+ /* Propagate to parent irq */
113+ if (on)
114+ enable_irq_wake(irq);
115+ else
116+ disable_irq_wake(irq);
117+
118+ return 0;
119+}
120+
113121 static irqreturn_t int0002_irq(int irq, void *data)
114122 {
115123 struct gpio_chip *chip = data;
@@ -132,6 +140,7 @@ static struct irq_chip int0002_irqchip = { · 16 unmodified lines
132140 .irq_ack = int0002_irq_ack,
133141 .irq_mask = int0002_irq_mask,
134142 .irq_unmask = int0002_irq_unmask,
143+ .irq_set_wake = int0002_irq_set_wake,
135144 };
136145
137146 static int int0002_probe(struct platform_device *pdev)
@@ -216,4 +225,4 @@ module_platform_driver(int0002_driver); · 78 unmodified lines
216225
217226 MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>");
218227 MODULE_DESCRIPTION("Intel INT0002 Virtual GPIO driver");
219−MODULE_LICENSE("GPL");
228+MODULE_LICENSE("GPL v2");
drivers/platform/x86/intel_ips.c+2−13
@@ -1,18 +1,7 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Copyright (c) 2009-2010 Intel Corporation
34 *
4− * This program is free software; you can redistribute it and/or modify it
5− * under the terms and conditions of the GNU General Public License,
6− * version 2, as published by the Free Software Foundation.
7− *
8− * This program is distributed in the hope it will be useful, but WITHOUT
9− * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10− * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11− * more details.
12− *
13− * The full GNU General Public License is included in this distribution in
14− * the file called "COPYING".
15− *
165 * Authors:
176 * Jesse Barnes <jbarnes@virtuousgeek.org>
187 */
@@ -1697,6 +1686,6 @@ static struct pci_driver ips_pci_driver = { · 1678 unmodified lines
16971686
16981687 module_pci_driver(ips_pci_driver);
16991688
1700−MODULE_LICENSE("GPL");
1689+MODULE_LICENSE("GPL v2");
17011690 MODULE_AUTHOR("Jesse Barnes <jbarnes@virtuousgeek.org>");
17021691 MODULE_DESCRIPTION("Intelligent Power Sharing Driver");
drivers/platform/x86/intel_ips.h+1−12
@@ -1,17 +1,6 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Copyright (c) 2010 Intel Corporation
3− *
4− * This program is free software; you can redistribute it and/or modify it
5− * under the terms and conditions of the GNU General Public License,
6− * version 2, as published by the Free Software Foundation.
7− *
8− * This program is distributed in the hope it will be useful, but WITHOUT
9− * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10− * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11− * more details.
12− *
13− * The full GNU General Public License is included in this distribution in
14− * the file called "COPYING".
154 */
165
176 void ips_link_to_i915_driver(void);
drivers/platform/x86/intel_menlow.c+6−22
@@ -1,25 +1,10 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
2− * intel_menlow.c - Intel menlow Driver for thermal management extension
3+ * Intel menlow Driver for thermal management extension
34 *
45 * Copyright (C) 2008 Intel Corp
56 * Copyright (C) 2008 Sujith Thomas <sujith.thomas@intel.com>
67 * Copyright (C) 2008 Zhang Rui <rui.zhang@intel.com>
7− * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8− *
9− * This program is free software; you can redistribute it and/or modify
10− * it under the terms of the GNU General Public License as published by
11− * the Free Software Foundation; version 2 of the License.
12− *
13− * This program is distributed in the hope that it will be useful, but
14− * WITHOUT ANY WARRANTY; without even the implied warranty of
15− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16− * General Public License for more details.
17− *
18− * You should have received a copy of the GNU General Public License along
19− * with this program; if not, write to the Free Software Foundation, Inc.,
20− * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21− *
22− * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
238 *
249 * This driver creates the sys I/F for programming the sensors.
2510 * It also implements the driver for intel menlow memory controller (hardware
@@ -29,20 +14,19 @@ · 3 unmodified lines
2914
3015 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
3116
17+#include <linux/acpi.h>
3218 #include <linux/kernel.h>
3319 #include <linux/module.h>
34−#include <linux/init.h>
35−#include <linux/slab.h>
36−#include <linux/types.h>
3720 #include <linux/pci.h>
3821 #include <linux/pm.h>
22+#include <linux/slab.h>
3923 #include <linux/thermal.h>
40−#include <linux/acpi.h>
24+#include <linux/types.h>
4125
4226 MODULE_AUTHOR("Thomas Sujith");
4327 MODULE_AUTHOR("Zhang Rui");
4428 MODULE_DESCRIPTION("Intel Menlow platform specific driver");
45−MODULE_LICENSE("GPL");
29+MODULE_LICENSE("GPL v2");
4630
4731 /*
4832 * Memory controller device control
drivers/platform/x86/intel_mid_powerbtn.c+3−15
@@ -1,3 +1,4 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Power button driver for Intel MID platforms.
34 *
@@ -5,18 +6,8 @@ · 1 unmodified line
56 *
67 * Author: Hong Liu <hong.liu@intel.com>
78 * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
8− *
9− * This program is free software; you can redistribute it and/or modify
10− * it under the terms of the GNU General Public License as published by
11− * the Free Software Foundation; version 2 of the License.
12− *
13− * This program is distributed in the hope that it will be useful, but
14− * WITHOUT ANY WARRANTY; without even the implied warranty of
15− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16− * General Public License for more details.
179 */
1810
19−#include <linux/init.h>
2011 #include <linux/input.h>
2112 #include <linux/interrupt.h>
2213 #include <linux/mfd/intel_msic.h>
@@ -121,12 +112,9 @@ static const struct mid_pb_ddata mrfld_ddata = { · 98 unmodified lines
121112 .setup = mrfld_setup,
122113 };
123114
124−#define ICPU(model, ddata) \
125− { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, (kernel_ulong_t)&ddata }
126−
127115 static const struct x86_cpu_id mid_pb_cpu_ids[] = {
128− ICPU(INTEL_FAM6_ATOM_SALTWELL_MID, mfld_ddata),
129− ICPU(INTEL_FAM6_ATOM_SILVERMONT_MID, mrfld_ddata),
116+ INTEL_CPU_FAM6(ATOM_SALTWELL_MID, mfld_ddata),
117+ INTEL_CPU_FAM6(ATOM_SILVERMONT_MID, mrfld_ddata),
130118 {}
131119 };
132120
drivers/platform/x86/intel_mid_thermal.c+7−23
@@ -1,39 +1,23 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
2− * intel_mid_thermal.c - Intel MID platform thermal driver
3+ * Intel MID platform thermal driver
34 *
45 * Copyright (C) 2011 Intel Corporation
56 *
6− * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7− *
8− * This program is free software; you can redistribute it and/or modify
9− * it under the terms of the GNU General Public License as published by
10− * the Free Software Foundation; version 2 of the License.
11− *
12− * This program is distributed in the hope that it will be useful, but
13− * WITHOUT ANY WARRANTY; without even the implied warranty of
14− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15− * General Public License for more details.
16− *
17− * You should have received a copy of the GNU General Public License along
18− * with this program; if not, write to the Free Software Foundation, Inc.,
19− * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20− *
21− * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
227 * Author: Durgadoss R <durgadoss.r@intel.com>
238 */
249
2510 #define pr_fmt(fmt) "intel_mid_thermal: " fmt
2611
27−#include <linux/module.h>
28−#include <linux/init.h>
12+#include <linux/device.h>
2913 #include <linux/err.h>
14+#include <linux/mfd/intel_msic.h>
15+#include <linux/module.h>
3016 #include <linux/param.h>
31−#include <linux/device.h>
3217 #include <linux/platform_device.h>
33−#include <linux/slab.h>
3418 #include <linux/pm.h>
19+#include <linux/slab.h>
3520 #include <linux/thermal.h>
36−#include <linux/mfd/intel_msic.h>
3721
3822 /* Number of thermal sensors */
3923 #define MSIC_THERMAL_SENSORS 4
@@ -567,4 +551,4 @@ module_platform_driver(mid_thermal_driver); · 527 unmodified lines
567551
568552 MODULE_AUTHOR("Durgadoss R <durgadoss.r@intel.com>");
569553 MODULE_DESCRIPTION("Intel Medfield Platform Thermal Driver");
570−MODULE_LICENSE("GPL");
554+MODULE_LICENSE("GPL v2");
drivers/platform/x86/intel_oaktrail.c+9−23
@@ -1,5 +1,6 @@
1+// SPDX-License-Identifier: GPL-2.0+
12 /*
2− * intel_oaktrail.c - Intel OakTrail Platform support.
3+ * Intel OakTrail Platform support
34 *
45 * Copyright (C) 2010-2011 Intel Corporation
56 * Author: Yin Kangkai (kangkai.yin@intel.com)
@@ -8,21 +9,6 @@ · 2 unmodified lines
89 * <cezary.jackiewicz (at) gmail.com>, based on MSI driver
910 * Copyright (C) 2006 Lennart Poettering <mzxreary (at) 0pointer (dot) de>
1011 *
11− * This program is free software; you can redistribute it and/or modify
12− * it under the terms of the GNU General Public License as published by
13− * the Free Software Foundation; either version 2 of the License, or
14− * (at your option) any later version.
15− *
16− * This program is distributed in the hope that it will be useful, but
17− * WITHOUT ANY WARRANTY; without even the implied warranty of
18− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19− * General Public License for more details.
20− *
21− * You should have received a copy of the GNU General Public License
22− * along with this program; if not, write to the Free Software
23− * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24− * 02110-1301, USA.
25− *
2612 * This driver does below things:
2713 * 1. registers itself in the Linux backlight control in
2814 * /sys/class/backlight/intel_oaktrail/
@@ -38,18 +24,18 @@ · 9 unmodified lines
3824
3925 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
4026
41−#include <linux/module.h>
42−#include <linux/kernel.h>
43−#include <linux/init.h>
4427 #include <linux/acpi.h>
45−#include <linux/fb.h>
46−#include <linux/mutex.h>
28+#include <linux/backlight.h>
29+#include <linux/dmi.h>
4730 #include <linux/err.h>
31+#include <linux/fb.h>
4832 #include <linux/i2c.h>
49−#include <linux/backlight.h>
33+#include <linux/kernel.h>
34+#include <linux/module.h>
35+#include <linux/mutex.h>
5036 #include <linux/platform_device.h>
51−#include <linux/dmi.h>
5237 #include <linux/rfkill.h>
38+
5339 #include <acpi/video.h>
5440
5541 #define DRIVER_NAME "intel_oaktrail"
drivers/platform/x86/intel_pmc_core.c+1−10
@@ -1,3 +1,4 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Intel Core SoC Power Management Controller Driver
34 *
@@ -6,16 +7,6 @@ · 2 unmodified lines
67 *
78 * Authors: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
89 * Vishwanath Somayaji <vishwanath.somayaji@intel.com>
9− *
10− * This program is free software; you can redistribute it and/or modify it
11− * under the terms and conditions of the GNU General Public License,
12− * version 2, as published by the Free Software Foundation.
13− *
14− * This program is distributed in the hope it will be useful, but WITHOUT
15− * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16− * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17− * more details.
18− *
1910 */
2011
2112 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
drivers/platform/x86/intel_pmc_core.h+1−10
@@ -1,3 +1,4 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Intel Core SoC Power Management Controller Header File
34 *
@@ -6,16 +7,6 @@ · 2 unmodified lines
67 *
78 * Authors: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
89 * Vishwanath Somayaji <vishwanath.somayaji@intel.com>
9− *
10− * This program is free software; you can redistribute it and/or modify it
11− * under the terms and conditions of the GNU General Public License,
12− * version 2, as published by the Free Software Foundation.
13− *
14− * This program is distributed in the hope it will be useful, but WITHOUT
15− * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16− * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17− * more details.
18− *
1910 */
2011
2112 #ifndef PMC_CORE_H
drivers/platform/x86/intel_pmc_ipc.c+15−20
@@ -1,39 +1,34 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
2− * intel_pmc_ipc.c: Driver for the Intel PMC IPC mechanism
3+ * Driver for the Intel PMC IPC mechanism
34 *
45 * (C) Copyright 2014-2015 Intel Corporation
56 *
6− * This driver is based on Intel SCU IPC driver(intel_scu_opc.c) by
7+ * This driver is based on Intel SCU IPC driver(intel_scu_ipc.c) by
78 * Sreedhara DS <sreedhara.ds@intel.com>
89 *
9− * This program is free software; you can redistribute it and/or
10− * modify it under the terms of the GNU General Public License
11− * as published by the Free Software Foundation; version 2
12− * of the License.
13− *
1410 * PMC running in ARC processor communicates with other entity running in IA
1511 * core through IPC mechanism which in turn messaging between IA core ad PMC.
1612 */
1713
18−#include <linux/module.h>
14+#include <linux/acpi.h>
15+#include <linux/atomic.h>
16+#include <linux/bitops.h>
1917 #include <linux/delay.h>
20−#include <linux/errno.h>
21−#include <linux/init.h>
2218 #include <linux/device.h>
23−#include <linux/pm.h>
19+#include <linux/errno.h>
20+#include <linux/interrupt.h>
21+#include <linux/io-64-nonatomic-lo-hi.h>
22+#include <linux/kernel.h>
23+#include <linux/module.h>
24+#include <linux/notifier.h>
2425 #include <linux/pci.h>
2526 #include <linux/platform_device.h>
26−#include <linux/interrupt.h>
27+#include <linux/pm.h>
2728 #include <linux/pm_qos.h>
28−#include <linux/kernel.h>
29−#include <linux/bitops.h>
3029 #include <linux/sched.h>
31−#include <linux/atomic.h>
32−#include <linux/notifier.h>
33−#include <linux/suspend.h>
34−#include <linux/acpi.h>
35−#include <linux/io-64-nonatomic-lo-hi.h>
3630 #include <linux/spinlock.h>
31+#include <linux/suspend.h>
3732
3833 #include <asm/intel_pmc_ipc.h>
3934
@@ -1029,7 +1024,7 @@ static void __exit intel_pmc_ipc_exit(void) · 989 unmodified lines
10291024
10301025 MODULE_AUTHOR("Zha Qipeng <qipeng.zha@intel.com>");
10311026 MODULE_DESCRIPTION("Intel PMC IPC driver");
1032−MODULE_LICENSE("GPL");
1027+MODULE_LICENSE("GPL v2");
10331028
10341029 /* Some modules are dependent on this, so init earlier */
10351030 fs_initcall(intel_pmc_ipc_init);
drivers/platform/x86/intel_punit_ipc.c+5−7
@@ -1,25 +1,23 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Driver for the Intel P-Unit Mailbox IPC mechanism
34 *
45 * (C) Copyright 2015 Intel Corporation
56 *
6− * This program is free software; you can redistribute it and/or modify
7− * it under the terms of the GNU General Public License version 2 as
8− * published by the Free Software Foundation.
9− *
107 * The heart of the P-Unit is the Foxton microcontroller and its firmware,
118 * which provide mailbox interface for power management usage.
129 */
1310
14−#include <linux/module.h>
15−#include <linux/mod_devicetable.h>
1611 #include <linux/acpi.h>
17−#include <linux/delay.h>
1812 #include <linux/bitops.h>
13+#include <linux/delay.h>
1914 #include <linux/device.h>
2015 #include <linux/interrupt.h>
2116 #include <linux/io.h>
17+#include <linux/mod_devicetable.h>
18+#include <linux/module.h>
2219 #include <linux/platform_device.h>
20+
2321 #include <asm/intel_punit_ipc.h>
2422
2523 /* IPC Mailbox registers */
drivers/platform/x86/intel_scu_ipc.c+7−9
@@ -1,14 +1,10 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
2− * intel_scu_ipc.c: Driver for the Intel SCU IPC mechanism
3+ * Driver for the Intel SCU IPC mechanism
34 *
45 * (C) Copyright 2008-2010,2015 Intel Corporation
56 * Author: Sreedhara DS (sreedhara.ds@intel.com)
67 *
7− * This program is free software; you can redistribute it and/or
8− * modify it under the terms of the GNU General Public License
9− * as published by the Free Software Foundation; version 2
10− * of the License.
11− *
128 * SCU running in ARC processor communicates with other entity running in IA
139 * core through IPC mechanism which in turn messaging between IA core ad SCU.
1410 * SCU has two IPC mechanism IPC-1 and IPC-2. IPC-1 is used between IA32 and
@@ -16,14 +12,16 @@ · 1 unmodified line
1612 * IPC-1 Driver provides an API for power control unit registers (e.g. MSIC)
1713 * along with other APIs.
1814 */
15+
1916 #include <linux/delay.h>
17+#include <linux/device.h>
2018 #include <linux/errno.h>
2119 #include <linux/init.h>
22−#include <linux/device.h>
23−#include <linux/pm.h>
24−#include <linux/pci.h>
2520 #include <linux/interrupt.h>
21+#include <linux/pci.h>
22+#include <linux/pm.h>
2623 #include <linux/sfi.h>
24+
2725 #include <asm/intel-mid.h>
2826 #include <asm/intel_scu_ipc.h>
2927
drivers/platform/x86/intel_scu_ipcutil.c+10−14
@@ -1,32 +1,28 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
2− * intel_scu_ipc.c: Driver for the Intel SCU IPC mechanism
3+ * Driver for the Intel SCU IPC mechanism
34 *
45 * (C) Copyright 2008-2010 Intel Corporation
56 * Author: Sreedhara DS (sreedhara.ds@intel.com)
67 *
7− * This program is free software; you can redistribute it and/or
8− * modify it under the terms of the GNU General Public License
9− * as published by the Free Software Foundation; version 2
10− * of the License.
11− *
12− * This driver provides ioctl interfaces to call intel scu ipc driver api
8+ * This driver provides IOCTL interfaces to call Intel SCU IPC driver API.
139 */
1410
15−#include <linux/module.h>
16−#include <linux/kernel.h>
1711 #include <linux/errno.h>
18−#include <linux/types.h>
19−#include <linux/fs.h>
2012 #include <linux/fcntl.h>
13+#include <linux/fs.h>
14+#include <linux/kernel.h>
15+#include <linux/module.h>
2116 #include <linux/sched.h>
22−#include <linux/uaccess.h>
2317 #include <linux/slab.h>
24−#include <linux/init.h>
18+#include <linux/types.h>
19+#include <linux/uaccess.h>
20+
2521 #include <asm/intel_scu_ipc.h>
2622
2723 static int major;
2824
29−/* ioctl commnds */
25+/* IOCTL commands */
3026 #define INTE_SCU_IPC_REGISTER_READ 0
3127 #define INTE_SCU_IPC_REGISTER_WRITE 1
3228 #define INTE_SCU_IPC_REGISTER_UPDATE 2
drivers/platform/x86/intel_telemetry_core.c+2−10
@@ -1,17 +1,9 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Intel SoC Core Telemetry Driver
34 * Copyright (C) 2015, Intel Corporation.
45 * All Rights Reserved.
56 *
6− * This program is free software; you can redistribute it and/or modify it
7− * under the terms and conditions of the GNU General Public License,
8− * version 2, as published by the Free Software Foundation.
9− *
10− * This program is distributed in the hope it will be useful, but WITHOUT
11− * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12− * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13− * more details.
14− *
157 * Telemetry Framework provides platform related PM and performance statistics.
168 * This file provides the core telemetry API implementation.
179 */
@@ -460,4 +452,4 @@ module_exit(telemetry_module_exit); · 442 unmodified lines
460452
461453 MODULE_AUTHOR("Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com>");
462454 MODULE_DESCRIPTION("Intel SoC Telemetry Interface");
463−MODULE_LICENSE("GPL");
455+MODULE_LICENSE("GPL v2");
drivers/platform/x86/intel_telemetry_debugfs.c+10−17
@@ -1,17 +1,9 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Intel SOC Telemetry debugfs Driver: Currently supports APL
34 * Copyright (c) 2015, Intel Corporation.
45 * All Rights Reserved.
56 *
6− * This program is free software; you can redistribute it and/or modify it
7− * under the terms and conditions of the GNU General Public License,
8− * version 2, as published by the Free Software Foundation.
9− *
10− * This program is distributed in the hope it will be useful, but WITHOUT
11− * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12− * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13− * more details.
14− *
157 * This file provides the debugfs interfaces for telemetry.
168 * /sys/kernel/debug/telemetry/pss_info: Shows Primary Control Sub-Sys Counters
179 * /sys/kernel/debug/telemetry/ioss_info: Shows IO Sub-System Counters
@@ -72,9 +64,6 @@ · 54 unmodified lines
7264 #define TELEM_IOSS_DX_D0IX_EVTS 25
7365 #define TELEM_IOSS_PG_EVTS 30
7466
75−#define TELEM_DEBUGFS_CPU(model, data) \
76− { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, (unsigned long)&data}
77−
7867 #define TELEM_CHECK_AND_PARSE_EVTS(EVTID, EVTNUM, BUF, EVTLOG, EVTDAT, MASK) { \
7968 if (evtlog[index].telem_evtid == (EVTID)) { \
8069 for (idx = 0; idx < (EVTNUM); idx++) \
@@ -319,8 +308,8 @@ static struct telemetry_debugfs_conf telem_apl_debugfs_conf = { · 238 unmodified lines
319308 };
320309
321310 static const struct x86_cpu_id telemetry_debugfs_cpu_ids[] = {
322− TELEM_DEBUGFS_CPU(INTEL_FAM6_ATOM_GOLDMONT, telem_apl_debugfs_conf),
323− TELEM_DEBUGFS_CPU(INTEL_FAM6_ATOM_GOLDMONT_PLUS, telem_apl_debugfs_conf),
311+ INTEL_CPU_FAM6(ATOM_GOLDMONT, telem_apl_debugfs_conf),
312+ INTEL_CPU_FAM6(ATOM_GOLDMONT_PLUS, telem_apl_debugfs_conf),
324313 {}
325314 };
326315
@@ -951,12 +940,16 @@ static int __init telemetry_debugfs_init(void) · 624 unmodified lines
951940 debugfs_conf = (struct telemetry_debugfs_conf *)id->driver_data;
952941
953942 err = telemetry_pltconfig_valid();
954− if (err < 0)
943+ if (err < 0) {
944+ pr_info("Invalid pltconfig, ensure IPC1 device is enabled in BIOS\n");
955945 return -ENODEV;
946+ }
956947
957948 err = telemetry_debugfs_check_evts();
958− if (err < 0)
949+ if (err < 0) {
950+ pr_info("telemetry_debugfs_check_evts failed\n");
959951 return -EINVAL;
952+ }
960953
961954 register_pm_notifier(&pm_notifier);
962955
@@ -1037,4 +1030,4 @@ module_exit(telemetry_debugfs_exit); · 74 unmodified lines
10371030 MODULE_AUTHOR("Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com>");
10381031 MODULE_DESCRIPTION("Intel SoC Telemetry debugfs Interface");
10391032 MODULE_VERSION(DRIVER_VERSION);
1040−MODULE_LICENSE("GPL");
1033+MODULE_LICENSE("GPL v2");
drivers/platform/x86/intel_telemetry_pltdrv.c+2−10
@@ -1,17 +1,9 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Intel SOC Telemetry Platform Driver: Currently supports APL
34 * Copyright (c) 2015, Intel Corporation.
45 * All Rights Reserved.
56 *
6− * This program is free software; you can redistribute it and/or modify it
7− * under the terms and conditions of the GNU General Public License,
8− * version 2, as published by the Free Software Foundation.
9− *
10− * This program is distributed in the hope it will be useful, but WITHOUT
11− * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12− * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13− * more details.
14− *
157 * This file provides the platform specific telemetry implementation for APL.
168 * It used the PUNIT and PMC IPC interfaces for configuring the counters.
179 * The accumulated results are fetched from SRAM.
@@ -1242,4 +1234,4 @@ module_exit(telemetry_module_exit); · 1224 unmodified lines
12421234 MODULE_AUTHOR("Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com>");
12431235 MODULE_DESCRIPTION("Intel SoC Telemetry Platform Driver");
12441236 MODULE_VERSION(DRIVER_VERSION);
1245−MODULE_LICENSE("GPL");
1237+MODULE_LICENSE("GPL v2");
drivers/platform/x86/intel_turbo_max_3.c+5−13
@@ -1,28 +1,20 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Intel Turbo Boost Max Technology 3.0 legacy (non HWP) enumeration driver
34 * Copyright (c) 2017, Intel Corporation.
45 * All rights reserved.
56 *
67 * Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
7− *
8− * This program is free software; you can redistribute it and/or modify it
9− * under the terms and conditions of the GNU General Public License,
10− * version 2, as published by the Free Software Foundation.
11− *
12− * This program is distributed in the hope it will be useful, but WITHOUT
13− * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14− * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15− * more details.
16− *
178 */
189 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
1910
20−#include <linux/kernel.h>
11+#include <linux/cpufeature.h>
12+#include <linux/cpuhotplug.h>
2113 #include <linux/init.h>
14+#include <linux/kernel.h>
2215 #include <linux/topology.h>
2316 #include <linux/workqueue.h>
24−#include <linux/cpuhotplug.h>
25−#include <linux/cpufeature.h>
17+
2618 #include <asm/cpu_device_id.h>
2719 #include <asm/intel-family.h>
2820
drivers/platform/x86/lg-laptop.c+700−0
@@ -0,0 +1,700 @@
1+// SPDX-License-Identifier: GPL-2.0+
2+/*
3+ * lg-laptop.c - LG Gram ACPI features and hotkeys Driver
4+ *
5+ * Copyright (C) 2018 Matan Ziv-Av <matan@svgalib.org>
6+ */
7+
8+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
9+
10+#include <linux/acpi.h>
11+#include <linux/input.h>
12+#include <linux/input/sparse-keymap.h>
13+#include <linux/kernel.h>
14+#include <linux/leds.h>
15+#include <linux/module.h>
16+#include <linux/platform_device.h>
17+#include <linux/types.h>
18+
19+#define LED_DEVICE(_name, max) struct led_classdev _name = { \
20+ .name = __stringify(_name), \
21+ .max_brightness = max, \
22+ .brightness_set = _name##_set, \
23+ .brightness_get = _name##_get, \
24+}
25+
26+MODULE_AUTHOR("Matan Ziv-Av");
27+MODULE_DESCRIPTION("LG WMI Hotkey Driver");
28+MODULE_LICENSE("GPL");
29+
30+#define WMI_EVENT_GUID0 "E4FB94F9-7F2B-4173-AD1A-CD1D95086248"
31+#define WMI_EVENT_GUID1 "023B133E-49D1-4E10-B313-698220140DC2"
32+#define WMI_EVENT_GUID2 "37BE1AC0-C3F2-4B1F-BFBE-8FDEAF2814D6"
33+#define WMI_EVENT_GUID3 "911BAD44-7DF8-4FBB-9319-BABA1C4B293B"
34+#define WMI_METHOD_WMAB "C3A72B38-D3EF-42D3-8CBB-D5A57049F66D"
35+#define WMI_METHOD_WMBB "2B4F501A-BD3C-4394-8DCF-00A7D2BC8210"
36+#define WMI_EVENT_GUID WMI_EVENT_GUID0
37+
38+#define WMAB_METHOD "\\XINI.WMAB"
39+#define WMBB_METHOD "\\XINI.WMBB"
40+#define SB_GGOV_METHOD "\\_SB.GGOV"
41+#define GOV_TLED 0x2020008
42+#define WM_GET 1
43+#define WM_SET 2
44+#define WM_KEY_LIGHT 0x400
45+#define WM_TLED 0x404
46+#define WM_FN_LOCK 0x407
47+#define WM_BATT_LIMIT 0x61
48+#define WM_READER_MODE 0xBF
49+#define WM_FAN_MODE 0x33
50+#define WMBB_USB_CHARGE 0x10B
51+#define WMBB_BATT_LIMIT 0x10C
52+
53+#define PLATFORM_NAME "lg-laptop"
54+
55+MODULE_ALIAS("wmi:" WMI_EVENT_GUID0);
56+MODULE_ALIAS("wmi:" WMI_EVENT_GUID1);
57+MODULE_ALIAS("wmi:" WMI_EVENT_GUID2);
58+MODULE_ALIAS("wmi:" WMI_EVENT_GUID3);
59+MODULE_ALIAS("wmi:" WMI_METHOD_WMAB);
60+MODULE_ALIAS("wmi:" WMI_METHOD_WMBB);
61+MODULE_ALIAS("acpi*:LGEX0815:*");
62+
63+static struct platform_device *pf_device;
64+static struct input_dev *wmi_input_dev;
65+
66+static u32 inited;
67+#define INIT_INPUT_WMI_0 0x01
68+#define INIT_INPUT_WMI_2 0x02
69+#define INIT_INPUT_ACPI 0x04
70+#define INIT_TPAD_LED 0x08
71+#define INIT_KBD_LED 0x10
72+#define INIT_SPARSE_KEYMAP 0x80
73+
74+static const struct key_entry wmi_keymap[] = {
75+ {KE_KEY, 0x70, {KEY_F15} }, /* LG control panel (F1) */
76+ {KE_KEY, 0x74, {KEY_F13} }, /* Touchpad toggle (F5) */
77+ {KE_KEY, 0xf020000, {KEY_F14} }, /* Read mode (F9) */
78+ {KE_KEY, 0x10000000, {KEY_F16} },/* Keyboard backlight (F8) - pressing
79+ * this key both sends an event and
80+ * changes backlight level.
81+ */
82+ {KE_KEY, 0x80, {KEY_RFKILL} },
83+ {KE_END, 0}
84+};
85+
86+static int ggov(u32 arg0)
87+{
88+ union acpi_object args[1];
89+ union acpi_object *r;
90+ acpi_status status;
91+ acpi_handle handle;
92+ struct acpi_object_list arg;
93+ struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
94+ int res;
95+
96+ args[0].type = ACPI_TYPE_INTEGER;
97+ args[0].integer.value = arg0;
98+
99+ status = acpi_get_handle(NULL, (acpi_string) SB_GGOV_METHOD, &handle);
100+ if (ACPI_FAILURE(status)) {
101+ pr_err("Cannot get handle");
102+ return -ENODEV;
103+ }
104+
105+ arg.count = 1;
106+ arg.pointer = args;
107+
108+ status = acpi_evaluate_object(handle, NULL, &arg, &buffer);
109+ if (ACPI_FAILURE(status)) {
110+ acpi_handle_err(handle, "GGOV: call failed.\n");
111+ return -EINVAL;
112+ }
113+
114+ r = buffer.pointer;
115+ if (r->type != ACPI_TYPE_INTEGER) {
116+ kfree(r);
117+ return -EINVAL;
118+ }
119+
120+ res = r->integer.value;
121+ kfree(r);
122+
123+ return res;
124+}
125+
126+static union acpi_object *lg_wmab(u32 method, u32 arg1, u32 arg2)
127+{
128+ union acpi_object args[3];
129+ acpi_status status;
130+ acpi_handle handle;
131+ struct acpi_object_list arg;
132+ struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
133+
134+ args[0].type = ACPI_TYPE_INTEGER;
135+ args[0].integer.value = method;
136+ args[1].type = ACPI_TYPE_INTEGER;
137+ args[1].integer.value = arg1;
138+ args[2].type = ACPI_TYPE_INTEGER;
139+ args[2].integer.value = arg2;
140+
141+ status = acpi_get_handle(NULL, (acpi_string) WMAB_METHOD, &handle);
142+ if (ACPI_FAILURE(status)) {
143+ pr_err("Cannot get handle");
144+ return NULL;
145+ }
146+
147+ arg.count = 3;
148+ arg.pointer = args;
149+
150+ status = acpi_evaluate_object(handle, NULL, &arg, &buffer);
151+ if (ACPI_FAILURE(status)) {
152+ acpi_handle_err(handle, "WMAB: call failed.\n");
153+ return NULL;
154+ }
155+
156+ return buffer.pointer;
157+}
158+
159+static union acpi_object *lg_wmbb(u32 method_id, u32 arg1, u32 arg2)
160+{
161+ union acpi_object args[3];
162+ acpi_status status;
163+ acpi_handle handle;
164+ struct acpi_object_list arg;
165+ struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
166+ u8 buf[32];
167+
168+ *(u32 *)buf = method_id;
169+ *(u32 *)(buf + 4) = arg1;
170+ *(u32 *)(buf + 16) = arg2;
171+ args[0].type = ACPI_TYPE_INTEGER;
172+ args[0].integer.value = 0; /* ignored */
173+ args[1].type = ACPI_TYPE_INTEGER;
174+ args[1].integer.value = 1; /* Must be 1 or 2. Does not matter which */
175+ args[2].type = ACPI_TYPE_BUFFER;
176+ args[2].buffer.length = 32;
177+ args[2].buffer.pointer = buf;
178+
179+ status = acpi_get_handle(NULL, (acpi_string)WMBB_METHOD, &handle);
180+ if (ACPI_FAILURE(status)) {
181+ pr_err("Cannot get handle");
182+ return NULL;
183+ }
184+
185+ arg.count = 3;
186+ arg.pointer = args;
187+
188+ status = acpi_evaluate_object(handle, NULL, &arg, &buffer);
189+ if (ACPI_FAILURE(status)) {
190+ acpi_handle_err(handle, "WMAB: call failed.\n");
191+ return NULL;
192+ }
193+
194+ return (union acpi_object *)buffer.pointer;
195+}
196+
197+static void wmi_notify(u32 value, void *context)
198+{
199+ struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL };
200+ union acpi_object *obj;
201+ acpi_status status;
202+ long data = (long)context;
203+
204+ pr_debug("event guid %li\n", data);
205+ status = wmi_get_event_data(value, &response);
206+ if (ACPI_FAILURE(status)) {
207+ pr_err("Bad event status 0x%x\n", status);
208+ return;
209+ }
210+
211+ obj = (union acpi_object *)response.pointer;
212+ if (!obj)
213+ return;
214+
215+ if (obj->type == ACPI_TYPE_INTEGER) {
216+ int eventcode = obj->integer.value;
217+ struct key_entry *key;
218+
219+ key =
220+ sparse_keymap_entry_from_scancode(wmi_input_dev, eventcode);
221+ if (key && key->type == KE_KEY)
222+ sparse_keymap_report_entry(wmi_input_dev, key, 1, true);
223+ }
224+
225+ pr_debug("Type: %i Eventcode: 0x%llx\n", obj->type,
226+ obj->integer.value);
227+ kfree(response.pointer);
228+}
229+
230+static void wmi_input_setup(void)
231+{
232+ acpi_status status;
233+
234+ wmi_input_dev = input_allocate_device();
235+ if (wmi_input_dev) {
236+ wmi_input_dev->name = "LG WMI hotkeys";
237+ wmi_input_dev->phys = "wmi/input0";
238+ wmi_input_dev->id.bustype = BUS_HOST;
239+
240+ if (sparse_keymap_setup(wmi_input_dev, wmi_keymap, NULL) ||
241+ input_register_device(wmi_input_dev)) {
242+ pr_info("Cannot initialize input device");
243+ input_free_device(wmi_input_dev);
244+ return;
245+ }
246+
247+ inited |= INIT_SPARSE_KEYMAP;
248+ status = wmi_install_notify_handler(WMI_EVENT_GUID0, wmi_notify,
249+ (void *)0);
250+ if (ACPI_SUCCESS(status))
251+ inited |= INIT_INPUT_WMI_0;
252+
253+ status = wmi_install_notify_handler(WMI_EVENT_GUID2, wmi_notify,
254+ (void *)2);
255+ if (ACPI_SUCCESS(status))
256+ inited |= INIT_INPUT_WMI_2;
257+ } else {
258+ pr_info("Cannot allocate input device");
259+ }
260+}
261+
262+static void acpi_notify(struct acpi_device *device, u32 event)
263+{
264+ struct key_entry *key;
265+
266+ acpi_handle_debug(device->handle, "notify: %d\n", event);
267+ if (inited & INIT_SPARSE_KEYMAP) {
268+ key = sparse_keymap_entry_from_scancode(wmi_input_dev, 0x80);
269+ if (key && key->type == KE_KEY)
270+ sparse_keymap_report_entry(wmi_input_dev, key, 1, true);
271+ }
272+}
273+
274+static ssize_t fan_mode_store(struct device *dev,
275+ struct device_attribute *attr,
276+ const char *buffer, size_t count)
277+{
278+ bool value;
279+ union acpi_object *r;
280+ u32 m;
281+ int ret;
282+
283+ ret = kstrtobool(buffer, &value);
284+ if (ret)
285+ return ret;
286+
287+ r = lg_wmab(WM_FAN_MODE, WM_GET, 0);
288+ if (!r)
289+ return -EIO;
290+
291+ if (r->type != ACPI_TYPE_INTEGER) {
292+ kfree(r);
293+ return -EIO;
294+ }
295+
296+ m = r->integer.value;
297+ kfree(r);
298+ r = lg_wmab(WM_FAN_MODE, WM_SET, (m & 0xffffff0f) | (value << 4));
299+ kfree(r);
300+ r = lg_wmab(WM_FAN_MODE, WM_SET, (m & 0xfffffff0) | value);
301+ kfree(r);
302+
303+ return count;
304+}
305+
306+static ssize_t fan_mode_show(struct device *dev,
307+ struct device_attribute *attr, char *buffer)
308+{
309+ unsigned int status;
310+ union acpi_object *r;
311+
312+ r = lg_wmab(WM_FAN_MODE, WM_GET, 0);
313+ if (!r)
314+ return -EIO;
315+
316+ if (r->type != ACPI_TYPE_INTEGER) {
317+ kfree(r);
318+ return -EIO;
319+ }
320+
321+ status = r->integer.value & 0x01;
322+ kfree(r);
323+
324+ return snprintf(buffer, PAGE_SIZE, "%d\n", status);
325+}
326+
327+static ssize_t usb_charge_store(struct device *dev,
328+ struct device_attribute *attr,
329+ const char *buffer, size_t count)
330+{
331+ bool value;
332+ union acpi_object *r;
333+ int ret;
334+
335+ ret = kstrtobool(buffer, &value);
336+ if (ret)
337+ return ret;
338+
339+ r = lg_wmbb(WMBB_USB_CHARGE, WM_SET, value);
340+ if (!r)
341+ return -EIO;
342+
343+ kfree(r);
344+ return count;
345+}
346+
347+static ssize_t usb_charge_show(struct device *dev,
348+ struct device_attribute *attr, char *buffer)
349+{
350+ unsigned int status;
351+ union acpi_object *r;
352+
353+ r = lg_wmbb(WMBB_USB_CHARGE, WM_GET, 0);
354+ if (!r)
355+ return -EIO;
356+
357+ if (r->type != ACPI_TYPE_BUFFER) {
358+ kfree(r);
359+ return -EIO;
360+ }
361+
362+ status = !!r->buffer.pointer[0x10];
363+
364+ kfree(r);
365+
366+ return snprintf(buffer, PAGE_SIZE, "%d\n", status);
367+}
368+
369+static ssize_t reader_mode_store(struct device *dev,
370+ struct device_attribute *attr,
371+ const char *buffer, size_t count)
372+{
373+ bool value;
374+ union acpi_object *r;
375+ int ret;
376+
377+ ret = kstrtobool(buffer, &value);
378+ if (ret)
379+ return ret;
380+
381+ r = lg_wmab(WM_READER_MODE, WM_SET, value);
382+ if (!r)
383+ return -EIO;
384+
385+ kfree(r);
386+ return count;
387+}
388+
389+static ssize_t reader_mode_show(struct device *dev,
390+ struct device_attribute *attr, char *buffer)
391+{
392+ unsigned int status;
393+ union acpi_object *r;
394+
395+ r = lg_wmab(WM_READER_MODE, WM_GET, 0);
396+ if (!r)
397+ return -EIO;
398+
399+ if (r->type != ACPI_TYPE_INTEGER) {
400+ kfree(r);
401+ return -EIO;
402+ }
403+
404+ status = !!r->integer.value;
405+
406+ kfree(r);
407+
408+ return snprintf(buffer, PAGE_SIZE, "%d\n", status);
409+}
410+
411+static ssize_t fn_lock_store(struct device *dev,
412+ struct device_attribute *attr,
413+ const char *buffer, size_t count)
414+{
415+ bool value;
416+ union acpi_object *r;
417+ int ret;
418+
419+ ret = kstrtobool(buffer, &value);
420+ if (ret)
421+ return ret;
422+
423+ r = lg_wmab(WM_FN_LOCK, WM_SET, value);
424+ if (!r)
425+ return -EIO;
426+
427+ kfree(r);
428+ return count;
429+}
430+
431+static ssize_t fn_lock_show(struct device *dev,
432+ struct device_attribute *attr, char *buffer)
433+{
434+ unsigned int status;
435+ union acpi_object *r;
436+
437+ r = lg_wmab(WM_FN_LOCK, WM_GET, 0);
438+ if (!r)
439+ return -EIO;
440+
441+ if (r->type != ACPI_TYPE_BUFFER) {
442+ kfree(r);
443+ return -EIO;
444+ }
445+
446+ status = !!r->buffer.pointer[0];
447+ kfree(r);
448+
449+ return snprintf(buffer, PAGE_SIZE, "%d\n", status);
450+}
451+
452+static ssize_t battery_care_limit_store(struct device *dev,
453+ struct device_attribute *attr,
454+ const char *buffer, size_t count)
455+{
456+ unsigned long value;
457+ int ret;
458+
459+ ret = kstrtoul(buffer, 10, &value);
460+ if (ret)
461+ return ret;
462+
463+ if (value == 100 || value == 80) {
464+ union acpi_object *r;
465+
466+ r = lg_wmab(WM_BATT_LIMIT, WM_SET, value);
467+ if (!r)
468+ return -EIO;
469+
470+ kfree(r);
471+ return count;
472+ }
473+
474+ return -EINVAL;
475+}
476+
477+static ssize_t battery_care_limit_show(struct device *dev,
478+ struct device_attribute *attr,
479+ char *buffer)
480+{
481+ unsigned int status;
482+ union acpi_object *r;
483+
484+ r = lg_wmab(WM_BATT_LIMIT, WM_GET, 0);
485+ if (!r)
486+ return -EIO;
487+
488+ if (r->type != ACPI_TYPE_INTEGER) {
489+ kfree(r);
490+ return -EIO;
491+ }
492+
493+ status = r->integer.value;
494+ kfree(r);
495+ if (status != 80 && status != 100)
496+ status = 0;
497+
498+ return snprintf(buffer, PAGE_SIZE, "%d\n", status);
499+}
500+
501+static DEVICE_ATTR_RW(fan_mode);
502+static DEVICE_ATTR_RW(usb_charge);
503+static DEVICE_ATTR_RW(reader_mode);
504+static DEVICE_ATTR_RW(fn_lock);
505+static DEVICE_ATTR_RW(battery_care_limit);
506+
507+static struct attribute *dev_attributes[] = {
508+ &dev_attr_fan_mode.attr,
509+ &dev_attr_usb_charge.attr,
510+ &dev_attr_reader_mode.attr,
511+ &dev_attr_fn_lock.attr,
512+ &dev_attr_battery_care_limit.attr,
513+ NULL
514+};
515+
516+static const struct attribute_group dev_attribute_group = {
517+ .attrs = dev_attributes,
518+};
519+
520+static void tpad_led_set(struct led_classdev *cdev,
521+ enum led_brightness brightness)
522+{
523+ union acpi_object *r;
524+
525+ r = lg_wmab(WM_TLED, WM_SET, brightness > LED_OFF);
526+ kfree(r);
527+}
528+
529+static enum led_brightness tpad_led_get(struct led_classdev *cdev)
530+{
531+ return ggov(GOV_TLED) > 0 ? LED_ON : LED_OFF;
532+}
533+
534+static LED_DEVICE(tpad_led, 1);
535+
536+static void kbd_backlight_set(struct led_classdev *cdev,
537+ enum led_brightness brightness)
538+{
539+ u32 val;
540+ union acpi_object *r;
541+
542+ val = 0x22;
543+ if (brightness <= LED_OFF)
544+ val = 0;
545+ if (brightness >= LED_FULL)
546+ val = 0x24;
547+ r = lg_wmab(WM_KEY_LIGHT, WM_SET, val);
548+ kfree(r);
549+}
550+
551+static enum led_brightness kbd_backlight_get(struct led_classdev *cdev)
552+{
553+ union acpi_object *r;
554+ int val;
555+
556+ r = lg_wmab(WM_KEY_LIGHT, WM_GET, 0);
557+
558+ if (!r)
559+ return LED_OFF;
560+
561+ if (r->type != ACPI_TYPE_BUFFER || r->buffer.pointer[1] != 0x05) {
562+ kfree(r);
563+ return LED_OFF;
564+ }
565+
566+ switch (r->buffer.pointer[0] & 0x27) {
567+ case 0x24:
568+ val = LED_FULL;
569+ break;
570+ case 0x22:
571+ val = LED_HALF;
572+ break;
573+ default:
574+ val = LED_OFF;
575+ }
576+
577+ kfree(r);
578+
579+ return val;
580+}
581+
582+static LED_DEVICE(kbd_backlight, 255);
583+
584+static void wmi_input_destroy(void)
585+{
586+ if (inited & INIT_INPUT_WMI_2)
587+ wmi_remove_notify_handler(WMI_EVENT_GUID2);
588+
589+ if (inited & INIT_INPUT_WMI_0)
590+ wmi_remove_notify_handler(WMI_EVENT_GUID0);
591+
592+ if (inited & INIT_SPARSE_KEYMAP)
593+ input_unregister_device(wmi_input_dev);
594+
595+ inited &= ~(INIT_INPUT_WMI_0 | INIT_INPUT_WMI_2 | INIT_SPARSE_KEYMAP);
596+}
597+
598+static struct platform_driver pf_driver = {
599+ .driver = {
600+ .name = PLATFORM_NAME,
601+ }
602+};
603+
604+static int acpi_add(struct acpi_device *device)
605+{
606+ int ret;
607+
608+ if (pf_device)
609+ return 0;
610+
611+ ret = platform_driver_register(&pf_driver);
612+ if (ret)
613+ return ret;
614+
615+ pf_device = platform_device_register_simple(PLATFORM_NAME,
616+ PLATFORM_DEVID_NONE,
617+ NULL, 0);
618+ if (IS_ERR(pf_device)) {
619+ ret = PTR_ERR(pf_device);
620+ pf_device = NULL;
621+ pr_err("unable to register platform device\n");
622+ goto out_platform_registered;
623+ }
624+
625+ ret = sysfs_create_group(&pf_device->dev.kobj, &dev_attribute_group);
626+ if (ret)
627+ goto out_platform_device;
628+
629+ if (!led_classdev_register(&pf_device->dev, &kbd_backlight))
630+ inited |= INIT_KBD_LED;
631+
632+ if (!led_classdev_register(&pf_device->dev, &tpad_led))
633+ inited |= INIT_TPAD_LED;
634+
635+ wmi_input_setup();
636+
637+ return 0;
638+
639+out_platform_device:
640+ platform_device_unregister(pf_device);
641+out_platform_registered:
642+ platform_driver_unregister(&pf_driver);
643+ return ret;
644+}
645+
646+static int acpi_remove(struct acpi_device *device)
647+{
648+ sysfs_remove_group(&pf_device->dev.kobj, &dev_attribute_group);
649+ if (inited & INIT_KBD_LED)
650+ led_classdev_unregister(&kbd_backlight);
651+
652+ if (inited & INIT_TPAD_LED)
653+ led_classdev_unregister(&tpad_led);
654+
655+ wmi_input_destroy();
656+ platform_device_unregister(pf_device);
657+ pf_device = NULL;
658+ platform_driver_unregister(&pf_driver);
659+
660+ return 0;
661+}
662+
663+static const struct acpi_device_id device_ids[] = {
664+ {"LGEX0815", 0},
665+ {"", 0}
666+};
667+MODULE_DEVICE_TABLE(acpi, device_ids);
668+
669+static struct acpi_driver acpi_driver = {
670+ .name = "LG Gram Laptop Support",
671+ .class = "lg-laptop",
672+ .ids = device_ids,
673+ .ops = {
674+ .add = acpi_add,
675+ .remove = acpi_remove,
676+ .notify = acpi_notify,
677+ },
678+ .owner = THIS_MODULE,
679+};
680+
681+static int __init acpi_init(void)
682+{
683+ int result;
684+
685+ result = acpi_bus_register_driver(&acpi_driver);
686+ if (result < 0) {
687+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error registering driver\n"));
688+ return -ENODEV;
689+ }
690+
691+ return 0;
692+}
693+
694+static void __exit acpi_exit(void)
695+{
696+ acpi_bus_unregister_driver(&acpi_driver);
697+}
698+
699+module_init(acpi_init);
700+module_exit(acpi_exit);
drivers/platform/x86/mlx-platform.c+1−1
@@ -575,7 +575,7 @@ static struct mlxreg_core_item mlxplat_mlxcpld_msn201x_items[] = { · 574 unmodified lines
575575
576576 static
577577 struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_msn201x_data = {
578− .items = mlxplat_mlxcpld_msn21xx_items,
578+ .items = mlxplat_mlxcpld_msn201x_items,
579579 .counter = ARRAY_SIZE(mlxplat_mlxcpld_msn201x_items),
580580 .cell = MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET,
581581 .mask = MLXPLAT_CPLD_AGGR_MASK_DEF,
drivers/platform/x86/touchscreen_dmi.c+99−8
@@ -42,10 +42,13 @@ static const struct ts_dmi_data chuwi_hi8_data = { · 41 unmodified lines
4242 };
4343
4444 static const struct property_entry chuwi_hi8_pro_props[] = {
45+ PROPERTY_ENTRY_U32("touchscreen-min-x", 6),
46+ PROPERTY_ENTRY_U32("touchscreen-min-y", 3),
4547 PROPERTY_ENTRY_U32("touchscreen-size-x", 1728),
4648 PROPERTY_ENTRY_U32("touchscreen-size-y", 1148),
4749 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
4850 PROPERTY_ENTRY_STRING("firmware-name", "gsl3680-chuwi-hi8-pro.fw"),
51+ PROPERTY_ENTRY_U32("silead,max-fingers", 10),
4952 PROPERTY_ENTRY_BOOL("silead,home-button"),
5053 { }
5154 };
@@ -56,6 +59,8 @@ static const struct ts_dmi_data chuwi_hi8_pro_data = { · 4 unmodified lines
5659 };
5760
5861 static const struct property_entry chuwi_vi8_props[] = {
62+ PROPERTY_ENTRY_U32("touchscreen-min-x", 4),
63+ PROPERTY_ENTRY_U32("touchscreen-min-y", 6),
5964 PROPERTY_ENTRY_U32("touchscreen-size-x", 1724),
6065 PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
6166 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
@@ -88,9 +93,9 @@ static const struct ts_dmi_data chuwi_vi10_data = { · 26 unmodified lines
8893
8994 static const struct property_entry connect_tablet9_props[] = {
9095 PROPERTY_ENTRY_U32("touchscreen-min-x", 9),
91− PROPERTY_ENTRY_U32("touchscreen-min-y", 8),
96+ PROPERTY_ENTRY_U32("touchscreen-min-y", 10),
9297 PROPERTY_ENTRY_U32("touchscreen-size-x", 1664),
93− PROPERTY_ENTRY_U32("touchscreen-size-y", 878),
98+ PROPERTY_ENTRY_U32("touchscreen-size-y", 880),
9499 PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
95100 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
96101 PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-connect-tablet9.fw"),
@@ -104,8 +109,10 @@ static const struct ts_dmi_data connect_tablet9_data = { · 7 unmodified lines
104109 };
105110
106111 static const struct property_entry cube_iwork8_air_props[] = {
107− PROPERTY_ENTRY_U32("touchscreen-size-x", 1660),
108− PROPERTY_ENTRY_U32("touchscreen-size-y", 900),
112+ PROPERTY_ENTRY_U32("touchscreen-min-x", 1),
113+ PROPERTY_ENTRY_U32("touchscreen-min-y", 3),
114+ PROPERTY_ENTRY_U32("touchscreen-size-x", 1664),
115+ PROPERTY_ENTRY_U32("touchscreen-size-y", 896),
109116 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
110117 PROPERTY_ENTRY_STRING("firmware-name", "gsl3670-cube-iwork8-air.fw"),
111118 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
@@ -179,11 +186,14 @@ static const struct ts_dmi_data gp_electronic_t701_data = { · 67 unmodified lines
179186 };
180187
181188 static const struct property_entry itworks_tw891_props[] = {
189+ PROPERTY_ENTRY_U32("touchscreen-min-x", 1),
190+ PROPERTY_ENTRY_U32("touchscreen-min-y", 5),
182191 PROPERTY_ENTRY_U32("touchscreen-size-x", 1600),
183− PROPERTY_ENTRY_U32("touchscreen-size-y", 890),
192+ PROPERTY_ENTRY_U32("touchscreen-size-y", 896),
184193 PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
185194 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
186195 PROPERTY_ENTRY_STRING("firmware-name", "gsl3670-itworks-tw891.fw"),
196+ PROPERTY_ENTRY_U32("silead,max-fingers", 10),
187197 { }
188198 };
189199
@@ -207,8 +217,10 @@ static const struct ts_dmi_data jumper_ezpad_6_pro_data = { · 17 unmodified lines
207217 };
208218
209219 static const struct property_entry jumper_ezpad_mini3_props[] = {
220+ PROPERTY_ENTRY_U32("touchscreen-min-x", 23),
221+ PROPERTY_ENTRY_U32("touchscreen-min-y", 16),
210222 PROPERTY_ENTRY_U32("touchscreen-size-x", 1700),
211− PROPERTY_ENTRY_U32("touchscreen-size-y", 1150),
223+ PROPERTY_ENTRY_U32("touchscreen-size-y", 1138),
212224 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
213225 PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-jumper-ezpad-mini3.fw"),
214226 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
@@ -237,6 +249,24 @@ static const struct ts_dmi_data onda_obook_20_plus_data = { · 22 unmodified lines
237249 .properties = onda_obook_20_plus_props,
238250 };
239251
252+static const struct property_entry onda_v80_plus_v3_props[] = {
253+ PROPERTY_ENTRY_U32("touchscreen-min-x", 22),
254+ PROPERTY_ENTRY_U32("touchscreen-min-y", 15),
255+ PROPERTY_ENTRY_U32("touchscreen-size-x", 1698),
256+ PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
257+ PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
258+ PROPERTY_ENTRY_STRING("firmware-name",
259+ "gsl3676-onda-v80-plus-v3.fw"),
260+ PROPERTY_ENTRY_U32("silead,max-fingers", 10),
261+ PROPERTY_ENTRY_BOOL("silead,home-button"),
262+ { }
263+};
264+
265+static const struct ts_dmi_data onda_v80_plus_v3_data = {
266+ .acpi_name = "MSSL1680:00",
267+ .properties = onda_v80_plus_v3_props,
268+};
269+
240270 static const struct property_entry onda_v820w_32g_props[] = {
241271 PROPERTY_ENTRY_U32("touchscreen-size-x", 1665),
242272 PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
@@ -322,11 +352,14 @@ static const struct ts_dmi_data pov_mobii_wintab_p800w_v20_data = { · 79 unmodified lines
322352 };
323353
324354 static const struct property_entry pov_mobii_wintab_p800w_v21_props[] = {
325− PROPERTY_ENTRY_U32("touchscreen-size-x", 1800),
326− PROPERTY_ENTRY_U32("touchscreen-size-y", 1150),
355+ PROPERTY_ENTRY_U32("touchscreen-min-x", 1),
356+ PROPERTY_ENTRY_U32("touchscreen-min-y", 8),
357+ PROPERTY_ENTRY_U32("touchscreen-size-x", 1794),
358+ PROPERTY_ENTRY_U32("touchscreen-size-y", 1148),
327359 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
328360 PROPERTY_ENTRY_STRING("firmware-name",
329361 "gsl3692-pov-mobii-wintab-p800w.fw"),
362+ PROPERTY_ENTRY_U32("silead,max-fingers", 10),
330363 PROPERTY_ENTRY_BOOL("silead,home-button"),
331364 { }
332365 };
@@ -366,6 +399,22 @@ static const struct ts_dmi_data teclast_x98plus2_data = { · 33 unmodified lines
366399 .properties = teclast_x98plus2_props,
367400 };
368401
402+static const struct property_entry trekstor_primebook_c11_props[] = {
403+ PROPERTY_ENTRY_U32("touchscreen-size-x", 1970),
404+ PROPERTY_ENTRY_U32("touchscreen-size-y", 1530),
405+ PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
406+ PROPERTY_ENTRY_STRING("firmware-name",
407+ "gsl1680-trekstor-primebook-c11.fw"),
408+ PROPERTY_ENTRY_U32("silead,max-fingers", 10),
409+ PROPERTY_ENTRY_BOOL("silead,home-button"),
410+ { }
411+};
412+
413+static const struct ts_dmi_data trekstor_primebook_c11_data = {
414+ .acpi_name = "MSSL1680:00",
415+ .properties = trekstor_primebook_c11_props,
416+};
417+
369418 static const struct property_entry trekstor_primebook_c13_props[] = {
370419 PROPERTY_ENTRY_U32("touchscreen-size-x", 2624),
371420 PROPERTY_ENTRY_U32("touchscreen-size-y", 1920),
@@ -381,6 +430,22 @@ static const struct ts_dmi_data trekstor_primebook_c13_data = { · 9 unmodified lines
381430 .properties = trekstor_primebook_c13_props,
382431 };
383432
433+static const struct property_entry trekstor_primetab_t13b_props[] = {
434+ PROPERTY_ENTRY_U32("touchscreen-size-x", 2500),
435+ PROPERTY_ENTRY_U32("touchscreen-size-y", 1900),
436+ PROPERTY_ENTRY_STRING("firmware-name",
437+ "gsl1680-trekstor-primetab-t13b.fw"),
438+ PROPERTY_ENTRY_U32("silead,max-fingers", 10),
439+ PROPERTY_ENTRY_BOOL("silead,home-button"),
440+ PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
441+ { }
442+};
443+
444+static const struct ts_dmi_data trekstor_primetab_t13b_data = {
445+ .acpi_name = "MSSL1680:00",
446+ .properties = trekstor_primetab_t13b_props,
447+};
448+
384449 static const struct property_entry trekstor_surftab_twin_10_1_props[] = {
385450 PROPERTY_ENTRY_U32("touchscreen-size-x", 1900),
386451 PROPERTY_ENTRY_U32("touchscreen-size-y", 1280),
@@ -397,6 +462,8 @@ static const struct ts_dmi_data trekstor_surftab_twin_10_1_data = { · 10 unmodified lines
397462 };
398463
399464 static const struct property_entry trekstor_surftab_wintron70_props[] = {
465+ PROPERTY_ENTRY_U32("touchscreen-min-x", 12),
466+ PROPERTY_ENTRY_U32("touchscreen-min-y", 8),
400467 PROPERTY_ENTRY_U32("touchscreen-size-x", 884),
401468 PROPERTY_ENTRY_U32("touchscreen-size-y", 632),
402469 PROPERTY_ENTRY_STRING("firmware-name",
@@ -555,6 +622,14 @@ static const struct dmi_system_id touchscreen_dmi_table[] = { · 152 unmodified lines
555622 DMI_MATCH(DMI_PRODUCT_NAME, "OBOOK 20 PLUS"),
556623 },
557624 },
625+ {
626+ /* ONDA V80 plus v3 (P80PSBG9V3A01501) */
627+ .driver_data = (void *)&onda_v80_plus_v3_data,
628+ .matches = {
629+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ONDA"),
630+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "V80 PLUS")
631+ },
632+ },
558633 {
559634 /* ONDA V820w DualOS */
560635 .driver_data = (void *)&onda_v820w_32g_data,
@@ -640,6 +715,14 @@ static const struct dmi_system_id touchscreen_dmi_table[] = { · 79 unmodified lines
640715 DMI_MATCH(DMI_PRODUCT_NAME, "X98 Plus II"),
641716 },
642717 },
718+ {
719+ /* Trekstor Primebook C11 */
720+ .driver_data = (void *)&trekstor_primebook_c11_data,
721+ .matches = {
722+ DMI_MATCH(DMI_SYS_VENDOR, "TREKSTOR"),
723+ DMI_MATCH(DMI_PRODUCT_NAME, "Primebook C11"),
724+ },
725+ },
643726 {
644727 /* Trekstor Primebook C13 */
645728 .driver_data = (void *)&trekstor_primebook_c13_data,
@@ -648,6 +731,14 @@ static const struct dmi_system_id touchscreen_dmi_table[] = { · 2 unmodified lines
648731 DMI_MATCH(DMI_PRODUCT_NAME, "Primebook C13"),
649732 },
650733 },
734+ {
735+ /* Trekstor Primetab T13B */
736+ .driver_data = (void *)&trekstor_primetab_t13b_data,
737+ .matches = {
738+ DMI_MATCH(DMI_SYS_VENDOR, "TREKSTOR"),
739+ DMI_MATCH(DMI_PRODUCT_NAME, "Primetab T13B"),
740+ },
741+ },
651742 {
652743 /* TrekStor SurfTab twin 10.1 ST10432-8 */
653744 .driver_data = (void *)&trekstor_surftab_twin_10_1_data,
drivers/platform/x86/wmi.c+3−3
@@ -987,19 +987,19 @@ static struct bus_type wmi_bus_type = { · 986 unmodified lines
987987 .remove = wmi_dev_remove,
988988 };
989989
990−static struct device_type wmi_type_event = {
990+static const struct device_type wmi_type_event = {
991991 .name = "event",
992992 .groups = wmi_event_groups,
993993 .release = wmi_dev_release,
994994 };
995995
996−static struct device_type wmi_type_method = {
996+static const struct device_type wmi_type_method = {
997997 .name = "method",
998998 .groups = wmi_method_groups,
999999 .release = wmi_dev_release,
10001000 };
10011001
1002−static struct device_type wmi_type_data = {
1002+static const struct device_type wmi_type_data = {
10031003 .name = "data",
10041004 .groups = wmi_data_groups,
10051005 .release = wmi_dev_release,
include/linux/platform_data/x86/asus-wmi.h+101−0
@@ -0,0 +1,101 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef __PLATFORM_DATA_X86_ASUS_WMI_H
3+#define __PLATFORM_DATA_X86_ASUS_WMI_H
4+
5+#include <linux/errno.h>
6+#include <linux/types.h>
7+
8+/* WMI Methods */
9+#define ASUS_WMI_METHODID_SPEC 0x43455053 /* BIOS SPECification */
10+#define ASUS_WMI_METHODID_SFBD 0x44424653 /* Set First Boot Device */
11+#define ASUS_WMI_METHODID_GLCD 0x44434C47 /* Get LCD status */
12+#define ASUS_WMI_METHODID_GPID 0x44495047 /* Get Panel ID?? (Resol) */
13+#define ASUS_WMI_METHODID_QMOD 0x444F4D51 /* Quiet MODe */
14+#define ASUS_WMI_METHODID_SPLV 0x4C425053 /* Set Panel Light Value */
15+#define ASUS_WMI_METHODID_AGFN 0x4E464741 /* FaN? */
16+#define ASUS_WMI_METHODID_SFUN 0x4E554653 /* FUNCtionalities */
17+#define ASUS_WMI_METHODID_SDSP 0x50534453 /* Set DiSPlay output */
18+#define ASUS_WMI_METHODID_GDSP 0x50534447 /* Get DiSPlay output */
19+#define ASUS_WMI_METHODID_DEVP 0x50564544 /* DEVice Policy */
20+#define ASUS_WMI_METHODID_OSVR 0x5256534F /* OS VeRsion */
21+#define ASUS_WMI_METHODID_DSTS 0x53544344 /* Device STatuS */
22+#define ASUS_WMI_METHODID_DSTS2 0x53545344 /* Device STatuS #2*/
23+#define ASUS_WMI_METHODID_BSTS 0x53545342 /* Bios STatuS ? */
24+#define ASUS_WMI_METHODID_DEVS 0x53564544 /* DEVice Set */
25+#define ASUS_WMI_METHODID_CFVS 0x53564643 /* CPU Frequency Volt Set */
26+#define ASUS_WMI_METHODID_KBFT 0x5446424B /* KeyBoard FilTer */
27+#define ASUS_WMI_METHODID_INIT 0x54494E49 /* INITialize */
28+#define ASUS_WMI_METHODID_HKEY 0x59454B48 /* Hot KEY ?? */
29+
30+#define ASUS_WMI_UNSUPPORTED_METHOD 0xFFFFFFFE
31+
32+/* Wireless */
33+#define ASUS_WMI_DEVID_HW_SWITCH 0x00010001
34+#define ASUS_WMI_DEVID_WIRELESS_LED 0x00010002
35+#define ASUS_WMI_DEVID_CWAP 0x00010003
36+#define ASUS_WMI_DEVID_WLAN 0x00010011
37+#define ASUS_WMI_DEVID_WLAN_LED 0x00010012
38+#define ASUS_WMI_DEVID_BLUETOOTH 0x00010013
39+#define ASUS_WMI_DEVID_GPS 0x00010015
40+#define ASUS_WMI_DEVID_WIMAX 0x00010017
41+#define ASUS_WMI_DEVID_WWAN3G 0x00010019
42+#define ASUS_WMI_DEVID_UWB 0x00010021
43+
44+/* Leds */
45+/* 0x000200XX and 0x000400XX */
46+#define ASUS_WMI_DEVID_LED1 0x00020011
47+#define ASUS_WMI_DEVID_LED2 0x00020012
48+#define ASUS_WMI_DEVID_LED3 0x00020013
49+#define ASUS_WMI_DEVID_LED4 0x00020014
50+#define ASUS_WMI_DEVID_LED5 0x00020015
51+#define ASUS_WMI_DEVID_LED6 0x00020016
52+
53+/* Backlight and Brightness */
54+#define ASUS_WMI_DEVID_ALS_ENABLE 0x00050001 /* Ambient Light Sensor */
55+#define ASUS_WMI_DEVID_BACKLIGHT 0x00050011
56+#define ASUS_WMI_DEVID_BRIGHTNESS 0x00050012
57+#define ASUS_WMI_DEVID_KBD_BACKLIGHT 0x00050021
58+#define ASUS_WMI_DEVID_LIGHT_SENSOR 0x00050022 /* ?? */
59+#define ASUS_WMI_DEVID_LIGHTBAR 0x00050025
60+
61+/* Misc */
62+#define ASUS_WMI_DEVID_CAMERA 0x00060013
63+
64+/* Storage */
65+#define ASUS_WMI_DEVID_CARDREADER 0x00080013
66+
67+/* Input */
68+#define ASUS_WMI_DEVID_TOUCHPAD 0x00100011
69+#define ASUS_WMI_DEVID_TOUCHPAD_LED 0x00100012
70+
71+/* Fan, Thermal */
72+#define ASUS_WMI_DEVID_THERMAL_CTRL 0x00110011
73+#define ASUS_WMI_DEVID_FAN_CTRL 0x00110012
74+
75+/* Power */
76+#define ASUS_WMI_DEVID_PROCESSOR_STATE 0x00120012
77+
78+/* Deep S3 / Resume on LID open */
79+#define ASUS_WMI_DEVID_LID_RESUME 0x00120031
80+
81+/* DSTS masks */
82+#define ASUS_WMI_DSTS_STATUS_BIT 0x00000001
83+#define ASUS_WMI_DSTS_UNKNOWN_BIT 0x00000002
84+#define ASUS_WMI_DSTS_PRESENCE_BIT 0x00010000
85+#define ASUS_WMI_DSTS_USER_BIT 0x00020000
86+#define ASUS_WMI_DSTS_BIOS_BIT 0x00040000
87+#define ASUS_WMI_DSTS_BRIGHTNESS_MASK 0x000000FF
88+#define ASUS_WMI_DSTS_MAX_BRIGTH_MASK 0x0000FF00
89+#define ASUS_WMI_DSTS_LIGHTBAR_MASK 0x0000000F
90+
91+#if IS_REACHABLE(CONFIG_ASUS_WMI)
92+int asus_wmi_evaluate_method(u32 method_id, u32 arg0, u32 arg1, u32 *retval);
93+#else
94+static inline int asus_wmi_evaluate_method(u32 method_id, u32 arg0, u32 arg1,
95+ u32 *retval)
96+{
97+ return -ENODEV;
98+}
99+#endif
100+
101+#endif /* __PLATFORM_DATA_X86_ASUS_WMI_H */
kernel/trace/trace_printk.c+1−1
@@ -115,7 +115,7 @@ static int module_trace_bprintk_format_notify(struct notifier_block *self, · 114 unmodified lines
115115 * section, then we need to read the link list pointers. The trick is
116116 * we pass the address of the string to the seq function just like
117117 * we do for the kernel core formats. To get back the structure that
118− * holds the format, we simply use containerof() and then go to the
118+ * holds the format, we simply use container_of() and then go to the
119119 * next format in the list.
120120 */
121121 static const char **