soc/mediatek: Add DEVAPC_DEBUG option

Add DEVAPC_DEBUG option and set this option to disabled by default.
This option prevents DEVAPC log flooding during the boot process. Enable
this option when we need to debug DEVAPC issues.

TEST=DEVAPC log is disabled by default.

Change-Id: I26bc0378b8a766c6a8cc4903d64a921c3e96b93f
Signed-off-by: Yidi Lin <yidilin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71158
Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/soc/mediatek/common/Kconfig b/src/soc/mediatek/common/Kconfig
index 62934da..1352a8c 100644
--- a/src/soc/mediatek/common/Kconfig
+++ b/src/soc/mediatek/common/Kconfig
@@ -77,4 +77,11 @@
 	  For SoCs where IO pins default to PMIF_SPMI mode, enable this option
 	  to skip software PMIF_SPMI IO pins configuration.
 
+config DEVAPC_DEBUG
+	bool
+	default n
+	help
+	  When this option is enabled, the DEVAPC driver prints the settings after
+	  initialization.
+
 endif
diff --git a/src/soc/mediatek/common/devapc.c b/src/soc/mediatek/common/devapc.c
index 5859c9a..7838d7d 100644
--- a/src/soc/mediatek/common/devapc.c
+++ b/src/soc/mediatek/common/devapc.c
@@ -45,8 +45,8 @@
 		if (devapc_init[i].init)
 			devapc_init[i].init(devapc_ao_base);
 
-		/* Dump Setting */
-		if (devapc_init[i].dump)
+		/* Dump setting */
+		if (CONFIG(DEVAPC_DEBUG) && devapc_init[i].dump)
 			devapc_init[i].dump(devapc_ao_base);
 	}
 }