blob: 08efe1534dbecb5dd2ab2631af9708f19f2f9474 [file] [log] [blame]
Yinghai Lu13f1c2a2005-07-08 02:49:49 +00001#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 Reinauer138be832010-02-27 01:50:21 +00006#include "i82801ex.h"
Yinghai Lu13f1c2a2005-07-08 02:49:49 +00007
8static void ac97_set_subsystem(device_t dev, unsigned vendor, unsigned device)
9{
10 /* Write the subsystem vendor and device id */
Stefan Reinauer14e22772010-04-27 06:56:47 +000011 pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
Yinghai Lu13f1c2a2005-07-08 02:49:49 +000012 ((device & 0xffff) << 16) | (vendor & 0xffff));
13}
14
15static struct pci_operations lops_pci = {
16 .set_subsystem = ac97_set_subsystem,
17};
18static 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 Reinauer138be832010-02-27 01:50:21 +000024 .enable = i82801ex_enable,
Yinghai Lu13f1c2a2005-07-08 02:49:49 +000025 .ops_pci = &lops_pci,
26};
27
Stefan Reinauerf1cf1f72007-10-24 09:08:58 +000028static const struct pci_driver ac97_audio_driver __pci_driver = {
Yinghai Lu13f1c2a2005-07-08 02:49:49 +000029 .ops = &ac97_ops,
30 .vendor = PCI_VENDOR_ID_INTEL,
31 .device = PCI_DEVICE_ID_INTEL_82801ER_AC97_AUDIO,
32};
Stefan Reinauerf1cf1f72007-10-24 09:08:58 +000033static const struct pci_driver ac97_modem_driver __pci_driver = {
Yinghai Lu13f1c2a2005-07-08 02:49:49 +000034 .ops = &ac97_ops,
35 .vendor = PCI_VENDOR_ID_INTEL,
36 .device = PCI_DEVICE_ID_INTEL_82801ER_AC97_MODEM,
37};