mb/google/nissa/var/nivviks: Disable MIPI WFC based on fw_config

BUG=b:218929856
TEST=Boot to OS on nivviks. Change fw_config in CBI and check that WFC
is enabled/disabled as expected.

Change-Id: Iac4bb358d904579376e0810f8c2644b3bde4f1e6
Signed-off-by: Reka Norman <rekanorman@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64208
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kangheui Won <khwon@chromium.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
diff --git a/src/mainboard/google/brya/variants/nivviks/fw_config.c b/src/mainboard/google/brya/variants/nivviks/fw_config.c
index 9e9932b..d899750 100644
--- a/src/mainboard/google/brya/variants/nivviks/fw_config.c
+++ b/src/mainboard/google/brya/variants/nivviks/fw_config.c
@@ -27,6 +27,21 @@
 	PAD_NC(GPP_H13, NONE),
 };
 
+static const struct pad_config wfc_disable_pads[] = {
+	/* D3  : WCAM_RST_L */
+	PAD_NC(GPP_D3, NONE),
+	/* D15 : EN_PP2800_WCAM_X */
+	PAD_NC(GPP_D15, NONE),
+	/* D16 : EN_PP1800_PP1200_WCAM_X */
+	PAD_NC(GPP_D16, NONE),
+	/* H22 : WCAM_MCLK_R */
+	PAD_NC(GPP_H22, NONE),
+	/* R6 : DMIC_WCAM_CLK_R */
+	PAD_NC(GPP_R6, NONE),
+	/* R7 : DMIC_WCAM_DATA */
+	PAD_NC(GPP_R7, NONE),
+};
+
 static void fw_config_handle(void *unused)
 {
 	if (!fw_config_probe(FW_CONFIG(DB_USB, DB_1C_LTE))) {
@@ -38,5 +53,10 @@
 		printk(BIOS_INFO, "Disable SD card GPIO pins.\n");
 		gpio_configure_pads(sd_disable_pads, ARRAY_SIZE(sd_disable_pads));
 	}
+
+	if (fw_config_probe(FW_CONFIG(WFC, WFC_ABSENT))) {
+		printk(BIOS_INFO, "Disable MIPI WFC GPIO pins.\n");
+		gpio_configure_pads(wfc_disable_pads, ARRAY_SIZE(wfc_disable_pads));
+	}
 }
 BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL);