#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/usb.h>
#include <linux/usb/hcd.h>
#include <asm/io.h>
#include <asm/irq.h>
#ifdef CONFIG_PPC_PMAC
#include <asm/machdep.h>
#include <asm/pmac_feature.h>
#endif
#include "usb.h"
static DECLARE_RWSEM(companions_rwsem);
#define CL_UHCI …
#define CL_OHCI …
#define CL_EHCI …
static inline int is_ohci_or_uhci(struct pci_dev *pdev)
{ … }
companion_fn;
static void for_each_companion(struct pci_dev *pdev, struct usb_hcd *hcd,
companion_fn fn)
{ … }
static void ehci_pre_add(struct pci_dev *pdev, struct usb_hcd *hcd,
struct pci_dev *companion, struct usb_hcd *companion_hcd)
{ … }
static void ehci_post_add(struct pci_dev *pdev, struct usb_hcd *hcd,
struct pci_dev *companion, struct usb_hcd *companion_hcd)
{ … }
static void non_ehci_add(struct pci_dev *pdev, struct usb_hcd *hcd,
struct pci_dev *companion, struct usb_hcd *companion_hcd)
{ … }
static void ehci_remove(struct pci_dev *pdev, struct usb_hcd *hcd,
struct pci_dev *companion, struct usb_hcd *companion_hcd)
{ … }
#ifdef CONFIG_PM
static void ehci_wait_for_companions(struct pci_dev *pdev, struct usb_hcd *hcd,
struct pci_dev *companion, struct usb_hcd *companion_hcd)
{ … }
#endif
int usb_hcd_pci_probe(struct pci_dev *dev, const struct hc_driver *driver)
{ … }
EXPORT_SYMBOL_GPL(…);
void usb_hcd_pci_remove(struct pci_dev *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
void usb_hcd_pci_shutdown(struct pci_dev *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
#ifdef CONFIG_PM
#ifdef CONFIG_PPC_PMAC
static void powermac_set_asic(struct pci_dev *pci_dev, int enable)
{
if (machine_is(powermac)) {
struct device_node *of_node;
of_node = pci_device_to_OF_node(pci_dev);
if (of_node)
pmac_call_feature(PMAC_FTR_USB_ENABLE,
of_node, 0, enable);
}
}
#else
static inline void powermac_set_asic(struct pci_dev *pci_dev, int enable)
{ … }
#endif
static int check_root_hub_suspended(struct device *dev)
{ … }
static int suspend_common(struct device *dev, pm_message_t msg)
{ … }
static int resume_common(struct device *dev, pm_message_t msg)
{ … }
#ifdef CONFIG_PM_SLEEP
static int hcd_pci_suspend(struct device *dev)
{ … }
static int hcd_pci_suspend_noirq(struct device *dev)
{ … }
static int hcd_pci_poweroff_late(struct device *dev)
{ … }
static int hcd_pci_resume_noirq(struct device *dev)
{ … }
static int hcd_pci_resume(struct device *dev)
{ … }
static int hcd_pci_restore(struct device *dev)
{ … }
#else
#define hcd_pci_suspend …
#define hcd_pci_suspend_noirq …
#define hcd_pci_poweroff_late …
#define hcd_pci_resume_noirq …
#define hcd_pci_resume …
#define hcd_pci_restore …
#endif
static int hcd_pci_runtime_suspend(struct device *dev)
{ … }
static int hcd_pci_runtime_resume(struct device *dev)
{ … }
const struct dev_pm_ops usb_hcd_pci_pm_ops = …;
EXPORT_SYMBOL_GPL(…);
#endif