Re: [PATCH 2/2] usb: host: xhci-plat: add wakeup entry at /sys

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

 



On Fri, Jul 03, 2020 at 02:25:32PM +0800, Peter Chen wrote:
> After that, the user could enable controller as wakeup source
> for system suspend through /sys entry.
> 
> Signed-off-by: Peter Chen <peter.chen@xxxxxxx>
> ---
>  drivers/usb/host/xhci-plat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> index cebe24ec80a5..bb5d73f0a796 100644
> --- a/drivers/usb/host/xhci-plat.c
> +++ b/drivers/usb/host/xhci-plat.c
> @@ -287,7 +287,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
>  		*priv = *priv_match;
>  	}
>  
> -	device_wakeup_enable(hcd->self.controller);
> +	device_set_wakeup_capable(hcd->self.controller, true);


In fact both this patch and the original code are wrong.  It really should 
be:

	device_init_wakeup(hcd->self.controller, true);

This will add the wakeup entry in sysfs and set it to Enabled.  This is 
the appropriate behavior, as explained in the kerneldoc for 
device_init_wakeup().  The reason is because the controller device doesn't 
create any wakeup events on its own; it merely relays wakeup requests from 
descendant devices (root hubs or USB devices).

Alan Stern



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

  Powered by Linux