of_match_device(of_match_ptr(usb20_host_of_match), &_dev->dev);
if (match && match->data) {
- dev->platform_data = (void *)match->data;
+ pldata = (void *)match->data;
+ pldata->dev = dev;
} else {
- dev_err(dev, "usb20host match failed\n");
+ dev_err(dev, "usb20otg match failed\n");
return -EINVAL;
}
- pldata = dev->platform_data;
- pldata->dev = dev;
-
if (!node) {
dev_err(dev, "device node not found\n");
return -EINVAL;
retval = -ENOMEM;
goto clk_disable;
}
- dev_dbg(&_dev->dev, "base=0x%08x\n",
- (unsigned)dwc_otg_device->os_dep.base);
+ dev_dbg(&_dev->dev, "base=0x%p\n", 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
static void dwc_otg_driver_shutdown(struct platform_device *_dev)
{
struct device *dev = &_dev->dev;
- struct dwc_otg_platform_data *pldata = dev->platform_data;
dwc_otg_device_t *otg_dev = dev->platform_data;
dwc_otg_core_if_t *core_if = otg_dev->core_if;
+ struct dwc_otg_platform_data *pldata = otg_dev->pldata;
dctl_data_t dctl = {.d32 = 0 };
DWC_PRINTF("%s: disconnect USB %s mode\n", __func__,
dwc_otg_is_host_mode(core_if) ? "host" : "device");
- if( pldata->dwc_otg_uart_mode != NULL)
- pldata->dwc_otg_uart_mode( pldata, PHY_USB_MODE);
- if(pldata->phy_suspend != NULL)
- pldata->phy_suspend(pldata, USB_PHY_ENABLED);
+ if (pldata->dwc_otg_uart_mode != NULL)
+ pldata->dwc_otg_uart_mode(pldata, PHY_USB_MODE);
+ if (pldata->phy_suspend != NULL)
+ pldata->phy_suspend(pldata, USB_PHY_ENABLED);
if (dwc_otg_is_host_mode(core_if)) {
if (core_if->hcd_cb && core_if->hcd_cb->stop)
core_if->hcd_cb->stop(core_if->hcd_cb_p);
.compatible = "rockchip,rk3126_usb20_otg",
.data = &usb20otg_pdata_rk3126,
},
+ {
+ .compatible = "rockchip,rk3368_usb20_otg",
+ .data = &usb20otg_pdata_rk3368,
+ },
{ },
};
const struct of_device_id *match =
of_match_device(of_match_ptr(usb20_otg_of_match), &_dev->dev);
- if (match) {
- dev->platform_data = (void *)match->data;
+ if (match && match->data) {
+ pldata = (void *)match->data;
+ pldata->dev = dev;
} else {
dev_err(dev, "usb20otg match failed\n");
return -EINVAL;
}
- pldata = dev->platform_data;
- pldata->dev = dev;
-
if (!node) {
dev_err(dev, "device node not found\n");
return -EINVAL;
}
- /*todo : move to usbdev_rk-XX.c */
+
if (pldata->hw_init)
pldata->hw_init();
retval = -ENOMEM;
goto clk_disable;
}
- dev_dbg(&_dev->dev, "base=0x%08x\n",
- (unsigned)dwc_otg_device->os_dep.base);
+ dev_dbg(&_dev->dev, "base=0x%p\n", 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