So i tried to connect steamdeck to pc using usb and i read its immpossible because steamdeck is a computer and some explanation on quora about strong master slave relationship. But then why is it possible for android phones to connect to pc whilist also having the ability to use USB and other usb c accesories. Also why cant it be a toggle? So that you can change whetewer this usb( or device ) is reciving data ot sending data .

  • Rustmilian@lemmy.world
    link
    fedilink
    English
    arrow-up
    27
    ·
    edit-2
    2 months ago

    I found some directions that might help.

    Enabling USB-C OTG Device Mode :
    Ensure the Linux device has a USB-C port that supports OTG functionality.
    In the device tree, set the dr_mode property of the USB OTG controller to “peripheral” or “otg” to enable device mode.
    Configure the TUSB320 USB-C controller (or equivalent) to operate in UFP (Upstream Facing Port) mode, which allows the device to act as a USB peripheral.
    Configuring USB Gadget Drivers :
    Load the appropriate Linux USB gadget driver for the desired functionality, such as g_ether for Ethernet over USB, g_serial for a serial device, etc.
    Manually configure the USB network interface, such as assigning an IP address to usb0.
    Connecting to a Host :
    Use a USB-C to USB-C or USB-C to USB-A cable to connect the Linux device in OTG device mode to a host PC.
    The host PC should then detect the Linux device as a USB peripheral, allowing file transfer, network connectivity, or other functionality depending on the configured gadget driver.

    Gateworks.com Wiki Linux OTG
    Kernel.org Driver-API USB Gadget
    Collabora Blog Modern Linux USB Gadget integration with Systemd Part1

    A tool : gt
    Rust library : usb-gadget
    C Library : libusbgx