| .. | .. |
|---|
| 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 | 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; |
|---|
| .. | .. |
|---|
| 60 | 56 | .attrs = tbt_attrs, |
|---|
| 61 | 57 | }; |
|---|
| 62 | 58 | |
|---|
| 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) |
|---|
| 64 | 61 | { |
|---|
| 65 | 62 | int ret; |
|---|
| 66 | 63 | |
|---|
| .. | .. |
|---|
| 92 | 89 | |
|---|
| 93 | 90 | module_wmi_driver(intel_wmi_thunderbolt_driver); |
|---|
| 94 | 91 | |
|---|
| 95 | | -MODULE_ALIAS("wmi:" INTEL_WMI_THUNDERBOLT_GUID); |
|---|
| 92 | +MODULE_DEVICE_TABLE(wmi, intel_wmi_thunderbolt_id_table); |
|---|
| 96 | 93 | MODULE_AUTHOR("Mario Limonciello <mario.limonciello@dell.com>"); |
|---|
| 97 | 94 | MODULE_DESCRIPTION("Intel WMI Thunderbolt force power driver"); |
|---|
| 98 | | -MODULE_LICENSE("GPL"); |
|---|
| 95 | +MODULE_LICENSE("GPL v2"); |
|---|