blob: c53291d815bf6c23945b4fb3fbe9dde850b91a1f [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,
Furquan Shaikha1cd7eb2020-04-15 23:58:22 -070013 PCI_DEVICE_ID_AMD_FAM17H_HDA1,
Marc Jones24484842017-05-04 21:17:45 -060014 0
15};
16
Marc Jones24484842017-05-04 21:17:45 -060017static struct device_operations hda_audio_ops = {
Furquan Shaikh45f06c52020-04-27 18:02:21 -070018 .read_resources = pci_dev_read_resources,
19 .set_resources = pci_dev_set_resources,
20 .enable_resources = pci_dev_enable_resources,
21 .ops_pci = &pci_dev_ops_pci,
Marc Jones24484842017-05-04 21:17:45 -060022};
23
24static const struct pci_driver hdaaudio_driver __pci_driver = {
Furquan Shaikh45f06c52020-04-27 18:02:21 -070025 .ops = CONFIG(AZALIA_PLUGIN_SUPPORT) ?
26 &default_azalia_audio_ops : &hda_audio_ops,
27 .vendor = PCI_VENDOR_ID_AMD,
28 .devices = pci_device_ids,
Marc Jones24484842017-05-04 21:17:45 -060029};