soc/intel: Refactor `xdci_can_enable()` function

The same pattern appears on all `xdci_can_enable()` call sites. Move the
logic inside the function and take the xDCI devfn as parameter.

Change-Id: I94c24c10c7fc7c5b4938cffca17bdfb853c7bd59
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55790
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
diff --git a/src/soc/intel/apollolake/chip.c b/src/soc/intel/apollolake/chip.c
index b9f007d..4cc29e6 100644
--- a/src/soc/intel/apollolake/chip.c
+++ b/src/soc/intel/apollolake/chip.c
@@ -680,10 +680,7 @@
 	else
 		apl_fsp_silicon_init_params_cb(cfg, silconfig);
 
-	/* Enable xDCI controller if enabled in devicetree and allowed */
-	if (!xdci_can_enable())
-		devfn_disable(pci_root_bus(), PCH_DEVFN_XDCI);
-	silconfig->UsbOtg = is_devfn_enabled(PCH_DEVFN_XDCI);
+	silconfig->UsbOtg = xdci_can_enable(PCH_DEVFN_XDCI);
 
 	silconfig->VmxEnable = CONFIG(ENABLE_VMX);