diff options
-rw-r--r-- | drivers/pci/hotplug/pciehp.h | 4 | ||||
-rw-r--r-- | drivers/pci/hotplug/pciehp_hpc.c | 101 |
2 files changed, 0 insertions, 105 deletions
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h index 4b7cce1de6ec..26ffd3e3fb74 100644 --- a/drivers/pci/hotplug/pciehp.h +++ b/drivers/pci/hotplug/pciehp.h | |||
@@ -149,10 +149,6 @@ int pciehp_get_attention_status(struct slot *slot, u8 *status); | |||
149 | int pciehp_set_attention_status(struct slot *slot, u8 status); | 149 | int pciehp_set_attention_status(struct slot *slot, u8 status); |
150 | int pciehp_get_latch_status(struct slot *slot, u8 *status); | 150 | int pciehp_get_latch_status(struct slot *slot, u8 *status); |
151 | int pciehp_get_adapter_status(struct slot *slot, u8 *status); | 151 | int pciehp_get_adapter_status(struct slot *slot, u8 *status); |
152 | int pciehp_get_max_link_speed(struct slot *slot, enum pci_bus_speed *speed); | ||
153 | int pciehp_get_max_link_width(struct slot *slot, enum pcie_link_width *val); | ||
154 | int pciehp_get_cur_link_speed(struct slot *slot, enum pci_bus_speed *speed); | ||
155 | int pciehp_get_cur_link_width(struct slot *slot, enum pcie_link_width *val); | ||
156 | int pciehp_query_power_fault(struct slot *slot); | 152 | int pciehp_query_power_fault(struct slot *slot); |
157 | void pciehp_green_led_on(struct slot *slot); | 153 | void pciehp_green_led_on(struct slot *slot); |
158 | void pciehp_green_led_off(struct slot *slot); | 154 | void pciehp_green_led_off(struct slot *slot); |
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index a960faec1021..302451e8289d 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c | |||
@@ -705,107 +705,6 @@ static irqreturn_t pcie_isr(int irq, void *dev_id) | |||
705 | return IRQ_HANDLED; | 705 | return IRQ_HANDLED; |
706 | } | 706 | } |
707 | 707 | ||
708 | int pciehp_get_max_lnk_width(struct slot *slot, | ||
709 | enum pcie_link_width *value) | ||
710 | { | ||
711 | struct controller *ctrl = slot->ctrl; | ||
712 | enum pcie_link_width lnk_wdth; | ||
713 | u32 lnk_cap; | ||
714 | int retval = 0; | ||
715 | |||
716 | retval = pciehp_readl(ctrl, PCI_EXP_LNKCAP, &lnk_cap); | ||
717 | if (retval) { | ||
718 | ctrl_err(ctrl, "%s: Cannot read LNKCAP register\n", __func__); | ||
719 | return retval; | ||
720 | } | ||
721 | |||
722 | switch ((lnk_cap & PCI_EXP_LNKSTA_NLW) >> 4){ | ||
723 | case 0: | ||
724 | lnk_wdth = PCIE_LNK_WIDTH_RESRV; | ||
725 | break; | ||
726 | case 1: | ||
727 | lnk_wdth = PCIE_LNK_X1; | ||
728 | break; | ||
729 | case 2: | ||
730 | lnk_wdth = PCIE_LNK_X2; | ||
731 | break; | ||
732 | case 4: | ||
733 | lnk_wdth = PCIE_LNK_X4; | ||
734 | break; | ||
735 | case 8: | ||
736 | lnk_wdth = PCIE_LNK_X8; | ||
737 | break; | ||
738 | case 12: | ||
739 | lnk_wdth = PCIE_LNK_X12; | ||
740 | break; | ||
741 | case 16: | ||
742 | lnk_wdth = PCIE_LNK_X16; | ||
743 | break; | ||
744 | case 32: | ||
745 | lnk_wdth = PCIE_LNK_X32; | ||
746 | break; | ||
747 | default: | ||
748 | lnk_wdth = PCIE_LNK_WIDTH_UNKNOWN; | ||
749 | break; | ||
750 | } | ||
751 | |||
752 | *value = lnk_wdth; | ||
753 | ctrl_dbg(ctrl, "Max link width = %d\n", lnk_wdth); | ||
754 | |||
755 | return retval; | ||
756 | } | ||
757 | |||
758 | int pciehp_get_cur_lnk_width(struct slot *slot, | ||
759 | enum pcie_link_width *value) | ||
760 | { | ||
761 | struct controller *ctrl = slot->ctrl; | ||
762 | enum pcie_link_width lnk_wdth = PCIE_LNK_WIDTH_UNKNOWN; | ||
763 | int retval = 0; | ||
764 | u16 lnk_status; | ||
765 | |||
766 | retval = pciehp_readw(ctrl, PCI_EXP_LNKSTA, &lnk_status); | ||
767 | if (retval) { | ||
768 | ctrl_err(ctrl, "%s: Cannot read LNKSTATUS register\n", | ||
769 | __func__); | ||
770 | return retval; | ||
771 | } | ||
772 | |||
773 | switch ((lnk_status & PCI_EXP_LNKSTA_NLW) >> 4){ | ||
774 | case 0: | ||
775 | lnk_wdth = PCIE_LNK_WIDTH_RESRV; | ||
776 | break; | ||
777 | case 1: | ||
778 | lnk_wdth = PCIE_LNK_X1; | ||
779 | break; | ||
780 | case 2: | ||
781 | lnk_wdth = PCIE_LNK_X2; | ||
782 | break; | ||
783 | case 4: | ||
784 | lnk_wdth = PCIE_LNK_X4; | ||
785 | break; | ||
786 | case 8: | ||
787 | lnk_wdth = PCIE_LNK_X8; | ||
788 | break; | ||
789 | case 12: | ||
790 | lnk_wdth = PCIE_LNK_X12; | ||
791 | break; | ||
792 | case 16: | ||
793 | lnk_wdth = PCIE_LNK_X16; | ||
794 | break; | ||
795 | case 32: | ||
796 | lnk_wdth = PCIE_LNK_X32; | ||
797 | break; | ||
798 | default: | ||
799 | lnk_wdth = PCIE_LNK_WIDTH_UNKNOWN; | ||
800 | break; | ||
801 | } | ||
802 | |||
803 | *value = lnk_wdth; | ||
804 | ctrl_dbg(ctrl, "Current link width = %d\n", lnk_wdth); | ||
805 | |||
806 | return retval; | ||
807 | } | ||
808 | |||
809 | int pcie_enable_notification(struct controller *ctrl) | 708 | int pcie_enable_notification(struct controller *ctrl) |
810 | { | 709 | { |
811 | u16 cmd, mask; | 710 | u16 cmd, mask; |