xref: /linux/drivers/platform/x86/intel/smartconnect.c (revision a3a02a52bcfcbcc4a637d4b68bf1bc391c9fad02)
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  *  Copyright 2013 Matthew Garrett <mjg59@srcf.ucam.org>
4  */
5 
6 #include <linux/acpi.h>
7 #include <linux/module.h>
8 
9 MODULE_DESCRIPTION("Intel Smart Connect disabling driver");
10 MODULE_LICENSE("GPL");
11 
12 static int smartconnect_acpi_init(struct acpi_device *acpi)
13 {
14 	unsigned long long value;
15 	acpi_status status;
16 
17 	status = acpi_evaluate_integer(acpi->handle, "GAOS", NULL, &value);
18 	if (ACPI_FAILURE(status))
19 		return -EINVAL;
20 
21 	if (value & 0x1) {
22 		dev_info(&acpi->dev, "Disabling Intel Smart Connect\n");
23 		status = acpi_execute_simple_method(acpi->handle, "SAOS", 0);
24 	}
25 
26 	return 0;
27 }
28 
29 static const struct acpi_device_id smartconnect_ids[] = {
30 	{"INT33A0", 0},
31 	{"", 0}
32 };
33 MODULE_DEVICE_TABLE(acpi, smartconnect_ids);
34 
35 static struct acpi_driver smartconnect_driver = {
36 	.name = "intel_smart_connect",
37 	.class = "intel_smart_connect",
38 	.ids = smartconnect_ids,
39 	.ops = {
40 		.add = smartconnect_acpi_init,
41 	},
42 };
43 
44 module_acpi_driver(smartconnect_driver);
45