1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <acpi/acpigen.h>
4 #include <device/device.h>
5 #include <device/pci.h>
6 #include <device/pci_ids.h>
7 #include <device/pci_ops.h>
8 #include <device/azalia_device.h>
10 static const unsigned short pci_device_ids
[] = {
11 PCI_DID_AMD_SB900_HDA
,
13 PCI_DID_AMD_FAM17H_HDA1
,
17 static const char *hda_acpi_name(const struct device
*dev
)
22 static struct device_operations hda_audio_ops
= {
23 .read_resources
= pci_dev_read_resources
,
24 .set_resources
= pci_dev_set_resources
,
25 .enable_resources
= pci_dev_enable_resources
,
26 .ops_pci
= &pci_dev_ops_pci
,
27 .acpi_name
= hda_acpi_name
,
28 .acpi_fill_ssdt
= acpi_device_write_pci_dev
,
31 static const struct pci_driver hdaaudio_driver __pci_driver
= {
32 .ops
= CONFIG(AZALIA_HDA_CODEC_SUPPORT
) ?
33 &default_azalia_audio_ops
: &hda_audio_ops
,
34 .vendor
= PCI_VID_AMD
,
35 .devices
= pci_device_ids
,