summaryrefslogtreecommitdiff
path: root/drivers/usb/host/ehci-mx6.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ehci-mx6.c')
-rw-r--r--drivers/usb/host/ehci-mx6.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index 37b59758bb..d2f49cf469 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -472,7 +472,7 @@ static const struct ehci_ops mx6_ehci_ops = {
static int ehci_usb_phy_mode(struct udevice *dev)
{
- struct usb_platdata *plat = dev_get_platdata(dev);
+ struct usb_plat *plat = dev_get_plat(dev);
void *__iomem addr = dev_read_addr_ptr(dev);
void *__iomem phy_ctrl, *__iomem phy_status;
const void *blob = gd->fdt_blob;
@@ -518,9 +518,9 @@ static int ehci_usb_phy_mode(struct udevice *dev)
return 0;
}
-static int ehci_usb_ofdata_to_platdata(struct udevice *dev)
+static int ehci_usb_of_to_plat(struct udevice *dev)
{
- struct usb_platdata *plat = dev_get_platdata(dev);
+ struct usb_plat *plat = dev_get_plat(dev);
enum usb_dr_mode dr_mode;
dr_mode = usb_get_dr_mode(dev->node);
@@ -569,17 +569,23 @@ static int ehci_usb_bind(struct udevice *dev)
* With these changes in place, the ad-hoc indexing goes away and
* the driver is fully converted to DT probing.
*/
- u32 controller_spacing = is_mx7() ? 0x10000 : 0x200;
- fdt_addr_t addr = devfdt_get_addr_index(dev, 0);
- dev->req_seq = (addr - USB_BASE_ADDR) / controller_spacing;
+ /*
+ * FIXME: This cannot work with the new sequence numbers.
+ * Please complete the DM conversion.
+ *
+ * u32 controller_spacing = is_mx7() ? 0x10000 : 0x200;
+ * fdt_addr_t addr = devfdt_get_addr_index(dev, 0);
+ *
+ * dev->req_seq = (addr - USB_BASE_ADDR) / controller_spacing;
+ */
return 0;
}
static int ehci_usb_probe(struct udevice *dev)
{
- struct usb_platdata *plat = dev_get_platdata(dev);
+ struct usb_plat *plat = dev_get_plat(dev);
struct usb_ehci *ehci = dev_read_addr_ptr(dev);
struct ehci_mx6_priv_data *priv = dev_get_priv(dev);
enum usb_init_type type = plat->init_type;
@@ -596,7 +602,7 @@ static int ehci_usb_probe(struct udevice *dev)
}
priv->ehci = ehci;
- priv->portnr = dev->seq;
+ priv->portnr = dev_seq(dev);
priv->init_type = type;
#if CONFIG_IS_ENABLED(DM_REGULATOR)
@@ -645,13 +651,13 @@ U_BOOT_DRIVER(usb_mx6) = {
.name = "ehci_mx6",
.id = UCLASS_USB,
.of_match = mx6_usb_ids,
- .ofdata_to_platdata = ehci_usb_ofdata_to_platdata,
+ .of_to_plat = ehci_usb_of_to_plat,
.bind = ehci_usb_bind,
.probe = ehci_usb_probe,
.remove = ehci_deregister,
.ops = &ehci_usb_ops,
- .platdata_auto_alloc_size = sizeof(struct usb_platdata),
- .priv_auto_alloc_size = sizeof(struct ehci_mx6_priv_data),
+ .plat_auto = sizeof(struct usb_plat),
+ .priv_auto = sizeof(struct ehci_mx6_priv_data),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
#endif