Andy Shevchenko | 00f49ee | 2018-01-31 19:54:07 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 2 | /* |
| 3 | * Intel Virtual Button driver for Windows 8.1+ |
| 4 | * |
| 5 | * Copyright (C) 2016 AceLan Kao <acelan.kao@canonical.com> |
| 6 | * Copyright (C) 2016 Alex Hung <alex.hung@canonical.com> |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 7 | */ |
| 8 | |
Andy Shevchenko | bd1b27e | 2018-01-31 19:54:06 +0200 | [diff] [blame] | 9 | #include <linux/acpi.h> |
Mario Limonciello | de9647e | 2018-02-22 13:58:42 -0600 | [diff] [blame] | 10 | #include <linux/dmi.h> |
Andy Shevchenko | bd1b27e | 2018-01-31 19:54:06 +0200 | [diff] [blame] | 11 | #include <linux/input.h> |
| 12 | #include <linux/input/sparse-keymap.h> |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 13 | #include <linux/kernel.h> |
| 14 | #include <linux/module.h> |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 15 | #include <linux/platform_device.h> |
Rafael J. Wysocki | 91f9e85 | 2017-06-08 02:15:52 +0200 | [diff] [blame] | 16 | #include <linux/suspend.h> |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 17 | |
Marco Martin | 30323fb | 2018-01-29 21:27:43 +0100 | [diff] [blame] | 18 | /* When NOT in tablet mode, VGBS returns with the flag 0x40 */ |
| 19 | #define TABLET_MODE_FLAG 0x40 |
Matt Delco | 4f5e81a | 2018-06-24 17:29:40 -0700 | [diff] [blame] | 20 | #define DOCK_MODE_FLAG 0x80 |
Marco Martin | 30323fb | 2018-01-29 21:27:43 +0100 | [diff] [blame] | 21 | |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 22 | MODULE_LICENSE("GPL"); |
| 23 | MODULE_AUTHOR("AceLan Kao"); |
| 24 | |
| 25 | static const struct acpi_device_id intel_vbtn_ids[] = { |
| 26 | {"INT33D6", 0}, |
| 27 | {"", 0}, |
| 28 | }; |
Andy Shevchenko | 807e92d | 2020-01-28 12:26:21 +0200 | [diff] [blame] | 29 | MODULE_DEVICE_TABLE(acpi, intel_vbtn_ids); |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 30 | |
| 31 | /* In theory, these are HID usages. */ |
| 32 | static const struct key_entry intel_vbtn_keymap[] = { |
Mario Limonciello | c801603 | 2017-08-04 12:00:06 -0500 | [diff] [blame] | 33 | { KE_KEY, 0xC0, { KEY_POWER } }, /* power key press */ |
| 34 | { KE_IGNORE, 0xC1, { KEY_POWER } }, /* power key release */ |
Stefan Brüns | 9678d0e | 2017-11-09 23:44:36 +0100 | [diff] [blame] | 35 | { KE_KEY, 0xC2, { KEY_LEFTMETA } }, /* 'Windows' key press */ |
| 36 | { KE_KEY, 0xC3, { KEY_LEFTMETA } }, /* 'Windows' key release */ |
Maarten Maathuis | 8d9e299 | 2017-04-24 23:35:21 +0200 | [diff] [blame] | 37 | { KE_KEY, 0xC4, { KEY_VOLUMEUP } }, /* volume-up key press */ |
| 38 | { KE_IGNORE, 0xC5, { KEY_VOLUMEUP } }, /* volume-up key release */ |
| 39 | { KE_KEY, 0xC6, { KEY_VOLUMEDOWN } }, /* volume-down key press */ |
| 40 | { KE_IGNORE, 0xC7, { KEY_VOLUMEDOWN } }, /* volume-down key release */ |
Stefan Brüns | 3d5d95d | 2017-11-09 23:44:35 +0100 | [diff] [blame] | 41 | { KE_KEY, 0xC8, { KEY_ROTATE_LOCK_TOGGLE } }, /* rotate-lock key press */ |
| 42 | { KE_KEY, 0xC9, { KEY_ROTATE_LOCK_TOGGLE } }, /* rotate-lock key release */ |
Hans de Goede | f6ba524 | 2020-05-02 20:29:48 +0200 | [diff] [blame^] | 43 | }; |
| 44 | |
| 45 | static const struct key_entry intel_vbtn_switchmap[] = { |
Matt Delco | 4f5e81a | 2018-06-24 17:29:40 -0700 | [diff] [blame] | 46 | { KE_SW, 0xCA, { .sw = { SW_DOCK, 1 } } }, /* Docked */ |
| 47 | { KE_SW, 0xCB, { .sw = { SW_DOCK, 0 } } }, /* Undocked */ |
Stefan Brüns | 1c82849 | 2017-11-09 23:44:32 +0100 | [diff] [blame] | 48 | { KE_SW, 0xCC, { .sw = { SW_TABLET_MODE, 1 } } }, /* Tablet */ |
| 49 | { KE_SW, 0xCD, { .sw = { SW_TABLET_MODE, 0 } } }, /* Laptop */ |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 50 | }; |
| 51 | |
Hans de Goede | f6ba524 | 2020-05-02 20:29:48 +0200 | [diff] [blame^] | 52 | #define KEYMAP_LEN \ |
| 53 | (ARRAY_SIZE(intel_vbtn_keymap) + ARRAY_SIZE(intel_vbtn_switchmap) + 1) |
| 54 | |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 55 | struct intel_vbtn_priv { |
Hans de Goede | f6ba524 | 2020-05-02 20:29:48 +0200 | [diff] [blame^] | 56 | struct key_entry keymap[KEYMAP_LEN]; |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 57 | struct input_dev *input_dev; |
Rafael J. Wysocki | 91f9e85 | 2017-06-08 02:15:52 +0200 | [diff] [blame] | 58 | bool wakeup_mode; |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 59 | }; |
| 60 | |
| 61 | static int intel_vbtn_input_setup(struct platform_device *device) |
| 62 | { |
| 63 | struct intel_vbtn_priv *priv = dev_get_drvdata(&device->dev); |
Hans de Goede | f6ba524 | 2020-05-02 20:29:48 +0200 | [diff] [blame^] | 64 | int ret, keymap_len = 0; |
| 65 | |
| 66 | if (true) { |
| 67 | memcpy(&priv->keymap[keymap_len], intel_vbtn_keymap, |
| 68 | ARRAY_SIZE(intel_vbtn_keymap) * |
| 69 | sizeof(struct key_entry)); |
| 70 | keymap_len += ARRAY_SIZE(intel_vbtn_keymap); |
| 71 | } |
| 72 | |
| 73 | if (true) { |
| 74 | memcpy(&priv->keymap[keymap_len], intel_vbtn_switchmap, |
| 75 | ARRAY_SIZE(intel_vbtn_switchmap) * |
| 76 | sizeof(struct key_entry)); |
| 77 | keymap_len += ARRAY_SIZE(intel_vbtn_switchmap); |
| 78 | } |
| 79 | |
| 80 | priv->keymap[keymap_len].type = KE_END; |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 81 | |
Axel Lin | bb9ad48 | 2016-09-20 17:01:24 +0800 | [diff] [blame] | 82 | priv->input_dev = devm_input_allocate_device(&device->dev); |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 83 | if (!priv->input_dev) |
| 84 | return -ENOMEM; |
| 85 | |
Hans de Goede | f6ba524 | 2020-05-02 20:29:48 +0200 | [diff] [blame^] | 86 | ret = sparse_keymap_setup(priv->input_dev, priv->keymap, NULL); |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 87 | if (ret) |
Axel Lin | bb9ad48 | 2016-09-20 17:01:24 +0800 | [diff] [blame] | 88 | return ret; |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 89 | |
| 90 | priv->input_dev->dev.parent = &device->dev; |
| 91 | priv->input_dev->name = "Intel Virtual Button driver"; |
| 92 | priv->input_dev->id.bustype = BUS_HOST; |
| 93 | |
Axel Lin | bb9ad48 | 2016-09-20 17:01:24 +0800 | [diff] [blame] | 94 | return input_register_device(priv->input_dev); |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 95 | } |
| 96 | |
| 97 | static void notify_handler(acpi_handle handle, u32 event, void *context) |
| 98 | { |
| 99 | struct platform_device *device = context; |
| 100 | struct intel_vbtn_priv *priv = dev_get_drvdata(&device->dev); |
Darren Hart (VMware) | 1c3fdf1 | 2017-12-08 14:57:54 -0800 | [diff] [blame] | 101 | unsigned int val = !(event & 1); /* Even=press, Odd=release */ |
Mathew King | cb1921b | 2019-05-20 16:41:24 -0600 | [diff] [blame] | 102 | const struct key_entry *ke, *ke_rel; |
Stefan Brüns | 95f38fd | 2017-11-09 23:44:33 +0100 | [diff] [blame] | 103 | bool autorelease; |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 104 | |
Rafael J. Wysocki | 91f9e85 | 2017-06-08 02:15:52 +0200 | [diff] [blame] | 105 | if (priv->wakeup_mode) { |
Mathew King | cb1921b | 2019-05-20 16:41:24 -0600 | [diff] [blame] | 106 | ke = sparse_keymap_entry_from_scancode(priv->input_dev, event); |
| 107 | if (ke) { |
Rafael J. Wysocki | 91f9e85 | 2017-06-08 02:15:52 +0200 | [diff] [blame] | 108 | pm_wakeup_hard_event(&device->dev); |
Mathew King | cb1921b | 2019-05-20 16:41:24 -0600 | [diff] [blame] | 109 | |
| 110 | /* |
| 111 | * Switch events like tablet mode will wake the device |
| 112 | * and report the new switch position to the input |
| 113 | * subsystem. |
| 114 | */ |
| 115 | if (ke->type == KE_SW) |
| 116 | sparse_keymap_report_event(priv->input_dev, |
| 117 | event, |
| 118 | val, |
| 119 | 0); |
Rafael J. Wysocki | 91f9e85 | 2017-06-08 02:15:52 +0200 | [diff] [blame] | 120 | return; |
| 121 | } |
Darren Hart (VMware) | 1c3fdf1 | 2017-12-08 14:57:54 -0800 | [diff] [blame] | 122 | goto out_unknown; |
Rafael J. Wysocki | 91f9e85 | 2017-06-08 02:15:52 +0200 | [diff] [blame] | 123 | } |
Darren Hart (VMware) | 1c3fdf1 | 2017-12-08 14:57:54 -0800 | [diff] [blame] | 124 | |
| 125 | /* |
| 126 | * Even press events are autorelease if there is no corresponding odd |
| 127 | * release event, or if the odd event is KE_IGNORE. |
| 128 | */ |
| 129 | ke_rel = sparse_keymap_entry_from_scancode(priv->input_dev, event | 1); |
| 130 | autorelease = val && (!ke_rel || ke_rel->type == KE_IGNORE); |
| 131 | |
| 132 | if (sparse_keymap_report_event(priv->input_dev, event, val, autorelease)) |
| 133 | return; |
| 134 | |
| 135 | out_unknown: |
Alex Hung | a9c37b7 | 2017-07-20 20:56:48 -0700 | [diff] [blame] | 136 | dev_dbg(&device->dev, "unknown event index 0x%x\n", event); |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 137 | } |
| 138 | |
Mario Limonciello | de9647e | 2018-02-22 13:58:42 -0600 | [diff] [blame] | 139 | static void detect_tablet_mode(struct platform_device *device) |
| 140 | { |
| 141 | const char *chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE); |
| 142 | struct intel_vbtn_priv *priv = dev_get_drvdata(&device->dev); |
| 143 | acpi_handle handle = ACPI_HANDLE(&device->dev); |
Hans de Goede | 1893787 | 2020-05-02 20:29:47 +0200 | [diff] [blame] | 144 | unsigned long long vgbs; |
Mario Limonciello | de9647e | 2018-02-22 13:58:42 -0600 | [diff] [blame] | 145 | acpi_status status; |
| 146 | int m; |
| 147 | |
| 148 | if (!(chassis_type && strcmp(chassis_type, "31") == 0)) |
Hans de Goede | 1893787 | 2020-05-02 20:29:47 +0200 | [diff] [blame] | 149 | return; |
Mario Limonciello | de9647e | 2018-02-22 13:58:42 -0600 | [diff] [blame] | 150 | |
Hans de Goede | 1893787 | 2020-05-02 20:29:47 +0200 | [diff] [blame] | 151 | status = acpi_evaluate_integer(handle, "VGBS", NULL, &vgbs); |
Mario Limonciello | de9647e | 2018-02-22 13:58:42 -0600 | [diff] [blame] | 152 | if (ACPI_FAILURE(status)) |
Hans de Goede | 1893787 | 2020-05-02 20:29:47 +0200 | [diff] [blame] | 153 | return; |
Mario Limonciello | de9647e | 2018-02-22 13:58:42 -0600 | [diff] [blame] | 154 | |
Hans de Goede | 1893787 | 2020-05-02 20:29:47 +0200 | [diff] [blame] | 155 | m = !(vgbs & TABLET_MODE_FLAG); |
Mario Limonciello | de9647e | 2018-02-22 13:58:42 -0600 | [diff] [blame] | 156 | input_report_switch(priv->input_dev, SW_TABLET_MODE, m); |
Hans de Goede | 1893787 | 2020-05-02 20:29:47 +0200 | [diff] [blame] | 157 | m = (vgbs & DOCK_MODE_FLAG) ? 1 : 0; |
Matt Delco | 4f5e81a | 2018-06-24 17:29:40 -0700 | [diff] [blame] | 158 | input_report_switch(priv->input_dev, SW_DOCK, m); |
Mario Limonciello | de9647e | 2018-02-22 13:58:42 -0600 | [diff] [blame] | 159 | } |
| 160 | |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 161 | static int intel_vbtn_probe(struct platform_device *device) |
| 162 | { |
| 163 | acpi_handle handle = ACPI_HANDLE(&device->dev); |
| 164 | struct intel_vbtn_priv *priv; |
| 165 | acpi_status status; |
| 166 | int err; |
| 167 | |
| 168 | status = acpi_evaluate_object(handle, "VBDL", NULL, NULL); |
Axel Lin | 3526eca | 2016-09-19 09:33:51 +0800 | [diff] [blame] | 169 | if (ACPI_FAILURE(status)) { |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 170 | dev_warn(&device->dev, "failed to read Intel Virtual Button driver\n"); |
| 171 | return -ENODEV; |
| 172 | } |
| 173 | |
| 174 | priv = devm_kzalloc(&device->dev, sizeof(*priv), GFP_KERNEL); |
| 175 | if (!priv) |
| 176 | return -ENOMEM; |
| 177 | dev_set_drvdata(&device->dev, priv); |
| 178 | |
| 179 | err = intel_vbtn_input_setup(device); |
| 180 | if (err) { |
| 181 | pr_err("Failed to setup Intel Virtual Button\n"); |
| 182 | return err; |
| 183 | } |
| 184 | |
Mario Limonciello | de9647e | 2018-02-22 13:58:42 -0600 | [diff] [blame] | 185 | detect_tablet_mode(device); |
Marco Martin | 30323fb | 2018-01-29 21:27:43 +0100 | [diff] [blame] | 186 | |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 187 | status = acpi_install_notify_handler(handle, |
| 188 | ACPI_DEVICE_NOTIFY, |
| 189 | notify_handler, |
| 190 | device); |
Axel Lin | bb9ad48 | 2016-09-20 17:01:24 +0800 | [diff] [blame] | 191 | if (ACPI_FAILURE(status)) |
| 192 | return -EBUSY; |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 193 | |
Rafael J. Wysocki | 91f9e85 | 2017-06-08 02:15:52 +0200 | [diff] [blame] | 194 | device_init_wakeup(&device->dev, true); |
Rafael J. Wysocki | 10a08fd | 2019-07-30 11:55:59 +0200 | [diff] [blame] | 195 | /* |
| 196 | * In order for system wakeup to work, the EC GPE has to be marked as |
| 197 | * a wakeup one, so do that here (this setting will persist, but it has |
| 198 | * no effect until the wakeup mask is set for the EC GPE). |
| 199 | */ |
| 200 | acpi_ec_mark_gpe_for_wake(); |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 201 | return 0; |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 202 | } |
| 203 | |
| 204 | static int intel_vbtn_remove(struct platform_device *device) |
| 205 | { |
| 206 | acpi_handle handle = ACPI_HANDLE(&device->dev); |
| 207 | |
Rafael J. Wysocki | b758dbd | 2018-02-28 12:09:56 +0100 | [diff] [blame] | 208 | device_init_wakeup(&device->dev, false); |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 209 | acpi_remove_notify_handler(handle, ACPI_DEVICE_NOTIFY, notify_handler); |
| 210 | |
| 211 | /* |
| 212 | * Even if we failed to shut off the event stream, we can still |
| 213 | * safely detach from the device. |
| 214 | */ |
| 215 | return 0; |
| 216 | } |
| 217 | |
Rafael J. Wysocki | 91f9e85 | 2017-06-08 02:15:52 +0200 | [diff] [blame] | 218 | static int intel_vbtn_pm_prepare(struct device *dev) |
| 219 | { |
Rafael J. Wysocki | 10a08fd | 2019-07-30 11:55:59 +0200 | [diff] [blame] | 220 | if (device_may_wakeup(dev)) { |
| 221 | struct intel_vbtn_priv *priv = dev_get_drvdata(dev); |
Rafael J. Wysocki | 91f9e85 | 2017-06-08 02:15:52 +0200 | [diff] [blame] | 222 | |
Rafael J. Wysocki | 10a08fd | 2019-07-30 11:55:59 +0200 | [diff] [blame] | 223 | priv->wakeup_mode = true; |
Rafael J. Wysocki | 10a08fd | 2019-07-30 11:55:59 +0200 | [diff] [blame] | 224 | } |
Rafael J. Wysocki | 91f9e85 | 2017-06-08 02:15:52 +0200 | [diff] [blame] | 225 | return 0; |
| 226 | } |
| 227 | |
Rafael J. Wysocki | 31eb845 | 2019-08-08 11:39:17 +0200 | [diff] [blame] | 228 | static void intel_vbtn_pm_complete(struct device *dev) |
Rafael J. Wysocki | 91f9e85 | 2017-06-08 02:15:52 +0200 | [diff] [blame] | 229 | { |
Rafael J. Wysocki | 31eb845 | 2019-08-08 11:39:17 +0200 | [diff] [blame] | 230 | struct intel_vbtn_priv *priv = dev_get_drvdata(dev); |
Rafael J. Wysocki | 91f9e85 | 2017-06-08 02:15:52 +0200 | [diff] [blame] | 231 | |
Rafael J. Wysocki | b90ff35 | 2019-08-21 11:40:19 +0200 | [diff] [blame] | 232 | priv->wakeup_mode = false; |
Rafael J. Wysocki | 31eb845 | 2019-08-08 11:39:17 +0200 | [diff] [blame] | 233 | } |
| 234 | |
| 235 | static int intel_vbtn_pm_resume(struct device *dev) |
| 236 | { |
| 237 | intel_vbtn_pm_complete(dev); |
Rafael J. Wysocki | 91f9e85 | 2017-06-08 02:15:52 +0200 | [diff] [blame] | 238 | return 0; |
| 239 | } |
| 240 | |
| 241 | static const struct dev_pm_ops intel_vbtn_pm_ops = { |
| 242 | .prepare = intel_vbtn_pm_prepare, |
Rafael J. Wysocki | 31eb845 | 2019-08-08 11:39:17 +0200 | [diff] [blame] | 243 | .complete = intel_vbtn_pm_complete, |
Rafael J. Wysocki | 91f9e85 | 2017-06-08 02:15:52 +0200 | [diff] [blame] | 244 | .resume = intel_vbtn_pm_resume, |
| 245 | .restore = intel_vbtn_pm_resume, |
| 246 | .thaw = intel_vbtn_pm_resume, |
| 247 | }; |
| 248 | |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 249 | static struct platform_driver intel_vbtn_pl_driver = { |
| 250 | .driver = { |
| 251 | .name = "intel-vbtn", |
| 252 | .acpi_match_table = intel_vbtn_ids, |
Rafael J. Wysocki | 91f9e85 | 2017-06-08 02:15:52 +0200 | [diff] [blame] | 253 | .pm = &intel_vbtn_pm_ops, |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 254 | }, |
| 255 | .probe = intel_vbtn_probe, |
| 256 | .remove = intel_vbtn_remove, |
| 257 | }; |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 258 | |
| 259 | static acpi_status __init |
| 260 | check_acpi_dev(acpi_handle handle, u32 lvl, void *context, void **rv) |
| 261 | { |
| 262 | const struct acpi_device_id *ids = context; |
| 263 | struct acpi_device *dev; |
| 264 | |
| 265 | if (acpi_bus_get_device(handle, &dev) != 0) |
| 266 | return AE_OK; |
| 267 | |
| 268 | if (acpi_match_device_ids(dev, ids) == 0) |
Heikki Krogerus | 1571875 | 2016-11-03 16:21:26 +0200 | [diff] [blame] | 269 | if (acpi_create_platform_device(dev, NULL)) |
AceLan Kao | 332e081 | 2016-07-01 09:51:49 +0800 | [diff] [blame] | 270 | dev_info(&dev->dev, |
| 271 | "intel-vbtn: created platform device\n"); |
| 272 | |
| 273 | return AE_OK; |
| 274 | } |
| 275 | |
| 276 | static int __init intel_vbtn_init(void) |
| 277 | { |
| 278 | acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, |
| 279 | ACPI_UINT32_MAX, check_acpi_dev, NULL, |
| 280 | (void *)intel_vbtn_ids, NULL); |
| 281 | |
| 282 | return platform_driver_register(&intel_vbtn_pl_driver); |
| 283 | } |
| 284 | module_init(intel_vbtn_init); |
| 285 | |
| 286 | static void __exit intel_vbtn_exit(void) |
| 287 | { |
| 288 | platform_driver_unregister(&intel_vbtn_pl_driver); |
| 289 | } |
| 290 | module_exit(intel_vbtn_exit); |