Yinghai Lu | 13f1c2a | 2005-07-08 02:49:49 +0000 | [diff] [blame] | 1 | #include <console/console.h> |
| 2 | #include <device/device.h> |
| 3 | #include <device/pci.h> |
| 4 | #include <device/pci_ids.h> |
| 5 | #include <device/pci_ops.h> |
Stefan Reinauer | 138be83 | 2010-02-27 01:50:21 +0000 | [diff] [blame] | 6 | #include "i82801ex.h" |
Yinghai Lu | 13f1c2a | 2005-07-08 02:49:49 +0000 | [diff] [blame] | 7 | |
| 8 | static void ac97_set_subsystem(device_t dev, unsigned vendor, unsigned device) |
| 9 | { |
| 10 | /* Write the subsystem vendor and device id */ |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 11 | pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, |
Yinghai Lu | 13f1c2a | 2005-07-08 02:49:49 +0000 | [diff] [blame] | 12 | ((device & 0xffff) << 16) | (vendor & 0xffff)); |
| 13 | } |
| 14 | |
| 15 | static struct pci_operations lops_pci = { |
| 16 | .set_subsystem = ac97_set_subsystem, |
| 17 | }; |
| 18 | static struct device_operations ac97_ops = { |
| 19 | .read_resources = pci_dev_read_resources, |
| 20 | .set_resources = pci_dev_set_resources, |
| 21 | .enable_resources = pci_dev_enable_resources, |
| 22 | .init = 0, |
| 23 | .scan_bus = 0, |
Stefan Reinauer | 138be83 | 2010-02-27 01:50:21 +0000 | [diff] [blame] | 24 | .enable = i82801ex_enable, |
Yinghai Lu | 13f1c2a | 2005-07-08 02:49:49 +0000 | [diff] [blame] | 25 | .ops_pci = &lops_pci, |
| 26 | }; |
| 27 | |
Stefan Reinauer | f1cf1f7 | 2007-10-24 09:08:58 +0000 | [diff] [blame] | 28 | static const struct pci_driver ac97_audio_driver __pci_driver = { |
Yinghai Lu | 13f1c2a | 2005-07-08 02:49:49 +0000 | [diff] [blame] | 29 | .ops = &ac97_ops, |
| 30 | .vendor = PCI_VENDOR_ID_INTEL, |
| 31 | .device = PCI_DEVICE_ID_INTEL_82801ER_AC97_AUDIO, |
| 32 | }; |
Stefan Reinauer | f1cf1f7 | 2007-10-24 09:08:58 +0000 | [diff] [blame] | 33 | static const struct pci_driver ac97_modem_driver __pci_driver = { |
Yinghai Lu | 13f1c2a | 2005-07-08 02:49:49 +0000 | [diff] [blame] | 34 | .ops = &ac97_ops, |
| 35 | .vendor = PCI_VENDOR_ID_INTEL, |
| 36 | .device = PCI_DEVICE_ID_INTEL_82801ER_AC97_MODEM, |
| 37 | }; |