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 2012年06月06日 22:21, Alan Stern wrote:
On Wed, 6 Jun 2012, Lan Tianyu wrote:

If "auto" does nothing, there's no reason to put it in this patch at
all.  It could be added in a later patch, along with its
implementation.
OK. I prefer to remove "auto" option in this patch. We can further discuss
the function of "auto".

Sounds good.

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

        /* Wait at least 100 msec for power to become stable */
        delay = max(pgood_delay, (unsigned) 100);


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


B and H Foto and Electronics Corp.

[Linux Media]     [Video for Linux]     [Linux Input]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]     [More Archives]

Add to Google Powered by Linux