gpt4 book ai didi

Linux USB : turning the power on and off?

转载 作者:IT老高 更新时间:2023-10-28 12:31:32 26 4
gpt4 key购买 nike

如何以编程方式启用和禁用 Linux 上特定 USB 端口的电源?这样的事情甚至可能吗? Mac 答案也很受欢迎!

我正在尝试 BOC (不要假装你也没有尝试过!)最终得到了其中一个,并希望通过将它连接到我们的服务器监视器来使用它。

最佳答案

在 Linux 中有一个 sys 条目。来自 Documentation/usb/power-management.txt :

power/level

This file contains one of three words: "on", "auto",
or "suspend". You can write those words to the file
to change the device's setting.

"on" means that the device should be resumed and
autosuspend is not allowed. (Of course, system
suspends are still allowed.)

"auto" is the normal state in which the kernel is
allowed to autosuspend and autoresume the device.

"suspend" means that the device should remain
suspended, and autoresume is not allowed. (But remote
wakeup may still be allowed, since it is controlled
separately by the power/wakeup attribute.)

类似:echo on >/sys/bus/usb/devices/usb5/power/level

您可能还需要使用自动暂停设置。在不告诉内核停止尝试的情况下,它可能会自动挂起端口。

祝你好运!

关于Linux USB : turning the power on and off?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1163824/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com