[coreboot-gerrit] Patch set updated for coreboot: mainboard/google/reef: Add proper DMIC endpoints based on DMIC config pin

Sathyanarayana Nujella (sathyanarayana.nujella@intel.com) gerrit at coreboot.org
Mon Nov 14 19:28:01 CET 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/17158

-gerrit

commit fb1c7aee84be7ac0500798f04aed554152237216
Author: Sathyanarayana Nujella <sathyanarayana.nujella at intel.com>
Date:   Wed Oct 26 17:35:39 2016 -0700

    mainboard/google/reef: Add proper DMIC endpoints based on DMIC config pin
    
    Reef board uses GPIO_17 as DMIC config pin.
    This pin distinguishes board with Quad DMIC's or Mono DMIC.
    This patch adds necessary DMIC endpoints to support either of
    those configurations.
    
    CQ-DEPEND=CL:*304339,CL:409774
    
    BUG=chrome-os-partner:56918
    BRANCH=none
    TEST=Verify Mono and Quad Channel DMIC record
    
    Change-Id: I5b2825b5f39f8962985a129f8ec65265fb18f0b2
    Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella at intel.com>
---
 src/mainboard/google/reef/Kconfig                      |  2 ++
 .../reef/variants/baseboard/include/baseboard/gpio.h   |  3 +++
 src/mainboard/google/reef/variants/baseboard/nhlt.c    | 18 +++++++++++++++---
 3 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/src/mainboard/google/reef/Kconfig b/src/mainboard/google/reef/Kconfig
index 4e32b86..4d76f38 100644
--- a/src/mainboard/google/reef/Kconfig
+++ b/src/mainboard/google/reef/Kconfig
@@ -91,7 +91,9 @@ config UART_FOR_CONSOLE
 
 config INCLUDE_NHLT_BLOBS
 	bool "Include blobs for audio."
+	select NHLT_DMIC_1CH_16B
 	select NHLT_DMIC_2CH_16B
+	select NHLT_DMIC_4CH_16B
 	select NHLT_DA7219
 	select NHLT_MAX98357
 
diff --git a/src/mainboard/google/reef/variants/baseboard/include/baseboard/gpio.h b/src/mainboard/google/reef/variants/baseboard/include/baseboard/gpio.h
index f60bfdc..11e9e64 100644
--- a/src/mainboard/google/reef/variants/baseboard/include/baseboard/gpio.h
+++ b/src/mainboard/google/reef/variants/baseboard/include/baseboard/gpio.h
@@ -45,4 +45,7 @@
 #define MEM_CONFIG1	GPIO_102
 #define MEM_CONFIG0	GPIO_101
 
+/* DMIC config GPIO */
+#define DMIC_CONFIG_PIN	GPIO_17
+
 #endif /* BASEBOARD_GPIO_H */
diff --git a/src/mainboard/google/reef/variants/baseboard/nhlt.c b/src/mainboard/google/reef/variants/baseboard/nhlt.c
index ef9ec6c..28c1b9c 100644
--- a/src/mainboard/google/reef/variants/baseboard/nhlt.c
+++ b/src/mainboard/google/reef/variants/baseboard/nhlt.c
@@ -17,13 +17,25 @@
 #include <console/console.h>
 #include <nhlt.h>
 #include <soc/nhlt.h>
+#include <gpio.h>
+#include <variant/gpio.h>
+
+/* DMIC_CONFIG_PIN:  High for 1-DMIC and low for 4-DMIC's */
 
 void __attribute__((weak)) variant_nhlt_init(struct nhlt *nhlt)
 {
-	/* 2 Channel DMIC array. */
-	if (!nhlt_soc_add_dmic_array(nhlt, 2))
-		printk(BIOS_ERR, "Added 2CH DMIC array.\n");
+	if (gpio_get(DMIC_CONFIG_PIN) == 1) {
+		/* 1-dmic configuration */
+		if (!nhlt_soc_add_dmic_array(nhlt, 1))
+			printk(BIOS_ERR, "Added 1CH DMIC array.\n");
+	} else {
+		/* 4-dmic configuration */
+		if (!nhlt_soc_add_dmic_array(nhlt, 2))
+			printk(BIOS_ERR, "Added 2CH DMIC array.\n");
 
+		if (!nhlt_soc_add_dmic_array(nhlt, 4))
+			printk(BIOS_ERR, "Added 4CH DMIC array.\n");
+	}
 	/* Dialog for Headset codec.
 	 * Headset codec is bi-directional but uses the same configuration
 	 * settings for render and capture endpoints.



More information about the coreboot-gerrit mailing list