Lines Matching defs:slot
246 static void pnv_php_add_pdns(struct pnv_php_slot *slot)
248 struct pci_controller *hose = pci_bus_to_host(slot->bus);
250 pci_traverse_device_nodes(slot->dn, pnv_php_add_one_pdn, hose);
326 static inline struct pnv_php_slot *to_pnv_php_slot(struct hotplug_slot *slot)
328 return container_of(slot, struct pnv_php_slot, slot);
331 int pnv_php_set_slot_power_state(struct hotplug_slot *slot,
334 struct pnv_php_slot *php_slot = to_pnv_php_slot(slot);
370 static int pnv_php_get_power_state(struct hotplug_slot *slot, u8 *state)
372 struct pnv_php_slot *php_slot = to_pnv_php_slot(slot);
392 static int pnv_php_get_adapter_state(struct hotplug_slot *slot, u8 *state)
394 struct pnv_php_slot *php_slot = to_pnv_php_slot(slot);
413 static int pnv_php_get_attention_state(struct hotplug_slot *slot, u8 *state)
415 struct pnv_php_slot *php_slot = to_pnv_php_slot(slot);
421 static int pnv_php_set_attention_state(struct hotplug_slot *slot, u8 state)
423 struct pnv_php_slot *php_slot = to_pnv_php_slot(slot);
445 struct hotplug_slot *slot = &php_slot->slot;
450 /* Check if the slot has been configured */
454 /* Retrieve slot presence status */
455 ret = pnv_php_get_adapter_state(slot, &presence);
460 * Proceed if there have nothing behind the slot. However,
461 * we should leave the slot in registered state at the
476 * If the power supply to the slot is off, we can't detect
478 * slot on before going to probe slot's presence state.
482 * supplies consistent slot power status: empty slot always
483 * has its power off and non-empty slot has its power on.
488 ret = pnv_php_get_power_state(slot, &power_status);
496 /* Check the power status. Scan the slot if it is already on */
497 ret = pnv_php_get_power_state(slot, &power_status);
504 /* Power is off, turn it on and then scan the slot */
505 ret = pnv_php_set_slot_power_state(slot, OPAL_PCI_SLOT_POWER_ON);
528 static int pnv_php_reset_slot(struct hotplug_slot *slot, int probe)
530 struct pnv_php_slot *php_slot = to_pnv_php_slot(slot);
559 static int pnv_php_enable_slot(struct hotplug_slot *slot)
561 struct pnv_php_slot *php_slot = to_pnv_php_slot(slot);
566 static int pnv_php_disable_slot(struct hotplug_slot *slot)
568 struct pnv_php_slot *php_slot = to_pnv_php_slot(slot);
572 * Allow to disable a slot already in the registered state to
573 * cover cases where the slot couldn't be enabled and never
580 /* Remove all devices behind the slot */
589 ret = pnv_php_set_slot_power_state(slot, OPAL_PCI_SLOT_POWER_OFF);
627 ret = of_property_read_string(dn, "ibm,slot-label", &label);
651 php_slot->slot_no = -1; /* Placeholder slot */
660 php_slot->slot.ops = &php_slot_ops;
675 /* Check if the slot is registered or not */
682 /* Register PCI slot */
683 ret = pci_hp_register(&php_slot->slot, php_slot->bus,
686 SLOT_WARN(php_slot, "Error %d registering slot\n", ret);
753 pnv_php_enable_slot(&php_slot->slot);
755 pnv_php_disable_slot(&php_slot->slot);
777 pci_dbg(pdev, "PCI slot [%s]: HP int! DLAct: %d, PresDet: %d\n",
790 "PCI slot [%s] error %d getting presence (0x%04x), to retry the operation.\n",
797 pci_dbg(pdev, "PCI slot [%s]: Spurious IRQ?\n", php_slot->name);
822 "PCI slot [%s] missed hotplug event 0x%04x\n",
827 pci_info(pdev, "PCI slot [%s] %s (IRQ: %d)\n",
853 ret = of_property_read_u32(php_slot->dn, "ibm,slot-broken-pdc",
937 /* Check if it's hotpluggable slot */
938 ret = of_property_read_u32(dn, "ibm,slot-pluggable", &prop32);
958 /* Enable interrupt if the slot supports surprise hotplug */
959 ret = of_property_read_u32(dn, "ibm,slot-surprise-pluggable", &prop32);
995 pci_hp_deregister(&php_slot->slot);
1023 pnv_php_register_one(dn); /* slot directly under the PHB */
1038 pnv_php_unregister_one(dn); /* slot directly under the PHB */