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.
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
[] = {
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
);
30 dev_notice(&adev
->dev
, "Unknown SMKB event: %#x\n", event
);
33 input_report_key(idev
, KEY_RFKILL
, 1);
34 input_report_key(idev
, KEY_RFKILL
, 0);
38 static int acer_wireless_add(struct acpi_device
*adev
)
40 struct input_dev
*idev
;
42 idev
= devm_input_allocate_device(&adev
->dev
);
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",
61 .ids
= acer_wireless_acpi_ids
,
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");