2966d204e44a6c86d9766e59ad1e805ee915f4ce
[coreboot.git] / src / southbridge / intel / i82801bx / i82801bx_ac97.c
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2005 Tyan Computer
5  * (Written by Yinghai Lu <yinghailu@gmail.com> for Tyan Computer)
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
20  */
21
22 /* This code should work for all ICH* southbridges with AC97 audio/modem. */
23
24 #include <console/console.h>
25 #include <device/device.h>
26 #include <device/pci.h>
27 #include <device/pci_ids.h>
28 #include "i82801bx.h"
29
30 static struct device_operations ac97_ops = {
31         .read_resources         = pci_dev_read_resources,
32         .set_resources          = pci_dev_set_resources,
33         .enable_resources       = pci_dev_enable_resources,
34         .init                   = 0,
35         .scan_bus               = 0,
36         .enable                 = i82801bx_enable,
37 };
38
39 /* 82801AA (ICH) */
40 static const struct pci_driver i82801aa_ac97_audio __pci_driver = {
41         .ops    = &ac97_ops,
42         .vendor = PCI_VENDOR_ID_INTEL,
43         .device = PCI_DEVICE_ID_INTEL_82801AA_AC97_AUDIO,
44 };
45
46 static const struct pci_driver i82801aa_ac97_modem __pci_driver = {
47         .ops    = &ac97_ops,
48         .vendor = PCI_VENDOR_ID_INTEL,
49         .device = PCI_DEVICE_ID_INTEL_82801AA_AC97_MODEM,
50 };
51
52 /* 82801AB (ICH0) */
53 static const struct pci_driver i82801ab_ac97_audio __pci_driver = {
54         .ops    = &ac97_ops,
55         .vendor = PCI_VENDOR_ID_INTEL,
56         .device = PCI_DEVICE_ID_INTEL_82801AB_AC97_AUDIO,
57 };
58
59 static const struct pci_driver i82801ab_ac97_modem __pci_driver = {
60         .ops    = &ac97_ops,
61         .vendor = PCI_VENDOR_ID_INTEL,
62         .device = PCI_DEVICE_ID_INTEL_82801AB_AC97_MODEM,
63 };
64
65 /* 82801BA/BAM (ICH2/ICH2-M) */
66 static const struct pci_driver i82801ba_ac97_audio __pci_driver = {
67         .ops    = &ac97_ops,
68         .vendor = PCI_VENDOR_ID_INTEL,
69         .device = PCI_DEVICE_ID_INTEL_82801BA_AC97_AUDIO,
70 };
71
72 static const struct pci_driver i82801ba_ac97_modem __pci_driver = {
73         .ops    = &ac97_ops,
74         .vendor = PCI_VENDOR_ID_INTEL,
75         .device = PCI_DEVICE_ID_INTEL_82801BA_AC97_MODEM,
76 };
77
78 /* 82801CA/CAM (ICH3-S/ICH3-M) */
79 static const struct pci_driver i82801ca_ac97_audio __pci_driver = {
80         .ops    = &ac97_ops,
81         .vendor = PCI_VENDOR_ID_INTEL,
82         .device = PCI_DEVICE_ID_INTEL_82801CA_AC97_AUDIO,
83 };
84
85 static const struct pci_driver i82801ca_ac97_modem __pci_driver = {
86         .ops    = &ac97_ops,
87         .vendor = PCI_VENDOR_ID_INTEL,
88         .device = PCI_DEVICE_ID_INTEL_82801CA_AC97_MODEM,
89 };
90
91 /* 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) */
92 static const struct pci_driver i82801db_ac97_audio __pci_driver = {
93         .ops    = &ac97_ops,
94         .vendor = PCI_VENDOR_ID_INTEL,
95         .device = PCI_DEVICE_ID_INTEL_82801DB_AC97_AUDIO,
96 };
97
98 static const struct pci_driver i82801db_ac97_modem __pci_driver = {
99         .ops    = &ac97_ops,
100         .vendor = PCI_VENDOR_ID_INTEL,
101         .device = PCI_DEVICE_ID_INTEL_82801DB_AC97_MODEM,
102 };
103
104 /* 82801EB/ER (ICH5/ICH5R) */
105 static const struct pci_driver i82801eb_ac97_audio __pci_driver = {
106         .ops    = &ac97_ops,
107         .vendor = PCI_VENDOR_ID_INTEL,
108         .device = PCI_DEVICE_ID_INTEL_82801EB_AC97_AUDIO,
109 };
110
111 static const struct pci_driver i82801eb_ac97_modem __pci_driver = {
112         .ops    = &ac97_ops,
113         .vendor = PCI_VENDOR_ID_INTEL,
114         .device = PCI_DEVICE_ID_INTEL_82801EB_AC97_MODEM,
115 };
116
117 /* 82801FB/FR/FW/FRW/FBM (ICH6/ICH6R/ICH6W/ICH6RW/ICH6-M) */
118 static const struct pci_driver i82801fb_ac97_audio __pci_driver = {
119         .ops    = &ac97_ops,
120         .vendor = PCI_VENDOR_ID_INTEL,
121         .device = PCI_DEVICE_ID_INTEL_82801FB_AC97_AUDIO,
122 };
123
124 static const struct pci_driver i82801fb_ac97_modem __pci_driver = {
125         .ops    = &ac97_ops,
126         .vendor = PCI_VENDOR_ID_INTEL,
127         .device = PCI_DEVICE_ID_INTEL_82801FB_AC97_MODEM,
128 };