forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/platform/x86/intel-wmi-thunderbolt.c
....@@ -1,16 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * WMI Thunderbolt driver
34 *
45 * Copyright (C) 2017 Dell Inc. All Rights Reserved.
5
- *
6
- * This program is free software; you can redistribute it and/or modify it
7
- * under the terms of the GNU General Public License version 2 as published
8
- * by the Free Software Foundation.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
146 */
157
168 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
....@@ -38,12 +30,16 @@
3830 input.length = sizeof(u8);
3931 input.pointer = &mode;
4032 mode = hex_to_bin(buf[0]);
33
+ dev_dbg(dev, "force_power: storing %#x\n", mode);
4134 if (mode == 0 || mode == 1) {
4235 status = wmi_evaluate_method(INTEL_WMI_THUNDERBOLT_GUID, 0, 1,
4336 &input, NULL);
44
- if (ACPI_FAILURE(status))
37
+ if (ACPI_FAILURE(status)) {
38
+ dev_dbg(dev, "force_power: failed to evaluate ACPI method\n");
4539 return -ENODEV;
40
+ }
4641 } else {
42
+ dev_dbg(dev, "force_power: unsupported mode\n");
4743 return -EINVAL;
4844 }
4945 return count;
....@@ -60,7 +56,8 @@
6056 .attrs = tbt_attrs,
6157 };
6258
63
-static int intel_wmi_thunderbolt_probe(struct wmi_device *wdev)
59
+static int intel_wmi_thunderbolt_probe(struct wmi_device *wdev,
60
+ const void *context)
6461 {
6562 int ret;
6663
....@@ -92,7 +89,7 @@
9289
9390 module_wmi_driver(intel_wmi_thunderbolt_driver);
9491
95
-MODULE_ALIAS("wmi:" INTEL_WMI_THUNDERBOLT_GUID);
92
+MODULE_DEVICE_TABLE(wmi, intel_wmi_thunderbolt_id_table);
9693 MODULE_AUTHOR("Mario Limonciello <mario.limonciello@dell.com>");
9794 MODULE_DESCRIPTION("Intel WMI Thunderbolt force power driver");
98
-MODULE_LICENSE("GPL");
95
+MODULE_LICENSE("GPL v2");