[coreboot-gerrit] New patch to review for coreboot: Add support for DMIC-4ch in apollolake
Sathyanarayana Nujella (sathyanarayana.nujella@intel.com)
gerrit at coreboot.org
Thu Oct 27 03:15:36 CEST 2016
Sathyanarayana Nujella (sathyanarayana.nujella at intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17156
-gerrit
commit 47cf9cf54f6622a17b38258de4d40d8f7e08587b
Author: Sathyanarayana Nujella <sathyanarayana.nujella at intel.com>
Date: Wed Oct 26 17:31:36 2016 -0700
Add support for DMIC-4ch in apollolake
BUG=chrome-os-partner:56918
BRANCH=none
Change-Id: If630ed53bb2cf00ccc441eb062b2e8c650d3cf01
Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella at intel.com>
---
src/soc/intel/apollolake/Kconfig | 7 +++++
src/soc/intel/apollolake/Makefile.inc | 5 ++++
src/soc/intel/apollolake/nhlt.c | 49 ++++++++++++++++++++++++++++++-----
3 files changed, 54 insertions(+), 7 deletions(-)
diff --git a/src/soc/intel/apollolake/Kconfig b/src/soc/intel/apollolake/Kconfig
index 187214a..7daeff6 100644
--- a/src/soc/intel/apollolake/Kconfig
+++ b/src/soc/intel/apollolake/Kconfig
@@ -217,6 +217,13 @@ config NHLT_DMIC_2CH_16B
help
Include DSP firmware settings for 2 channel 16B DMIC array.
+config NHLT_DMIC_4CH_16B
+ bool
+ depends on ACPI_NHLT
+ default n
+ help
+ Include DSP firmware settings for 4 channel 16B DMIC array.
+
config NHLT_MAX98357
bool
depends on ACPI_NHLT
diff --git a/src/soc/intel/apollolake/Makefile.inc b/src/soc/intel/apollolake/Makefile.inc
index 4f867e1..79d1d28 100644
--- a/src/soc/intel/apollolake/Makefile.inc
+++ b/src/soc/intel/apollolake/Makefile.inc
@@ -125,6 +125,7 @@ endif
# DSP firmware settings files.
NHLT_BLOB_PATH = 3rdparty/blobs/soc/intel/apollolake/nhlt-blobs
DMIC_2CH_48KHZ_16B = dmic-2ch-48khz-16b.bin
+DMIC_4CH_48KHZ_16B = dmic-4ch-48khz-16b.bin
MAX98357_RENDER = max98357-render-2ch-48khz-24b.bin
DA7219_RENDER_CAPTURE = dialog-2ch-48khz-24b.bin
@@ -132,6 +133,10 @@ cbfs-files-$(CONFIG_NHLT_DMIC_2CH_16B) += $(DMIC_2CH_48KHZ_16B)
$(DMIC_2CH_48KHZ_16B)-file := $(NHLT_BLOB_PATH)/$(DMIC_2CH_48KHZ_16B)
$(DMIC_2CH_48KHZ_16B)-type := raw
+cbfs-files-$(CONFIG_NHLT_DMIC_4CH_16B) += $(DMIC_4CH_48KHZ_16B)
+$(DMIC_4CH_48KHZ_16B)-file := $(NHLT_BLOB_PATH)/$(DMIC_4CH_48KHZ_16B)
+$(DMIC_4CH_48KHZ_16B)-type := raw
+
cbfs-files-$(CONFIG_NHLT_MAX98357) += $(MAX98357_RENDER)
$(MAX98357_RENDER)-file := $(NHLT_BLOB_PATH)/$(MAX98357_RENDER)
$(MAX98357_RENDER)-type := raw
diff --git a/src/soc/intel/apollolake/nhlt.c b/src/soc/intel/apollolake/nhlt.c
index 3670a13..7bd2205 100644
--- a/src/soc/intel/apollolake/nhlt.c
+++ b/src/soc/intel/apollolake/nhlt.c
@@ -50,6 +50,38 @@ static const struct nhlt_endp_descriptor dmic_2ch_descriptors[] = {
},
};
+static const struct nhlt_format_config dmic_4ch_formats[] = {
+ /* 48 KHz 16-bits per sample. */
+ {
+ .num_channels = 4,
+ .sample_freq_khz = 48,
+ .container_bits_per_sample = 16,
+ .valid_bits_per_sample = 16,
+ .settings_file = "dmic-4ch-48khz-16b.bin",
+ },
+};
+
+static const struct nhlt_dmic_array_config dmic_4ch_mic_config = {
+ .tdm_config = {
+ .config_type = NHLT_TDM_MIC_ARRAY,
+ },
+ .array_type = NHLT_MIC_ARRAY_4CH_L_SHAPED,
+};
+
+static const struct nhlt_endp_descriptor dmic_4ch_descriptors[] = {
+ {
+ .link = NHLT_LINK_PDM,
+ .device = NHLT_PDM_DEV,
+ .direction = NHLT_DIR_CAPTURE,
+ .vid = NHLT_VID,
+ .did = NHLT_DID_DMIC,
+ .cfg = &dmic_4ch_mic_config,
+ .cfg_size = sizeof(dmic_4ch_mic_config),
+ .formats = dmic_4ch_formats,
+ .num_formats = ARRAY_SIZE(dmic_4ch_formats),
+ },
+};
+
static const struct nhlt_format_config da7219_formats[] = {
/* 48 KHz 24-bits per sample. */
{
@@ -118,13 +150,16 @@ static const struct nhlt_endp_descriptor max98357_descriptors[] = {
int nhlt_soc_add_dmic_array(struct nhlt *nhlt, int num_channels)
{
- if (num_channels != 2) {
- printk(BIOS_ERR, "APL only supports 2CH DMIC array.\n");
- return -1;
- }
-
- return nhlt_add_endpoints(nhlt, dmic_2ch_descriptors,
- ARRAY_SIZE(dmic_2ch_descriptors));
+ switch (num_channels) {
+ case 2:
+ return nhlt_add_endpoints(nhlt, dmic_2ch_descriptors,
+ ARRAY_SIZE(dmic_2ch_descriptors));
+ case 4:
+ return nhlt_add_endpoints(nhlt, dmic_4ch_descriptors,
+ ARRAY_SIZE(dmic_4ch_descriptors));
+ default:
+ return -1;
+ }
}
int nhlt_soc_add_da7219(struct nhlt *nhlt, int hwlink)
More information about the coreboot-gerrit
mailing list