diff options
Diffstat (limited to 'drivers/usb/musb-new/omap2430.c')
-rw-r--r-- | drivers/usb/musb-new/omap2430.c | 67 |
1 files changed, 31 insertions, 36 deletions
diff --git a/drivers/usb/musb-new/omap2430.c b/drivers/usb/musb-new/omap2430.c index 2e029d8..9150c4d 100644 --- a/drivers/usb/musb-new/omap2430.c +++ b/drivers/usb/musb-new/omap2430.c @@ -151,67 +151,63 @@ struct omap2430_musb_platdata { static int omap2430_musb_ofdata_to_platdata(struct udevice *dev) { - struct omap2430_musb_platdata *platdata = dev_get_platdata(dev); + struct omap2430_musb_platdata *plat = dev_get_platdata(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_platdata *plat = dev_get_platdata(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 @@ -280,7 +275,7 @@ U_BOOT_DRIVER(omap2430_musb) = { #ifdef CONFIG_USB_MUSB_HOST .ops = &musb_usb_ops, #endif - .platdata_auto = sizeof(struct omap2430_musb_platdata), + .plat_auto = sizeof(struct omap2430_musb_platdata), .priv_auto = sizeof(struct musb_host_data), }; |