Lines Matching +full:hot +full:- +full:plug

1 // SPDX-License-Identifier: GPL-2.0+
3 * Standard Hot Plug Controller Driver
6 * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com)
8 * Copyright (C) 2003-2004 Intel Corporation
30 #define DRIVER_AUTHOR "Dan Zink <dan.zink@compaq.com>, Greg Kroah-Hartman <greg@kroah.com>, Dely Sy…
31 #define DRIVER_DESC "Standard Hot Plug PCI Controller Driver"
40 MODULE_PARM_DESC(shpchp_poll_mode, "Using polling mechanism for hot-plug events or not");
71 for (i = 0; i < ctrl->num_slots; i++) { in init_slots()
74 retval = -ENOMEM; in init_slots()
78 hotplug_slot = &slot->hotplug_slot; in init_slots()
80 slot->hp_slot = i; in init_slots()
81 slot->ctrl = ctrl; in init_slots()
82 slot->bus = ctrl->pci_dev->subordinate->number; in init_slots()
83 slot->device = ctrl->slot_device_offset + i; in init_slots()
84 slot->number = ctrl->first_slot + (ctrl->slot_num_inc * i); in init_slots()
86 slot->wq = alloc_workqueue("shpchp-%d", 0, 0, slot->number); in init_slots()
87 if (!slot->wq) { in init_slots()
88 retval = -ENOMEM; in init_slots()
92 mutex_init(&slot->lock); in init_slots()
93 INIT_DELAYED_WORK(&slot->work, shpchp_queue_pushbutton_work); in init_slots()
96 snprintf(name, SLOT_NAME_SIZE, "%d", slot->number); in init_slots()
97 hotplug_slot->ops = &shpchp_hotplug_slot_ops; in init_slots()
100 pci_domain_nr(ctrl->pci_dev->subordinate), in init_slots()
101 slot->bus, slot->device, slot->hp_slot, slot->number, in init_slots()
102 ctrl->slot_device_offset); in init_slots()
104 ctrl->pci_dev->subordinate, slot->device, name); in init_slots()
111 get_power_status(hotplug_slot, &slot->pwr_save); in init_slots()
112 get_attention_status(hotplug_slot, &slot->attention_save); in init_slots()
113 get_latch_status(hotplug_slot, &slot->latch_save); in init_slots()
114 get_adapter_status(hotplug_slot, &slot->presence_save); in init_slots()
116 list_add(&slot->slot_list, &ctrl->slot_list); in init_slots()
121 destroy_workqueue(slot->wq); in init_slots()
132 list_for_each_entry_safe(slot, next, &ctrl->slot_list, slot_list) { in cleanup_slots()
133 list_del(&slot->slot_list); in cleanup_slots()
134 cancel_delayed_work(&slot->work); in cleanup_slots()
135 destroy_workqueue(slot->wq); in cleanup_slots()
136 pci_hp_deregister(&slot->hotplug_slot); in cleanup_slots()
142 * set_attention_status - Turns the Amber LED for a slot on, off or blink
148 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", in set_attention_status()
151 slot->attention_save = status; in set_attention_status()
161 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", in enable_slot()
171 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", in disable_slot()
182 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", in get_power_status()
187 *value = slot->pwr_save; in get_power_status()
197 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", in get_attention_status()
202 *value = slot->attention_save; in get_attention_status()
212 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", in get_latch_status()
217 *value = slot->latch_save; in get_latch_status()
227 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", in get_adapter_status()
232 *value = slot->presence_save; in get_adapter_status()
243 if (bridge->vendor == PCI_VENDOR_ID_AMD && in shpc_capable()
244 bridge->device == PCI_DEVICE_ID_AMD_GOLAM_7450) in shpc_capable()
259 return -ENODEV; in shpc_probe()
262 return -ENODEV; in shpc_probe()
268 INIT_LIST_HEAD(&ctrl->slot_list); in shpc_probe()
289 pdev->shpc_managed = 1; in shpc_probe()
299 return -ENODEV; in shpc_probe()
306 dev->shpc_managed = 0; in shpc_remove()