Enabling SPDIF output on ALC887?

In Windows 10, when a motherboard has a SPDIF header, there’s a “Realtek Digital Output” device. On a motherboard without it, it’s not there. Both motherboards use the same ALC887 IC which has 2 SPDIF outputs.

How does the driver know if a motherboard has an SPDIF header? I’ve tried changing the drivers and it’s not there.
The datasheet for the ALC887 says BIOS can set configuration, so I’m guessing it’s in the BIOS?
https://www.hardwaresecrets.com/datasheets/ALC887.pdf

So what I wonder is, how do I modify a BIOS to configure the ALC887 for a digital output?

Some bios motherboards have some switches for routing, SPDIF/HDMI/DVI Audio.

The detection of the hw audio ports is done by the Realtek driver itself and its changed upon device connection on the headers/layout, not talking of the HD/AC97 audio ports.

I have ALC889 spdif header not connected but i use Optical link on the back i/o to my AV Receiver, so audio devices present with possible selection on audio control are:

-Display (NVIDIA/AMD High Definition Audio) in use with display port
-Speakers (Realtek Audio) in use with 5.1 speakers
-Realtek Digital Output (Optical) (Realtek Audio) in use for Toslink in back i/o to AV
-Realtek Digital Output (Realtek Audio) for DVI

In another mboard with ALC887 that was used, it was the same options.

I feel like the ports aren’t configured in the hardware. There is a SENSE C pin 33 that can have a resistance to determine if SPDIFO or SPDIFO2 are connected, but on a motherboard with ALC887 that has a SPDIF header, pin 33 appears NC. There is no resistance on pin 33 with reference to either ground or Vcc. I tried connecting a 10-ohm resistance between pin 33 and GND, but nothing happened.

Also, using the driver for a board with ALC887 that has the SPDIF header doesn’t add a Realtek Digital Output device to the motherboard w ith ALC887 without the header.

The datasheet mentions configuration can be set by BIOS, so I’m guessing that’s where it may be done.

I have a specific motherboard to work with now, Gigabyte GA-H310M-A with ALC887.

I think I have some idea now that the audio ports are mapped in BIOS modules PlatformInit and PlatformInitPreMem. Got that from this post written by @Mov_AX_0xDEAD :
How to remap audio jack in BIOS ? (2)
I was able to find “EC 10 87 08” in both of those modules.

I think changing the verb tables to that of a motherboard with the same rear ports but with addition of SPDIF header might work, but not sure.
I don’t know how to find the proper verb tables. Do I need IDA to find them?

Following