Lines Matching refs:ctrl
29 static void set_slot_off(struct controller *ctrl, struct slot *pslot) in set_slot_off() argument
32 if (POWER_CTRL(ctrl)) { in set_slot_off()
57 struct controller *ctrl = p_slot->ctrl; in board_added() local
58 struct pci_bus *parent = ctrl->pcie->port->subordinate; in board_added()
60 if (POWER_CTRL(ctrl)) { in board_added()
70 retval = pciehp_check_link_status(ctrl); in board_added()
72 ctrl_err(ctrl, "Failed to check link status\n"); in board_added()
77 if (ctrl->power_fault_detected || pciehp_query_power_fault(p_slot)) { in board_added()
78 ctrl_err(ctrl, "Slot(%s): Power fault\n", slot_name(p_slot)); in board_added()
86 ctrl_err(ctrl, "Cannot add device at %04x:%02x:00\n", in board_added()
97 set_slot_off(ctrl, p_slot); in board_added()
107 struct controller *ctrl = p_slot->ctrl; in remove_board() local
111 if (POWER_CTRL(ctrl)) { in remove_board()
129 void pciehp_request(struct controller *ctrl, int action) in pciehp_request() argument
131 atomic_or(action, &ctrl->pending_events); in pciehp_request()
133 irq_wake_thread(ctrl->pcie->irq, ctrl); in pciehp_request()
139 struct controller *ctrl = p_slot->ctrl; in pciehp_queue_pushbutton_work() local
144 pciehp_request(ctrl, DISABLE_SLOT); in pciehp_queue_pushbutton_work()
147 pciehp_request(ctrl, PCI_EXP_SLTSTA_PDC); in pciehp_queue_pushbutton_work()
157 struct controller *ctrl = p_slot->ctrl; in pciehp_handle_button_press() local
165 ctrl_info(ctrl, "Slot(%s): Powering off due to button press\n", in pciehp_handle_button_press()
169 ctrl_info(ctrl, "Slot(%s) Powering on due to button press\n", in pciehp_handle_button_press()
184 ctrl_info(ctrl, "Slot(%s): Button cancel\n", slot_name(p_slot)); in pciehp_handle_button_press()
194 ctrl_info(ctrl, "Slot(%s): Action canceled due to button press\n", in pciehp_handle_button_press()
198 ctrl_err(ctrl, "Slot(%s): Ignoring invalid state %#x\n", in pciehp_handle_button_press()
207 struct controller *ctrl = slot->ctrl; in pciehp_handle_disable_request() local
219 ctrl->request_result = pciehp_disable_slot(slot); in pciehp_handle_disable_request()
224 struct controller *ctrl = slot->ctrl; in pciehp_handle_presence_or_link_change() local
241 ctrl_info(ctrl, "Slot(%s): Link Down\n", in pciehp_handle_presence_or_link_change()
244 ctrl_info(ctrl, "Slot(%s): Card not present\n", in pciehp_handle_presence_or_link_change()
256 link_active = pciehp_check_link_active(ctrl); in pciehp_handle_presence_or_link_change()
270 ctrl_info(ctrl, "Slot(%s): Card present\n", in pciehp_handle_presence_or_link_change()
273 ctrl_info(ctrl, "Slot(%s): Link Up\n", in pciehp_handle_presence_or_link_change()
275 ctrl->request_result = pciehp_enable_slot(slot); in pciehp_handle_presence_or_link_change()
286 struct controller *ctrl = p_slot->ctrl; in __pciehp_enable_slot() local
290 ctrl_info(ctrl, "Slot(%s): No adapter\n", slot_name(p_slot)); in __pciehp_enable_slot()
293 if (MRL_SENS(p_slot->ctrl)) { in __pciehp_enable_slot()
296 ctrl_info(ctrl, "Slot(%s): Latch open\n", in __pciehp_enable_slot()
302 if (POWER_CTRL(p_slot->ctrl)) { in __pciehp_enable_slot()
305 ctrl_info(ctrl, "Slot(%s): Already enabled\n", in __pciehp_enable_slot()
316 struct controller *ctrl = slot->ctrl; in pciehp_enable_slot() local
319 pm_runtime_get_sync(&ctrl->pcie->port->dev); in pciehp_enable_slot()
321 if (ret && ATTN_BUTTN(ctrl)) in pciehp_enable_slot()
323 pm_runtime_put(&ctrl->pcie->port->dev); in pciehp_enable_slot()
335 struct controller *ctrl = p_slot->ctrl; in __pciehp_disable_slot() local
337 if (POWER_CTRL(p_slot->ctrl)) { in __pciehp_disable_slot()
340 ctrl_info(ctrl, "Slot(%s): Already disabled\n", in __pciehp_disable_slot()
352 struct controller *ctrl = slot->ctrl; in pciehp_disable_slot() local
355 pm_runtime_get_sync(&ctrl->pcie->port->dev); in pciehp_disable_slot()
357 pm_runtime_put(&ctrl->pcie->port->dev); in pciehp_disable_slot()
368 struct controller *ctrl = p_slot->ctrl; in pciehp_sysfs_enable_slot() local
379 ctrl->request_result = -ENODEV; in pciehp_sysfs_enable_slot()
380 pciehp_request(ctrl, PCI_EXP_SLTSTA_PDC); in pciehp_sysfs_enable_slot()
381 wait_event(ctrl->requester, in pciehp_sysfs_enable_slot()
382 !atomic_read(&ctrl->pending_events)); in pciehp_sysfs_enable_slot()
383 return ctrl->request_result; in pciehp_sysfs_enable_slot()
385 ctrl_info(ctrl, "Slot(%s): Already in powering on state\n", in pciehp_sysfs_enable_slot()
391 ctrl_info(ctrl, "Slot(%s): Already enabled\n", in pciehp_sysfs_enable_slot()
395 ctrl_err(ctrl, "Slot(%s): Invalid state %#x\n", in pciehp_sysfs_enable_slot()
406 struct controller *ctrl = p_slot->ctrl; in pciehp_sysfs_disable_slot() local
413 pciehp_request(ctrl, DISABLE_SLOT); in pciehp_sysfs_disable_slot()
414 wait_event(ctrl->requester, in pciehp_sysfs_disable_slot()
415 !atomic_read(&ctrl->pending_events)); in pciehp_sysfs_disable_slot()
416 return ctrl->request_result; in pciehp_sysfs_disable_slot()
418 ctrl_info(ctrl, "Slot(%s): Already in powering off state\n", in pciehp_sysfs_disable_slot()
424 ctrl_info(ctrl, "Slot(%s): Already disabled\n", in pciehp_sysfs_disable_slot()
428 ctrl_err(ctrl, "Slot(%s): Invalid state %#x\n", in pciehp_sysfs_disable_slot()