Re: [RFC PATCH V3 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 Thu, 7 Jun 2012, Lan Tianyu wrote:

> > One more problem -- your implementation of "off" isn't quite right.
> > You need to update hub_power_on() too.
> >
> How about this?
> 
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -861,7 +861,9 @@ static unsigned hub_power_on(struct usb_hub *hub, bool do_delay)
>                  dev_dbg(hub->intfdev, "trying to enable port power on "
>                                  "non-switchable hub\n");
>          for (port1 = 1; port1 <= hub->descriptor->bNbrPorts; port1++)
> -               set_port_feature(hub->hdev, port1, USB_PORT_FEAT_POWER);
> +               if (hub->port_data[port1 - 1].port_power_policy
> +                               == USB_PORT_POWER_ON)
> +                       set_port_feature(hub->hdev, port1, USB_PORT_FEAT_POWER);

Yes, that's the idea.

Alan Stern

--
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