blob: 64c2dc93472f474869b98e418ac1a67bb74d5559 [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001// SPDX-License-Identifier: GPL-2.0+
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002/*
3 * Copyright 2013 Matthew Garrett <mjg59@srcf.ucam.org>
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00004 */
5
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00006#include <linux/acpi.h>
David Brazdil0f672f62019-12-10 10:32:29 +00007#include <linux/module.h>
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00008
9MODULE_LICENSE("GPL");
10
11static int smartconnect_acpi_init(struct acpi_device *acpi)
12{
13 unsigned long long value;
14 acpi_status status;
15
16 status = acpi_evaluate_integer(acpi->handle, "GAOS", NULL, &value);
17 if (ACPI_FAILURE(status))
18 return -EINVAL;
19
20 if (value & 0x1) {
21 dev_info(&acpi->dev, "Disabling Intel Smart Connect\n");
22 status = acpi_execute_simple_method(acpi->handle, "SAOS", 0);
23 }
24
25 return 0;
26}
27
28static const struct acpi_device_id smartconnect_ids[] = {
29 {"INT33A0", 0},
30 {"", 0}
31};
David Brazdil0f672f62019-12-10 10:32:29 +000032MODULE_DEVICE_TABLE(acpi, smartconnect_ids);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000033
34static struct acpi_driver smartconnect_driver = {
35 .owner = THIS_MODULE,
36 .name = "intel_smart_connect",
37 .class = "intel_smart_connect",
38 .ids = smartconnect_ids,
39 .ops = {
40 .add = smartconnect_acpi_init,
41 },
42};
43
44module_acpi_driver(smartconnect_driver);