Re: [RFC PATCH v2 3/3] usb : Add sysfs files to control usb port's power

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2012年06月01日 23:55, Alan Stern wrote:
On Fri, 1 Jun 2012, Lan Tianyu wrote:

Change since v1: move sysfs files from usb hub device sysfs directory to usb
hub interface sysfs directory.

This patch is to add two sys files for each usb hub ports to control port's power.
Control port's power through setting or clearing PORT_POWER feature.

The new sys files is under the usb hub interface sysfs portx directory.
ls /sys/bus/usb/devices/1-0:1.0
bAlternateSetting  bInterfaceClass  bInterfaceNumber  bInterfaceProtocol
bInterfaceSubClass  bNumEndpoints  driver  ep_81  modalias  power
subsystem  supports_autosuspend  uevent port1 port2 port3 port4

ls /sys/bus/usb/devices/1-0:1.0/port1
control state

You need to add entries to Documentation/ABI explaining these new
files.
Ok. I will add.

control has three options. "auto", "on" and "off"
"auto" - if port without device, power off the port.
	(This patch only cover ports without device)

Is this option really needed?  Can't userspace check first to see
whether there is a device, and then write "off" if there isn't?
Yes, user-space can dealt with. So "auto" only work for ports with
devices.



Alan Stern


--
Best Regards
Tianyu Lan
linux kernel enabling team
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux