From stern@rowland.harvard.edu Mon Apr 25 08:27:18 2005 Date: Mon, 25 Apr 2005 11:21:31 -0400 (EDT) From: Alan Stern To: Greg KH Subject: [PATCH as511 (3/5)] ohci-omap, sl811, dummy: remove hub_set_power_budget This patch changes the HCDs that used the old hub_set_power_budget call, making them use the new hcd->power_budget field instead. Signed-off-by: Alan Stern Acked-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- --- gregkh-2.6.orig/drivers/usb/host/ohci-hcd.c 2005-04-28 10:46:22.000000000 -0700 +++ gregkh-2.6/drivers/usb/host/ohci-hcd.c 2005-04-28 11:14:27.000000000 -0700 @@ -699,8 +699,6 @@ ohci_writel (ohci, ohci->hc_control, &ohci->regs->control); return -ENODEV; } - if (ohci->power_budget) - hub_set_power_budget(udev, ohci->power_budget); register_reboot_notifier (&ohci->reboot_notifier); create_debug_files (ohci); --- gregkh-2.6.orig/drivers/usb/host/ohci-omap.c 2005-04-20 21:25:10.000000000 -0700 +++ gregkh-2.6/drivers/usb/host/ohci-omap.c 2005-04-28 11:14:27.000000000 -0700 @@ -181,7 +181,7 @@ if (config->otg) { ohci_to_hcd(ohci)->self.otg_port = config->otg; /* default/minimum OTG power budget: 8 mA */ - ohci->power_budget = 8; + ohci_to_hcd(ohci)->power_budget = 8; } /* boards can use OTG transceivers in non-OTG modes */ @@ -230,7 +230,7 @@ /* TPS2045 switch for internal transceiver (port 1) */ if (machine_is_omap_osk()) { - ohci->power_budget = 250; + ohci_to_hcd(ohci)->power_budget = 250; rh &= ~RH_A_NOCP; --- gregkh-2.6.orig/drivers/usb/host/ohci.h 2005-04-28 10:46:22.000000000 -0700 +++ gregkh-2.6/drivers/usb/host/ohci.h 2005-04-28 11:14:27.000000000 -0700 @@ -371,7 +371,6 @@ * other external transceivers should be software-transparent */ struct otg_transceiver *transceiver; - unsigned power_budget; /* * memory management for queue data structures --- gregkh-2.6.orig/drivers/usb/host/sl811-hcd.c 2005-04-06 11:47:47.000000000 -0700 +++ gregkh-2.6/drivers/usb/host/sl811-hcd.c 2005-04-28 11:14:27.000000000 -0700 @@ -1564,8 +1564,10 @@ udev->speed = USB_SPEED_FULL; hcd->state = HC_STATE_RUNNING; - if (sl811->board) + if (sl811->board) { hcd->can_wakeup = sl811->board->can_wakeup; + hcd->power_budget = sl811->board->power * 2; + } if (usb_hcd_register_root_hub(udev, hcd) != 0) { usb_put_dev(udev); @@ -1573,9 +1575,6 @@ return -ENODEV; } - if (sl811->board && sl811->board->power) - hub_set_power_budget(udev, sl811->board->power * 2); - return 0; } --- gregkh-2.6.orig/drivers/usb/gadget/dummy_hcd.c 2005-04-06 11:47:47.000000000 -0700 +++ gregkh-2.6/drivers/usb/gadget/dummy_hcd.c 2005-04-28 11:14:27.000000000 -0700 @@ -1646,6 +1646,9 @@ if (!root) return -ENOMEM; + /* only show a low-power port: just 8mA */ + hcd->power_budget = 8; + /* root hub enters addressed state... */ hcd->state = HC_STATE_RUNNING; root->speed = USB_SPEED_HIGH; @@ -1655,9 +1658,6 @@ goto err1; } - /* only show a low-power port: just 8mA */ - hub_set_power_budget (root, 8); - if ((retval = dummy_register_udc (dum)) != 0) goto err2;