diff options
author | Dexuan Cui <dexuan.cui@intel.com> | 2009-12-07 00:03:22 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-12-16 16:37:51 -0500 |
commit | aeb30016fec3378c543cae33654c2144277fe674 (patch) | |
tree | f45c459334b963634d0c54aab4d3c0ff46e686b1 /drivers/pci/quirks.c | |
parent | b9c3b266411d27f1a6466c19d146d08db576bfea (diff) |
PCI: add Intel USB specific reset method
Handle device specific reset requirements (i.e. vendor reg for reset
along with appropriate timeout).
Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/quirks.c')
-rw-r--r-- | drivers/pci/quirks.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 86c9177a6c6c..cf96776d4bbf 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -2642,7 +2642,31 @@ fs_initcall_sync(pci_apply_final_quirks); | |||
2642 | * reset a single function if other methods (e.g. FLR, PM D0->D3) are | 2642 | * reset a single function if other methods (e.g. FLR, PM D0->D3) are |
2643 | * not available. | 2643 | * not available. |
2644 | */ | 2644 | */ |
2645 | static int reset_intel_generic_dev(struct pci_dev *dev, int probe) | ||
2646 | { | ||
2647 | int pos; | ||
2648 | |||
2649 | /* only implement PCI_CLASS_SERIAL_USB at present */ | ||
2650 | if (dev->class == PCI_CLASS_SERIAL_USB) { | ||
2651 | pos = pci_find_capability(dev, PCI_CAP_ID_VNDR); | ||
2652 | if (!pos) | ||
2653 | return -ENOTTY; | ||
2654 | |||
2655 | if (probe) | ||
2656 | return 0; | ||
2657 | |||
2658 | pci_write_config_byte(dev, pos + 0x4, 1); | ||
2659 | msleep(100); | ||
2660 | |||
2661 | return 0; | ||
2662 | } else { | ||
2663 | return -ENOTTY; | ||
2664 | } | ||
2665 | } | ||
2666 | |||
2645 | struct pci_dev_reset_methods pci_dev_reset_methods[] = { | 2667 | struct pci_dev_reset_methods pci_dev_reset_methods[] = { |
2668 | { PCI_VENDOR_ID_INTEL, PCI_ANY_ID, | ||
2669 | reset_intel_generic_dev }, | ||
2646 | { 0 } | 2670 | { 0 } |
2647 | }; | 2671 | }; |
2648 | #else | 2672 | #else |