usb: dwc2: Deprecate g-use-dma binding
authorJohn Youn <johnyoun@synopsys.com>
Thu, 10 Nov 2016 03:27:40 +0000 (19:27 -0800)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Fri, 18 Nov 2016 11:54:17 +0000 (13:54 +0200)
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>
Documentation/devicetree/bindings/usb/dwc2.txt
arch/arm/boot/dts/rk3036.dtsi
arch/arm/boot/dts/rk3288.dtsi
arch/arm/boot/dts/rk3xxx.dtsi
arch/arm64/boot/dts/hisilicon/hi6220.dtsi
arch/arm64/boot/dts/rockchip/rk3368.dtsi
drivers/usb/dwc2/core.h
drivers/usb/dwc2/params.c
drivers/usb/dwc2/pci.c

index 2c30a5479069b98ef22467fd91a0f090c87f1d91..ad8f7ff173eaf626ec8757f6c83c9a7b1d5f35e6 100644 (file)
@@ -25,11 +25,13 @@ Optional properties:
 Refer to phy/phy-bindings.txt for generic phy consumer properties
 - dr_mode: shall be one of "host", "peripheral" and "otg"
   Refer to usb/generic.txt
-- g-use-dma: enable dma usage in gadget driver.
 - g-rx-fifo-size: size of rx fifo size in gadget mode.
 - g-np-tx-fifo-size: size of non-periodic tx fifo size in gadget mode.
 - g-tx-fifo-size: size of periodic tx fifo per endpoint (except ep0) in gadget mode.
 
+Deprecated properties:
+- g-use-dma: gadget DMA mode is automatically detected
+
 Example:
 
         usb@101c0000 {
index a935523a1eb85a0314788f8f707c4d95a7a2d49f..7c2dc19925a1d29f6099dd3b295553d0b12ecde7 100644 (file)
                g-np-tx-fifo-size = <16>;
                g-rx-fifo-size = <275>;
                g-tx-fifo-size = <256 128 128 64 64 32>;
-               g-use-dma;
                status = "disabled";
        };
 
index 17ec2e2d7a60bda135d089cfdc404446c1f05039..74a749c566eedf1719610029e6e7c9cfc6e0180f 100644 (file)
                g-np-tx-fifo-size = <16>;
                g-rx-fifo-size = <275>;
                g-tx-fifo-size = <256 128 128 64 64 32>;
-               g-use-dma;
                phys = <&usbphy0>;
                phy-names = "usb2-phy";
                status = "disabled";
index e15beb3c671ed58dcbc20b8a2e6df66851643179..8fbd3c806fa0bf2687f167898ab2c9d98cf4fecf 100644 (file)
                g-np-tx-fifo-size = <16>;
                g-rx-fifo-size = <275>;
                g-tx-fifo-size = <256 128 128 64 64 32>;
-               g-use-dma;
                phys = <&usbphy0>;
                phy-names = "usb2-phy";
                status = "disabled";
index 17839db585d5c8ec16f88fc6b8b383741bdd6eb3..e0ea60382087c2cb4ab9a6fb0b2d0691d36389af 100644 (file)
                        clocks = <&sys_ctrl HI6220_USBOTG_HCLK>;
                        clock-names = "otg";
                        dr_mode = "otg";
-                       g-use-dma;
                        g-rx-fifo-size = <512>;
                        g-np-tx-fifo-size = <128>;
                        g-tx-fifo-size = <128 128 128 128 128 128>;
index 0fcb2147c9f9959a100c3e6134779052cd0f1b87..df231c4df5a5ac362d20baad1b08dda9604fb8d9 100644 (file)
                g-np-tx-fifo-size = <16>;
                g-rx-fifo-size = <275>;
                g-tx-fifo-size = <256 128 128 64 64 32>;
-               g-use-dma;
                status = "disabled";
        };
 
index a1075ad1a08c73d90badc714fbabc2fc147d9bb3..f8c97f5da45875b3a98a855b4e005870b148e111 100644 (file)
@@ -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).
index 2eb79e8bee7f2d476e2a5d8633dc6c3857f77a94..74c3728f77d9d7d5beb9bce5b827ce74d97f53b8 100644 (file)
@@ -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
index b3f3b582d10b616e04c0db67e559d07b222b86aa..a23329e3d7cd209f6d251c8a209f3a4a538e529d 100644 (file)
@@ -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"),
                        { },
                };