diff options
Diffstat (limited to 'drivers/usb/musb-new/omap2430.c')
-rw-r--r-- | drivers/usb/musb-new/omap2430.c | 75 |
1 files changed, 35 insertions, 40 deletions
diff --git a/drivers/usb/musb-new/omap2430.c b/drivers/usb/musb-new/omap2430.c index da63cc2c22..3fdcaeaa5d 100644 --- a/drivers/usb/musb-new/omap2430.c +++ b/drivers/usb/musb-new/omap2430.c @@ -141,7 +141,7 @@ const struct musb_platform_ops omap2430_ops = { #if CONFIG_IS_ENABLED(DM_USB) -struct omap2430_musb_platdata { +struct omap2430_musb_plat { void *base; void *ctrl_mod_base; struct musb_hdrc_platform_data plat; @@ -149,69 +149,65 @@ struct omap2430_musb_platdata { struct omap_musb_board_data otg_board_data; }; -static int omap2430_musb_ofdata_to_platdata(struct udevice *dev) +static int omap2430_musb_of_to_plat(struct udevice *dev) { - struct omap2430_musb_platdata *platdata = dev_get_platdata(dev); + struct omap2430_musb_plat *plat = dev_get_plat(dev); const void *fdt = gd->fdt_blob; int node = dev_of_offset(dev); - platdata->base = (void *)dev_read_addr_ptr(dev); + plat->base = (void *)dev_read_addr_ptr(dev); - platdata->musb_config.multipoint = fdtdec_get_int(fdt, node, - "multipoint", - -1); - if (platdata->musb_config.multipoint < 0) { + plat->musb_config.multipoint = fdtdec_get_int(fdt, node, "multipoint", + -1); + if (plat->musb_config.multipoint < 0) { pr_err("MUSB multipoint DT entry missing\n"); return -ENOENT; } - platdata->musb_config.dyn_fifo = 1; - platdata->musb_config.num_eps = fdtdec_get_int(fdt, node, - "num-eps", -1); - if (platdata->musb_config.num_eps < 0) { + plat->musb_config.dyn_fifo = 1; + plat->musb_config.num_eps = fdtdec_get_int(fdt, node, "num-eps", -1); + if (plat->musb_config.num_eps < 0) { pr_err("MUSB num-eps DT entry missing\n"); return -ENOENT; } - platdata->musb_config.ram_bits = fdtdec_get_int(fdt, node, - "ram-bits", -1); - if (platdata->musb_config.ram_bits < 0) { + plat->musb_config.ram_bits = fdtdec_get_int(fdt, node, "ram-bits", -1); + if (plat->musb_config.ram_bits < 0) { pr_err("MUSB ram-bits DT entry missing\n"); return -ENOENT; } - platdata->plat.power = fdtdec_get_int(fdt, node, - "power", -1); - if (platdata->plat.power < 0) { + plat->plat.power = fdtdec_get_int(fdt, node, "power", -1); + if (plat->plat.power < 0) { pr_err("MUSB power DT entry missing\n"); return -ENOENT; } - platdata->otg_board_data.interface_type = fdtdec_get_int(fdt, node, - "interface-type", -1); - if (platdata->otg_board_data.interface_type < 0) { + plat->otg_board_data.interface_type = fdtdec_get_int(fdt, node, + "interface-type", + -1); + if (plat->otg_board_data.interface_type < 0) { pr_err("MUSB interface-type DT entry missing\n"); return -ENOENT; } #if 0 /* In a perfect world, mode would be set to OTG, mode 3 from DT */ - platdata->plat.mode = fdtdec_get_int(fdt, node, - "mode", -1); - if (platdata->plat.mode < 0) { + plat->plat.mode = fdtdec_get_int(fdt, node, "mode", -1); + if (plat->plat.mode < 0) { pr_err("MUSB mode DT entry missing\n"); return -ENOENT; } #else /* MUSB_OTG, it doesn't work */ #ifdef CONFIG_USB_MUSB_HOST /* Host seems to be the only option that works */ - platdata->plat.mode = MUSB_HOST; + plat->plat.mode = MUSB_HOST; #else /* For that matter, MUSB_PERIPHERAL doesn't either */ - platdata->plat.mode = MUSB_PERIPHERAL; + plat->plat.mode = MUSB_PERIPHERAL; #endif #endif - platdata->otg_board_data.dev = dev; - platdata->plat.config = &platdata->musb_config; - platdata->plat.platform_ops = &omap2430_ops; - platdata->plat.board_data = &platdata->otg_board_data; + plat->otg_board_data.dev = dev; + plat->plat.config = &plat->musb_config; + plat->plat.platform_ops = &omap2430_ops; + plat->plat.board_data = &plat->otg_board_data; return 0; } @@ -222,7 +218,7 @@ static int omap2430_musb_probe(struct udevice *dev) #else struct musb *musbp; #endif - struct omap2430_musb_platdata *platdata = dev_get_platdata(dev); + struct omap2430_musb_plat *plat = dev_get_plat(dev); struct usb_bus_priv *priv = dev_get_uclass_priv(dev); struct omap_musb_board_data *otg_board_data; int ret = 0; @@ -230,21 +226,20 @@ static int omap2430_musb_probe(struct udevice *dev) priv->desc_before_addr = true; - otg_board_data = &platdata->otg_board_data; + otg_board_data = &plat->otg_board_data; #ifdef CONFIG_USB_MUSB_HOST - host->host = musb_init_controller(&platdata->plat, + host->host = musb_init_controller(&plat->plat, (struct device *)otg_board_data, - platdata->base); + plat->base); if (!host->host) { return -EIO; } ret = musb_lowlevel_init(host); #else - musbp = musb_register(&platdata->plat, - (struct device *)otg_board_data, - platdata->base); + musbp = musb_register(&plat->plat, (struct device *)otg_board_data, + plat->base); if (IS_ERR_OR_NULL(musbp)) return -EINVAL; #endif @@ -274,14 +269,14 @@ U_BOOT_DRIVER(omap2430_musb) = { .id = UCLASS_USB_GADGET_GENERIC, #endif .of_match = omap2430_musb_ids, - .ofdata_to_platdata = omap2430_musb_ofdata_to_platdata, + .of_to_plat = omap2430_musb_of_to_plat, .probe = omap2430_musb_probe, .remove = omap2430_musb_remove, #ifdef CONFIG_USB_MUSB_HOST .ops = &musb_usb_ops, #endif - .platdata_auto_alloc_size = sizeof(struct omap2430_musb_platdata), - .priv_auto_alloc_size = sizeof(struct musb_host_data), + .plat_auto = sizeof(struct omap2430_musb_plat), + .priv_auto = sizeof(struct musb_host_data), }; #endif /* CONFIG_IS_ENABLED(DM_USB) */ |