blob: 56c7795ed890f0c95e49d97dea36f30cd0a6f2f4 [file] [log] [blame]
Bjorn Helgaas736759e2018-01-26 14:22:04 -06001// SPDX-License-Identifier: GPL-2.0+
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
3 * Standard Hot Plug Controller Driver
4 *
5 * Copyright (C) 1995,2001 Compaq Computer Corporation
6 * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com)
7 * Copyright (C) 2001 IBM Corp.
8 * Copyright (C) 2003-2004 Intel Corporation
9 *
10 * All rights reserved.
11 *
Kristen Accardi8cf4c192005-08-16 15:16:10 -070012 * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013 *
14 */
15
Linus Torvalds1da177e2005-04-16 15:20:36 -070016#include <linux/module.h>
17#include <linux/moduleparam.h>
18#include <linux/kernel.h>
19#include <linux/types.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090020#include <linux/slab.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070021#include <linux/pci.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070022#include "shpchp.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070023
24/* Global variables */
Rusty Russell90ab5ee2012-01-13 09:32:20 +103025bool shpchp_debug;
26bool shpchp_poll_mode;
Linus Torvalds1da177e2005-04-16 15:20:36 -070027int shpchp_poll_time;
Linus Torvalds1da177e2005-04-16 15:20:36 -070028
29#define DRIVER_VERSION "0.4"
30#define DRIVER_AUTHOR "Dan Zink <dan.zink@compaq.com>, Greg Kroah-Hartman <greg@kroah.com>, Dely Sy <dely.l.sy@intel.com>"
31#define DRIVER_DESC "Standard Hot Plug PCI Controller Driver"
32
33MODULE_AUTHOR(DRIVER_AUTHOR);
34MODULE_DESCRIPTION(DRIVER_DESC);
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
36module_param(shpchp_debug, bool, 0644);
37module_param(shpchp_poll_mode, bool, 0644);
38module_param(shpchp_poll_time, int, 0644);
39MODULE_PARM_DESC(shpchp_debug, "Debugging mode enabled or not");
40MODULE_PARM_DESC(shpchp_poll_mode, "Using polling mechanism for hot-plug events or not");
41MODULE_PARM_DESC(shpchp_poll_time, "Polling mechanism frequency, in seconds");
42
43#define SHPC_MODULE_NAME "shpchp"
44
Bogicevic Sasaff3ce482015-12-27 13:21:11 -080045static int set_attention_status(struct hotplug_slot *slot, u8 value);
46static int enable_slot(struct hotplug_slot *slot);
47static int disable_slot(struct hotplug_slot *slot);
48static int get_power_status(struct hotplug_slot *slot, u8 *value);
49static int get_attention_status(struct hotplug_slot *slot, u8 *value);
50static int get_latch_status(struct hotplug_slot *slot, u8 *value);
51static int get_adapter_status(struct hotplug_slot *slot, u8 *value);
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
Lukas Wunner81c4b5b2018-09-08 09:59:01 +020053static const struct hotplug_slot_ops shpchp_hotplug_slot_ops = {
Linus Torvalds1da177e2005-04-16 15:20:36 -070054 .set_attention_status = set_attention_status,
55 .enable_slot = enable_slot,
56 .disable_slot = disable_slot,
57 .get_power_status = get_power_status,
58 .get_attention_status = get_attention_status,
59 .get_latch_status = get_latch_status,
60 .get_adapter_status = get_adapter_status,
Linus Torvalds1da177e2005-04-16 15:20:36 -070061};
62
Linus Torvalds1da177e2005-04-16 15:20:36 -070063static int init_slots(struct controller *ctrl)
64{
Kenji Kaneshige926030f2006-01-26 09:55:35 +090065 struct slot *slot;
66 struct hotplug_slot *hotplug_slot;
Alex Chiang66f17052008-10-20 17:41:53 -060067 char name[SLOT_NAME_SIZE];
Julia Lawall83d05712012-07-16 09:25:56 -060068 int retval;
Alex Chiang5fe6cc62008-10-20 17:41:02 -060069 int i;
Linus Torvalds1da177e2005-04-16 15:20:36 -070070
Kenji Kaneshige926030f2006-01-26 09:55:35 +090071 for (i = 0; i < ctrl->num_slots; i++) {
Kenji Kaneshige57c95c02006-01-26 10:02:41 +090072 slot = kzalloc(sizeof(*slot), GFP_KERNEL);
Julia Lawall83d05712012-07-16 09:25:56 -060073 if (!slot) {
74 retval = -ENOMEM;
Linus Torvalds1da177e2005-04-16 15:20:36 -070075 goto error;
Julia Lawall83d05712012-07-16 09:25:56 -060076 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070077
Lukas Wunner125450f2018-09-08 09:59:01 +020078 hotplug_slot = &slot->hotplug_slot;
Linus Torvalds1da177e2005-04-16 15:20:36 -070079
Kenji Kaneshige926030f2006-01-26 09:55:35 +090080 slot->hp_slot = i;
Kenji Kaneshige926030f2006-01-26 09:55:35 +090081 slot->ctrl = ctrl;
Kenji Kaneshige227b84c2006-12-16 15:25:42 -080082 slot->bus = ctrl->pci_dev->subordinate->number;
Kenji Kaneshige926030f2006-01-26 09:55:35 +090083 slot->device = ctrl->slot_device_offset + i;
84 slot->hpc_ops = ctrl->hpc_ops;
Kenji Kaneshige6f39be22006-12-16 15:25:49 -080085 slot->number = ctrl->first_slot + (ctrl->slot_num_inc * i);
Bjorn Helgaasf652e7d2013-01-11 12:21:15 -070086
Kees Cookd8537542013-07-03 15:04:57 -070087 slot->wq = alloc_workqueue("shpchp-%d", 0, 0, slot->number);
Bjorn Helgaasf652e7d2013-01-11 12:21:15 -070088 if (!slot->wq) {
89 retval = -ENOMEM;
Lukas Wunner125450f2018-09-08 09:59:01 +020090 goto error_slot;
Bjorn Helgaasf652e7d2013-01-11 12:21:15 -070091 }
92
Kenji Kaneshigea246fa42006-02-21 15:45:48 -080093 mutex_init(&slot->lock);
Kristen Carlson Accardie325e1f2007-03-21 11:45:31 -070094 INIT_DELAYED_WORK(&slot->work, shpchp_queue_pushbutton_work);
Linus Torvalds1da177e2005-04-16 15:20:36 -070095
96 /* register this slot with the hotplug pci core */
Alex Chiang66f17052008-10-20 17:41:53 -060097 snprintf(name, SLOT_NAME_SIZE, "%d", slot->number);
Kenji Kaneshige926030f2006-01-26 09:55:35 +090098 hotplug_slot->ops = &shpchp_hotplug_slot_ops;
Linus Torvalds1da177e2005-04-16 15:20:36 -070099
Ryan Desfosses227f0642014-04-18 20:13:50 -0400100 ctrl_dbg(ctrl, "Registering domain:bus:dev=%04x:%02x:%02x hp_slot=%x sun=%x slot_device_offset=%x\n",
Bjorn Helgaasf7625982013-11-14 11:28:18 -0700101 pci_domain_nr(ctrl->pci_dev->subordinate),
102 slot->bus, slot->device, slot->hp_slot, slot->number,
103 ctrl->slot_device_offset);
Lukas Wunner125450f2018-09-08 09:59:01 +0200104 retval = pci_hp_register(hotplug_slot,
Alex Chiang66f17052008-10-20 17:41:53 -0600105 ctrl->pci_dev->subordinate, slot->device, name);
Kenji Kaneshige926030f2006-01-26 09:55:35 +0900106 if (retval) {
Taku Izumif98ca312008-10-23 11:52:12 +0900107 ctrl_err(ctrl, "pci_hp_register failed with error %d\n",
108 retval);
Bjorn Helgaasf652e7d2013-01-11 12:21:15 -0700109 goto error_slotwq;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110 }
111
Lukas Wunnera7da2162018-09-08 09:59:01 +0200112 get_power_status(hotplug_slot, &slot->pwr_save);
113 get_attention_status(hotplug_slot, &slot->attention_save);
114 get_latch_status(hotplug_slot, &slot->latch_save);
115 get_adapter_status(hotplug_slot, &slot->presence_save);
Alex Chiang66f17052008-10-20 17:41:53 -0600116
Kenji Kaneshige5b1a9602006-01-26 09:57:40 +0900117 list_add(&slot->slot_list, &ctrl->slot_list);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118 }
119
120 return 0;
Bjorn Helgaasf652e7d2013-01-11 12:21:15 -0700121error_slotwq:
122 destroy_workqueue(slot->wq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123error_slot:
Kenji Kaneshige926030f2006-01-26 09:55:35 +0900124 kfree(slot);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125error:
Kenji Kaneshige926030f2006-01-26 09:55:35 +0900126 return retval;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700127}
128
Kenji Kaneshigef7391f52006-02-21 15:45:45 -0800129void cleanup_slots(struct controller *ctrl)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700130{
Geliang Tang2ac83cc2015-12-12 21:36:57 +0800131 struct slot *slot, *next;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700132
Geliang Tang2ac83cc2015-12-12 21:36:57 +0800133 list_for_each_entry_safe(slot, next, &ctrl->slot_list, slot_list) {
Kenji Kaneshige5b1a9602006-01-26 09:57:40 +0900134 list_del(&slot->slot_list);
Kenji Kaneshigef7391f52006-02-21 15:45:45 -0800135 cancel_delayed_work(&slot->work);
Bjorn Helgaasf652e7d2013-01-11 12:21:15 -0700136 destroy_workqueue(slot->wq);
Lukas Wunner125450f2018-09-08 09:59:01 +0200137 pci_hp_deregister(&slot->hotplug_slot);
Lukas Wunner51bbf9b2018-07-19 17:27:43 -0500138 kfree(slot);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700139 }
140}
141
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142/*
143 * set_attention_status - Turns the Amber LED for a slot on, off or blink
144 */
Bogicevic Sasaff3ce482015-12-27 13:21:11 -0800145static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146{
Kenji Kaneshige8352e042006-12-16 15:25:57 -0800147 struct slot *slot = get_slot(hotplug_slot);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148
Taku Izumibe7bce22008-10-23 11:54:39 +0900149 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
Taku Izumif98ca312008-10-23 11:52:12 +0900150 __func__, slot_name(slot));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700151
Lukas Wunnera7da2162018-09-08 09:59:01 +0200152 slot->attention_save = status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700153 slot->hpc_ops->set_attention_status(slot, status);
154
155 return 0;
156}
157
Bogicevic Sasaff3ce482015-12-27 13:21:11 -0800158static int enable_slot(struct hotplug_slot *hotplug_slot)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700159{
Kenji Kaneshige8352e042006-12-16 15:25:57 -0800160 struct slot *slot = get_slot(hotplug_slot);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161
Taku Izumibe7bce22008-10-23 11:54:39 +0900162 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
Taku Izumif98ca312008-10-23 11:52:12 +0900163 __func__, slot_name(slot));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164
Kenji Kaneshigea246fa42006-02-21 15:45:48 -0800165 return shpchp_sysfs_enable_slot(slot);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700166}
167
Bogicevic Sasaff3ce482015-12-27 13:21:11 -0800168static int disable_slot(struct hotplug_slot *hotplug_slot)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700169{
Kenji Kaneshige8352e042006-12-16 15:25:57 -0800170 struct slot *slot = get_slot(hotplug_slot);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700171
Taku Izumibe7bce22008-10-23 11:54:39 +0900172 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
Taku Izumif98ca312008-10-23 11:52:12 +0900173 __func__, slot_name(slot));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700174
Kenji Kaneshigea246fa42006-02-21 15:45:48 -0800175 return shpchp_sysfs_disable_slot(slot);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700176}
177
Bogicevic Sasaff3ce482015-12-27 13:21:11 -0800178static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700179{
Kenji Kaneshige8352e042006-12-16 15:25:57 -0800180 struct slot *slot = get_slot(hotplug_slot);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700181 int retval;
182
Taku Izumibe7bce22008-10-23 11:54:39 +0900183 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
Taku Izumif98ca312008-10-23 11:52:12 +0900184 __func__, slot_name(slot));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700185
186 retval = slot->hpc_ops->get_power_status(slot, value);
187 if (retval < 0)
Lukas Wunnera7da2162018-09-08 09:59:01 +0200188 *value = slot->pwr_save;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700189
190 return 0;
191}
192
Bogicevic Sasaff3ce482015-12-27 13:21:11 -0800193static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700194{
Kenji Kaneshige8352e042006-12-16 15:25:57 -0800195 struct slot *slot = get_slot(hotplug_slot);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196 int retval;
197
Taku Izumibe7bce22008-10-23 11:54:39 +0900198 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
Taku Izumif98ca312008-10-23 11:52:12 +0900199 __func__, slot_name(slot));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700200
201 retval = slot->hpc_ops->get_attention_status(slot, value);
202 if (retval < 0)
Lukas Wunnera7da2162018-09-08 09:59:01 +0200203 *value = slot->attention_save;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700204
205 return 0;
206}
207
Bogicevic Sasaff3ce482015-12-27 13:21:11 -0800208static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209{
Kenji Kaneshige8352e042006-12-16 15:25:57 -0800210 struct slot *slot = get_slot(hotplug_slot);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700211 int retval;
212
Taku Izumibe7bce22008-10-23 11:54:39 +0900213 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
Taku Izumif98ca312008-10-23 11:52:12 +0900214 __func__, slot_name(slot));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700215
216 retval = slot->hpc_ops->get_latch_status(slot, value);
217 if (retval < 0)
Lukas Wunnera7da2162018-09-08 09:59:01 +0200218 *value = slot->latch_save;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700219
220 return 0;
221}
222
Bogicevic Sasaff3ce482015-12-27 13:21:11 -0800223static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700224{
Kenji Kaneshige8352e042006-12-16 15:25:57 -0800225 struct slot *slot = get_slot(hotplug_slot);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700226 int retval;
227
Taku Izumibe7bce22008-10-23 11:54:39 +0900228 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
Taku Izumif98ca312008-10-23 11:52:12 +0900229 __func__, slot_name(slot));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700230
231 retval = slot->hpc_ops->get_adapter_status(slot, value);
232 if (retval < 0)
Lukas Wunnera7da2162018-09-08 09:59:01 +0200233 *value = slot->presence_save;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700234
235 return 0;
236}
237
Bjorn Helgaasb03799b2018-06-25 16:49:06 -0500238static bool shpc_capable(struct pci_dev *bridge)
239{
240 /*
241 * It is assumed that AMD GOLAM chips support SHPC but they do not
242 * have SHPC capability.
243 */
244 if (bridge->vendor == PCI_VENDOR_ID_AMD &&
245 bridge->device == PCI_DEVICE_ID_AMD_GOLAM_7450)
246 return true;
247
248 if (pci_find_capability(bridge, PCI_CAP_ID_SHPC))
249 return true;
250
251 return false;
252}
253
Linus Torvalds1da177e2005-04-16 15:20:36 -0700254static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
255{
256 int rc;
257 struct controller *ctrl;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700258
Bjorn Helgaasb03799b2018-06-25 16:49:06 -0500259 if (!shpc_capable(pdev))
260 return -ENODEV;
261
Mika Westerberg90cc0c32018-05-31 11:42:11 -0500262 if (acpi_get_hp_hw_control_from_firmware(pdev))
rajesh.shah@intel.com1410dc12005-10-13 12:05:39 -0700263 return -ENODEV;
264
Kenji Kaneshige57c95c02006-01-26 10:02:41 +0900265 ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL);
Markus Elfringc7abb232017-12-29 12:15:16 +0100266 if (!ctrl)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700267 goto err_out_none;
Markus Elfringc7abb232017-12-29 12:15:16 +0100268
Kenji Kaneshige5b1a9602006-01-26 09:57:40 +0900269 INIT_LIST_HEAD(&ctrl->slot_list);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700270
rajesh.shah@intel.comee138332005-10-13 12:05:42 -0700271 rc = shpc_init(ctrl, pdev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700272 if (rc) {
Taku Izumibe7bce22008-10-23 11:54:39 +0900273 ctrl_dbg(ctrl, "Controller initialization failed\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700274 goto err_out_free_ctrl;
275 }
276
Linus Torvalds1da177e2005-04-16 15:20:36 -0700277 pci_set_drvdata(pdev, ctrl);
278
Linus Torvalds1da177e2005-04-16 15:20:36 -0700279 /* Setup the slot information structures */
280 rc = init_slots(ctrl);
281 if (rc) {
Taku Izumibe7bce22008-10-23 11:54:39 +0900282 ctrl_err(ctrl, "Slot initialization failed\n");
Kenji Kaneshigef7391f52006-02-21 15:45:45 -0800283 goto err_out_release_ctlr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700284 }
285
Greg Kroah-Hartmane1b95dc2006-08-28 11:43:25 -0700286 rc = shpchp_create_ctrl_files(ctrl);
287 if (rc)
288 goto err_cleanup_slots;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700289
Bjorn Helgaasb03799b2018-06-25 16:49:06 -0500290 pdev->shpc_managed = 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700291 return 0;
292
Greg Kroah-Hartmane1b95dc2006-08-28 11:43:25 -0700293err_cleanup_slots:
294 cleanup_slots(ctrl);
Kenji Kaneshigef7391f52006-02-21 15:45:45 -0800295err_out_release_ctlr:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700296 ctrl->hpc_ops->release_ctlr(ctrl);
297err_out_free_ctrl:
298 kfree(ctrl);
299err_out_none:
300 return -ENODEV;
301}
302
Kenji Kaneshigee6b82b132006-02-21 15:45:50 -0800303static void shpc_remove(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700304{
Kenji Kaneshigee6b82b132006-02-21 15:45:50 -0800305 struct controller *ctrl = pci_get_drvdata(dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700306
Bjorn Helgaasb03799b2018-06-25 16:49:06 -0500307 dev->shpc_managed = 0;
Kenji Kaneshigee6b82b132006-02-21 15:45:50 -0800308 shpchp_remove_ctrl_files(ctrl);
309 ctrl->hpc_ops->release_ctlr(ctrl);
310 kfree(ctrl);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700311}
312
Arvind Yadav83942642017-08-03 18:20:17 -0500313static const struct pci_device_id shpcd_pci_tbl[] = {
Pali Rohár904b10f2022-02-14 12:41:08 +0100314 {PCI_DEVICE_CLASS(PCI_CLASS_BRIDGE_PCI_NORMAL, ~0)},
Linus Torvalds1da177e2005-04-16 15:20:36 -0700315 { /* end: all zeroes */ }
316};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317MODULE_DEVICE_TABLE(pci, shpcd_pci_tbl);
318
Linus Torvalds1da177e2005-04-16 15:20:36 -0700319static struct pci_driver shpc_driver = {
320 .name = SHPC_MODULE_NAME,
321 .id_table = shpcd_pci_tbl,
322 .probe = shpc_probe,
Kenji Kaneshigee6b82b132006-02-21 15:45:50 -0800323 .remove = shpc_remove,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700324};
325
Linus Torvalds1da177e2005-04-16 15:20:36 -0700326static int __init shpcd_init(void)
327{
Bjorn Helgaasf652e7d2013-01-11 12:21:15 -0700328 int retval;
Tejun Heoe24dcbe2010-10-18 08:33:02 +0200329
rajesh.shah@intel.com424600f2005-10-13 12:05:38 -0700330 retval = pci_register_driver(&shpc_driver);
Harvey Harrison66bef8c2008-03-03 19:09:46 -0800331 dbg("%s: pci_register_driver = %d\n", __func__, retval);
rajesh.shah@intel.com424600f2005-10-13 12:05:38 -0700332 info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
Bjorn Helgaasf652e7d2013-01-11 12:21:15 -0700333
Linus Torvalds1da177e2005-04-16 15:20:36 -0700334 return retval;
335}
336
337static void __exit shpcd_cleanup(void)
338{
339 dbg("unload_shpchpd()\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700340 pci_unregister_driver(&shpc_driver);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700341 info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n");
342}
343
344module_init(shpcd_init);
345module_exit(shpcd_cleanup);