blob: 1eaee1e57880157cbb857f339cca92bffd1a5b6a [file] [log] [blame]
Angel Ponsae593872020-04-04 18:50:57 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
Marc Jones24484842017-05-04 21:17:45 -06003
Marc Jones24484842017-05-04 21:17:45 -06004#include <device/device.h>
5#include <device/pci.h>
6#include <device/pci_ids.h>
Marshall Dawsone1a59dc2019-08-20 18:17:54 -06007#include <device/pci_ops.h>
8#include <device/azalia_device.h>
Marc Jones24484842017-05-04 21:17:45 -06009
10static const unsigned short pci_device_ids[] = {
11 PCI_DEVICE_ID_AMD_SB900_HDA,
12 PCI_DEVICE_ID_AMD_CZ_HDA,
Marshall Dawson57c9bb02019-06-20 14:34:22 -060013 PCI_DEVICE_ID_AMD_PCO_HDA1,
Marc Jones24484842017-05-04 21:17:45 -060014 0
15};
16
Marc Jones24484842017-05-04 21:17:45 -060017static struct pci_operations lops_pci = {
18 .set_subsystem = pci_dev_set_subsystem,
19};
20
21static struct device_operations hda_audio_ops = {
22 .read_resources = pci_dev_read_resources,
23 .set_resources = pci_dev_set_resources,
24 .enable_resources = pci_dev_enable_resources,
Marc Jones24484842017-05-04 21:17:45 -060025 .ops_pci = &lops_pci,
26};
27
28static const struct pci_driver hdaaudio_driver __pci_driver = {
Marshall Dawsone1a59dc2019-08-20 18:17:54 -060029 .ops = CONFIG(AZALIA_PLUGIN_SUPPORT) ?
30 &default_azalia_audio_ops : &hda_audio_ops,
Marc Jones24484842017-05-04 21:17:45 -060031 .vendor = PCI_VENDOR_ID_AMD,
32 .devices = pci_device_ids,
33};