aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHuang Rui <ray.huang@amd.com>2013-10-03 11:37:13 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-03 18:44:51 -0400
commit02c123ee99c793f65af2dbda17d5fe87d448f808 (patch)
treeb162941b0c565ec3119438c778e1ed32a81842fe /drivers
parent3ad145b62a15c86150dd0cc229a39a3120d462f9 (diff)
usb: ohci: use amd_chipset_type to filter for SB800 prefetch
Commit "usb: pci-quirks: refactor AMD quirk to abstract AMD chipset types" introduced a new AMD chipset type to filter AMD platforms with different chipsets. According to a recent thread [1], this patch updates SB800 prefetch routine in AMD PLL quirk. And make it use the new chipset type to represent SB800 generation. [1] http://marc.info/?l=linux-usb&m=138012321616452&w=2 Signed-off-by: Huang Rui <ray.huang@amd.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/host/ohci-pci.c14
-rw-r--r--drivers/usb/host/pci-quirks.c8
-rw-r--r--drivers/usb/host/pci-quirks.h1
3 files changed, 10 insertions, 13 deletions
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c
index eedf97c1790e..90879e9ccbec 100644
--- a/drivers/usb/host/ohci-pci.c
+++ b/drivers/usb/host/ohci-pci.c
@@ -150,28 +150,16 @@ static int ohci_quirk_nec(struct usb_hcd *hcd)
150static int ohci_quirk_amd700(struct usb_hcd *hcd) 150static int ohci_quirk_amd700(struct usb_hcd *hcd)
151{ 151{
152 struct ohci_hcd *ohci = hcd_to_ohci(hcd); 152 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
153 struct pci_dev *amd_smbus_dev;
154 u8 rev;
155 153
156 if (usb_amd_find_chipset_info()) 154 if (usb_amd_find_chipset_info())
157 ohci->flags |= OHCI_QUIRK_AMD_PLL; 155 ohci->flags |= OHCI_QUIRK_AMD_PLL;
158 156
159 amd_smbus_dev = pci_get_device(PCI_VENDOR_ID_ATI,
160 PCI_DEVICE_ID_ATI_SBX00_SMBUS, NULL);
161 if (!amd_smbus_dev)
162 return 0;
163
164 rev = amd_smbus_dev->revision;
165
166 /* SB800 needs pre-fetch fix */ 157 /* SB800 needs pre-fetch fix */
167 if ((rev >= 0x40) && (rev <= 0x4f)) { 158 if (usb_amd_prefetch_quirk()) {
168 ohci->flags |= OHCI_QUIRK_AMD_PREFETCH; 159 ohci->flags |= OHCI_QUIRK_AMD_PREFETCH;
169 ohci_dbg(ohci, "enabled AMD prefetch quirk\n"); 160 ohci_dbg(ohci, "enabled AMD prefetch quirk\n");
170 } 161 }
171 162
172 pci_dev_put(amd_smbus_dev);
173 amd_smbus_dev = NULL;
174
175 return 0; 163 return 0;
176} 164}
177 165
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index 138a55536d97..8c6c6d9036d1 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -275,6 +275,14 @@ bool usb_amd_hang_symptom_quirk(void)
275} 275}
276EXPORT_SYMBOL_GPL(usb_amd_hang_symptom_quirk); 276EXPORT_SYMBOL_GPL(usb_amd_hang_symptom_quirk);
277 277
278bool usb_amd_prefetch_quirk(void)
279{
280 usb_amd_find_chipset_info();
281 /* SB800 needs pre-fetch fix */
282 return amd_chipset.sb_type.gen == AMD_CHIPSET_SB800;
283}
284EXPORT_SYMBOL_GPL(usb_amd_prefetch_quirk);
285
278/* 286/*
279 * The hardware normally enables the A-link power management feature, which 287 * The hardware normally enables the A-link power management feature, which
280 * lets the system lower the power consumption in idle states. 288 * lets the system lower the power consumption in idle states.
diff --git a/drivers/usb/host/pci-quirks.h b/drivers/usb/host/pci-quirks.h
index 820f532f7c1c..638e88f7a28b 100644
--- a/drivers/usb/host/pci-quirks.h
+++ b/drivers/usb/host/pci-quirks.h
@@ -6,6 +6,7 @@ void uhci_reset_hc(struct pci_dev *pdev, unsigned long base);
6int uhci_check_and_reset_hc(struct pci_dev *pdev, unsigned long base); 6int uhci_check_and_reset_hc(struct pci_dev *pdev, unsigned long base);
7int usb_amd_find_chipset_info(void); 7int usb_amd_find_chipset_info(void);
8bool usb_amd_hang_symptom_quirk(void); 8bool usb_amd_hang_symptom_quirk(void);
9bool usb_amd_prefetch_quirk(void);
9void usb_amd_dev_put(void); 10void usb_amd_dev_put(void);
10void usb_amd_quirk_pll_disable(void); 11void usb_amd_quirk_pll_disable(void);
11void usb_amd_quirk_pll_enable(void); 12void usb_amd_quirk_pll_enable(void);