mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 12:57:06 +09:00
usb: dwc_otg: set dma_mask 32bit for both device and host mode
This commit is contained in:
@@ -1015,6 +1015,13 @@ static int host20_driver_probe(struct platform_device *_dev)
|
||||
dev_dbg(&_dev->dev, "base=0x%08x\n",
|
||||
(unsigned)dwc_otg_device->os_dep.base);
|
||||
|
||||
/* Set device flags indicating whether the HCD supports DMA. */
|
||||
if (!_dev->dev.dma_mask)
|
||||
_dev->dev.dma_mask = &_dev->dev.coherent_dma_mask;
|
||||
retval = dma_set_coherent_mask(&_dev->dev, DMA_BIT_MASK(32));
|
||||
if (retval)
|
||||
goto clk_disable;
|
||||
|
||||
/*
|
||||
* Initialize driver data to point to the global DWC_otg
|
||||
* Device structure.
|
||||
@@ -1391,6 +1398,13 @@ static int otg20_driver_probe(struct platform_device *_dev)
|
||||
dev_dbg(&_dev->dev, "base=0x%08x\n",
|
||||
(unsigned)dwc_otg_device->os_dep.base);
|
||||
|
||||
/* Set device flags indicating whether the HCD supports DMA. */
|
||||
if (!_dev->dev.dma_mask)
|
||||
_dev->dev.dma_mask = &_dev->dev.coherent_dma_mask;
|
||||
retval = dma_set_coherent_mask(&_dev->dev, DMA_BIT_MASK(32));
|
||||
if (retval)
|
||||
goto clk_disable;
|
||||
|
||||
/*
|
||||
* Initialize driver data to point to the global DWC_otg
|
||||
* Device structure.
|
||||
|
||||
@@ -451,21 +451,9 @@ int otg20_hcd_init(struct platform_device *_dev)
|
||||
dwc_otg_device_t *otg_dev = dwc_get_device_platform_data(_dev);
|
||||
int retval = 0;
|
||||
int irq;
|
||||
static u64 usb_dmamask = 0xffffffffUL;
|
||||
|
||||
DWC_DEBUGPL(DBG_HCD, "DWC OTG HCD INIT\n");
|
||||
|
||||
/* Set device flags indicating whether the HCD supports DMA. */
|
||||
if (dwc_otg_is_dma_enable(otg_dev->core_if)) {
|
||||
|
||||
_dev->dev.dma_mask = &usb_dmamask;
|
||||
_dev->dev.coherent_dma_mask = ~0;
|
||||
} else {
|
||||
|
||||
_dev->dev.dma_mask = (void *)0;
|
||||
_dev->dev.coherent_dma_mask = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate memory for the base HCD plus the DWC OTG HCD.
|
||||
* Initialize the base HCD.
|
||||
@@ -556,20 +544,8 @@ int host20_hcd_init(struct platform_device *_dev)
|
||||
dwc_otg_device_t *otg_dev = dwc_get_device_platform_data(_dev);
|
||||
int retval = 0;
|
||||
int irq;
|
||||
static u64 usb_dmamask = 0xffffffffUL;
|
||||
DWC_DEBUGPL(DBG_HCD, "DWC OTG HCD INIT\n");
|
||||
|
||||
/* Set device flags indicating whether the HCD supports DMA. */
|
||||
if (dwc_otg_is_dma_enable(otg_dev->core_if)) {
|
||||
|
||||
_dev->dev.dma_mask = &usb_dmamask;
|
||||
_dev->dev.coherent_dma_mask = ~0;
|
||||
} else {
|
||||
|
||||
_dev->dev.dma_mask = (void *)0;
|
||||
_dev->dev.coherent_dma_mask = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate memory for the base HCD plus the DWC OTG HCD.
|
||||
* Initialize the base HCD.
|
||||
|
||||
Reference in New Issue
Block a user