How to set Raspberry Pi 4 USB-C to host mode

By default, the Raspberry Pi 4 USB-C port is not set to Host mode and therefore it’s not possible.

In order to set the USB-C port to host mode, add the following line to the end of /boot/config.txt (in the [all] section):

dtoverlay=dwc2,dr_mode=host

and

reboot