Skip to content

Commit

Permalink
usb: chipidea: add power_budget limit for ehci to platform data
Browse files Browse the repository at this point in the history
Some implementations need this limitation to work correctly.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Alexander Shishkin authored and Greg Kroah-Hartman committed May 11, 2012
1 parent eb70e5a commit bd84198
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/usb/chipidea/ci13xxx_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ struct ci13xxx_udc_driver langwell_pci_driver = {
.capoffset = 0,
};

struct ci13xxx_udc_driver penwell_pci_driver = {
.name = UDC_DRIVER_NAME,
.capoffset = 0,
.power_budget = 200,
};

/**
* ci13xxx_pci_probe: PCI probe
* @pdev: USB device controller being probed
Expand Down Expand Up @@ -153,7 +159,7 @@ static DEFINE_PCI_DEVICE_TABLE(ci13xxx_pci_id_table) = {
},
{
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0829),
.driver_data = (kernel_ulong_t)&langwell_pci_driver,
.driver_data = (kernel_ulong_t)&penwell_pci_driver,
},
{ 0, 0, 0, 0, 0, 0, 0 /* end: all zeroes */ }
};
Expand Down
2 changes: 2 additions & 0 deletions drivers/usb/chipidea/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ static int host_start(struct ci13xxx *ci)
hcd->regs = ci->hw_bank.abs;
hcd->has_tt = 1;

hcd->power_budget = ci->udc_driver->power_budget;

ehci = hcd_to_ehci(hcd);
ehci->caps = ci->hw_bank.cap;
ehci->has_hostpc = ci->hw_bank.lpm;
Expand Down
1 change: 1 addition & 0 deletions include/linux/usb/chipidea.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ struct ci13xxx_udc_driver {
const char *name;
/* offset of the capability registers */
uintptr_t capoffset;
unsigned power_budget;
unsigned long flags;
#define CI13XXX_REGS_SHARED BIT(0)
#define CI13XXX_REQUIRE_TRANSCEIVER BIT(1)
Expand Down

0 comments on commit bd84198

Please sign in to comment.