Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0189293 authored by Ajay Agarwal's avatar Ajay Agarwal Committed by Gerrit - the friendly Code Review server
Browse files

usb: gadget: Setup DMA ops for OTG's gadget devices



A device that is not probed via DT nodes needs to setup its DMA
operations with an explicit call to arch_setup_dma_ops. The child
and grandchild gadget devices of msm_otg are not populated via DT
nodes. This patch adds the above method for these devices.

Change-Id: Ida9d63dce2cbb8c61c65cb95e0ea5f10860e8edc
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 57ed0766
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3841,6 +3841,7 @@ static int udc_probe(struct ci13xxx_udc_driver *driver, struct device *dev,
			(unsigned long) mEp);
	}

	arch_setup_dma_ops(&udc->gadget.dev, 0, DMA_BIT_MASK(32), NULL, false);
	for (i = 0; i < hw_ep_max/2; i++) {
		for (j = RX; j <= TX; j++) {
			int k = i + j * hw_ep_max/2;
+4 −0
Original line number Diff line number Diff line
@@ -1172,6 +1172,10 @@ int usb_add_gadget_udc_release(struct device *parent, struct usb_gadget *gadget,
	INIT_WORK(&gadget->work, usb_gadget_state_work);
	gadget->dev.parent = parent;

	dma_set_coherent_mask(&gadget->dev, parent->coherent_dma_mask);
	gadget->dev.dma_parms = parent->dma_parms;
	gadget->dev.dma_mask = parent->dma_mask;

	if (release)
		gadget->dev.release = release;
	else
+1 −0
Original line number Diff line number Diff line
@@ -3905,6 +3905,7 @@ static struct platform_device *msm_otg_add_pdev(
			goto error;
	}

	arch_setup_dma_ops(&pdev->dev, 0, DMA_BIT_MASK(32), NULL, false);
	retval = platform_device_add(pdev);
	if (retval)
		goto error;