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 #include <linux/platform_device.h> 9 10 MODULE_DESCRIPTION("Intel Smart Connect disabling driver"); 11 MODULE_LICENSE("GPL"); 12 13 static int smartconnect_acpi_probe(struct platform_device *pdev) 14 { 15 acpi_handle handle = ACPI_HANDLE(&pdev->dev); 16 unsigned long long value; 17 acpi_status status; 18 19 status = acpi_evaluate_integer(handle, "GAOS", NULL, &value); 20 if (ACPI_FAILURE(status)) 21 return -EINVAL; 22 23 if (value & 0x1) { 24 dev_info(&pdev->dev, "Disabling Intel Smart Connect\n"); 25 status = acpi_execute_simple_method(handle, "SAOS", 0); 26 } 27 28 return 0; 29 } 30 31 static const struct acpi_device_id smartconnect_ids[] = { 32 {"INT33A0", 0}, 33 {"", 0} 34 }; 35 MODULE_DEVICE_TABLE(acpi, smartconnect_ids); 36 37 static struct platform_driver smartconnect_driver = { 38 .probe = smartconnect_acpi_probe, 39 .driver = { 40 .name = "intel_smart_connect", 41 .acpi_match_table = smartconnect_ids, 42 }, 43 }; 44 45 module_platform_driver(smartconnect_driver); 46