[PATCH v4 24/24] usb: chipidea: add power_budget limit for ehci to platform data

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

 



Some implementations need this limitation to work correctly.

Signed-off-by: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
---
 drivers/usb/chipidea/ci13xxx_pci.c |    3 +++
 drivers/usb/chipidea/host.c        |    3 +++
 include/linux/usb/chipidea.h       |    1 +
 3 files changed, 7 insertions(+)

diff --git a/drivers/usb/chipidea/ci13xxx_pci.c b/drivers/usb/chipidea/ci13xxx_pci.c
index 79e9864..a2201b5 100644
--- a/drivers/usb/chipidea/ci13xxx_pci.c
+++ b/drivers/usb/chipidea/ci13xxx_pci.c
@@ -76,6 +76,9 @@ static int __devinit ci13xxx_pci_probe(struct pci_dev *pdev,
 	if (pdev->vendor == PCI_VENDOR_ID_INTEL) {
 		driver.capoffset = 0;
 
+		if (pdev->device == 0x0829)
+			driver.power_budget_limit = 200;
+
 		/* private SRAM */
 		if (pci_resource_len(pdev, 1)) {
 			res[2].start	= pci_resource_start(pdev, 1);
diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
index 126753c..9ea2a31 100644
--- a/drivers/usb/chipidea/host.c
+++ b/drivers/usb/chipidea/host.c
@@ -117,6 +117,9 @@ static int host_start(struct ci13xxx *ci)
 	hcd->regs = ci->hw_bank.abs;
 	hcd->has_tt = 1;
 
+	if (ci->udc_driver->power_budget_limit)
+		hcd->power_budget = ci->udc_driver->power_budget_limit;
+
 	ehci = hcd_to_ehci(hcd);
 	ehci->caps = ci->hw_bank.cap;
 	ehci->regs = ci->hw_bank.cap +
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
index 86273ce..8d3d23e 100644
--- a/include/linux/usb/chipidea.h
+++ b/include/linux/usb/chipidea.h
@@ -10,6 +10,7 @@ struct ci13xxx_udc_driver {
 	const char	*name;
 	/* offset of the capability registers */
 	uintptr_t	 capoffset;
+	unsigned	 power_budget_limit;
 	unsigned long	 flags;
 #define CI13XXX_REGS_SHARED		BIT(0)
 #define CI13XXX_REQUIRE_TRANSCEIVER	BIT(1)
-- 
1.7.10

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