diff options
-rw-r--r-- | drivers/usb/host/ohci-hcd.c | 9 | ||||
-rw-r--r-- | drivers/usb/host/ohci-pci.c | 13 | ||||
-rw-r--r-- | drivers/usb/host/ohci-q.c | 6 | ||||
-rw-r--r-- | drivers/usb/host/pci-quirks.c | 13 | ||||
-rw-r--r-- | drivers/usb/host/pci-quirks.h | 2 |
5 files changed, 19 insertions, 24 deletions
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 20a632d09f93..93d2f3edd19d 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c | |||
@@ -80,15 +80,6 @@ static const char hcd_name [] = "ohci_hcd"; | |||
80 | 80 | ||
81 | static void ohci_dump (struct ohci_hcd *ohci, int verbose); | 81 | static void ohci_dump (struct ohci_hcd *ohci, int verbose); |
82 | static void ohci_stop (struct usb_hcd *hcd); | 82 | static void ohci_stop (struct usb_hcd *hcd); |
83 | #ifdef CONFIG_PCI | ||
84 | static void sb800_prefetch(struct ohci_hcd *ohci, int on); | ||
85 | #else | ||
86 | static inline void sb800_prefetch(struct ohci_hcd *ohci, int on) | ||
87 | { | ||
88 | return; | ||
89 | } | ||
90 | #endif | ||
91 | |||
92 | 83 | ||
93 | #include "ohci-hub.c" | 84 | #include "ohci-hub.c" |
94 | #include "ohci-dbg.c" | 85 | #include "ohci-dbg.c" |
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c index 2c27a5fc4bfe..c3fa93638ea6 100644 --- a/drivers/usb/host/ohci-pci.c +++ b/drivers/usb/host/ohci-pci.c | |||
@@ -168,19 +168,6 @@ static int ohci_quirk_amd700(struct usb_hcd *hcd) | |||
168 | return 0; | 168 | return 0; |
169 | } | 169 | } |
170 | 170 | ||
171 | static void sb800_prefetch(struct ohci_hcd *ohci, int on) | ||
172 | { | ||
173 | struct pci_dev *pdev; | ||
174 | u16 misc; | ||
175 | |||
176 | pdev = to_pci_dev(ohci_to_hcd(ohci)->self.controller); | ||
177 | pci_read_config_word(pdev, 0x50, &misc); | ||
178 | if (on == 0) | ||
179 | pci_write_config_word(pdev, 0x50, misc & 0xfcff); | ||
180 | else | ||
181 | pci_write_config_word(pdev, 0x50, misc | 0x0300); | ||
182 | } | ||
183 | |||
184 | /* List of quirks for OHCI */ | 171 | /* List of quirks for OHCI */ |
185 | static const struct pci_device_id ohci_pci_quirks[] = { | 172 | static const struct pci_device_id ohci_pci_quirks[] = { |
186 | { | 173 | { |
diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c index 88731b7c5f42..df4a6707322d 100644 --- a/drivers/usb/host/ohci-q.c +++ b/drivers/usb/host/ohci-q.c | |||
@@ -41,6 +41,7 @@ finish_urb(struct ohci_hcd *ohci, struct urb *urb, int status) | |||
41 | __releases(ohci->lock) | 41 | __releases(ohci->lock) |
42 | __acquires(ohci->lock) | 42 | __acquires(ohci->lock) |
43 | { | 43 | { |
44 | struct device *dev = ohci_to_hcd(ohci)->self.controller; | ||
44 | // ASSERT (urb->hcpriv != 0); | 45 | // ASSERT (urb->hcpriv != 0); |
45 | 46 | ||
46 | urb_free_priv (ohci, urb->hcpriv); | 47 | urb_free_priv (ohci, urb->hcpriv); |
@@ -55,7 +56,7 @@ __acquires(ohci->lock) | |||
55 | if (quirk_amdiso(ohci)) | 56 | if (quirk_amdiso(ohci)) |
56 | usb_amd_quirk_pll_enable(); | 57 | usb_amd_quirk_pll_enable(); |
57 | if (quirk_amdprefetch(ohci)) | 58 | if (quirk_amdprefetch(ohci)) |
58 | sb800_prefetch(ohci, 0); | 59 | sb800_prefetch(dev, 0); |
59 | } | 60 | } |
60 | break; | 61 | break; |
61 | case PIPE_INTERRUPT: | 62 | case PIPE_INTERRUPT: |
@@ -580,6 +581,7 @@ static void td_submit_urb ( | |||
580 | struct urb *urb | 581 | struct urb *urb |
581 | ) { | 582 | ) { |
582 | struct urb_priv *urb_priv = urb->hcpriv; | 583 | struct urb_priv *urb_priv = urb->hcpriv; |
584 | struct device *dev = ohci_to_hcd(ohci)->self.controller; | ||
583 | dma_addr_t data; | 585 | dma_addr_t data; |
584 | int data_len = urb->transfer_buffer_length; | 586 | int data_len = urb->transfer_buffer_length; |
585 | int cnt = 0; | 587 | int cnt = 0; |
@@ -689,7 +691,7 @@ static void td_submit_urb ( | |||
689 | if (quirk_amdiso(ohci)) | 691 | if (quirk_amdiso(ohci)) |
690 | usb_amd_quirk_pll_disable(); | 692 | usb_amd_quirk_pll_disable(); |
691 | if (quirk_amdprefetch(ohci)) | 693 | if (quirk_amdprefetch(ohci)) |
692 | sb800_prefetch(ohci, 1); | 694 | sb800_prefetch(dev, 1); |
693 | } | 695 | } |
694 | periodic = ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs++ == 0 | 696 | periodic = ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs++ == 0 |
695 | && ohci_to_hcd(ohci)->self.bandwidth_int_reqs == 0; | 697 | && ohci_to_hcd(ohci)->self.bandwidth_int_reqs == 0; |
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index 4c338ec03a07..b9848e4d3d44 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c | |||
@@ -91,6 +91,19 @@ static struct amd_chipset_info { | |||
91 | 91 | ||
92 | static DEFINE_SPINLOCK(amd_lock); | 92 | static DEFINE_SPINLOCK(amd_lock); |
93 | 93 | ||
94 | void sb800_prefetch(struct device *dev, int on) | ||
95 | { | ||
96 | u16 misc; | ||
97 | struct pci_dev *pdev = to_pci_dev(dev); | ||
98 | |||
99 | pci_read_config_word(pdev, 0x50, &misc); | ||
100 | if (on == 0) | ||
101 | pci_write_config_word(pdev, 0x50, misc & 0xfcff); | ||
102 | else | ||
103 | pci_write_config_word(pdev, 0x50, misc | 0x0300); | ||
104 | } | ||
105 | EXPORT_SYMBOL_GPL(sb800_prefetch); | ||
106 | |||
94 | int usb_amd_find_chipset_info(void) | 107 | int usb_amd_find_chipset_info(void) |
95 | { | 108 | { |
96 | u8 rev = 0; | 109 | u8 rev = 0; |
diff --git a/drivers/usb/host/pci-quirks.h b/drivers/usb/host/pci-quirks.h index 7f69a39163ce..4b8a2092432f 100644 --- a/drivers/usb/host/pci-quirks.h +++ b/drivers/usb/host/pci-quirks.h | |||
@@ -11,11 +11,13 @@ void usb_amd_quirk_pll_enable(void); | |||
11 | bool usb_is_intel_switchable_xhci(struct pci_dev *pdev); | 11 | bool usb_is_intel_switchable_xhci(struct pci_dev *pdev); |
12 | void usb_enable_xhci_ports(struct pci_dev *xhci_pdev); | 12 | void usb_enable_xhci_ports(struct pci_dev *xhci_pdev); |
13 | void usb_disable_xhci_ports(struct pci_dev *xhci_pdev); | 13 | void usb_disable_xhci_ports(struct pci_dev *xhci_pdev); |
14 | void sb800_prefetch(struct device *dev, int on); | ||
14 | #else | 15 | #else |
15 | static inline void usb_amd_quirk_pll_disable(void) {} | 16 | static inline void usb_amd_quirk_pll_disable(void) {} |
16 | static inline void usb_amd_quirk_pll_enable(void) {} | 17 | static inline void usb_amd_quirk_pll_enable(void) {} |
17 | static inline void usb_amd_dev_put(void) {} | 18 | static inline void usb_amd_dev_put(void) {} |
18 | static inline void usb_disable_xhci_ports(struct pci_dev *xhci_pdev) {} | 19 | static inline void usb_disable_xhci_ports(struct pci_dev *xhci_pdev) {} |
20 | static inline void sb800_prefetch(struct device *dev, int on) {} | ||
19 | #endif /* CONFIG_PCI */ | 21 | #endif /* CONFIG_PCI */ |
20 | 22 | ||
21 | #endif /* __LINUX_USB_PCI_QUIRKS_H */ | 23 | #endif /* __LINUX_USB_PCI_QUIRKS_H */ |