• Lan Tianyu's avatar
    usb : Add sysfs files to control port power. · ca9c9d0c
    Lan Tianyu authored
    This patch adds two sysfs files for each usb hub port to allow userspace
    to control the port power policy.
    
    For an upcoming Intel xHCI roothub, this will translate into ACPI calls
    to completely power off or power on the port.  As a reminder, when these
    ports are completely powered off, the USB host and device will see a
    physical disconnect.  All future USB device connections will be lost,
    and the device will not be able to signal a remote wakeup.
    
    The control sysfs file can be written to with two options:
    "on" - port power must be on.
    "off" - port must be off.
    
    The state sysfs file reports usb port's power state:
    "on" - powered on
    "off" - powered off
    "error" - can't get power state
    
    For now, let userspace dictate the port power off policy.  Future
    patches may add an in-kernel policy.
    Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
    Signed-off-by: default avatarLan Tianyu <tianyu.lan@intel.com>
    Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    ca9c9d0c
sysfs-bus-usb 9.1 KB