1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20#include <linux/init.h>
21#include <linux/module.h>
22#include <linux/acpi.h>
23
24MODULE_LICENSE("GPL");
25
26static int smartconnect_acpi_init(struct acpi_device *acpi)
27{
28 unsigned long long value;
29 acpi_status status;
30
31 status = acpi_evaluate_integer(acpi->handle, "GAOS", NULL, &value);
32 if (ACPI_FAILURE(status))
33 return -EINVAL;
34
35 if (value & 0x1) {
36 dev_info(&acpi->dev, "Disabling Intel Smart Connect\n");
37 status = acpi_execute_simple_method(acpi->handle, "SAOS", 0);
38 }
39
40 return 0;
41}
42
43static const struct acpi_device_id smartconnect_ids[] = {
44 {"INT33A0", 0},
45 {"", 0}
46};
47
48static struct acpi_driver smartconnect_driver = {
49 .owner = THIS_MODULE,
50 .name = "intel_smart_connect",
51 .class = "intel_smart_connect",
52 .ids = smartconnect_ids,
53 .ops = {
54 .add = smartconnect_acpi_init,
55 },
56};
57
58module_acpi_driver(smartconnect_driver);
59
60MODULE_DEVICE_TABLE(acpi, smartconnect_ids);
61