You are not logged in.
Hi,
Im trying to see if its possible to turn off / on a single usb port on demand and while its in use, so that I dont have to unplug / plug the device. The port is 1-10 with ID 1131:1810
~❯ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 03f0:2f4a Hewlett-Packard
Bus 001 Device 003: ID 03f0:134a Hewlett-Packard Optical Mouse
Bus 001 Device 005: ID 1131:1810 Integrated System Solution Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
dmesg:
[13274.583531] usb 1-10: USB disconnect, device number 4
[13600.226176] usb 1-10: new full-speed USB device number 5 using xhci_hcd
[13600.375608] hid-generic 0003:1131:1810.0005: hiddev1,hidraw3: USB HID v1.11 Device [ISSC Simple HID Device ] on usb-0000:00:14.0-10/input0
[13990.225274] WARNING! power/level is deprecated; use power/control instead
According to https://www.kernel.org/doc/Documentatio … gement.txt power/control only accepts "on" and "auto" as arguments. So in my case Im connecting a speaker to the usb for charging it. How can I check if its usbfs file is open or if it even has one? I want to be able to tell the kernel when to start considering the device idle so I can autosuspend it by passing in auto to /sys/bus/usb/drivers/usb/1-10/power/control. Any ideas how I can achieve this?
Thanks for your time!
Offline
Set the suspend delay to 0 "echo 0 > /sys/bus/usb/drivers/usb/1-10/power/autosuspend_delay_ms" and the power mode to auto.
This is assuming that the driver supports suspend.
Doing it the Linux way since 1997 and Arch way since 2015 (and loving it!)
Platforms: Intel, ARMv6 (Raspberry Pi), ARMv7 (BeagleBone Black), ARMv8 (Raspberry Pi)
Languages: C, C++, ASM, Pascal & Java
Offline
That does suspend the usb port but only after I remove and reconnect the device. Is it possible to suspend while the device is connected and then wake up the device again whenever needed, because editing the autosuspend_delay_ms and control files did not wake it up without a reboot.
Thanks!
Offline
I'm not 100% sure but it rather sounds as if you want to unbind the port and not suspend it?
https://zedt.eu/tech/linux/restarting-u … em-centos/
Offline