I have not worked on device mode of USB-C. However, even if the port is in device mode, then there will be no recognition of such from the other side of the cable unless the port responds as a device. The gadget framework is itself a partial implementation of certain standard class devices, e.g., ethernet devices or mass storage, but you have to go through setting up the details of those specific devices before the port will actually respond as such. A mode is more or less an assignment of of pins and functions, but drivers of a sort are still required to talk to those pins.
As I mentioned, I am unfamiliar with using gadget on USB-C, I’ve only dealt with micro-OTG ports and dedicated type-B ports. However, if you Google for the topic, there should be significant information out in the wild. Here is one URL I found which you will probably be interested in:
Do keep in mind that USB-C is quite different than all other past cables. USB itself has only a device at one end, and a host at the other end, with no exceptions to the rule. This is true regardless of being USB-C or not, but there is a bit of “magic” and extra wiring which means the cable itself can have the same connector on both ends, and more logic to determine whether that cable is device or host. I have not studied any of those USB-C details.