Revision: linuxbios@linuxbios.org--devel/freebios--devel--2.0--patch-30
[coreboot.git] / src / southbridge / nvidia / ck804 / ck804_ac97.c
1 /*
2  * Copyright 2004 Tyan Computer
3  *  by yhlu@tyan.com
4  */
5 #include <console/console.h>
6 #include <device/device.h>
7 #include <device/pci.h>
8 #include <device/pci_ids.h>
9 #include <device/pci_ops.h>
10 #include "ck804.h"
11
12 static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
13 {
14         pci_write_config32(dev, 0x40,
15                 ((device & 0xffff) << 16) | (vendor & 0xffff));
16 }
17
18 static struct pci_operations lops_pci = {
19         .set_subsystem = lpci_set_subsystem,
20 };
21
22 static struct device_operations ac97audio_ops  = {
23         .read_resources   = pci_dev_read_resources,
24         .set_resources    = pci_dev_set_resources,
25         .enable_resources = pci_dev_enable_resources,
26 //      .enable           = ck804_enable,
27         .init             = 0,
28         .scan_bus         = 0,
29         .ops_pci          = &lops_pci,
30 };
31
32 static struct pci_driver ac97audio_driver __pci_driver = {
33         .ops    = &ac97audio_ops,
34         .vendor = PCI_VENDOR_ID_NVIDIA,
35         .device = PCI_DEVICE_ID_NVIDIA_CK804_ACI,
36 };
37
38
39 static struct device_operations ac97modem_ops  = {
40         .read_resources   = pci_dev_read_resources,
41         .set_resources    = pci_dev_set_resources,
42         .enable_resources = pci_dev_enable_resources,
43 //      .enable           = ck804_enable,
44         .init             = 0,
45         .scan_bus         = 0,
46         .ops_pci          = &lops_pci,
47 };
48
49 static struct pci_driver ac97modem_driver __pci_driver = {
50         .ops    = &ac97modem_ops,
51         .vendor = PCI_VENDOR_ID_NVIDIA,
52         .device = PCI_DEVICE_ID_NVIDIA_CK804_MCI,
53 };