summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc2
diff options
context:
space:
mode:
authorJohn Youn <johnyoun@synopsys.com>2016-11-09 19:27:40 -0800
committerFelipe Balbi <felipe.balbi@linux.intel.com>2016-11-18 13:54:17 +0200
commit9962b62f1be95c981c4d9307921f15e232f4d603 (patch)
tree21f94033a4cedc507b9fc0f820eff4a7d6098e3a /drivers/usb/dwc2
parent5fb6fdaf38f71ad15ae85b1c4b4d94e8865e7284 (diff)
usb: dwc2: Deprecate g-use-dma binding
This is not needed as the gadget now fully supports DMA and it can autodetect it. This was initially added because gadget DMA mode was only partially implemented so could not be automatically enabled. Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc2')
-rw-r--r--drivers/usb/dwc2/core.h4
-rw-r--r--drivers/usb/dwc2/params.c17
-rw-r--r--drivers/usb/dwc2/pci.c1
3 files changed, 15 insertions, 7 deletions
diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
index a1075ad1a08c..f8c97f5da458 100644
--- a/drivers/usb/dwc2/core.h
+++ b/drivers/usb/dwc2/core.h
@@ -418,9 +418,7 @@ enum dwc2_ep0_state {
* needed.
* 0 - No (default)
* 1 - Yes
- * @g_dma: If true, enables dma usage on the device. This
- * setting is not auto-detected. It must be
- * explicitly enabled (default: false).
+ * @g_dma: Enables gadget dma usage (default: autodetect).
* @g_rx_fifo_size: The periodic rx fifo size for the device, in
* DWORDS from 16-32768 (default: 2048 if
* possible, otherwise autodetect).
diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index 2eb79e8bee7f..74c3728f77d9 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -1086,6 +1086,19 @@ static void dwc2_set_param_tx_fifo_sizes(struct dwc2_hsotg *hsotg)
}
}
+static void dwc2_set_gadget_dma(struct dwc2_hsotg *hsotg)
+{
+ struct dwc2_hw_params *hw = &hsotg->hw_params;
+ struct dwc2_core_params *p = &hsotg->params;
+ bool dma_capable = !(hw->arch == GHWCFG2_SLAVE_ONLY_ARCH);
+
+ /* Buffer DMA */
+ dwc2_set_param_bool(hsotg, &p->g_dma,
+ false, "gadget-dma",
+ true, false,
+ dma_capable);
+}
+
/**
* dwc2_set_parameters() - Set all core parameters.
*
@@ -1161,9 +1174,7 @@ static void dwc2_set_parameters(struct dwc2_hsotg *hsotg,
(hsotg->dr_mode == USB_DR_MODE_OTG)) {
dev_dbg(hsotg->dev, "Setting peripheral device properties\n");
- dwc2_set_param_bool(hsotg, &p->g_dma, true, "g-use-dma",
- false, false,
- dma_capable);
+ dwc2_set_gadget_dma(hsotg);
/*
* The values for g_rx_fifo_size (2048) and
diff --git a/drivers/usb/dwc2/pci.c b/drivers/usb/dwc2/pci.c
index b3f3b582d10b..a23329e3d7cd 100644
--- a/drivers/usb/dwc2/pci.c
+++ b/drivers/usb/dwc2/pci.c
@@ -67,7 +67,6 @@ static int dwc2_pci_quirks(struct pci_dev *pdev, struct platform_device *dwc2)
if (pdev->vendor == PCI_VENDOR_ID_SYNOPSYS &&
pdev->device == PCI_PRODUCT_ID_HAPS_HSOTG) {
struct property_entry properties[] = {
- PROPERTY_ENTRY_BOOL("g-use-dma"),
{ },
};