diff options
Diffstat (limited to 'src/soc/intel/common/block')
-rw-r--r-- | src/soc/intel/common/block/hda/Kconfig | 4 | ||||
-rw-r--r-- | src/soc/intel/common/block/hda/hda.c | 41 |
2 files changed, 6 insertions, 39 deletions
diff --git a/src/soc/intel/common/block/hda/Kconfig b/src/soc/intel/common/block/hda/Kconfig index a2209ab3ce..a01ede4ac6 100644 --- a/src/soc/intel/common/block/hda/Kconfig +++ b/src/soc/intel/common/block/hda/Kconfig @@ -6,5 +6,9 @@ config SOC_INTEL_COMMON_BLOCK_HDA config SOC_INTEL_COMMON_BLOCK_HDA_VERB bool depends on SOC_INTEL_COMMON_BLOCK_HDA + select AZALIA_LOCK_DOWN_R_WO_GCAP help Enable initialization of HDA codecs. + +config AZALIA_MAX_CODECS + default 4 if SOC_INTEL_COMMON_BLOCK_HDA_VERB diff --git a/src/soc/intel/common/block/hda/hda.c b/src/soc/intel/common/block/hda/hda.c index ece06caaeb..3aa2ad78bc 100644 --- a/src/soc/intel/common/block/hda/hda.c +++ b/src/soc/intel/common/block/hda/hda.c @@ -1,58 +1,21 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#include <console/console.h> #include <device/device.h> #include <device/azalia_device.h> #include <device/pci.h> #include <device/pci_ids.h> -#include <soc/intel/common/hda_verb.h> -#include <soc/ramstage.h> - -#if CONFIG(SOC_INTEL_COMMON_BLOCK_HDA_VERB) -static void codecs_init(uint8_t *base, u32 codec_mask) -{ - int i; - - /* Can support up to 4 codecs */ - for (i = 3; i >= 0; i--) { - if (codec_mask & (1 << i)) - hda_codec_init(base, i, - cim_verb_data_size, cim_verb_data); - } - - if (pc_beep_verbs_size) - hda_codec_write(base, pc_beep_verbs_size, pc_beep_verbs); -} static void hda_init(struct device *dev) { - struct resource *res; - int codec_mask; - uint8_t *base; - - res = find_resource(dev, PCI_BASE_ADDRESS_0); - if (!res) - return; - - base = res2mmio(res, 0, 0); - if (!base) - return; - - codec_mask = hda_codec_detect(base); - if (codec_mask) { - printk(BIOS_INFO, "HDA: codec_mask = %02x\n", codec_mask); - codecs_init(base, codec_mask); - } + if (CONFIG(SOC_INTEL_COMMON_BLOCK_HDA_VERB)) + azalia_audio_init(dev); } -#endif static struct device_operations hda_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, -#if CONFIG(SOC_INTEL_COMMON_BLOCK_HDA_VERB) .init = hda_init, -#endif .ops_pci = &pci_dev_ops_pci, .scan_bus = scan_static_bus }; |