Linux USB: turning the power on and off?

后端 未结 13 1328
遥遥无期
遥遥无期 2020-12-07 10:41

How can I programmatically enable and disable the power to a particular USB port on Linux? Is such a thing even possible? Mac answers appreciated as well!

I was tryi

13条回答
  •  一生所求
    2020-12-07 10:57

    In OS X you can access a USB device from user space and request it to suspend.

    You can find a general example in the USB Device Interface Guide. You will need to use the IOUSBDeviceInterface182 (or higher) USBDeviceSuspend method.

    Note: Hubs and controller ports may have ganged power supplies, meaning the same switch is shared by multiple ports. if this is the case and your device is in the same group as another active device, it will not be powered down.

提交回复
热议问题