workqueue: Make worker_attach/detach_pool() update worker->pool
[linux/fpc-iii.git] / drivers / platform / x86 / acer-wireless.c
blob858037987b33e330d54226a57a9628dd7238aa33
1 /*
2 * Acer Wireless Radio Control Driver
4 * Copyright (C) 2017 Endless Mobile, Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
11 #include <linux/acpi.h>
12 #include <linux/input.h>
13 #include <linux/kernel.h>
14 #include <linux/module.h>
15 #include <linux/pci_ids.h>
16 #include <linux/types.h>
18 static const struct acpi_device_id acer_wireless_acpi_ids[] = {
19 {"10251229", 0},
20 {"", 0},
22 MODULE_DEVICE_TABLE(acpi, acer_wireless_acpi_ids);
24 static void acer_wireless_notify(struct acpi_device *adev, u32 event)
26 struct input_dev *idev = acpi_driver_data(adev);
28 dev_dbg(&adev->dev, "event=%#x\n", event);
29 if (event != 0x80) {
30 dev_notice(&adev->dev, "Unknown SMKB event: %#x\n", event);
31 return;
33 input_report_key(idev, KEY_RFKILL, 1);
34 input_report_key(idev, KEY_RFKILL, 0);
35 input_sync(idev);
38 static int acer_wireless_add(struct acpi_device *adev)
40 struct input_dev *idev;
42 idev = devm_input_allocate_device(&adev->dev);
43 if (!idev)
44 return -ENOMEM;
46 adev->driver_data = idev;
47 idev->name = "Acer Wireless Radio Control";
48 idev->phys = "acer-wireless/input0";
49 idev->id.bustype = BUS_HOST;
50 idev->id.vendor = PCI_VENDOR_ID_AI;
51 idev->id.product = 0x1229;
52 set_bit(EV_KEY, idev->evbit);
53 set_bit(KEY_RFKILL, idev->keybit);
55 return input_register_device(idev);
58 static struct acpi_driver acer_wireless_driver = {
59 .name = "Acer Wireless Radio Control Driver",
60 .class = "hotkey",
61 .ids = acer_wireless_acpi_ids,
62 .ops = {
63 .add = acer_wireless_add,
64 .notify = acer_wireless_notify,
67 module_acpi_driver(acer_wireless_driver);
69 MODULE_DESCRIPTION("Acer Wireless Radio Control Driver");
70 MODULE_AUTHOR("Chris Chiu <chiu@gmail.com>");
71 MODULE_LICENSE("GPL v2");