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 ...
Unified · Split
| @@ -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. | |
| @@ -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. | |
| @@ -376,7 +376,7 @@ F: drivers/platform/x86/i2c-multi-instantiate.c · 375 unmodified lines | ||
| 376 | 376 | ACPI PMIC DRIVERS |
| 377 | 377 | M: "Rafael J. Wysocki" <rjw@rjwysocki.net> |
| 378 | 378 | M: Len Brown <lenb@kernel.org> |
| 379 | −R: Andy Shevchenko <andy@infradead.org> | |
| 379 | +R: Andy Shevchenko <andriy.shevchenko@linux.intel.com> | |
| 380 | 380 | R: Mika Westerberg <mika.westerberg@linux.intel.com> |
| 381 | 381 | L: linux-acpi@vger.kernel.org |
| 382 | 382 | Q: https://patchwork.kernel.org/project/linux-acpi/list/ |
| @@ -4207,6 +4207,12 @@ M: Pali Rohár <pali.rohar@gmail.com> · 3824 unmodified lines | ||
| 4207 | 4207 | S: Maintained |
| 4208 | 4208 | F: drivers/platform/x86/dell-rbtn.* |
| 4209 | 4209 | |
| 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 | + | |
| 4210 | 4216 | DELL LAPTOP SMM DRIVER |
| 4211 | 4217 | M: Pali Rohár <pali.rohar@gmail.com> |
| 4212 | 4218 | S: Maintained |
| @@ -4214,10 +4220,11 @@ F: drivers/hwmon/dell-smm-hwmon.c · 1 unmodified line | ||
| 4214 | 4220 | F: include/uapi/linux/i8k.h |
| 4215 | 4221 | |
| 4216 | 4222 | 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 | |
| 4218 | 4225 | S: Maintained |
| 4219 | 4226 | F: Documentation/dcdbas.txt |
| 4220 | −F: drivers/firmware/dcdbas.* | |
| 4227 | +F: drivers/platform/x86/dcdbas.* | |
| 4221 | 4228 | |
| 4222 | 4229 | DELL WMI NOTIFICATIONS DRIVER |
| 4223 | 4230 | M: Matthew Garrett <mjg59@srcf.ucam.org> |
| @@ -7347,6 +7354,12 @@ L: alsa-devel@alsa-project.org (moderated for non-subscribers) · 3123 unmodified lines | ||
| 7347 | 7354 | S: Supported |
| 7348 | 7355 | F: sound/soc/intel/ |
| 7349 | 7356 | |
| 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 | + | |
| 7350 | 7363 | INTEL C600 SERIES SAS CONTROLLER DRIVER |
| 7351 | 7364 | M: Intel SCU Linux support <intel-linux-scu@intel.com> |
| 7352 | 7365 | M: Artur Paszkiewicz <artur.paszkiewicz@intel.com> |
| @@ -7533,7 +7546,6 @@ M: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com> · 180 unmodified lines | ||
| 7533 | 7546 | M: Vishwanath Somayaji <vishwanath.somayaji@intel.com> |
| 7534 | 7547 | L: platform-driver-x86@vger.kernel.org |
| 7535 | 7548 | S: Maintained |
| 7536 | −F: arch/x86/include/asm/pmc_core.h | |
| 7537 | 7549 | F: drivers/platform/x86/intel_pmc_core* |
| 7538 | 7550 | |
| 7539 | 7551 | INTEL PMC/P-Unit IPC DRIVER |
| @@ -7577,7 +7589,8 @@ F: drivers/infiniband/hw/i40iw/ · 37 unmodified lines | ||
| 7577 | 7589 | F: include/uapi/rdma/i40iw-abi.h |
| 7578 | 7590 | |
| 7579 | 7591 | 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> | |
| 7581 | 7594 | L: platform-driver-x86@vger.kernel.org |
| 7582 | 7595 | S: Maintained |
| 7583 | 7596 | F: arch/x86/include/asm/intel_telemetry.h |
| @@ -8310,6 +8323,14 @@ W: http://legousb.sourceforge.net/ · 726 unmodified lines | ||
| 8310 | 8323 | S: Maintained |
| 8311 | 8324 | F: drivers/usb/misc/legousbtower.c |
| 8312 | 8325 | |
| 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 | + | |
| 8313 | 8334 | LG2160 MEDIA DRIVER |
| 8314 | 8335 | M: Michael Krufky <mkrufky@linuxtv.org> |
| 8315 | 8336 | L: linux-media@vger.kernel.org |
| @@ -145,34 +145,6 @@ config EFI_PCDP · 144 unmodified lines | ||
| 145 | 145 | See DIG64_HCDPv20_042804.pdf available from |
| 146 | 146 | <http://www.dig64.org/specifications/> |
| 147 | 147 | |
| 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 | − | |
| 176 | 148 | config DMIID |
| 177 | 149 | bool "Export DMI identification via sysfs to userspace" |
| 178 | 150 | depends on DMI |
| @@ -11,8 +11,6 @@ obj-$(CONFIG_DMI) += dmi_scan.o · 10 unmodified lines | ||
| 11 | 11 | obj-$(CONFIG_DMI_SYSFS) += dmi-sysfs.o |
| 12 | 12 | obj-$(CONFIG_EDD) += edd.o |
| 13 | 13 | obj-$(CONFIG_EFI_PCDP) += pcdp.o |
| 14 | −obj-$(CONFIG_DELL_RBU) += dell_rbu.o | |
| 15 | −obj-$(CONFIG_DCDBAS) += dcdbas.o | |
| 16 | 14 | obj-$(CONFIG_DMIID) += dmi-id.o |
| 17 | 15 | obj-$(CONFIG_ISCSI_IBFT_FIND) += iscsi_ibft_find.o |
| 18 | 16 | obj-$(CONFIG_ISCSI_IBFT) += iscsi_ibft.o |
| @@ -149,6 +149,7 @@ config HID_APPLEIR · 148 unmodified lines | ||
| 149 | 149 | config HID_ASUS |
| 150 | 150 | tristate "Asus" |
| 151 | 151 | depends on LEDS_CLASS |
| 152 | + depends on ASUS_WMI || ASUS_WMI=n | |
| 152 | 153 | ---help--- |
| 153 | 154 | Support for Asus notebook built-in keyboard and touchpad via i2c, and |
| 154 | 155 | the Asus Republic of Gamers laptop keyboard special keys. |
| @@ -29,6 +29,7 @@ · 28 unmodified lines | ||
| 29 | 29 | #include <linux/dmi.h> |
| 30 | 30 | #include <linux/hid.h> |
| 31 | 31 | #include <linux/module.h> |
| 32 | +#include <linux/platform_data/x86/asus-wmi.h> | |
| 32 | 33 | #include <linux/input/mt.h> |
| 33 | 34 | #include <linux/usb.h> /* For to_usb_interface for T100 touchpad intf check */ |
| 34 | 35 | |
| @@ -349,6 +350,24 @@ static void asus_kbd_backlight_work(struct work_struct *work) · 314 unmodified lines | ||
| 349 | 350 | hid_err(led->hdev, "Asus failed to set keyboard backlight: %d\n", ret); |
| 350 | 351 | } |
| 351 | 352 | |
| 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 | + | |
| 352 | 371 | static int asus_kbd_register_leds(struct hid_device *hdev) |
| 353 | 372 | { |
| 354 | 373 | 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 | ||
| 436 | 455 | |
| 437 | 456 | drvdata->input = input; |
| 438 | 457 | |
| 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)) | |
| 440 | 461 | hid_warn(hdev, "Failed to initialize backlight.\n"); |
| 441 | 462 | |
| 442 | 463 | return 0; |
| @@ -60,7 +60,10 @@ config ACERHDF · 59 unmodified lines | ||
| 60 | 60 | |
| 61 | 61 | After loading this driver the BIOS is still in control of the fan. |
| 62 | 62 | 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". | |
| 64 | 67 | |
| 65 | 68 | For more information about this driver see |
| 66 | 69 | <http://piie.net/files/acerhdf_README.txt> |
| @@ -105,6 +108,22 @@ config ASUS_LAPTOP · 38 unmodified lines | ||
| 105 | 108 | |
| 106 | 109 | If you have an ACPI-compatible ASUS laptop, say Y or M here. |
| 107 | 110 | |
| 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 | + | |
| 108 | 127 | # |
| 109 | 128 | # The DELL_SMBIOS driver depends on ACPI_WMI and/or DCDBAS if those |
| 110 | 129 | # backends are selected. The "depends" line prevents a configuration |
| @@ -227,6 +246,18 @@ config DELL_RBTN · 116 unmodified lines | ||
| 227 | 246 | To compile this driver as a module, choose M here: the module will |
| 228 | 247 | be called dell-rbtn. |
| 229 | 248 | |
| 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 | + | |
| 230 | 261 | |
| 231 | 262 | config FUJITSU_LAPTOP |
| 232 | 263 | tristate "Fujitsu Laptop Extras" |
| @@ -336,6 +367,20 @@ config HP_WMI · 103 unmodified lines | ||
| 336 | 367 | To compile this driver as a module, choose M here: the module will |
| 337 | 368 | be called hp-wmi. |
| 338 | 369 | |
| 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 | + | |
| 339 | 384 | config MSI_LAPTOP |
| 340 | 385 | tristate "MSI Laptop Extras" |
| 341 | 386 | depends on ACPI |
| @@ -1231,6 +1276,18 @@ config I2C_MULTI_INSTANTIATE · 889 unmodified lines | ||
| 1231 | 1276 | To compile this driver as a module, choose M here: the module |
| 1232 | 1277 | will be called i2c-multi-instantiate. |
| 1233 | 1278 | |
| 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 | + | |
| 1234 | 1291 | endif # X86_PLATFORM_DEVICES |
| 1235 | 1292 | |
| 1236 | 1293 | config PMC_ATOM |
| @@ -9,9 +9,11 @@ obj-$(CONFIG_ASUS_NB_WMI) += asus-nb-wmi.o · 8 unmodified lines | ||
| 9 | 9 | obj-$(CONFIG_ASUS_WIRELESS) += asus-wireless.o |
| 10 | 10 | obj-$(CONFIG_EEEPC_LAPTOP) += eeepc-laptop.o |
| 11 | 11 | obj-$(CONFIG_EEEPC_WMI) += eeepc-wmi.o |
| 12 | +obj-$(CONFIG_LG_LAPTOP) += lg-laptop.o | |
| 12 | 13 | obj-$(CONFIG_MSI_LAPTOP) += msi-laptop.o |
| 13 | 14 | obj-$(CONFIG_ACPI_CMPC) += classmate-laptop.o |
| 14 | 15 | obj-$(CONFIG_COMPAL_LAPTOP) += compal-laptop.o |
| 16 | +obj-$(CONFIG_DCDBAS) += dcdbas.o | |
| 15 | 17 | obj-$(CONFIG_DELL_SMBIOS) += dell-smbios.o |
| 16 | 18 | dell-smbios-objs := dell-smbios-base.o |
| 17 | 19 | 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 | ||
| 23 | 25 | obj-$(CONFIG_DELL_WMI_LED) += dell-wmi-led.o |
| 24 | 26 | obj-$(CONFIG_DELL_SMO8800) += dell-smo8800.o |
| 25 | 27 | obj-$(CONFIG_DELL_RBTN) += dell-rbtn.o |
| 28 | +obj-$(CONFIG_DELL_RBU) += dell_rbu.o | |
| 26 | 29 | obj-$(CONFIG_ACER_WMI) += acer-wmi.o |
| 27 | 30 | obj-$(CONFIG_ACER_WIRELESS) += acer-wireless.o |
| 28 | 31 | obj-$(CONFIG_ACERHDF) += acerhdf.o |
| @@ -92,3 +95,4 @@ obj-$(CONFIG_MLX_PLATFORM) += mlx-platform.o · 63 unmodified lines | ||
| 92 | 95 | obj-$(CONFIG_INTEL_TURBO_MAX_3) += intel_turbo_max_3.o |
| 93 | 96 | obj-$(CONFIG_INTEL_CHTDC_TI_PWRBTN) += intel_chtdc_ti_pwrbtn.o |
| 94 | 97 | obj-$(CONFIG_I2C_MULTI_INSTANTIATE) += i2c-multi-instantiate.o |
| 98 | +obj-$(CONFIG_INTEL_ATOMISP2_PM) += intel_atomisp2_pm.o | |
| @@ -86,6 +86,7 @@ static unsigned int interval = 10; · 85 unmodified lines | ||
| 86 | 86 | static unsigned int fanon = 60000; |
| 87 | 87 | static unsigned int fanoff = 53000; |
| 88 | 88 | static unsigned int verbose; |
| 89 | +static unsigned int list_supported; | |
| 89 | 90 | static unsigned int fanstate = ACERHDF_FAN_AUTO; |
| 90 | 91 | static char force_bios[16]; |
| 91 | 92 | static char force_product[16]; |
| @@ -104,10 +105,12 @@ module_param(fanoff, uint, 0600); · 12 unmodified lines | ||
| 104 | 105 | MODULE_PARM_DESC(fanoff, "Turn the fan off below this temperature"); |
| 105 | 106 | module_param(verbose, uint, 0600); |
| 106 | 107 | 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"); | |
| 107 | 110 | 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"); | |
| 109 | 112 | 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"); | |
| 111 | 114 | |
| 112 | 115 | /* |
| 113 | 116 | * 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 | ||
| 130 | 133 | .moff = 0xff, |
| 131 | 134 | }; |
| 132 | 135 | |
| 133 | −/* BIOS settings */ | |
| 136 | +/* BIOS settings - only used during probe */ | |
| 134 | 137 | struct bios_settings { |
| 135 | 138 | const char *vendor; |
| 136 | 139 | const char *product; |
| @@ -141,8 +144,18 @@ struct bios_settings { · 4 unmodified lines | ||
| 141 | 144 | int mcmd_enable; |
| 142 | 145 | }; |
| 143 | 146 | |
| 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 | + | |
| 144 | 157 | /* 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 = { | |
| 146 | 159 | /* AOA110 */ |
| 147 | 160 | {"Acer", "AOA110", "v0.3109", 0x55, 0x58, {0x1f, 0x00}, 0}, |
| 148 | 161 | {"Acer", "AOA110", "v0.3114", 0x55, 0x58, {0x1f, 0x00}, 0}, |
| @@ -233,6 +246,7 @@ static const struct bios_settings bios_tbl[] = { · 84 unmodified lines | ||
| 233 | 246 | {"Gateway", "LT31", "v1.3201", 0x55, 0x58, {0x9e, 0x00}, 0}, |
| 234 | 247 | {"Gateway", "LT31", "v1.3302", 0x55, 0x58, {0x9e, 0x00}, 0}, |
| 235 | 248 | {"Gateway", "LT31", "v1.3303t", 0x55, 0x58, {0x9e, 0x00}, 0}, |
| 249 | + {"Gateway", "LT31", "v1.3307", 0x55, 0x58, {0x9e, 0x00}, 0}, | |
| 236 | 250 | /* Packard Bell */ |
| 237 | 251 | {"Packard Bell", "DOA150", "v0.3104", 0x55, 0x58, {0x21, 0x00}, 0}, |
| 238 | 252 | {"Packard Bell", "DOA150", "v0.3105", 0x55, 0x58, {0x20, 0x00}, 0}, |
| @@ -256,8 +270,6 @@ static const struct bios_settings bios_tbl[] = { · 17 unmodified lines | ||
| 256 | 270 | {"", "", "", 0, 0, {0, 0}, 0} |
| 257 | 271 | }; |
| 258 | 272 | |
| 259 | −static const struct bios_settings *bios_cfg __read_mostly; | |
| 260 | − | |
| 261 | 273 | /* |
| 262 | 274 | * this struct is used to instruct thermal layer to use bang_bang instead of |
| 263 | 275 | * default governor for acerhdf |
| @@ -270,7 +282,7 @@ static int acerhdf_get_temp(int *temp) · 6 unmodified lines | ||
| 270 | 282 | { |
| 271 | 283 | u8 read_temp; |
| 272 | 284 | |
| 273 | − if (ec_read(bios_cfg->tempreg, &read_temp)) | |
| 285 | + if (ec_read(ctrl_cfg.tempreg, &read_temp)) | |
| 274 | 286 | return -EINVAL; |
| 275 | 287 | |
| 276 | 288 | *temp = read_temp * 1000; |
| @@ -282,10 +294,10 @@ static int acerhdf_get_fanstate(int *state) · 5 unmodified lines | ||
| 282 | 294 | { |
| 283 | 295 | u8 fan; |
| 284 | 296 | |
| 285 | − if (ec_read(bios_cfg->fanreg, &fan)) | |
| 297 | + if (ec_read(ctrl_cfg.fanreg, &fan)) | |
| 286 | 298 | return -EINVAL; |
| 287 | 299 | |
| 288 | − if (fan != bios_cfg->cmd.cmd_off) | |
| 300 | + if (fan != ctrl_cfg.cmd.cmd_off) | |
| 289 | 301 | *state = ACERHDF_FAN_AUTO; |
| 290 | 302 | else |
| 291 | 303 | *state = ACERHDF_FAN_OFF; |
| @@ -306,13 +318,13 @@ static void acerhdf_change_fanstate(int state) · 14 unmodified lines | ||
| 306 | 318 | state = ACERHDF_FAN_AUTO; |
| 307 | 319 | } |
| 308 | 320 | |
| 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; | |
| 311 | 323 | fanstate = state; |
| 312 | 324 | |
| 313 | − ec_write(bios_cfg->fanreg, cmd); | |
| 325 | + ec_write(ctrl_cfg.fanreg, cmd); | |
| 314 | 326 | |
| 315 | − if (bios_cfg->mcmd_enable && state == ACERHDF_FAN_OFF) { | |
| 327 | + if (ctrl_cfg.mcmd_enable && state == ACERHDF_FAN_OFF) { | |
| 316 | 328 | if (verbose) |
| 317 | 329 | pr_notice("turning off fan manually\n"); |
| 318 | 330 | ec_write(mcmd.mreg, mcmd.moff); |
| @@ -615,10 +627,11 @@ static int str_starts_with(const char *str, const char *start) · 296 unmodified lines | ||
| 615 | 627 | } |
| 616 | 628 | |
| 617 | 629 | /* check hardware */ |
| 618 | −static int acerhdf_check_hardware(void) | |
| 630 | +static int __init acerhdf_check_hardware(void) | |
| 619 | 631 | { |
| 620 | 632 | char const *vendor, *version, *product; |
| 621 | 633 | const struct bios_settings *bt = NULL; |
| 634 | + int found = 0; | |
| 622 | 635 | |
| 623 | 636 | /* get BIOS data */ |
| 624 | 637 | vendor = dmi_get_system_info(DMI_SYS_VENDOR); |
| @@ -632,6 +645,17 @@ static int acerhdf_check_hardware(void) · 7 unmodified lines | ||
| 632 | 645 | |
| 633 | 646 | pr_info("Acer Aspire One Fan driver, v.%s\n", DRV_VER); |
| 634 | 647 | |
| 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 | + | |
| 635 | 659 | if (force_bios[0]) { |
| 636 | 660 | version = force_bios; |
| 637 | 661 | pr_info("forcing BIOS version: %s\n", version); |
| @@ -657,30 +681,36 @@ static int acerhdf_check_hardware(void) · 19 unmodified lines | ||
| 657 | 681 | if (str_starts_with(vendor, bt->vendor) && |
| 658 | 682 | str_starts_with(product, bt->product) && |
| 659 | 683 | str_starts_with(version, bt->version)) { |
| 660 | − bios_cfg = bt; | |
| 684 | + found = 1; | |
| 661 | 685 | break; |
| 662 | 686 | } |
| 663 | 687 | } |
| 664 | 688 | |
| 665 | − if (!bios_cfg) { | |
| 689 | + if (!found) { | |
| 666 | 690 | pr_err("unknown (unsupported) BIOS version %s/%s/%s, please report, aborting!\n", |
| 667 | 691 | vendor, product, version); |
| 668 | 692 | return -EINVAL; |
| 669 | 693 | } |
| 670 | 694 | |
| 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 | + | |
| 671 | 701 | /* |
| 672 | 702 | * if started with kernel mode off, prevent the kernel from switching |
| 673 | 703 | * off the fan |
| 674 | 704 | */ |
| 675 | 705 | if (!kernelmode) { |
| 676 | 706 | 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"); | |
| 678 | 708 | } |
| 679 | 709 | |
| 680 | 710 | return 0; |
| 681 | 711 | } |
| 682 | 712 | |
| 683 | −static int acerhdf_register_platform(void) | |
| 713 | +static int __init acerhdf_register_platform(void) | |
| 684 | 714 | { |
| 685 | 715 | int err = 0; |
| 686 | 716 | |
| @@ -712,7 +742,7 @@ static void acerhdf_unregister_platform(void) · 25 unmodified lines | ||
| 712 | 742 | platform_driver_unregister(&acerhdf_driver); |
| 713 | 743 | } |
| 714 | 744 | |
| 715 | −static int acerhdf_register_thermal(void) | |
| 745 | +static int __init acerhdf_register_thermal(void) | |
| 716 | 746 | { |
| 717 | 747 | cl_dev = thermal_cooling_device_register("acerhdf-fan", NULL, |
| 718 | 748 | &acerhdf_cooling_ops); |
| @@ -43,6 +43,7 @@ · 42 unmodified lines | ||
| 43 | 43 | #include <linux/hwmon-sysfs.h> |
| 44 | 44 | #include <linux/debugfs.h> |
| 45 | 45 | #include <linux/seq_file.h> |
| 46 | +#include <linux/platform_data/x86/asus-wmi.h> | |
| 46 | 47 | #include <linux/platform_device.h> |
| 47 | 48 | #include <linux/thermal.h> |
| 48 | 49 | #include <linux/acpi.h> |
| @@ -69,89 +70,6 @@ MODULE_LICENSE("GPL"); · 20 unmodified lines | ||
| 69 | 70 | #define NOTIFY_KBD_BRTDWN 0xc5 |
| 70 | 71 | #define NOTIFY_KBD_BRTTOGGLE 0xc7 |
| 71 | 72 | |
| 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 | − | |
| 155 | 73 | #define ASUS_FAN_DESC "cpu_fan" |
| 156 | 74 | #define ASUS_FAN_MFUN 0x13 |
| 157 | 75 | #define ASUS_FAN_SFUN_READ 0x06 |
| @@ -239,7 +157,6 @@ struct asus_wmi { · 81 unmodified lines | ||
| 239 | 157 | int lightbar_led_wk; |
| 240 | 158 | struct workqueue_struct *led_workqueue; |
| 241 | 159 | struct work_struct tpd_led_work; |
| 242 | − struct work_struct kbd_led_work; | |
| 243 | 160 | struct work_struct wlan_led_work; |
| 244 | 161 | struct work_struct lightbar_led_work; |
| 245 | 162 | |
| @@ -302,8 +219,7 @@ static void asus_wmi_input_exit(struct asus_wmi *asus) · 56 unmodified lines | ||
| 302 | 219 | asus->inputdev = NULL; |
| 303 | 220 | } |
| 304 | 221 | |
| 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) | |
| 307 | 223 | { |
| 308 | 224 | struct bios_args args = { |
| 309 | 225 | .arg0 = arg0, |
| @@ -339,6 +255,7 @@ exit: · 29 unmodified lines | ||
| 339 | 255 | |
| 340 | 256 | return 0; |
| 341 | 257 | } |
| 258 | +EXPORT_SYMBOL_GPL(asus_wmi_evaluate_method); | |
| 342 | 259 | |
| 343 | 260 | static int asus_wmi_evaluate_method_agfn(const struct acpi_buffer args) |
| 344 | 261 | { |
| @@ -456,12 +373,9 @@ static enum led_brightness tpd_led_get(struct led_classdev *led_cdev) · 111 unmodified lines | ||
| 456 | 373 | return read_tpd_led_state(asus); |
| 457 | 374 | } |
| 458 | 375 | |
| 459 | −static void kbd_led_update(struct work_struct *work) | |
| 376 | +static void kbd_led_update(struct asus_wmi *asus) | |
| 460 | 377 | { |
| 461 | 378 | int ctrl_param = 0; |
| 462 | − struct asus_wmi *asus; | |
| 463 | − | |
| 464 | − asus = container_of(work, struct asus_wmi, kbd_led_work); | |
| 465 | 379 | |
| 466 | 380 | /* |
| 467 | 381 | * bits 0-2: level |
| @@ -471,7 +385,6 @@ static void kbd_led_update(struct work_struct *work) · 3 unmodified lines | ||
| 471 | 385 | ctrl_param = 0x80 | (asus->kbd_led_wk & 0x7F); |
| 472 | 386 | |
| 473 | 387 | 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); | |
| 475 | 388 | } |
| 476 | 389 | |
| 477 | 390 | 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 | ||
| 516 | 429 | value = 0; |
| 517 | 430 | |
| 518 | 431 | asus->kbd_led_wk = value; |
| 519 | − queue_work(asus->led_workqueue, &asus->kbd_led_work); | |
| 432 | + kbd_led_update(asus); | |
| 520 | 433 | } |
| 521 | 434 | |
| 522 | 435 | 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 | ||
| 525 | 438 | do_kbd_led_set(led_cdev, value); |
| 526 | 439 | } |
| 527 | 440 | |
| 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 | + | |
| 528 | 449 | static enum led_brightness kbd_led_get(struct led_classdev *led_cdev) |
| 529 | 450 | { |
| 530 | 451 | struct asus_wmi *asus; |
| @@ -671,8 +592,6 @@ static int asus_wmi_led_init(struct asus_wmi *asus) · 140 unmodified lines | ||
| 671 | 592 | |
| 672 | 593 | led_val = kbd_led_read(asus, NULL, NULL); |
| 673 | 594 | if (led_val >= 0) { |
| 674 | − INIT_WORK(&asus->kbd_led_work, kbd_led_update); | |
| 675 | − | |
| 676 | 595 | asus->kbd_led_wk = led_val; |
| 677 | 596 | asus->kbd_led.name = "asus::kbd_backlight"; |
| 678 | 597 | asus->kbd_led.flags = LED_BRIGHT_HW_CHANGED; |
| @@ -1746,18 +1665,18 @@ static void asus_wmi_notify(u32 value, void *context) · 1067 unmodified lines | ||
| 1746 | 1665 | } |
| 1747 | 1666 | |
| 1748 | 1667 | 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); | |
| 1750 | 1669 | goto exit; |
| 1751 | 1670 | } |
| 1752 | 1671 | 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); | |
| 1754 | 1673 | goto exit; |
| 1755 | 1674 | } |
| 1756 | 1675 | if (code == NOTIFY_KBD_BRTTOGGLE) { |
| 1757 | 1676 | 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); | |
| 1759 | 1678 | 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); | |
| 1761 | 1680 | goto exit; |
| 1762 | 1681 | } |
| 1763 | 1682 | |
| @@ -2291,7 +2210,7 @@ static int asus_hotk_resume(struct device *device) · 527 unmodified lines | ||
| 2291 | 2210 | struct asus_wmi *asus = dev_get_drvdata(device); |
| 2292 | 2211 | |
| 2293 | 2212 | if (!IS_ERR_OR_NULL(asus->kbd_led.dev)) |
| 2294 | − queue_work(asus->led_workqueue, &asus->kbd_led_work); | |
| 2213 | + kbd_led_update(asus); | |
| 2295 | 2214 | |
| 2296 | 2215 | return 0; |
| 2297 | 2216 | } |
| @@ -2327,7 +2246,7 @@ static int asus_hotk_restore(struct device *device) · 29 unmodified lines | ||
| 2327 | 2246 | rfkill_set_sw_state(asus->uwb.rfkill, bl); |
| 2328 | 2247 | } |
| 2329 | 2248 | if (!IS_ERR_OR_NULL(asus->kbd_led.dev)) |
| 2330 | − queue_work(asus->led_workqueue, &asus->kbd_led_work); | |
| 2249 | + kbd_led_update(asus); | |
| 2331 | 2250 | |
| 2332 | 2251 | return 0; |
| 2333 | 2252 | } |
| @@ -21,11 +21,13 @@ · 20 unmodified lines | ||
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | 23 | #include <linux/platform_device.h> |
| 24 | +#include <linux/acpi.h> | |
| 24 | 25 | #include <linux/dma-mapping.h> |
| 25 | 26 | #include <linux/errno.h> |
| 26 | 27 | #include <linux/cpu.h> |
| 27 | 28 | #include <linux/gfp.h> |
| 28 | 29 | #include <linux/init.h> |
| 30 | +#include <linux/io.h> | |
| 29 | 31 | #include <linux/kernel.h> |
| 30 | 32 | #include <linux/mc146818rtc.h> |
| 31 | 33 | #include <linux/module.h> |
| @@ -36,12 +38,11 @@ · 4 unmodified lines | ||
| 36 | 38 | #include <linux/string.h> |
| 37 | 39 | #include <linux/types.h> |
| 38 | 40 | #include <linux/mutex.h> |
| 39 | −#include <asm/io.h> | |
| 40 | 41 | |
| 41 | 42 | #include "dcdbas.h" |
| 42 | 43 | |
| 43 | 44 | #define DRIVER_NAME "dcdbas" |
| 44 | −#define DRIVER_VERSION "5.6.0-3.2" | |
| 45 | +#define DRIVER_VERSION "5.6.0-3.3" | |
| 45 | 46 | #define DRIVER_DESCRIPTION "Dell Systems Management Base Driver" |
| 46 | 47 | |
| 47 | 48 | static struct platform_device *dcdbas_pdev; |
| @@ -49,19 +50,23 @@ static struct platform_device *dcdbas_pdev; · 1 unmodified line | ||
| 49 | 50 | static u8 *smi_data_buf; |
| 50 | 51 | static dma_addr_t smi_data_buf_handle; |
| 51 | 52 | static unsigned long smi_data_buf_size; |
| 53 | +static unsigned long max_smi_data_buf_size = MAX_SMI_DATA_BUF_SIZE; | |
| 52 | 54 | static u32 smi_data_buf_phys_addr; |
| 53 | 55 | static DEFINE_MUTEX(smi_data_lock); |
| 56 | +static u8 *eps_buffer; | |
| 54 | 57 | |
| 55 | 58 | static unsigned int host_control_action; |
| 56 | 59 | static unsigned int host_control_smi_type; |
| 57 | 60 | static unsigned int host_control_on_shutdown; |
| 58 | 61 | |
| 62 | +static bool wsmt_enabled; | |
| 63 | + | |
| 59 | 64 | /** |
| 60 | 65 | * smi_data_buf_free: free SMI data buffer |
| 61 | 66 | */ |
| 62 | 67 | static void smi_data_buf_free(void) |
| 63 | 68 | { |
| 64 | − if (!smi_data_buf) | |
| 69 | + if (!smi_data_buf || wsmt_enabled) | |
| 65 | 70 | return; |
| 66 | 71 | |
| 67 | 72 | 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 | ||
| 86 | 91 | if (smi_data_buf_size >= size) |
| 87 | 92 | return 0; |
| 88 | 93 | |
| 89 | − if (size > MAX_SMI_DATA_BUF_SIZE) | |
| 94 | + if (size > max_smi_data_buf_size) | |
| 90 | 95 | return -EINVAL; |
| 91 | 96 | |
| 92 | 97 | /* new buffer is needed */ |
| @@ -169,7 +174,7 @@ static ssize_t smi_data_write(struct file *filp, struct kobject *kobj, · 76 unmodified lines | ||
| 169 | 174 | { |
| 170 | 175 | ssize_t ret; |
| 171 | 176 | |
| 172 | − if ((pos + count) > MAX_SMI_DATA_BUF_SIZE) | |
| 177 | + if ((pos + count) > max_smi_data_buf_size) | |
| 173 | 178 | return -EINVAL; |
| 174 | 179 | |
| 175 | 180 | mutex_lock(&smi_data_lock); |
| @@ -322,8 +327,20 @@ static ssize_t smi_request_store(struct device *dev, · 146 unmodified lines | ||
| 322 | 327 | ret = count; |
| 323 | 328 | break; |
| 324 | 329 | 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); | |
| 327 | 344 | ret = dcdbas_smi_request(smi_cmd); |
| 328 | 345 | if (!ret) |
| 329 | 346 | ret = count; |
| @@ -482,6 +499,93 @@ static void dcdbas_host_control(void) · 152 unmodified lines | ||
| 482 | 499 | } |
| 483 | 500 | } |
| 484 | 501 | |
| 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 | + | |
| 485 | 589 | /** |
| 486 | 590 | * dcdbas_reboot_notify: handle reboot notification for host control |
| 487 | 591 | */ |
| @@ -548,6 +652,11 @@ static int dcdbas_probe(struct platform_device *dev) · 60 unmodified lines | ||
| 548 | 652 | |
| 549 | 653 | dcdbas_pdev = dev; |
| 550 | 654 | |
| 655 | + /* Check if ACPI WSMT table specifies protected SMI buffer address */ | |
| 656 | + error = dcdbas_check_wsmt(); | |
| 657 | + if (error < 0) | |
| 658 | + return error; | |
| 659 | + | |
| 551 | 660 | /* |
| 552 | 661 | * BIOS SMI calls require buffer addresses be in 32-bit address space. |
| 553 | 662 | * This is done by setting the DMA mask below. |
| @@ -635,6 +744,8 @@ static void __exit dcdbas_exit(void) · 81 unmodified lines | ||
| 635 | 744 | */ |
| 636 | 745 | if (dcdbas_pdev) |
| 637 | 746 | smi_data_buf_free(); |
| 747 | + if (eps_buffer) | |
| 748 | + memunmap(eps_buffer); | |
| 638 | 749 | platform_device_unregister(dcdbas_pdev_reg); |
| 639 | 750 | platform_driver_unregister(&dcdbas_driver); |
| 640 | 751 | } |
| @@ -53,6 +53,7 @@ · 52 unmodified lines | ||
| 53 | 53 | #define EXPIRED_TIMER (0) |
| 54 | 54 | |
| 55 | 55 | #define SMI_CMD_MAGIC (0x534D4931) |
| 56 | +#define SMM_EPS_SIG "$SCB" | |
| 56 | 57 | |
| 57 | 58 | #define DCDBAS_DEV_ATTR_RW(_name) \ |
| 58 | 59 | DEVICE_ATTR(_name,0600,_name##_show,_name##_store); |
| @@ -103,5 +104,14 @@ struct apm_cmd { · 44 unmodified lines | ||
| 103 | 104 | |
| 104 | 105 | int dcdbas_smi_request(struct smi_cmd *smi_cmd); |
| 105 | 106 | |
| 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 | + | |
| 106 | 116 | #endif /* _DCDBAS_H_ */ |
| 107 | 117 | |
| @@ -18,7 +18,7 @@ · 17 unmodified lines | ||
| 18 | 18 | #include <linux/module.h> |
| 19 | 19 | #include <linux/mutex.h> |
| 20 | 20 | #include <linux/platform_device.h> |
| 21 | −#include "../../firmware/dcdbas.h" | |
| 21 | +#include "dcdbas.h" | |
| 22 | 22 | #include "dell-smbios.h" |
| 23 | 23 | |
| 24 | 24 | static int da_command_address; |
| @@ -45,6 +45,7 @@ · 44 unmodified lines | ||
| 45 | 45 | #include <linux/moduleparam.h> |
| 46 | 46 | #include <linux/firmware.h> |
| 47 | 47 | #include <linux/dma-mapping.h> |
| 48 | +#include <asm/set_memory.h> | |
| 48 | 49 | |
| 49 | 50 | MODULE_AUTHOR("Abhay Salunke <abhay_salunke@dell.com>"); |
| 50 | 51 | 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 | ||
| 181 | 182 | packet_data_temp_buf = NULL; |
| 182 | 183 | } |
| 183 | 184 | } |
| 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 | + | |
| 184 | 190 | spin_lock(&rbu_data.lock); |
| 185 | 191 | |
| 186 | 192 | newpacket->data = packet_data_temp_buf; |
| @@ -349,6 +355,8 @@ static void packet_empty_list(void) · 162 unmodified lines | ||
| 349 | 355 | * to make sure there are no stale RBU packets left in memory |
| 350 | 356 | */ |
| 351 | 357 | memset(newpacket->data, 0, rbu_data.packetsize); |
| 358 | + set_memory_wb((unsigned long)newpacket->data, | |
| 359 | + 1 << newpacket->ordernum); | |
| 352 | 360 | free_pages((unsigned long) newpacket->data, |
| 353 | 361 | newpacket->ordernum); |
| 354 | 362 | kfree(newpacket); |
| @@ -212,7 +212,7 @@ static int read_ec_data(acpi_handle handle, int cmd, unsigned long *data) · 211 unmodified lines | ||
| 212 | 212 | return 0; |
| 213 | 213 | } |
| 214 | 214 | } |
| 215 | − pr_err("timeout in read_ec_cmd\n"); | |
| 215 | + pr_err("timeout in %s\n", __func__); | |
| 216 | 216 | return -1; |
| 217 | 217 | } |
| 218 | 218 | |
| @@ -1146,6 +1146,13 @@ static const struct dmi_system_id no_hw_rfkill_list[] = { · 927 unmodified lines | ||
| 1146 | 1146 | DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Y520-15IKBM"), |
| 1147 | 1147 | }, |
| 1148 | 1148 | }, |
| 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 | + }, | |
| 1149 | 1156 | { |
| 1150 | 1157 | .ident = "Lenovo Legion Y720-15IKB", |
| 1151 | 1158 | .matches = { |
| @@ -1,19 +1,9 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0+ | |
| 1 | 2 | /* |
| 2 | 3 | * Intel HID event & 5 button array driver |
| 3 | 4 | * |
| 4 | 5 | * Copyright (C) 2015 Alex Hung <alex.hung@canonical.com> |
| 5 | 6 | * 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 | − * | |
| 17 | 7 | */ |
| 18 | 8 | |
| 19 | 9 | #include <linux/acpi.h> |
| @@ -1,26 +1,11 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0+ | |
| 1 | 2 | /* |
| 2 | 3 | * 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. | |
| 17 | 4 | */ |
| 18 | 5 | |
| 19 | − | |
| 20 | −#include <linux/init.h> | |
| 6 | +#include <linux/acpi.h> | |
| 21 | 7 | #include <linux/module.h> |
| 22 | 8 | #include <linux/slab.h> |
| 23 | −#include <linux/acpi.h> | |
| 24 | 9 | |
| 25 | 10 | MODULE_LICENSE("GPL"); |
| 26 | 11 | |
| @@ -53,12 +38,10 @@ static ssize_t irst_store_wakeup_events(struct device *dev, · 26 unmodified lines | ||
| 53 | 38 | acpi = to_acpi_device(dev); |
| 54 | 39 | |
| 55 | 40 | error = kstrtoul(buf, 0, &value); |
| 56 | − | |
| 57 | 41 | if (error) |
| 58 | 42 | return error; |
| 59 | 43 | |
| 60 | 44 | status = acpi_execute_simple_method(acpi->handle, "SFFS", value); |
| 61 | − | |
| 62 | 45 | if (ACPI_FAILURE(status)) |
| 63 | 46 | return -EINVAL; |
| 64 | 47 | |
| @@ -99,12 +82,10 @@ static ssize_t irst_store_wakeup_time(struct device *dev, · 34 unmodified lines | ||
| 99 | 82 | acpi = to_acpi_device(dev); |
| 100 | 83 | |
| 101 | 84 | error = kstrtoul(buf, 0, &value); |
| 102 | − | |
| 103 | 85 | if (error) |
| 104 | 86 | return error; |
| 105 | 87 | |
| 106 | 88 | status = acpi_execute_simple_method(acpi->handle, "SFTV", value); |
| 107 | − | |
| 108 | 89 | if (ACPI_FAILURE(status)) |
| 109 | 90 | return -EINVAL; |
| 110 | 91 | |
| @@ -1,25 +1,10 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0+ | |
| 1 | 2 | /* |
| 2 | 3 | * 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. | |
| 17 | 4 | */ |
| 18 | 5 | |
| 19 | − | |
| 20 | −#include <linux/init.h> | |
| 21 | −#include <linux/module.h> | |
| 22 | 6 | #include <linux/acpi.h> |
| 7 | +#include <linux/module.h> | |
| 23 | 8 | |
| 24 | 9 | MODULE_LICENSE("GPL"); |
| 25 | 10 | |
| @@ -44,6 +29,7 @@ static const struct acpi_device_id smartconnect_ids[] = { · 18 unmodified lines | ||
| 44 | 29 | {"INT33A0", 0}, |
| 45 | 30 | {"", 0} |
| 46 | 31 | }; |
| 32 | +MODULE_DEVICE_TABLE(acpi, smartconnect_ids); | |
| 47 | 33 | |
| 48 | 34 | static struct acpi_driver smartconnect_driver = { |
| 49 | 35 | .owner = THIS_MODULE, |
| @@ -56,5 +42,3 @@ static struct acpi_driver smartconnect_driver = { · 6 unmodified lines | ||
| 56 | 42 | }; |
| 57 | 43 | |
| 58 | 44 | module_acpi_driver(smartconnect_driver); |
| 59 | − | |
| 60 | −MODULE_DEVICE_TABLE(acpi, smartconnect_ids); | |
| @@ -1,16 +1,8 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | 3 | * WMI Thunderbolt driver |
| 3 | 4 | * |
| 4 | 5 | * 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. | |
| 14 | 6 | */ |
| 15 | 7 | |
| 16 | 8 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| @@ -38,12 +30,16 @@ static ssize_t force_power_store(struct device *dev, · 21 unmodified lines | ||
| 38 | 30 | input.length = sizeof(u8); |
| 39 | 31 | input.pointer = &mode; |
| 40 | 32 | mode = hex_to_bin(buf[0]); |
| 33 | + dev_dbg(dev, "force_power: storing %#x\n", mode); | |
| 41 | 34 | if (mode == 0 || mode == 1) { |
| 42 | 35 | status = wmi_evaluate_method(INTEL_WMI_THUNDERBOLT_GUID, 0, 1, |
| 43 | 36 | &input, NULL); |
| 44 | − if (ACPI_FAILURE(status)) | |
| 37 | + if (ACPI_FAILURE(status)) { | |
| 38 | + dev_dbg(dev, "force_power: failed to evaluate ACPI method\n"); | |
| 45 | 39 | return -ENODEV; |
| 40 | + } | |
| 46 | 41 | } else { |
| 42 | + dev_dbg(dev, "force_power: unsupported mode\n"); | |
| 47 | 43 | return -EINVAL; |
| 48 | 44 | } |
| 49 | 45 | return count; |
| @@ -95,4 +91,4 @@ module_wmi_driver(intel_wmi_thunderbolt_driver); · 45 unmodified lines | ||
| 95 | 91 | MODULE_ALIAS("wmi:" INTEL_WMI_THUNDERBOLT_GUID); |
| 96 | 92 | MODULE_AUTHOR("Mario Limonciello <mario.limonciello@dell.com>"); |
| 97 | 93 | MODULE_DESCRIPTION("Intel WMI Thunderbolt force power driver"); |
| 98 | −MODULE_LICENSE("GPL"); | |
| 94 | +MODULE_LICENSE("GPL v2"); | |
| @@ -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"); | |
| @@ -1,21 +1,12 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | − * intel_bxtwc_tmu.c - Intel BXT Whiskey Cove PMIC TMU driver | |
| 3 | + * Intel BXT Whiskey Cove PMIC TMU driver | |
| 3 | 4 | * |
| 4 | 5 | * Copyright (C) 2016 Intel Corporation. All rights reserved. |
| 5 | 6 | * |
| 6 | 7 | * This driver adds TMU (Time Management Unit) support for Intel BXT platform. |
| 7 | 8 | * It enables the alarm wake-up functionality in the TMU unit of Whiskey Cove |
| 8 | 9 | * 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 | − * | |
| 19 | 10 | */ |
| 20 | 11 | |
| 21 | 12 | #include <linux/module.h> |
| @@ -1,12 +1,9 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | 3 | * Intel Cherry Trail ACPI INT33FE pseudo device driver |
| 3 | 4 | * |
| 4 | 5 | * Copyright (C) 2017 Hans de Goede <hdegoede@redhat.com> |
| 5 | 6 | * |
| 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 | − * | |
| 10 | 7 | * Some Intel Cherry Trail based device which ship with Windows 10, have |
| 11 | 8 | * this weird INT33FE ACPI device with a CRS table with 4 I2cSerialBusV2 |
| 12 | 9 | * resources, for 4 different chips attached to various i2c busses: |
| @@ -257,4 +254,4 @@ module_platform_driver(cht_int33fe_driver); · 244 unmodified lines | ||
| 257 | 254 | |
| 258 | 255 | MODULE_DESCRIPTION("Intel Cherry Trail ACPI INT33FE pseudo device driver"); |
| 259 | 256 | MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>"); |
| 260 | −MODULE_LICENSE("GPL"); | |
| 257 | +MODULE_LICENSE("GPL v2"); | |
| @@ -1,3 +1,4 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | 3 | * Power-button driver for Dollar Cove TI PMIC |
| 3 | 4 | * Copyright (C) 2014 Intel Corp |
| @@ -1,3 +1,4 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | 3 | * Intel INT0002 "Virtual GPIO" driver |
| 3 | 4 | * |
| @@ -9,10 +10,6 @@ · 5 unmodified lines | ||
| 9 | 10 | * |
| 10 | 11 | * Author: Dyut Kumar Sil <dyut.k.sil@intel.com> |
| 11 | 12 | * |
| 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 | − * | |
| 16 | 13 | * Some peripherals on Bay Trail and Cherry Trail platforms signal a Power |
| 17 | 14 | * Management Event (PME) to the Power Management Controller (PMC) to wakeup |
| 18 | 15 | * the system. When this happens software needs to clear the PME bus 0 status |
| @@ -57,11 +54,7 @@ · 38 unmodified lines | ||
| 57 | 54 | #define ICPU(model) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, } |
| 58 | 55 | |
| 59 | 56 | 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 */ | |
| 65 | 58 | ICPU(INTEL_FAM6_ATOM_AIRMONT), /* Braswell, Cherry Trail */ |
| 66 | 59 | {} |
| 67 | 60 | }; |
| @@ -110,6 +103,21 @@ static void int0002_irq_mask(struct irq_data *data) · 42 unmodified lines | ||
| 110 | 103 | outl(gpe_en_reg, GPE0A_EN_PORT); |
| 111 | 104 | } |
| 112 | 105 | |
| 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 | + | |
| 113 | 121 | static irqreturn_t int0002_irq(int irq, void *data) |
| 114 | 122 | { |
| 115 | 123 | struct gpio_chip *chip = data; |
| @@ -132,6 +140,7 @@ static struct irq_chip int0002_irqchip = { · 16 unmodified lines | ||
| 132 | 140 | .irq_ack = int0002_irq_ack, |
| 133 | 141 | .irq_mask = int0002_irq_mask, |
| 134 | 142 | .irq_unmask = int0002_irq_unmask, |
| 143 | + .irq_set_wake = int0002_irq_set_wake, | |
| 135 | 144 | }; |
| 136 | 145 | |
| 137 | 146 | static int int0002_probe(struct platform_device *pdev) |
| @@ -216,4 +225,4 @@ module_platform_driver(int0002_driver); · 78 unmodified lines | ||
| 216 | 225 | |
| 217 | 226 | MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>"); |
| 218 | 227 | MODULE_DESCRIPTION("Intel INT0002 Virtual GPIO driver"); |
| 219 | −MODULE_LICENSE("GPL"); | |
| 228 | +MODULE_LICENSE("GPL v2"); | |
| @@ -1,18 +1,7 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | 3 | * Copyright (c) 2009-2010 Intel Corporation |
| 3 | 4 | * |
| 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 | − * | |
| 16 | 5 | * Authors: |
| 17 | 6 | * Jesse Barnes <jbarnes@virtuousgeek.org> |
| 18 | 7 | */ |
| @@ -1697,6 +1686,6 @@ static struct pci_driver ips_pci_driver = { · 1678 unmodified lines | ||
| 1697 | 1686 | |
| 1698 | 1687 | module_pci_driver(ips_pci_driver); |
| 1699 | 1688 | |
| 1700 | −MODULE_LICENSE("GPL"); | |
| 1689 | +MODULE_LICENSE("GPL v2"); | |
| 1701 | 1690 | MODULE_AUTHOR("Jesse Barnes <jbarnes@virtuousgeek.org>"); |
| 1702 | 1691 | MODULE_DESCRIPTION("Intelligent Power Sharing Driver"); |
| @@ -1,17 +1,6 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | 3 | * 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". | |
| 15 | 4 | */ |
| 16 | 5 | |
| 17 | 6 | void ips_link_to_i915_driver(void); |
| @@ -1,25 +1,10 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | − * intel_menlow.c - Intel menlow Driver for thermal management extension | |
| 3 | + * Intel menlow Driver for thermal management extension | |
| 3 | 4 | * |
| 4 | 5 | * Copyright (C) 2008 Intel Corp |
| 5 | 6 | * Copyright (C) 2008 Sujith Thomas <sujith.thomas@intel.com> |
| 6 | 7 | * 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 | − * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| 23 | 8 | * |
| 24 | 9 | * This driver creates the sys I/F for programming the sensors. |
| 25 | 10 | * It also implements the driver for intel menlow memory controller (hardware |
| @@ -29,20 +14,19 @@ · 3 unmodified lines | ||
| 29 | 14 | |
| 30 | 15 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| 31 | 16 | |
| 17 | +#include <linux/acpi.h> | |
| 32 | 18 | #include <linux/kernel.h> |
| 33 | 19 | #include <linux/module.h> |
| 34 | −#include <linux/init.h> | |
| 35 | −#include <linux/slab.h> | |
| 36 | −#include <linux/types.h> | |
| 37 | 20 | #include <linux/pci.h> |
| 38 | 21 | #include <linux/pm.h> |
| 22 | +#include <linux/slab.h> | |
| 39 | 23 | #include <linux/thermal.h> |
| 40 | −#include <linux/acpi.h> | |
| 24 | +#include <linux/types.h> | |
| 41 | 25 | |
| 42 | 26 | MODULE_AUTHOR("Thomas Sujith"); |
| 43 | 27 | MODULE_AUTHOR("Zhang Rui"); |
| 44 | 28 | MODULE_DESCRIPTION("Intel Menlow platform specific driver"); |
| 45 | −MODULE_LICENSE("GPL"); | |
| 29 | +MODULE_LICENSE("GPL v2"); | |
| 46 | 30 | |
| 47 | 31 | /* |
| 48 | 32 | * Memory controller device control |
| @@ -1,3 +1,4 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | 3 | * Power button driver for Intel MID platforms. |
| 3 | 4 | * |
| @@ -5,18 +6,8 @@ · 1 unmodified line | ||
| 5 | 6 | * |
| 6 | 7 | * Author: Hong Liu <hong.liu@intel.com> |
| 7 | 8 | * 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. | |
| 17 | 9 | */ |
| 18 | 10 | |
| 19 | −#include <linux/init.h> | |
| 20 | 11 | #include <linux/input.h> |
| 21 | 12 | #include <linux/interrupt.h> |
| 22 | 13 | #include <linux/mfd/intel_msic.h> |
| @@ -121,12 +112,9 @@ static const struct mid_pb_ddata mrfld_ddata = { · 98 unmodified lines | ||
| 121 | 112 | .setup = mrfld_setup, |
| 122 | 113 | }; |
| 123 | 114 | |
| 124 | −#define ICPU(model, ddata) \ | |
| 125 | − { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, (kernel_ulong_t)&ddata } | |
| 126 | − | |
| 127 | 115 | 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), | |
| 130 | 118 | {} |
| 131 | 119 | }; |
| 132 | 120 | |
| @@ -1,39 +1,23 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | − * intel_mid_thermal.c - Intel MID platform thermal driver | |
| 3 | + * Intel MID platform thermal driver | |
| 3 | 4 | * |
| 4 | 5 | * Copyright (C) 2011 Intel Corporation |
| 5 | 6 | * |
| 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 | − * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| 22 | 7 | * Author: Durgadoss R <durgadoss.r@intel.com> |
| 23 | 8 | */ |
| 24 | 9 | |
| 25 | 10 | #define pr_fmt(fmt) "intel_mid_thermal: " fmt |
| 26 | 11 | |
| 27 | −#include <linux/module.h> | |
| 28 | −#include <linux/init.h> | |
| 12 | +#include <linux/device.h> | |
| 29 | 13 | #include <linux/err.h> |
| 14 | +#include <linux/mfd/intel_msic.h> | |
| 15 | +#include <linux/module.h> | |
| 30 | 16 | #include <linux/param.h> |
| 31 | −#include <linux/device.h> | |
| 32 | 17 | #include <linux/platform_device.h> |
| 33 | −#include <linux/slab.h> | |
| 34 | 18 | #include <linux/pm.h> |
| 19 | +#include <linux/slab.h> | |
| 35 | 20 | #include <linux/thermal.h> |
| 36 | −#include <linux/mfd/intel_msic.h> | |
| 37 | 21 | |
| 38 | 22 | /* Number of thermal sensors */ |
| 39 | 23 | #define MSIC_THERMAL_SENSORS 4 |
| @@ -567,4 +551,4 @@ module_platform_driver(mid_thermal_driver); · 527 unmodified lines | ||
| 567 | 551 | |
| 568 | 552 | MODULE_AUTHOR("Durgadoss R <durgadoss.r@intel.com>"); |
| 569 | 553 | MODULE_DESCRIPTION("Intel Medfield Platform Thermal Driver"); |
| 570 | −MODULE_LICENSE("GPL"); | |
| 554 | +MODULE_LICENSE("GPL v2"); | |
| @@ -1,5 +1,6 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0+ | |
| 1 | 2 | /* |
| 2 | − * intel_oaktrail.c - Intel OakTrail Platform support. | |
| 3 | + * Intel OakTrail Platform support | |
| 3 | 4 | * |
| 4 | 5 | * Copyright (C) 2010-2011 Intel Corporation |
| 5 | 6 | * Author: Yin Kangkai (kangkai.yin@intel.com) |
| @@ -8,21 +9,6 @@ · 2 unmodified lines | ||
| 8 | 9 | * <cezary.jackiewicz (at) gmail.com>, based on MSI driver |
| 9 | 10 | * Copyright (C) 2006 Lennart Poettering <mzxreary (at) 0pointer (dot) de> |
| 10 | 11 | * |
| 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 | − * | |
| 26 | 12 | * This driver does below things: |
| 27 | 13 | * 1. registers itself in the Linux backlight control in |
| 28 | 14 | * /sys/class/backlight/intel_oaktrail/ |
| @@ -38,18 +24,18 @@ · 9 unmodified lines | ||
| 38 | 24 | |
| 39 | 25 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| 40 | 26 | |
| 41 | −#include <linux/module.h> | |
| 42 | −#include <linux/kernel.h> | |
| 43 | −#include <linux/init.h> | |
| 44 | 27 | #include <linux/acpi.h> |
| 45 | −#include <linux/fb.h> | |
| 46 | −#include <linux/mutex.h> | |
| 28 | +#include <linux/backlight.h> | |
| 29 | +#include <linux/dmi.h> | |
| 47 | 30 | #include <linux/err.h> |
| 31 | +#include <linux/fb.h> | |
| 48 | 32 | #include <linux/i2c.h> |
| 49 | −#include <linux/backlight.h> | |
| 33 | +#include <linux/kernel.h> | |
| 34 | +#include <linux/module.h> | |
| 35 | +#include <linux/mutex.h> | |
| 50 | 36 | #include <linux/platform_device.h> |
| 51 | −#include <linux/dmi.h> | |
| 52 | 37 | #include <linux/rfkill.h> |
| 38 | + | |
| 53 | 39 | #include <acpi/video.h> |
| 54 | 40 | |
| 55 | 41 | #define DRIVER_NAME "intel_oaktrail" |
| @@ -1,3 +1,4 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | 3 | * Intel Core SoC Power Management Controller Driver |
| 3 | 4 | * |
| @@ -6,16 +7,6 @@ · 2 unmodified lines | ||
| 6 | 7 | * |
| 7 | 8 | * Authors: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com> |
| 8 | 9 | * 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 | − * | |
| 19 | 10 | */ |
| 20 | 11 | |
| 21 | 12 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| @@ -1,3 +1,4 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | 3 | * Intel Core SoC Power Management Controller Header File |
| 3 | 4 | * |
| @@ -6,16 +7,6 @@ · 2 unmodified lines | ||
| 6 | 7 | * |
| 7 | 8 | * Authors: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com> |
| 8 | 9 | * 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 | − * | |
| 19 | 10 | */ |
| 20 | 11 | |
| 21 | 12 | #ifndef PMC_CORE_H |
| @@ -1,39 +1,34 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | − * intel_pmc_ipc.c: Driver for the Intel PMC IPC mechanism | |
| 3 | + * Driver for the Intel PMC IPC mechanism | |
| 3 | 4 | * |
| 4 | 5 | * (C) Copyright 2014-2015 Intel Corporation |
| 5 | 6 | * |
| 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 | |
| 7 | 8 | * Sreedhara DS <sreedhara.ds@intel.com> |
| 8 | 9 | * |
| 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 | − * | |
| 14 | 10 | * PMC running in ARC processor communicates with other entity running in IA |
| 15 | 11 | * core through IPC mechanism which in turn messaging between IA core ad PMC. |
| 16 | 12 | */ |
| 17 | 13 | |
| 18 | −#include <linux/module.h> | |
| 14 | +#include <linux/acpi.h> | |
| 15 | +#include <linux/atomic.h> | |
| 16 | +#include <linux/bitops.h> | |
| 19 | 17 | #include <linux/delay.h> |
| 20 | −#include <linux/errno.h> | |
| 21 | −#include <linux/init.h> | |
| 22 | 18 | #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> | |
| 24 | 25 | #include <linux/pci.h> |
| 25 | 26 | #include <linux/platform_device.h> |
| 26 | −#include <linux/interrupt.h> | |
| 27 | +#include <linux/pm.h> | |
| 27 | 28 | #include <linux/pm_qos.h> |
| 28 | −#include <linux/kernel.h> | |
| 29 | −#include <linux/bitops.h> | |
| 30 | 29 | #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> | |
| 36 | 30 | #include <linux/spinlock.h> |
| 31 | +#include <linux/suspend.h> | |
| 37 | 32 | |
| 38 | 33 | #include <asm/intel_pmc_ipc.h> |
| 39 | 34 | |
| @@ -1029,7 +1024,7 @@ static void __exit intel_pmc_ipc_exit(void) · 989 unmodified lines | ||
| 1029 | 1024 | |
| 1030 | 1025 | MODULE_AUTHOR("Zha Qipeng <qipeng.zha@intel.com>"); |
| 1031 | 1026 | MODULE_DESCRIPTION("Intel PMC IPC driver"); |
| 1032 | −MODULE_LICENSE("GPL"); | |
| 1027 | +MODULE_LICENSE("GPL v2"); | |
| 1033 | 1028 | |
| 1034 | 1029 | /* Some modules are dependent on this, so init earlier */ |
| 1035 | 1030 | fs_initcall(intel_pmc_ipc_init); |
| @@ -1,25 +1,23 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | 3 | * Driver for the Intel P-Unit Mailbox IPC mechanism |
| 3 | 4 | * |
| 4 | 5 | * (C) Copyright 2015 Intel Corporation |
| 5 | 6 | * |
| 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 | − * | |
| 10 | 7 | * The heart of the P-Unit is the Foxton microcontroller and its firmware, |
| 11 | 8 | * which provide mailbox interface for power management usage. |
| 12 | 9 | */ |
| 13 | 10 | |
| 14 | −#include <linux/module.h> | |
| 15 | −#include <linux/mod_devicetable.h> | |
| 16 | 11 | #include <linux/acpi.h> |
| 17 | −#include <linux/delay.h> | |
| 18 | 12 | #include <linux/bitops.h> |
| 13 | +#include <linux/delay.h> | |
| 19 | 14 | #include <linux/device.h> |
| 20 | 15 | #include <linux/interrupt.h> |
| 21 | 16 | #include <linux/io.h> |
| 17 | +#include <linux/mod_devicetable.h> | |
| 18 | +#include <linux/module.h> | |
| 22 | 19 | #include <linux/platform_device.h> |
| 20 | + | |
| 23 | 21 | #include <asm/intel_punit_ipc.h> |
| 24 | 22 | |
| 25 | 23 | /* IPC Mailbox registers */ |
| @@ -1,14 +1,10 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | − * intel_scu_ipc.c: Driver for the Intel SCU IPC mechanism | |
| 3 | + * Driver for the Intel SCU IPC mechanism | |
| 3 | 4 | * |
| 4 | 5 | * (C) Copyright 2008-2010,2015 Intel Corporation |
| 5 | 6 | * Author: Sreedhara DS (sreedhara.ds@intel.com) |
| 6 | 7 | * |
| 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 | 8 | * SCU running in ARC processor communicates with other entity running in IA |
| 13 | 9 | * core through IPC mechanism which in turn messaging between IA core ad SCU. |
| 14 | 10 | * SCU has two IPC mechanism IPC-1 and IPC-2. IPC-1 is used between IA32 and |
| @@ -16,14 +12,16 @@ · 1 unmodified line | ||
| 16 | 12 | * IPC-1 Driver provides an API for power control unit registers (e.g. MSIC) |
| 17 | 13 | * along with other APIs. |
| 18 | 14 | */ |
| 15 | + | |
| 19 | 16 | #include <linux/delay.h> |
| 17 | +#include <linux/device.h> | |
| 20 | 18 | #include <linux/errno.h> |
| 21 | 19 | #include <linux/init.h> |
| 22 | −#include <linux/device.h> | |
| 23 | −#include <linux/pm.h> | |
| 24 | −#include <linux/pci.h> | |
| 25 | 20 | #include <linux/interrupt.h> |
| 21 | +#include <linux/pci.h> | |
| 22 | +#include <linux/pm.h> | |
| 26 | 23 | #include <linux/sfi.h> |
| 24 | + | |
| 27 | 25 | #include <asm/intel-mid.h> |
| 28 | 26 | #include <asm/intel_scu_ipc.h> |
| 29 | 27 | |
| @@ -1,32 +1,28 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | − * intel_scu_ipc.c: Driver for the Intel SCU IPC mechanism | |
| 3 | + * Driver for the Intel SCU IPC mechanism | |
| 3 | 4 | * |
| 4 | 5 | * (C) Copyright 2008-2010 Intel Corporation |
| 5 | 6 | * Author: Sreedhara DS (sreedhara.ds@intel.com) |
| 6 | 7 | * |
| 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. | |
| 13 | 9 | */ |
| 14 | 10 | |
| 15 | −#include <linux/module.h> | |
| 16 | −#include <linux/kernel.h> | |
| 17 | 11 | #include <linux/errno.h> |
| 18 | −#include <linux/types.h> | |
| 19 | −#include <linux/fs.h> | |
| 20 | 12 | #include <linux/fcntl.h> |
| 13 | +#include <linux/fs.h> | |
| 14 | +#include <linux/kernel.h> | |
| 15 | +#include <linux/module.h> | |
| 21 | 16 | #include <linux/sched.h> |
| 22 | −#include <linux/uaccess.h> | |
| 23 | 17 | #include <linux/slab.h> |
| 24 | −#include <linux/init.h> | |
| 18 | +#include <linux/types.h> | |
| 19 | +#include <linux/uaccess.h> | |
| 20 | + | |
| 25 | 21 | #include <asm/intel_scu_ipc.h> |
| 26 | 22 | |
| 27 | 23 | static int major; |
| 28 | 24 | |
| 29 | −/* ioctl commnds */ | |
| 25 | +/* IOCTL commands */ | |
| 30 | 26 | #define INTE_SCU_IPC_REGISTER_READ 0 |
| 31 | 27 | #define INTE_SCU_IPC_REGISTER_WRITE 1 |
| 32 | 28 | #define INTE_SCU_IPC_REGISTER_UPDATE 2 |
| @@ -1,17 +1,9 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | 3 | * Intel SoC Core Telemetry Driver |
| 3 | 4 | * Copyright (C) 2015, Intel Corporation. |
| 4 | 5 | * All Rights Reserved. |
| 5 | 6 | * |
| 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 | − * | |
| 15 | 7 | * Telemetry Framework provides platform related PM and performance statistics. |
| 16 | 8 | * This file provides the core telemetry API implementation. |
| 17 | 9 | */ |
| @@ -460,4 +452,4 @@ module_exit(telemetry_module_exit); · 442 unmodified lines | ||
| 460 | 452 | |
| 461 | 453 | MODULE_AUTHOR("Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com>"); |
| 462 | 454 | MODULE_DESCRIPTION("Intel SoC Telemetry Interface"); |
| 463 | −MODULE_LICENSE("GPL"); | |
| 455 | +MODULE_LICENSE("GPL v2"); | |
| @@ -1,17 +1,9 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | 3 | * Intel SOC Telemetry debugfs Driver: Currently supports APL |
| 3 | 4 | * Copyright (c) 2015, Intel Corporation. |
| 4 | 5 | * All Rights Reserved. |
| 5 | 6 | * |
| 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 | − * | |
| 15 | 7 | * This file provides the debugfs interfaces for telemetry. |
| 16 | 8 | * /sys/kernel/debug/telemetry/pss_info: Shows Primary Control Sub-Sys Counters |
| 17 | 9 | * /sys/kernel/debug/telemetry/ioss_info: Shows IO Sub-System Counters |
| @@ -72,9 +64,6 @@ · 54 unmodified lines | ||
| 72 | 64 | #define TELEM_IOSS_DX_D0IX_EVTS 25 |
| 73 | 65 | #define TELEM_IOSS_PG_EVTS 30 |
| 74 | 66 | |
| 75 | −#define TELEM_DEBUGFS_CPU(model, data) \ | |
| 76 | − { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, (unsigned long)&data} | |
| 77 | − | |
| 78 | 67 | #define TELEM_CHECK_AND_PARSE_EVTS(EVTID, EVTNUM, BUF, EVTLOG, EVTDAT, MASK) { \ |
| 79 | 68 | if (evtlog[index].telem_evtid == (EVTID)) { \ |
| 80 | 69 | for (idx = 0; idx < (EVTNUM); idx++) \ |
| @@ -319,8 +308,8 @@ static struct telemetry_debugfs_conf telem_apl_debugfs_conf = { · 238 unmodified lines | ||
| 319 | 308 | }; |
| 320 | 309 | |
| 321 | 310 | 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), | |
| 324 | 313 | {} |
| 325 | 314 | }; |
| 326 | 315 | |
| @@ -951,12 +940,16 @@ static int __init telemetry_debugfs_init(void) · 624 unmodified lines | ||
| 951 | 940 | debugfs_conf = (struct telemetry_debugfs_conf *)id->driver_data; |
| 952 | 941 | |
| 953 | 942 | 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"); | |
| 955 | 945 | return -ENODEV; |
| 946 | + } | |
| 956 | 947 | |
| 957 | 948 | err = telemetry_debugfs_check_evts(); |
| 958 | − if (err < 0) | |
| 949 | + if (err < 0) { | |
| 950 | + pr_info("telemetry_debugfs_check_evts failed\n"); | |
| 959 | 951 | return -EINVAL; |
| 952 | + } | |
| 960 | 953 | |
| 961 | 954 | register_pm_notifier(&pm_notifier); |
| 962 | 955 | |
| @@ -1037,4 +1030,4 @@ module_exit(telemetry_debugfs_exit); · 74 unmodified lines | ||
| 1037 | 1030 | MODULE_AUTHOR("Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com>"); |
| 1038 | 1031 | MODULE_DESCRIPTION("Intel SoC Telemetry debugfs Interface"); |
| 1039 | 1032 | MODULE_VERSION(DRIVER_VERSION); |
| 1040 | −MODULE_LICENSE("GPL"); | |
| 1033 | +MODULE_LICENSE("GPL v2"); | |
| @@ -1,17 +1,9 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | 3 | * Intel SOC Telemetry Platform Driver: Currently supports APL |
| 3 | 4 | * Copyright (c) 2015, Intel Corporation. |
| 4 | 5 | * All Rights Reserved. |
| 5 | 6 | * |
| 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 | − * | |
| 15 | 7 | * This file provides the platform specific telemetry implementation for APL. |
| 16 | 8 | * It used the PUNIT and PMC IPC interfaces for configuring the counters. |
| 17 | 9 | * The accumulated results are fetched from SRAM. |
| @@ -1242,4 +1234,4 @@ module_exit(telemetry_module_exit); · 1224 unmodified lines | ||
| 1242 | 1234 | MODULE_AUTHOR("Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com>"); |
| 1243 | 1235 | MODULE_DESCRIPTION("Intel SoC Telemetry Platform Driver"); |
| 1244 | 1236 | MODULE_VERSION(DRIVER_VERSION); |
| 1245 | −MODULE_LICENSE("GPL"); | |
| 1237 | +MODULE_LICENSE("GPL v2"); | |
| @@ -1,28 +1,20 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | 3 | * Intel Turbo Boost Max Technology 3.0 legacy (non HWP) enumeration driver |
| 3 | 4 | * Copyright (c) 2017, Intel Corporation. |
| 4 | 5 | * All rights reserved. |
| 5 | 6 | * |
| 6 | 7 | * 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 | − * | |
| 17 | 8 | */ |
| 18 | 9 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| 19 | 10 | |
| 20 | −#include <linux/kernel.h> | |
| 11 | +#include <linux/cpufeature.h> | |
| 12 | +#include <linux/cpuhotplug.h> | |
| 21 | 13 | #include <linux/init.h> |
| 14 | +#include <linux/kernel.h> | |
| 22 | 15 | #include <linux/topology.h> |
| 23 | 16 | #include <linux/workqueue.h> |
| 24 | −#include <linux/cpuhotplug.h> | |
| 25 | −#include <linux/cpufeature.h> | |
| 17 | + | |
| 26 | 18 | #include <asm/cpu_device_id.h> |
| 27 | 19 | #include <asm/intel-family.h> |
| 28 | 20 | |
| @@ -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); | |
| @@ -575,7 +575,7 @@ static struct mlxreg_core_item mlxplat_mlxcpld_msn201x_items[] = { · 574 unmodified lines | ||
| 575 | 575 | |
| 576 | 576 | static |
| 577 | 577 | struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_msn201x_data = { |
| 578 | − .items = mlxplat_mlxcpld_msn21xx_items, | |
| 578 | + .items = mlxplat_mlxcpld_msn201x_items, | |
| 579 | 579 | .counter = ARRAY_SIZE(mlxplat_mlxcpld_msn201x_items), |
| 580 | 580 | .cell = MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET, |
| 581 | 581 | .mask = MLXPLAT_CPLD_AGGR_MASK_DEF, |
| @@ -42,10 +42,13 @@ static const struct ts_dmi_data chuwi_hi8_data = { · 41 unmodified lines | ||
| 42 | 42 | }; |
| 43 | 43 | |
| 44 | 44 | 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), | |
| 45 | 47 | PROPERTY_ENTRY_U32("touchscreen-size-x", 1728), |
| 46 | 48 | PROPERTY_ENTRY_U32("touchscreen-size-y", 1148), |
| 47 | 49 | PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), |
| 48 | 50 | PROPERTY_ENTRY_STRING("firmware-name", "gsl3680-chuwi-hi8-pro.fw"), |
| 51 | + PROPERTY_ENTRY_U32("silead,max-fingers", 10), | |
| 49 | 52 | PROPERTY_ENTRY_BOOL("silead,home-button"), |
| 50 | 53 | { } |
| 51 | 54 | }; |
| @@ -56,6 +59,8 @@ static const struct ts_dmi_data chuwi_hi8_pro_data = { · 4 unmodified lines | ||
| 56 | 59 | }; |
| 57 | 60 | |
| 58 | 61 | static const struct property_entry chuwi_vi8_props[] = { |
| 62 | + PROPERTY_ENTRY_U32("touchscreen-min-x", 4), | |
| 63 | + PROPERTY_ENTRY_U32("touchscreen-min-y", 6), | |
| 59 | 64 | PROPERTY_ENTRY_U32("touchscreen-size-x", 1724), |
| 60 | 65 | PROPERTY_ENTRY_U32("touchscreen-size-y", 1140), |
| 61 | 66 | PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), |
| @@ -88,9 +93,9 @@ static const struct ts_dmi_data chuwi_vi10_data = { · 26 unmodified lines | ||
| 88 | 93 | |
| 89 | 94 | static const struct property_entry connect_tablet9_props[] = { |
| 90 | 95 | PROPERTY_ENTRY_U32("touchscreen-min-x", 9), |
| 91 | − PROPERTY_ENTRY_U32("touchscreen-min-y", 8), | |
| 96 | + PROPERTY_ENTRY_U32("touchscreen-min-y", 10), | |
| 92 | 97 | PROPERTY_ENTRY_U32("touchscreen-size-x", 1664), |
| 93 | − PROPERTY_ENTRY_U32("touchscreen-size-y", 878), | |
| 98 | + PROPERTY_ENTRY_U32("touchscreen-size-y", 880), | |
| 94 | 99 | PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"), |
| 95 | 100 | PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), |
| 96 | 101 | 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 | ||
| 104 | 109 | }; |
| 105 | 110 | |
| 106 | 111 | 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), | |
| 109 | 116 | PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), |
| 110 | 117 | PROPERTY_ENTRY_STRING("firmware-name", "gsl3670-cube-iwork8-air.fw"), |
| 111 | 118 | PROPERTY_ENTRY_U32("silead,max-fingers", 10), |
| @@ -179,11 +186,14 @@ static const struct ts_dmi_data gp_electronic_t701_data = { · 67 unmodified lines | ||
| 179 | 186 | }; |
| 180 | 187 | |
| 181 | 188 | static const struct property_entry itworks_tw891_props[] = { |
| 189 | + PROPERTY_ENTRY_U32("touchscreen-min-x", 1), | |
| 190 | + PROPERTY_ENTRY_U32("touchscreen-min-y", 5), | |
| 182 | 191 | PROPERTY_ENTRY_U32("touchscreen-size-x", 1600), |
| 183 | − PROPERTY_ENTRY_U32("touchscreen-size-y", 890), | |
| 192 | + PROPERTY_ENTRY_U32("touchscreen-size-y", 896), | |
| 184 | 193 | PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"), |
| 185 | 194 | PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), |
| 186 | 195 | PROPERTY_ENTRY_STRING("firmware-name", "gsl3670-itworks-tw891.fw"), |
| 196 | + PROPERTY_ENTRY_U32("silead,max-fingers", 10), | |
| 187 | 197 | { } |
| 188 | 198 | }; |
| 189 | 199 | |
| @@ -207,8 +217,10 @@ static const struct ts_dmi_data jumper_ezpad_6_pro_data = { · 17 unmodified lines | ||
| 207 | 217 | }; |
| 208 | 218 | |
| 209 | 219 | 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), | |
| 210 | 222 | PROPERTY_ENTRY_U32("touchscreen-size-x", 1700), |
| 211 | − PROPERTY_ENTRY_U32("touchscreen-size-y", 1150), | |
| 223 | + PROPERTY_ENTRY_U32("touchscreen-size-y", 1138), | |
| 212 | 224 | PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), |
| 213 | 225 | PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-jumper-ezpad-mini3.fw"), |
| 214 | 226 | 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 | ||
| 237 | 249 | .properties = onda_obook_20_plus_props, |
| 238 | 250 | }; |
| 239 | 251 | |
| 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 | + | |
| 240 | 270 | static const struct property_entry onda_v820w_32g_props[] = { |
| 241 | 271 | PROPERTY_ENTRY_U32("touchscreen-size-x", 1665), |
| 242 | 272 | 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 | ||
| 322 | 352 | }; |
| 323 | 353 | |
| 324 | 354 | 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), | |
| 327 | 359 | PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), |
| 328 | 360 | PROPERTY_ENTRY_STRING("firmware-name", |
| 329 | 361 | "gsl3692-pov-mobii-wintab-p800w.fw"), |
| 362 | + PROPERTY_ENTRY_U32("silead,max-fingers", 10), | |
| 330 | 363 | PROPERTY_ENTRY_BOOL("silead,home-button"), |
| 331 | 364 | { } |
| 332 | 365 | }; |
| @@ -366,6 +399,22 @@ static const struct ts_dmi_data teclast_x98plus2_data = { · 33 unmodified lines | ||
| 366 | 399 | .properties = teclast_x98plus2_props, |
| 367 | 400 | }; |
| 368 | 401 | |
| 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 | + | |
| 369 | 418 | static const struct property_entry trekstor_primebook_c13_props[] = { |
| 370 | 419 | PROPERTY_ENTRY_U32("touchscreen-size-x", 2624), |
| 371 | 420 | PROPERTY_ENTRY_U32("touchscreen-size-y", 1920), |
| @@ -381,6 +430,22 @@ static const struct ts_dmi_data trekstor_primebook_c13_data = { · 9 unmodified lines | ||
| 381 | 430 | .properties = trekstor_primebook_c13_props, |
| 382 | 431 | }; |
| 383 | 432 | |
| 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 | + | |
| 384 | 449 | static const struct property_entry trekstor_surftab_twin_10_1_props[] = { |
| 385 | 450 | PROPERTY_ENTRY_U32("touchscreen-size-x", 1900), |
| 386 | 451 | 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 | ||
| 397 | 462 | }; |
| 398 | 463 | |
| 399 | 464 | 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), | |
| 400 | 467 | PROPERTY_ENTRY_U32("touchscreen-size-x", 884), |
| 401 | 468 | PROPERTY_ENTRY_U32("touchscreen-size-y", 632), |
| 402 | 469 | PROPERTY_ENTRY_STRING("firmware-name", |
| @@ -555,6 +622,14 @@ static const struct dmi_system_id touchscreen_dmi_table[] = { · 152 unmodified lines | ||
| 555 | 622 | DMI_MATCH(DMI_PRODUCT_NAME, "OBOOK 20 PLUS"), |
| 556 | 623 | }, |
| 557 | 624 | }, |
| 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 | + }, | |
| 558 | 633 | { |
| 559 | 634 | /* ONDA V820w DualOS */ |
| 560 | 635 | .driver_data = (void *)&onda_v820w_32g_data, |
| @@ -640,6 +715,14 @@ static const struct dmi_system_id touchscreen_dmi_table[] = { · 79 unmodified lines | ||
| 640 | 715 | DMI_MATCH(DMI_PRODUCT_NAME, "X98 Plus II"), |
| 641 | 716 | }, |
| 642 | 717 | }, |
| 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 | + }, | |
| 643 | 726 | { |
| 644 | 727 | /* Trekstor Primebook C13 */ |
| 645 | 728 | .driver_data = (void *)&trekstor_primebook_c13_data, |
| @@ -648,6 +731,14 @@ static const struct dmi_system_id touchscreen_dmi_table[] = { · 2 unmodified lines | ||
| 648 | 731 | DMI_MATCH(DMI_PRODUCT_NAME, "Primebook C13"), |
| 649 | 732 | }, |
| 650 | 733 | }, |
| 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 | + }, | |
| 651 | 742 | { |
| 652 | 743 | /* TrekStor SurfTab twin 10.1 ST10432-8 */ |
| 653 | 744 | .driver_data = (void *)&trekstor_surftab_twin_10_1_data, |
| @@ -987,19 +987,19 @@ static struct bus_type wmi_bus_type = { · 986 unmodified lines | ||
| 987 | 987 | .remove = wmi_dev_remove, |
| 988 | 988 | }; |
| 989 | 989 | |
| 990 | −static struct device_type wmi_type_event = { | |
| 990 | +static const struct device_type wmi_type_event = { | |
| 991 | 991 | .name = "event", |
| 992 | 992 | .groups = wmi_event_groups, |
| 993 | 993 | .release = wmi_dev_release, |
| 994 | 994 | }; |
| 995 | 995 | |
| 996 | −static struct device_type wmi_type_method = { | |
| 996 | +static const struct device_type wmi_type_method = { | |
| 997 | 997 | .name = "method", |
| 998 | 998 | .groups = wmi_method_groups, |
| 999 | 999 | .release = wmi_dev_release, |
| 1000 | 1000 | }; |
| 1001 | 1001 | |
| 1002 | −static struct device_type wmi_type_data = { | |
| 1002 | +static const struct device_type wmi_type_data = { | |
| 1003 | 1003 | .name = "data", |
| 1004 | 1004 | .groups = wmi_data_groups, |
| 1005 | 1005 | .release = wmi_dev_release, |
| @@ -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 */ | |
| @@ -115,7 +115,7 @@ static int module_trace_bprintk_format_notify(struct notifier_block *self, · 114 unmodified lines | ||
| 115 | 115 | * section, then we need to read the link list pointers. The trick is |
| 116 | 116 | * we pass the address of the string to the seq function just like |
| 117 | 117 | * 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 | |
| 119 | 119 | * next format in the list. |
| 120 | 120 | */ |
| 121 | 121 | static const char ** |