1736759efSBjorn Helgaas // SPDX-License-Identifier: GPL-2.0+
21da177e4SLinus Torvalds /*
31da177e4SLinus Torvalds  * Standard Hot Plug Controller Driver
41da177e4SLinus Torvalds  *
51da177e4SLinus Torvalds  * Copyright (C) 1995,2001 Compaq Computer Corporation
61da177e4SLinus Torvalds  * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com)
71da177e4SLinus Torvalds  * Copyright (C) 2001 IBM Corp.
81da177e4SLinus Torvalds  * Copyright (C) 2003-2004 Intel Corporation
91da177e4SLinus Torvalds  *
101da177e4SLinus Torvalds  * All rights reserved.
111da177e4SLinus Torvalds  *
128cf4c195SKristen Accardi  * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com>
131da177e4SLinus Torvalds  *
141da177e4SLinus Torvalds  */
151da177e4SLinus Torvalds 
161da177e4SLinus Torvalds #include <linux/module.h>
171da177e4SLinus Torvalds #include <linux/moduleparam.h>
181da177e4SLinus Torvalds #include <linux/kernel.h>
191da177e4SLinus Torvalds #include <linux/types.h>
205a0e3ad6STejun Heo #include <linux/slab.h>
211da177e4SLinus Torvalds #include <linux/pci.h>
221da177e4SLinus Torvalds #include "shpchp.h"
231da177e4SLinus Torvalds 
241da177e4SLinus Torvalds /* Global variables */
2590ab5ee9SRusty Russell bool shpchp_debug;
2690ab5ee9SRusty Russell bool shpchp_poll_mode;
271da177e4SLinus Torvalds int shpchp_poll_time;
281da177e4SLinus Torvalds 
291da177e4SLinus Torvalds #define DRIVER_VERSION	"0.4"
301da177e4SLinus Torvalds #define DRIVER_AUTHOR	"Dan Zink <dan.zink@compaq.com>, Greg Kroah-Hartman <greg@kroah.com>, Dely Sy <dely.l.sy@intel.com>"
311da177e4SLinus Torvalds #define DRIVER_DESC	"Standard Hot Plug PCI Controller Driver"
321da177e4SLinus Torvalds 
331da177e4SLinus Torvalds MODULE_AUTHOR(DRIVER_AUTHOR);
341da177e4SLinus Torvalds MODULE_DESCRIPTION(DRIVER_DESC);
351da177e4SLinus Torvalds 
361da177e4SLinus Torvalds module_param(shpchp_debug, bool, 0644);
371da177e4SLinus Torvalds module_param(shpchp_poll_mode, bool, 0644);
381da177e4SLinus Torvalds module_param(shpchp_poll_time, int, 0644);
391da177e4SLinus Torvalds MODULE_PARM_DESC(shpchp_debug, "Debugging mode enabled or not");
401da177e4SLinus Torvalds MODULE_PARM_DESC(shpchp_poll_mode, "Using polling mechanism for hot-plug events or not");
411da177e4SLinus Torvalds MODULE_PARM_DESC(shpchp_poll_time, "Polling mechanism frequency, in seconds");
421da177e4SLinus Torvalds 
431da177e4SLinus Torvalds #define SHPC_MODULE_NAME "shpchp"
441da177e4SLinus Torvalds 
451da177e4SLinus Torvalds static int set_attention_status(struct hotplug_slot *slot, u8 value);
461da177e4SLinus Torvalds static int enable_slot(struct hotplug_slot *slot);
471da177e4SLinus Torvalds static int disable_slot(struct hotplug_slot *slot);
481da177e4SLinus Torvalds static int get_power_status(struct hotplug_slot *slot, u8 *value);
491da177e4SLinus Torvalds static int get_attention_status(struct hotplug_slot *slot, u8 *value);
501da177e4SLinus Torvalds static int get_latch_status(struct hotplug_slot *slot, u8 *value);
511da177e4SLinus Torvalds static int get_adapter_status(struct hotplug_slot *slot, u8 *value);
521da177e4SLinus Torvalds 
5381c4b5bfSLukas Wunner static const struct hotplug_slot_ops shpchp_hotplug_slot_ops = {
541da177e4SLinus Torvalds 	.set_attention_status =	set_attention_status,
551da177e4SLinus Torvalds 	.enable_slot =		enable_slot,
561da177e4SLinus Torvalds 	.disable_slot =		disable_slot,
571da177e4SLinus Torvalds 	.get_power_status =	get_power_status,
581da177e4SLinus Torvalds 	.get_attention_status =	get_attention_status,
591da177e4SLinus Torvalds 	.get_latch_status =	get_latch_status,
601da177e4SLinus Torvalds 	.get_adapter_status =	get_adapter_status,
611da177e4SLinus Torvalds };
621da177e4SLinus Torvalds 
init_slots(struct controller * ctrl)631da177e4SLinus Torvalds static int init_slots(struct controller *ctrl)
641da177e4SLinus Torvalds {
65926030f6SKenji Kaneshige 	struct slot *slot;
66926030f6SKenji Kaneshige 	struct hotplug_slot *hotplug_slot;
6766f17055SAlex Chiang 	char name[SLOT_NAME_SIZE];
6883d05710SJulia Lawall 	int retval;
695fe6cc60SAlex Chiang 	int i;
701da177e4SLinus Torvalds 
71926030f6SKenji Kaneshige 	for (i = 0; i < ctrl->num_slots; i++) {
7257c95c0dSKenji Kaneshige 		slot = kzalloc(sizeof(*slot), GFP_KERNEL);
7383d05710SJulia Lawall 		if (!slot) {
7483d05710SJulia Lawall 			retval = -ENOMEM;
751da177e4SLinus Torvalds 			goto error;
7683d05710SJulia Lawall 		}
771da177e4SLinus Torvalds 
78125450f8SLukas Wunner 		hotplug_slot = &slot->hotplug_slot;
791da177e4SLinus Torvalds 
80926030f6SKenji Kaneshige 		slot->hp_slot = i;
81926030f6SKenji Kaneshige 		slot->ctrl = ctrl;
82227b84c7SKenji Kaneshige 		slot->bus = ctrl->pci_dev->subordinate->number;
83926030f6SKenji Kaneshige 		slot->device = ctrl->slot_device_offset + i;
84926030f6SKenji Kaneshige 		slot->hpc_ops = ctrl->hpc_ops;
856f39be2eSKenji Kaneshige 		slot->number = ctrl->first_slot + (ctrl->slot_num_inc * i);
86f652e7d2SBjorn Helgaas 
87d8537548SKees Cook 		slot->wq = alloc_workqueue("shpchp-%d", 0, 0, slot->number);
88f652e7d2SBjorn Helgaas 		if (!slot->wq) {
89f652e7d2SBjorn Helgaas 			retval = -ENOMEM;
90125450f8SLukas Wunner 			goto error_slot;
91f652e7d2SBjorn Helgaas 		}
92f652e7d2SBjorn Helgaas 
93a246fa4eSKenji Kaneshige 		mutex_init(&slot->lock);
94e325e1f0SKristen Carlson Accardi 		INIT_DELAYED_WORK(&slot->work, shpchp_queue_pushbutton_work);
951da177e4SLinus Torvalds 
961da177e4SLinus Torvalds 		/* register this slot with the hotplug pci core */
9766f17055SAlex Chiang 		snprintf(name, SLOT_NAME_SIZE, "%d", slot->number);
98926030f6SKenji Kaneshige 		hotplug_slot->ops = &shpchp_hotplug_slot_ops;
991da177e4SLinus Torvalds 
100227f0647SRyan Desfosses 		ctrl_dbg(ctrl, "Registering domain:bus:dev=%04x:%02x:%02x hp_slot=%x sun=%x slot_device_offset=%x\n",
101be7bce25STaku Izumi 			 pci_domain_nr(ctrl->pci_dev->subordinate),
102be7bce25STaku Izumi 			 slot->bus, slot->device, slot->hp_slot, slot->number,
103be7bce25STaku Izumi 			 ctrl->slot_device_offset);
104125450f8SLukas Wunner 		retval = pci_hp_register(hotplug_slot,
10566f17055SAlex Chiang 				ctrl->pci_dev->subordinate, slot->device, name);
106926030f6SKenji Kaneshige 		if (retval) {
107f98ca311STaku Izumi 			ctrl_err(ctrl, "pci_hp_register failed with error %d\n",
108f98ca311STaku Izumi 				 retval);
109f652e7d2SBjorn Helgaas 			goto error_slotwq;
1101da177e4SLinus Torvalds 		}
1111da177e4SLinus Torvalds 
112a7da2161SLukas Wunner 		get_power_status(hotplug_slot, &slot->pwr_save);
113a7da2161SLukas Wunner 		get_attention_status(hotplug_slot, &slot->attention_save);
114a7da2161SLukas Wunner 		get_latch_status(hotplug_slot, &slot->latch_save);
115a7da2161SLukas Wunner 		get_adapter_status(hotplug_slot, &slot->presence_save);
11666f17055SAlex Chiang 
1175b1a960dSKenji Kaneshige 		list_add(&slot->slot_list, &ctrl->slot_list);
1181da177e4SLinus Torvalds 	}
1191da177e4SLinus Torvalds 
1201da177e4SLinus Torvalds 	return 0;
121f652e7d2SBjorn Helgaas error_slotwq:
122f652e7d2SBjorn Helgaas 	destroy_workqueue(slot->wq);
1231da177e4SLinus Torvalds error_slot:
124926030f6SKenji Kaneshige 	kfree(slot);
1251da177e4SLinus Torvalds error:
126926030f6SKenji Kaneshige 	return retval;
1271da177e4SLinus Torvalds }
1281da177e4SLinus Torvalds 
cleanup_slots(struct controller * ctrl)129f7391f53SKenji Kaneshige void cleanup_slots(struct controller *ctrl)
1301da177e4SLinus Torvalds {
1312ac83cccSGeliang Tang 	struct slot *slot, *next;
1321da177e4SLinus Torvalds 
1332ac83cccSGeliang Tang 	list_for_each_entry_safe(slot, next, &ctrl->slot_list, slot_list) {
1345b1a960dSKenji Kaneshige 		list_del(&slot->slot_list);
135f7391f53SKenji Kaneshige 		cancel_delayed_work(&slot->work);
136f652e7d2SBjorn Helgaas 		destroy_workqueue(slot->wq);
137125450f8SLukas Wunner 		pci_hp_deregister(&slot->hotplug_slot);
13851bbf9beSLukas Wunner 		kfree(slot);
1391da177e4SLinus Torvalds 	}
1401da177e4SLinus Torvalds }
1411da177e4SLinus Torvalds 
1421da177e4SLinus Torvalds /*
1431da177e4SLinus Torvalds  * set_attention_status - Turns the Amber LED for a slot on, off or blink
1441da177e4SLinus Torvalds  */
set_attention_status(struct hotplug_slot * hotplug_slot,u8 status)1451da177e4SLinus Torvalds static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status)
1461da177e4SLinus Torvalds {
1478352e04eSKenji Kaneshige 	struct slot *slot = get_slot(hotplug_slot);
1481da177e4SLinus Torvalds 
149be7bce25STaku Izumi 	ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
150f98ca311STaku Izumi 		 __func__, slot_name(slot));
1511da177e4SLinus Torvalds 
152a7da2161SLukas Wunner 	slot->attention_save = status;
1531da177e4SLinus Torvalds 	slot->hpc_ops->set_attention_status(slot, status);
1541da177e4SLinus Torvalds 
1551da177e4SLinus Torvalds 	return 0;
1561da177e4SLinus Torvalds }
1571da177e4SLinus Torvalds 
enable_slot(struct hotplug_slot * hotplug_slot)1581da177e4SLinus Torvalds static int enable_slot(struct hotplug_slot *hotplug_slot)
1591da177e4SLinus Torvalds {
1608352e04eSKenji Kaneshige 	struct slot *slot = get_slot(hotplug_slot);
1611da177e4SLinus Torvalds 
162be7bce25STaku Izumi 	ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
163f98ca311STaku Izumi 		 __func__, slot_name(slot));
1641da177e4SLinus Torvalds 
165a246fa4eSKenji Kaneshige 	return shpchp_sysfs_enable_slot(slot);
1661da177e4SLinus Torvalds }
1671da177e4SLinus Torvalds 
disable_slot(struct hotplug_slot * hotplug_slot)1681da177e4SLinus Torvalds static int disable_slot(struct hotplug_slot *hotplug_slot)
1691da177e4SLinus Torvalds {
1708352e04eSKenji Kaneshige 	struct slot *slot = get_slot(hotplug_slot);
1711da177e4SLinus Torvalds 
172be7bce25STaku Izumi 	ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
173f98ca311STaku Izumi 		 __func__, slot_name(slot));
1741da177e4SLinus Torvalds 
175a246fa4eSKenji Kaneshige 	return shpchp_sysfs_disable_slot(slot);
1761da177e4SLinus Torvalds }
1771da177e4SLinus Torvalds 
get_power_status(struct hotplug_slot * hotplug_slot,u8 * value)1781da177e4SLinus Torvalds static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
1791da177e4SLinus Torvalds {
1808352e04eSKenji Kaneshige 	struct slot *slot = get_slot(hotplug_slot);
1811da177e4SLinus Torvalds 	int retval;
1821da177e4SLinus Torvalds 
183be7bce25STaku Izumi 	ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
184f98ca311STaku Izumi 		 __func__, slot_name(slot));
1851da177e4SLinus Torvalds 
1861da177e4SLinus Torvalds 	retval = slot->hpc_ops->get_power_status(slot, value);
1871da177e4SLinus Torvalds 	if (retval < 0)
188a7da2161SLukas Wunner 		*value = slot->pwr_save;
1891da177e4SLinus Torvalds 
1901da177e4SLinus Torvalds 	return 0;
1911da177e4SLinus Torvalds }
1921da177e4SLinus Torvalds 
get_attention_status(struct hotplug_slot * hotplug_slot,u8 * value)1931da177e4SLinus Torvalds static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
1941da177e4SLinus Torvalds {
1958352e04eSKenji Kaneshige 	struct slot *slot = get_slot(hotplug_slot);
1961da177e4SLinus Torvalds 	int retval;
1971da177e4SLinus Torvalds 
198be7bce25STaku Izumi 	ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
199f98ca311STaku Izumi 		 __func__, slot_name(slot));
2001da177e4SLinus Torvalds 
2011da177e4SLinus Torvalds 	retval = slot->hpc_ops->get_attention_status(slot, value);
2021da177e4SLinus Torvalds 	if (retval < 0)
203a7da2161SLukas Wunner 		*value = slot->attention_save;
2041da177e4SLinus Torvalds 
2051da177e4SLinus Torvalds 	return 0;
2061da177e4SLinus Torvalds }
2071da177e4SLinus Torvalds 
get_latch_status(struct hotplug_slot * hotplug_slot,u8 * value)2081da177e4SLinus Torvalds static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
2091da177e4SLinus Torvalds {
2108352e04eSKenji Kaneshige 	struct slot *slot = get_slot(hotplug_slot);
2111da177e4SLinus Torvalds 	int retval;
2121da177e4SLinus Torvalds 
213be7bce25STaku Izumi 	ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
214f98ca311STaku Izumi 		 __func__, slot_name(slot));
2151da177e4SLinus Torvalds 
2161da177e4SLinus Torvalds 	retval = slot->hpc_ops->get_latch_status(slot, value);
2171da177e4SLinus Torvalds 	if (retval < 0)
218a7da2161SLukas Wunner 		*value = slot->latch_save;
2191da177e4SLinus Torvalds 
2201da177e4SLinus Torvalds 	return 0;
2211da177e4SLinus Torvalds }
2221da177e4SLinus Torvalds 
get_adapter_status(struct hotplug_slot * hotplug_slot,u8 * value)2231da177e4SLinus Torvalds static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
2241da177e4SLinus Torvalds {
2258352e04eSKenji Kaneshige 	struct slot *slot = get_slot(hotplug_slot);
2261da177e4SLinus Torvalds 	int retval;
2271da177e4SLinus Torvalds 
228be7bce25STaku Izumi 	ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
229f98ca311STaku Izumi 		 __func__, slot_name(slot));
2301da177e4SLinus Torvalds 
2311da177e4SLinus Torvalds 	retval = slot->hpc_ops->get_adapter_status(slot, value);
2321da177e4SLinus Torvalds 	if (retval < 0)
233a7da2161SLukas Wunner 		*value = slot->presence_save;
2341da177e4SLinus Torvalds 
2351da177e4SLinus Torvalds 	return 0;
2361da177e4SLinus Torvalds }
2371da177e4SLinus Torvalds 
shpc_capable(struct pci_dev * bridge)238b03799b0SBjorn Helgaas static bool shpc_capable(struct pci_dev *bridge)
239b03799b0SBjorn Helgaas {
240b03799b0SBjorn Helgaas 	/*
241b03799b0SBjorn Helgaas 	 * It is assumed that AMD GOLAM chips support SHPC but they do not
242b03799b0SBjorn Helgaas 	 * have SHPC capability.
243b03799b0SBjorn Helgaas 	 */
244b03799b0SBjorn Helgaas 	if (bridge->vendor == PCI_VENDOR_ID_AMD &&
245b03799b0SBjorn Helgaas 	    bridge->device == PCI_DEVICE_ID_AMD_GOLAM_7450)
246b03799b0SBjorn Helgaas 		return true;
247b03799b0SBjorn Helgaas 
248b03799b0SBjorn Helgaas 	if (pci_find_capability(bridge, PCI_CAP_ID_SHPC))
249b03799b0SBjorn Helgaas 		return true;
250b03799b0SBjorn Helgaas 
251b03799b0SBjorn Helgaas 	return false;
252b03799b0SBjorn Helgaas }
253b03799b0SBjorn Helgaas 
shpc_probe(struct pci_dev * pdev,const struct pci_device_id * ent)2541da177e4SLinus Torvalds static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2551da177e4SLinus Torvalds {
2561da177e4SLinus Torvalds 	int rc;
2571da177e4SLinus Torvalds 	struct controller *ctrl;
2581da177e4SLinus Torvalds 
259b03799b0SBjorn Helgaas 	if (!shpc_capable(pdev))
260b03799b0SBjorn Helgaas 		return -ENODEV;
261b03799b0SBjorn Helgaas 
26290cc0c3cSMika Westerberg 	if (acpi_get_hp_hw_control_from_firmware(pdev))
2631410dc1cSrajesh.shah@intel.com 		return -ENODEV;
2641410dc1cSrajesh.shah@intel.com 
26557c95c0dSKenji Kaneshige 	ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL);
266c7abb235SMarkus Elfring 	if (!ctrl)
2671da177e4SLinus Torvalds 		goto err_out_none;
268c7abb235SMarkus Elfring 
2695b1a960dSKenji Kaneshige 	INIT_LIST_HEAD(&ctrl->slot_list);
2701da177e4SLinus Torvalds 
271ee138334Srajesh.shah@intel.com 	rc = shpc_init(ctrl, pdev);
2721da177e4SLinus Torvalds 	if (rc) {
273be7bce25STaku Izumi 		ctrl_dbg(ctrl, "Controller initialization failed\n");
2741da177e4SLinus Torvalds 		goto err_out_free_ctrl;
2751da177e4SLinus Torvalds 	}
2761da177e4SLinus Torvalds 
2771da177e4SLinus Torvalds 	pci_set_drvdata(pdev, ctrl);
2781da177e4SLinus Torvalds 
2791da177e4SLinus Torvalds 	/* Setup the slot information structures */
2801da177e4SLinus Torvalds 	rc = init_slots(ctrl);
2811da177e4SLinus Torvalds 	if (rc) {
282be7bce25STaku Izumi 		ctrl_err(ctrl, "Slot initialization failed\n");
283f7391f53SKenji Kaneshige 		goto err_out_release_ctlr;
2841da177e4SLinus Torvalds 	}
2851da177e4SLinus Torvalds 
286e1b95dc6SGreg Kroah-Hartman 	rc = shpchp_create_ctrl_files(ctrl);
287e1b95dc6SGreg Kroah-Hartman 	if (rc)
288e1b95dc6SGreg Kroah-Hartman 		goto err_cleanup_slots;
2891da177e4SLinus Torvalds 
290b03799b0SBjorn Helgaas 	pdev->shpc_managed = 1;
2911da177e4SLinus Torvalds 	return 0;
2921da177e4SLinus Torvalds 
293e1b95dc6SGreg Kroah-Hartman err_cleanup_slots:
294e1b95dc6SGreg Kroah-Hartman 	cleanup_slots(ctrl);
295f7391f53SKenji Kaneshige err_out_release_ctlr:
2961da177e4SLinus Torvalds 	ctrl->hpc_ops->release_ctlr(ctrl);
2971da177e4SLinus Torvalds err_out_free_ctrl:
2981da177e4SLinus Torvalds 	kfree(ctrl);
2991da177e4SLinus Torvalds err_out_none:
3001da177e4SLinus Torvalds 	return -ENODEV;
3011da177e4SLinus Torvalds }
3021da177e4SLinus Torvalds 
shpc_remove(struct pci_dev * dev)303e6b82b13SKenji Kaneshige static void shpc_remove(struct pci_dev *dev)
3041da177e4SLinus Torvalds {
305e6b82b13SKenji Kaneshige 	struct controller *ctrl = pci_get_drvdata(dev);
3061da177e4SLinus Torvalds 
307b03799b0SBjorn Helgaas 	dev->shpc_managed = 0;
308c2608a11Srajesh.shah@intel.com 	shpchp_remove_ctrl_files(ctrl);
3091da177e4SLinus Torvalds 	ctrl->hpc_ops->release_ctlr(ctrl);
310a4534560SKenji Kaneshige 	kfree(ctrl);
3111da177e4SLinus Torvalds }
3121da177e4SLinus Torvalds 
3138394264dSArvind Yadav static const struct pci_device_id shpcd_pci_tbl[] = {
314*904b10fbSPali Rohár 	{PCI_DEVICE_CLASS(PCI_CLASS_BRIDGE_PCI_NORMAL, ~0)},
3151da177e4SLinus Torvalds 	{ /* end: all zeroes */ }
3161da177e4SLinus Torvalds };
3171da177e4SLinus Torvalds MODULE_DEVICE_TABLE(pci, shpcd_pci_tbl);
3181da177e4SLinus Torvalds 
3191da177e4SLinus Torvalds static struct pci_driver shpc_driver = {
3201da177e4SLinus Torvalds 	.name =		SHPC_MODULE_NAME,
3211da177e4SLinus Torvalds 	.id_table =	shpcd_pci_tbl,
3221da177e4SLinus Torvalds 	.probe =	shpc_probe,
323e6b82b13SKenji Kaneshige 	.remove =	shpc_remove,
3241da177e4SLinus Torvalds };
3251da177e4SLinus Torvalds 
shpcd_init(void)3261da177e4SLinus Torvalds static int __init shpcd_init(void)
3271da177e4SLinus Torvalds {
328f652e7d2SBjorn Helgaas 	int retval;
329e24dcbefSTejun Heo 
3301da177e4SLinus Torvalds 	retval = pci_register_driver(&shpc_driver);
33166bef8c0SHarvey Harrison 	dbg("%s: pci_register_driver = %d\n", __func__, retval);
3321da177e4SLinus Torvalds 	info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
333f652e7d2SBjorn Helgaas 
3341da177e4SLinus Torvalds 	return retval;
3351da177e4SLinus Torvalds }
3361da177e4SLinus Torvalds 
shpcd_cleanup(void)3371da177e4SLinus Torvalds static void __exit shpcd_cleanup(void)
3381da177e4SLinus Torvalds {
3391da177e4SLinus Torvalds 	dbg("unload_shpchpd()\n");
3401da177e4SLinus Torvalds 	pci_unregister_driver(&shpc_driver);
3411da177e4SLinus Torvalds 	info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n");
3421da177e4SLinus Torvalds }
3431da177e4SLinus Torvalds 
3441da177e4SLinus Torvalds module_init(shpcd_init);
3451da177e4SLinus Torvalds module_exit(shpcd_cleanup);
346