Le Potato supports hardware SPDIF on the 3-pin header between the HDMI and 3.5mm jack. Please use the correct orientation via the GPIO map. The 5V pin is closest to HDMI and the ground pin is closest to the 3.5mm jack.
sudo ldto enable spdif
After you have tested your device(s) and confirmed that they are working, you can enable it permanently via:
sudo ldto merge spdif
If you no longer need SPDIF after merging the overlay, you can reset the system to default by:
sudo ldto reset sudo reboot
Device trees are not reset to default until the machine reboots. Do not try to merge new overlays before rebooting.