This patch is to expose usb port's pm qos flags(pm_qos_no_power_off, pm_qos_remote_wakeup) to user space. The pm_qos_no_power_off will be used to control usb port auto power off mechanism from user space. Signed-off-by: Lan Tianyu <tianyu.lan@xxxxxxxxx> --- drivers/usb/core/hub.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 1e9a395..f0e1b29 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1254,6 +1254,7 @@ static void usb_port_device_release(struct device *dev) { struct usb_port *port_dev = to_usb_port(dev); + dev_pm_qos_hide_flags(dev); kfree(port_dev); } @@ -1289,8 +1290,16 @@ static int usb_hub_create_port_device(struct usb_hub *hub, retval = device_register(&port_dev->dev); if (retval) goto error_register; + + retval = dev_pm_qos_expose_flags(&port_dev->dev, + PM_QOS_FLAG_NO_POWER_OFF); + if (retval) + goto error_expose_pm_qos; + return 0; +error_expose_pm_qos: + device_unregister(&port_dev->dev); error_register: put_device(&port_dev->dev); exit: -- 1.7.9.5 -- 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