blob: f49c9bfd5f95798fe175bcb32c63f3ab63f114f2 [file] [log] [blame]
Eric Biederman83b991a2003-10-11 06:20:25 +00001/*
2 * (C) 2003 Linux Networx
3 */
4#include <console/console.h>
5#include <device/device.h>
6#include <device/pci.h>
7#include <device/pci_ids.h>
8#include <device/pci_ops.h>
9#include "amd8111.h"
10
Eric Biedermandbec2d42004-10-21 10:44:08 +000011static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
12{
Stefan Reinauer14e22772010-04-27 06:56:47 +000013 pci_write_config32(dev, 0x2c,
Eric Biedermandbec2d42004-10-21 10:44:08 +000014 ((device & 0xffff) << 16) | (vendor & 0xffff));
15}
16
17static struct pci_operations lops_pci = {
18 .set_subsystem = lpci_set_subsystem,
19};
Eric Biederman83b991a2003-10-11 06:20:25 +000020
21static struct device_operations ac97audio_ops = {
22 .read_resources = pci_dev_read_resources,
23 .set_resources = pci_dev_set_resources,
24 .enable_resources = pci_dev_enable_resources,
Eric Biedermandbec2d42004-10-21 10:44:08 +000025 .enable = amd8111_enable,
Eric Biederman83b991a2003-10-11 06:20:25 +000026 .init = 0,
27 .scan_bus = 0,
Eric Biedermandbec2d42004-10-21 10:44:08 +000028 .ops_pci = &lops_pci,
Eric Biederman83b991a2003-10-11 06:20:25 +000029};
30
Stefan Reinauerf1cf1f72007-10-24 09:08:58 +000031static const struct pci_driver ac97audio_driver __pci_driver = {
Eric Biederman83b991a2003-10-11 06:20:25 +000032 .ops = &ac97audio_ops,
33 .vendor = PCI_VENDOR_ID_AMD,
34 .device = 0x746D,
35};
36
37
38static struct device_operations ac97modem_ops = {
39 .read_resources = pci_dev_read_resources,
40 .set_resources = pci_dev_set_resources,
41 .enable_resources = pci_dev_enable_resources,
Eric Biedermandbec2d42004-10-21 10:44:08 +000042 .enable = amd8111_enable,
Eric Biederman83b991a2003-10-11 06:20:25 +000043 .init = 0,
44 .scan_bus = 0,
Eric Biedermandbec2d42004-10-21 10:44:08 +000045 .ops_pci = &lops_pci,
Eric Biederman83b991a2003-10-11 06:20:25 +000046};
47
Stefan Reinauerf1cf1f72007-10-24 09:08:58 +000048static const struct pci_driver ac97modem_driver __pci_driver = {
Eric Biederman83b991a2003-10-11 06:20:25 +000049 .ops = &ac97modem_ops,
50 .vendor = PCI_VENDOR_ID_AMD,
51 .device = 0x746E,
52};