Angel Pons | ae59387 | 2020-04-04 18:50:57 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 3 | |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 4 | #include <device/device.h> |
| 5 | #include <device/pci.h> |
| 6 | #include <device/pci_ids.h> |
Marshall Dawson | e1a59dc | 2019-08-20 18:17:54 -0600 | [diff] [blame] | 7 | #include <device/pci_ops.h> |
| 8 | #include <device/azalia_device.h> |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 9 | |
| 10 | static const unsigned short pci_device_ids[] = { |
| 11 | PCI_DEVICE_ID_AMD_SB900_HDA, |
| 12 | PCI_DEVICE_ID_AMD_CZ_HDA, |
Furquan Shaikh | a1cd7eb | 2020-04-15 23:58:22 -0700 | [diff] [blame] | 13 | PCI_DEVICE_ID_AMD_FAM17H_HDA1, |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 14 | 0 |
| 15 | }; |
| 16 | |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 17 | static struct device_operations hda_audio_ops = { |
| 18 | .read_resources = pci_dev_read_resources, |
| 19 | .set_resources = pci_dev_set_resources, |
| 20 | .enable_resources = pci_dev_enable_resources, |
Furquan Shaikh | f9e6d3e | 2020-04-27 17:59:25 -0700 | [diff] [blame^] | 21 | .ops_pci = &pci_dev_ops_pci, |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 22 | }; |
| 23 | |
| 24 | static const struct pci_driver hdaaudio_driver __pci_driver = { |
Marshall Dawson | e1a59dc | 2019-08-20 18:17:54 -0600 | [diff] [blame] | 25 | .ops = CONFIG(AZALIA_PLUGIN_SUPPORT) ? |
| 26 | &default_azalia_audio_ops : &hda_audio_ops, |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 27 | .vendor = PCI_VENDOR_ID_AMD, |
| 28 | .devices = pci_device_ids, |
| 29 | }; |