dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2020-12-03 16:55:18 -07:00
parent 41575d8e4c
commit caa4daa2ae
575 changed files with 1633 additions and 1644 deletions

View File

@@ -190,6 +190,6 @@ U_BOOT_DRIVER(cdns_ti) = {
.bind = cdns3_bind,
.probe = cdns_ti_probe,
.remove = cdns_ti_remove,
.platdata_auto = sizeof(struct cdns_ti),
.plat_auto = sizeof(struct cdns_ti),
.flags = DM_FLAG_OS_PREPARE,
};

View File

@@ -159,7 +159,7 @@ U_BOOT_DRIVER(dwc3_generic_peripheral) = {
.probe = dwc3_generic_peripheral_probe,
.remove = dwc3_generic_peripheral_remove,
.priv_auto = sizeof(struct dwc3_generic_priv),
.platdata_auto = sizeof(struct dwc3_generic_plat),
.plat_auto = sizeof(struct dwc3_generic_plat),
};
#endif
@@ -201,7 +201,7 @@ U_BOOT_DRIVER(dwc3_generic_host) = {
.probe = dwc3_generic_host_probe,
.remove = dwc3_generic_host_remove,
.priv_auto = sizeof(struct dwc3_generic_host_priv),
.platdata_auto = sizeof(struct dwc3_generic_plat),
.plat_auto = sizeof(struct dwc3_generic_plat),
.ops = &xhci_usb_ops,
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
@@ -459,6 +459,6 @@ U_BOOT_DRIVER(dwc3_generic_wrapper) = {
.bind = dwc3_glue_bind,
.probe = dwc3_glue_probe,
.remove = dwc3_glue_remove,
.platdata_auto = sizeof(struct dwc3_glue_data),
.plat_auto = sizeof(struct dwc3_glue_data),
};

View File

@@ -469,6 +469,6 @@ U_BOOT_DRIVER(dwc3_generic_wrapper) = {
.of_match = dwc3_meson_g12a_ids,
.probe = dwc3_meson_g12a_probe,
.remove = dwc3_meson_g12a_remove,
.platdata_auto = sizeof(struct dwc3_meson_g12a),
.plat_auto = sizeof(struct dwc3_meson_g12a),
};

View File

@@ -420,6 +420,6 @@ U_BOOT_DRIVER(dwc3_generic_wrapper) = {
.of_match = dwc3_meson_gxl_ids,
.probe = dwc3_meson_gxl_probe,
.remove = dwc3_meson_gxl_remove,
.platdata_auto = sizeof(struct dwc3_meson_gxl),
.plat_auto = sizeof(struct dwc3_meson_gxl),
};

View File

@@ -422,5 +422,5 @@ U_BOOT_DRIVER(usb_sandbox_flash) = {
.ofdata_to_platdata = sandbox_flash_ofdata_to_platdata,
.ops = &sandbox_usb_flash_ops,
.priv_auto = sizeof(struct sandbox_flash_priv),
.platdata_auto = sizeof(struct sandbox_flash_plat),
.plat_auto = sizeof(struct sandbox_flash_plat),
};

View File

@@ -131,7 +131,7 @@ static struct udevice *hub_find_device(struct udevice *hub, int port,
device_find_next_child(&dev)) {
struct sandbox_hub_platdata *plat;
plat = dev_get_parent_platdata(dev);
plat = dev_get_parent_plat(dev);
if (plat->port == port) {
gen_desc = plat->plat.desc_list;
gen_desc = usb_emul_find_descriptor(gen_desc,
@@ -304,8 +304,8 @@ static int sandbox_hub_bind(struct udevice *dev)
static int sandbox_child_post_bind(struct udevice *dev)
{
struct sandbox_hub_platdata *plat = dev_get_parent_platdata(dev);
struct usb_emul_platdata *emul = dev_get_uclass_platdata(dev);
struct sandbox_hub_platdata *plat = dev_get_parent_plat(dev);
struct usb_emul_platdata *emul = dev_get_uclass_plat(dev);
plat->port = dev_read_u32_default(dev, "reg", -1);
emul->port1 = plat->port + 1;
@@ -329,7 +329,7 @@ U_BOOT_DRIVER(usb_sandbox_hub) = {
.bind = sandbox_hub_bind,
.ops = &sandbox_usb_hub_ops,
.priv_auto = sizeof(struct sandbox_hub_priv),
.per_child_platdata_auto =
.per_child_plat_auto =
sizeof(struct sandbox_hub_platdata),
.child_post_bind = sandbox_child_post_bind,
};

View File

@@ -242,5 +242,5 @@ U_BOOT_DRIVER(usb_sandbox_keyb) = {
.probe = sandbox_keyb_probe,
.ops = &sandbox_usb_keyb_ops,
.priv_auto = sizeof(struct sandbox_keyb_priv),
.platdata_auto = sizeof(struct sandbox_keyb_plat),
.plat_auto = sizeof(struct sandbox_keyb_plat),
};

View File

@@ -115,7 +115,7 @@ static int usb_emul_find_devnum(int devnum, int port1, struct udevice **emulp)
if (ret)
return ret;
uclass_foreach_dev(dev, uc) {
struct usb_dev_platdata *udev = dev_get_parent_platdata(dev);
struct usb_dev_platdata *udev = dev_get_parent_plat(dev);
/*
* devnum is initialzied to zero at the beginning of the
@@ -140,7 +140,7 @@ static int usb_emul_find_devnum(int devnum, int port1, struct udevice **emulp)
return 0;
}
plat = dev_get_uclass_platdata(dev);
plat = dev_get_uclass_plat(dev);
if (plat->port1 == port1) {
debug("%s: Found emulator '%s', port %d\n",
__func__, dev->name, port1);
@@ -169,7 +169,7 @@ int usb_emul_find(struct udevice *bus, ulong pipe, int port1,
int usb_emul_find_for_dev(struct udevice *dev, struct udevice **emulp)
{
struct usb_dev_platdata *udev = dev_get_parent_platdata(dev);
struct usb_dev_platdata *udev = dev_get_parent_plat(dev);
return usb_emul_find_devnum(udev->devnum, 0, emulp);
}
@@ -183,7 +183,7 @@ int usb_emul_control(struct udevice *emul, struct usb_device *udev,
int ret;
/* We permit getting the descriptor before we are probed */
plat = dev_get_parent_platdata(emul);
plat = dev_get_parent_plat(emul);
if (!ops->control)
return -ENOSYS;
debug("%s: dev=%s\n", __func__, emul->name);
@@ -262,7 +262,7 @@ int usb_emul_int(struct udevice *emul, struct usb_device *udev,
int usb_emul_setup_device(struct udevice *dev, struct usb_string *strings,
void **desc_list)
{
struct usb_dev_platdata *plat = dev_get_parent_platdata(dev);
struct usb_dev_platdata *plat = dev_get_parent_plat(dev);
struct usb_generic_descriptor **ptr;
struct usb_config_descriptor *cdesc;
int upto;
@@ -298,7 +298,7 @@ UCLASS_DRIVER(usb_emul) = {
.id = UCLASS_USB_EMUL,
.name = "usb_emul",
.post_bind = dm_scan_fdt_dev,
.per_device_platdata_auto = sizeof(struct usb_emul_platdata),
.per_device_plat_auto = sizeof(struct usb_emul_platdata),
.per_child_auto = sizeof(struct usb_device),
.per_child_platdata_auto = sizeof(struct usb_dev_platdata),
.per_child_plat_auto = sizeof(struct usb_dev_platdata),
};

View File

@@ -877,7 +877,7 @@ U_BOOT_DRIVER(asix_eth) = {
.probe = asix_eth_probe,
.ops = &asix_eth_ops,
.priv_auto = sizeof(struct asix_private),
.platdata_auto = sizeof(struct eth_pdata),
.plat_auto = sizeof(struct eth_pdata),
};
static const struct usb_device_id asix_eth_id_table[] = {

View File

@@ -903,7 +903,7 @@ U_BOOT_DRIVER(ax88179_eth) = {
.probe = ax88179_eth_probe,
.ops = &ax88179_eth_ops,
.priv_auto = sizeof(struct asix_private),
.platdata_auto = sizeof(struct eth_pdata),
.plat_auto = sizeof(struct eth_pdata),
};
static const struct usb_device_id ax88179_eth_id_table[] = {

View File

@@ -305,7 +305,7 @@ U_BOOT_DRIVER(lan75xx_eth) = {
.remove = lan7x_eth_remove,
.ops = &lan75xx_eth_ops,
.priv_auto = sizeof(struct lan7x_private),
.platdata_auto = sizeof(struct eth_pdata),
.plat_auto = sizeof(struct eth_pdata),
};
static const struct usb_device_id lan75xx_eth_id_table[] = {

View File

@@ -467,7 +467,7 @@ U_BOOT_DRIVER(lan78xx_eth) = {
.remove = lan7x_eth_remove,
.ops = &lan78xx_eth_ops,
.priv_auto = sizeof(struct lan7x_private),
.platdata_auto = sizeof(struct eth_pdata),
.plat_auto = sizeof(struct eth_pdata),
};
static const struct usb_device_id lan78xx_eth_id_table[] = {

View File

@@ -929,7 +929,7 @@ U_BOOT_DRIVER(mcs7830_eth) = {
.probe = mcs7830_eth_probe,
.ops = &mcs7830_eth_ops,
.priv_auto = sizeof(struct mcs7830_private),
.platdata_auto = sizeof(struct eth_pdata),
.plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};

View File

@@ -1843,7 +1843,7 @@ U_BOOT_DRIVER(r8152_eth) = {
.probe = r8152_eth_probe,
.ops = &r8152_eth_ops,
.priv_auto = sizeof(struct r8152),
.platdata_auto = sizeof(struct eth_pdata),
.plat_auto = sizeof(struct eth_pdata),
};
static const struct usb_device_id r8152_eth_id_table[] = {

View File

@@ -1063,7 +1063,7 @@ U_BOOT_DRIVER(smsc95xx_eth) = {
.probe = smsc95xx_eth_probe,
.ops = &smsc95xx_eth_ops,
.priv_auto = sizeof(struct smsc95xx_private),
.platdata_auto = sizeof(struct eth_pdata),
.plat_auto = sizeof(struct eth_pdata),
};
static const struct usb_device_id smsc95xx_eth_id_table[] = {

View File

@@ -982,7 +982,7 @@ static void dwc2_phy_shutdown(struct udevice *dev, struct phy_bulk *phys)
static int dwc2_udc_otg_ofdata_to_platdata(struct udevice *dev)
{
struct dwc2_plat_otg_data *platdata = dev_get_platdata(dev);
struct dwc2_plat_otg_data *plat = dev_get_platdata(dev);
ulong drvdata;
void (*set_params)(struct dwc2_plat_otg_data *data);
int ret;
@@ -993,35 +993,34 @@ static int dwc2_udc_otg_ofdata_to_platdata(struct udevice *dev)
return -ENODEV;
}
platdata->regs_otg = dev_read_addr(dev);
plat->regs_otg = dev_read_addr(dev);
platdata->rx_fifo_sz = dev_read_u32_default(dev, "g-rx-fifo-size", 0);
platdata->np_tx_fifo_sz = dev_read_u32_default(dev,
"g-np-tx-fifo-size", 0);
plat->rx_fifo_sz = dev_read_u32_default(dev, "g-rx-fifo-size", 0);
plat->np_tx_fifo_sz = dev_read_u32_default(dev, "g-np-tx-fifo-size", 0);
platdata->tx_fifo_sz_nb =
plat->tx_fifo_sz_nb =
dev_read_size(dev, "g-tx-fifo-size") / sizeof(u32);
if (platdata->tx_fifo_sz_nb > DWC2_MAX_HW_ENDPOINTS)
platdata->tx_fifo_sz_nb = DWC2_MAX_HW_ENDPOINTS;
if (platdata->tx_fifo_sz_nb) {
if (plat->tx_fifo_sz_nb > DWC2_MAX_HW_ENDPOINTS)
plat->tx_fifo_sz_nb = DWC2_MAX_HW_ENDPOINTS;
if (plat->tx_fifo_sz_nb) {
ret = dev_read_u32_array(dev, "g-tx-fifo-size",
platdata->tx_fifo_sz_array,
platdata->tx_fifo_sz_nb);
plat->tx_fifo_sz_array,
plat->tx_fifo_sz_nb);
if (ret)
return ret;
}
platdata->force_b_session_valid =
plat->force_b_session_valid =
dev_read_bool(dev, "u-boot,force-b-session-valid");
platdata->force_vbus_detection =
plat->force_vbus_detection =
dev_read_bool(dev, "u-boot,force-vbus-detection");
/* force platdata according compatible */
/* force plat according compatible */
drvdata = dev_get_driver_data(dev);
if (drvdata) {
set_params = (void *)drvdata;
set_params(platdata);
set_params(plat);
}
return 0;
@@ -1091,10 +1090,10 @@ static int dwc2_udc_otg_clk_init(struct udevice *dev,
static int dwc2_udc_otg_probe(struct udevice *dev)
{
struct dwc2_plat_otg_data *platdata = dev_get_platdata(dev);
struct dwc2_plat_otg_data *plat = dev_get_platdata(dev);
struct dwc2_priv_data *priv = dev_get_priv(dev);
struct dwc2_usbotg_reg *usbotg_reg =
(struct dwc2_usbotg_reg *)platdata->regs_otg;
(struct dwc2_usbotg_reg *)plat->regs_otg;
int ret;
ret = dwc2_udc_otg_clk_init(dev, &priv->clks);
@@ -1109,10 +1108,10 @@ static int dwc2_udc_otg_probe(struct udevice *dev)
if (ret)
return ret;
if (platdata->activate_stm_id_vb_detection) {
if (plat->activate_stm_id_vb_detection) {
if (CONFIG_IS_ENABLED(DM_REGULATOR) &&
(!platdata->force_b_session_valid ||
platdata->force_vbus_detection)) {
(!plat->force_b_session_valid ||
plat->force_vbus_detection)) {
ret = device_get_supply_regulator(dev, "usb33d-supply",
&priv->usb33d_supply);
if (ret) {
@@ -1126,8 +1125,8 @@ static int dwc2_udc_otg_probe(struct udevice *dev)
}
}
if (platdata->force_b_session_valid &&
!platdata->force_vbus_detection) {
if (plat->force_b_session_valid &&
!plat->force_vbus_detection) {
/* Override VBUS detection: enable then value*/
setbits_le32(&usbotg_reg->gotgctl, VB_VALOEN);
setbits_le32(&usbotg_reg->gotgctl, VB_VALOVAL);
@@ -1136,7 +1135,7 @@ static int dwc2_udc_otg_probe(struct udevice *dev)
setbits_le32(&usbotg_reg->ggpio,
GGPIO_STM32_OTG_GCCFG_VBDEN);
}
if (platdata->force_b_session_valid) {
if (plat->force_b_session_valid) {
/* Override B session bits: enable then value */
setbits_le32(&usbotg_reg->gotgctl, A_VALOEN | B_VALOEN);
setbits_le32(&usbotg_reg->gotgctl,
@@ -1148,7 +1147,7 @@ static int dwc2_udc_otg_probe(struct udevice *dev)
}
}
ret = dwc2_udc_probe(platdata);
ret = dwc2_udc_probe(plat);
if (ret)
return ret;
@@ -1189,15 +1188,15 @@ U_BOOT_DRIVER(dwc2_udc_otg) = {
.ofdata_to_platdata = dwc2_udc_otg_ofdata_to_platdata,
.probe = dwc2_udc_otg_probe,
.remove = dwc2_udc_otg_remove,
.platdata_auto = sizeof(struct dwc2_plat_otg_data),
.plat_auto = sizeof(struct dwc2_plat_otg_data),
.priv_auto = sizeof(struct dwc2_priv_data),
};
int dwc2_udc_B_session_valid(struct udevice *dev)
{
struct dwc2_plat_otg_data *platdata = dev_get_platdata(dev);
struct dwc2_plat_otg_data *plat = dev_get_platdata(dev);
struct dwc2_usbotg_reg *usbotg_reg =
(struct dwc2_usbotg_reg *)platdata->regs_otg;
(struct dwc2_usbotg_reg *)plat->regs_otg;
return readl(&usbotg_reg->gotgctl) & B_SESSION_VALID;
}

View File

@@ -2692,7 +2692,7 @@ U_BOOT_DRIVER(eth_usb) = {
.probe = usb_eth_probe,
.ops = &usb_eth_ops,
.priv_auto = sizeof(struct ether_priv),
.platdata_auto = sizeof(struct eth_pdata),
.plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
#endif /* CONFIG_DM_ETH */

View File

@@ -826,7 +826,7 @@ static int max3420_udc_probe(struct udevice *dev)
uint speed, mode;
struct udevice *spid;
slave_pdata = dev_get_parent_platdata(dev);
slave_pdata = dev_get_parent_plat(dev);
cs = slave_pdata->cs;
speed = slave_pdata->max_hz;
mode = slave_pdata->mode;

View File

@@ -102,6 +102,6 @@ U_BOOT_DRIVER(dwc3_of_simple) = {
.of_match = dwc3_of_simple_ids,
.probe = dwc3_of_simple_probe,
.remove = dwc3_of_simple_remove,
.platdata_auto = sizeof(struct dwc3_of_simple),
.plat_auto = sizeof(struct dwc3_of_simple),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};

View File

@@ -246,6 +246,6 @@ U_BOOT_DRIVER(dwc3_sti_glue) = {
.probe = sti_dwc3_glue_probe,
.remove = sti_dwc3_glue_remove,
.bind = sti_dwc3_glue_bind,
.platdata_auto = sizeof(struct sti_dwc3_glue_platdata),
.plat_auto = sizeof(struct sti_dwc3_glue_platdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};

View File

@@ -124,7 +124,7 @@ U_BOOT_DRIVER(ehci_atmel) = {
.probe = ehci_atmel_probe,
.remove = ehci_deregister,
.ops = &ehci_usb_ops,
.platdata_auto = sizeof(struct usb_platdata),
.plat_auto = sizeof(struct usb_platdata),
.priv_auto = sizeof(struct ehci_atmel_priv),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};

View File

@@ -259,6 +259,6 @@ U_BOOT_DRIVER(usb_ehci) = {
.remove = ehci_usb_remove,
.ops = &ehci_usb_ops,
.priv_auto = sizeof(struct exynos_ehci),
.platdata_auto = sizeof(struct exynos_ehci_platdata),
.plat_auto = sizeof(struct exynos_ehci_platdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};

View File

@@ -145,7 +145,7 @@ U_BOOT_DRIVER(ehci_fsl) = {
.probe = ehci_fsl_probe,
.remove = ehci_deregister,
.ops = &ehci_usb_ops,
.platdata_auto = sizeof(struct usb_platdata),
.plat_auto = sizeof(struct usb_platdata),
.priv_auto = sizeof(struct ehci_fsl_priv),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};

View File

@@ -152,7 +152,7 @@ U_BOOT_DRIVER(ehci_mvebu) = {
.probe = ehci_mvebu_probe,
.remove = ehci_deregister,
.ops = &ehci_usb_ops,
.platdata_auto = sizeof(struct usb_platdata),
.plat_auto = sizeof(struct usb_platdata),
.priv_auto = sizeof(struct ehci_mvebu_priv),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};

View File

@@ -145,6 +145,6 @@ U_BOOT_DRIVER(usb_ehci) = {
.remove = ehci_usb_remove,
.ops = &ehci_usb_ops,
.priv_auto = sizeof(struct msm_ehci_priv),
.platdata_auto = sizeof(struct usb_platdata),
.plat_auto = sizeof(struct usb_platdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};

View File

@@ -367,7 +367,7 @@ U_BOOT_DRIVER(usb_mx5) = {
.probe = ehci_usb_probe,
.remove = ehci_deregister,
.ops = &ehci_usb_ops,
.platdata_auto = sizeof(struct usb_platdata),
.plat_auto = sizeof(struct usb_platdata),
.priv_auto = sizeof(struct ehci_mx5_priv_data),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};

View File

@@ -650,7 +650,7 @@ U_BOOT_DRIVER(usb_mx6) = {
.probe = ehci_usb_probe,
.remove = ehci_deregister,
.ops = &ehci_usb_ops,
.platdata_auto = sizeof(struct usb_platdata),
.plat_auto = sizeof(struct usb_platdata),
.priv_auto = sizeof(struct ehci_mx6_priv_data),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};

View File

@@ -403,7 +403,7 @@ U_BOOT_DRIVER(usb_omap_ehci) = {
.of_match = omap_ehci_dt_ids,
.probe = omap_ehci_probe,
.ofdata_to_platdata = ehci_usb_ofdata_to_platdata,
.platdata_auto = sizeof(struct usb_platdata),
.plat_auto = sizeof(struct usb_platdata),
.priv_auto = sizeof(struct ehci_omap_priv_data),
.remove = ehci_deregister,
.ops = &ehci_usb_ops,

View File

@@ -163,7 +163,7 @@ U_BOOT_DRIVER(ehci_pci) = {
.remove = ehci_pci_remove,
.of_match = ehci_pci_ids,
.ops = &ehci_usb_ops,
.platdata_auto = sizeof(struct usb_platdata),
.plat_auto = sizeof(struct usb_platdata),
.priv_auto = sizeof(struct ehci_pci_priv),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};

View File

@@ -865,7 +865,7 @@ U_BOOT_DRIVER(usb_ehci) = {
.probe = ehci_usb_probe,
.remove = ehci_deregister,
.ops = &ehci_usb_ops,
.platdata_auto = sizeof(struct usb_platdata),
.plat_auto = sizeof(struct usb_platdata),
.priv_auto = sizeof(struct fdt_usb),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};

View File

@@ -355,7 +355,7 @@ U_BOOT_DRIVER(usb_ehci) = {
.remove = ehci_deregister,
.ops = &ehci_usb_ops,
.ofdata_to_platdata = vf_usb_ofdata_to_platdata,
.platdata_auto = sizeof(struct usb_platdata),
.plat_auto = sizeof(struct usb_platdata),
.priv_auto = sizeof(struct ehci_vf_priv_data),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};

View File

@@ -85,7 +85,7 @@ U_BOOT_DRIVER(ehci_zynq) = {
.probe = ehci_zynq_probe,
.remove = ehci_deregister,
.ops = &ehci_usb_ops,
.platdata_auto = sizeof(struct usb_platdata),
.plat_auto = sizeof(struct usb_platdata),
.priv_auto = sizeof(struct zynq_ehci_priv),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};

View File

@@ -39,7 +39,7 @@ U_BOOT_DRIVER(ohci_pci) = {
.remove = ohci_pci_remove,
.of_match = ohci_pci_ids,
.ops = &ohci_usb_ops,
.platdata_auto = sizeof(struct usb_platdata),
.plat_auto = sizeof(struct usb_platdata),
.priv_auto = sizeof(ohci_t),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};

View File

@@ -575,7 +575,7 @@ static int usb_find_and_bind_driver(struct udevice *parent,
drv = entry->driver;
/*
* We could pass the descriptor to the driver as
* platdata (instead of NULL) and allow its bind()
* plat (instead of NULL) and allow its bind()
* method to return -ENOENT if it doesn't support this
* device. That way we could continue the search to
* find another driver. For now this doesn't seem
@@ -587,7 +587,7 @@ static int usb_find_and_bind_driver(struct udevice *parent,
goto error;
debug("%s: Match found: %s\n", __func__, drv->name);
dev->driver_data = id->driver_info;
plat = dev_get_parent_platdata(dev);
plat = dev_get_parent_plat(dev);
plat->id = *id;
*devp = dev;
return 0;
@@ -622,7 +622,7 @@ static int usb_find_child(struct udevice *parent,
for (device_find_first_child(parent, &dev);
dev;
device_find_next_child(&dev)) {
struct usb_dev_platdata *plat = dev_get_parent_platdata(dev);
struct usb_dev_platdata *plat = dev_get_parent_plat(dev);
/* If this device is already in use, skip it */
if (device_active(dev))
@@ -707,7 +707,7 @@ int usb_scan_device(struct udevice *parent, int port,
return ret;
created = true;
}
plat = dev_get_parent_platdata(dev);
plat = dev_get_parent_plat(dev);
debug("%s: Probing '%s', plat=%p\n", __func__, dev->name, plat);
plat->devnum = udev->devnum;
plat->udev = udev;
@@ -770,7 +770,7 @@ int usb_detect_change(void)
static int usb_child_post_bind(struct udevice *dev)
{
struct usb_dev_platdata *plat = dev_get_parent_platdata(dev);
struct usb_dev_platdata *plat = dev_get_parent_plat(dev);
int val;
if (!dev_of_valid(dev))
@@ -809,7 +809,7 @@ struct udevice *usb_get_bus(struct udevice *dev)
int usb_child_pre_probe(struct udevice *dev)
{
struct usb_device *udev = dev_get_parent_priv(dev);
struct usb_dev_platdata *plat = dev_get_parent_platdata(dev);
struct usb_dev_platdata *plat = dev_get_parent_plat(dev);
int ret;
if (plat->udev) {
@@ -854,7 +854,7 @@ UCLASS_DRIVER(usb) = {
.per_device_auto = sizeof(struct usb_bus_priv),
.child_post_bind = usb_child_post_bind,
.child_pre_probe = usb_child_pre_probe,
.per_child_platdata_auto = sizeof(struct usb_dev_platdata),
.per_child_plat_auto = sizeof(struct usb_dev_platdata),
};
UCLASS_DRIVER(usb_dev_generic) = {

View File

@@ -92,7 +92,7 @@ U_BOOT_DRIVER(usb_xhci) = {
.remove = xhci_brcm_deregister,
.ops = &xhci_usb_ops,
.of_match = xhci_brcm_ids,
.platdata_auto = sizeof(struct brcm_xhci_platdata),
.plat_auto = sizeof(struct brcm_xhci_platdata),
.priv_auto = sizeof(struct xhci_ctrl),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};

View File

@@ -187,7 +187,7 @@ U_BOOT_DRIVER(xhci_dwc3) = {
.remove = xhci_dwc3_remove,
.ops = &xhci_usb_ops,
.priv_auto = sizeof(struct xhci_ctrl),
.platdata_auto = sizeof(struct xhci_dwc3_platdata),
.plat_auto = sizeof(struct xhci_dwc3_platdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
#endif

View File

@@ -255,7 +255,7 @@ U_BOOT_DRIVER(usb_xhci) = {
.probe = xhci_usb_probe,
.remove = xhci_usb_remove,
.ops = &xhci_usb_ops,
.platdata_auto = sizeof(struct exynos_xhci_platdata),
.plat_auto = sizeof(struct exynos_xhci_platdata),
.priv_auto = sizeof(struct exynos_xhci),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};

View File

@@ -169,7 +169,7 @@ U_BOOT_DRIVER(xhci_fsl) = {
.probe = xhci_fsl_probe,
.remove = xhci_fsl_remove,
.ops = &xhci_usb_ops,
.platdata_auto = sizeof(struct usb_platdata),
.plat_auto = sizeof(struct usb_platdata),
.priv_auto = sizeof(struct xhci_fsl_priv),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};

View File

@@ -96,7 +96,7 @@ U_BOOT_DRIVER(usb_xhci) = {
.probe = xhci_usb_probe,
.remove = xhci_deregister,
.ops = &xhci_usb_ops,
.platdata_auto = sizeof(struct mvebu_xhci_platdata),
.plat_auto = sizeof(struct mvebu_xhci_platdata),
.priv_auto = sizeof(struct mvebu_xhci),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};

View File

@@ -59,7 +59,7 @@ U_BOOT_DRIVER(xhci_pci) = {
.remove = xhci_deregister,
.of_match = xhci_pci_ids,
.ops = &xhci_usb_ops,
.platdata_auto = sizeof(struct usb_platdata),
.plat_auto = sizeof(struct usb_platdata),
.priv_auto = sizeof(struct xhci_ctrl),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};

View File

@@ -161,7 +161,7 @@ U_BOOT_DRIVER(usb_xhci) = {
.ops = &xhci_usb_ops,
.of_match = xhci_rcar_ids,
.ofdata_to_platdata = xhci_rcar_ofdata_to_platdata,
.platdata_auto = sizeof(struct rcar_xhci_platdata),
.plat_auto = sizeof(struct rcar_xhci_platdata),
.priv_auto = sizeof(struct rcar_xhci),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};

View File

@@ -258,43 +258,43 @@ struct da8xx_musb_platdata {
static int da8xx_musb_ofdata_to_platdata(struct udevice *dev)
{
struct da8xx_musb_platdata *platdata = dev_get_platdata(dev);
struct da8xx_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);
platdata->musb_config.multipoint = 1;
platdata->musb_config.dyn_fifo = 1;
platdata->musb_config.num_eps = 5;
platdata->musb_config.ram_bits = 10;
platdata->plat.power = fdtdec_get_int(fdt, node, "power", 50);
platdata->otg_board_data.interface_type = MUSB_INTERFACE_UTMI;
platdata->plat.mode = MUSB_HOST;
platdata->otg_board_data.dev = dev;
platdata->plat.config = &platdata->musb_config;
platdata->plat.platform_ops = &da8xx_ops;
platdata->plat.board_data = &platdata->otg_board_data;
platdata->otg_board_data.clear_irq = da8xx_musb_clear_irq;
platdata->otg_board_data.reset = da8xx_musb_reset;
plat->base = (void *)dev_read_addr_ptr(dev);
plat->musb_config.multipoint = 1;
plat->musb_config.dyn_fifo = 1;
plat->musb_config.num_eps = 5;
plat->musb_config.ram_bits = 10;
plat->plat.power = fdtdec_get_int(fdt, node, "power", 50);
plat->otg_board_data.interface_type = MUSB_INTERFACE_UTMI;
plat->plat.mode = MUSB_HOST;
plat->otg_board_data.dev = dev;
plat->plat.config = &plat->musb_config;
plat->plat.platform_ops = &da8xx_ops;
plat->plat.board_data = &plat->otg_board_data;
plat->otg_board_data.clear_irq = da8xx_musb_clear_irq;
plat->otg_board_data.reset = da8xx_musb_reset;
return 0;
}
static int da8xx_musb_probe(struct udevice *dev)
{
struct musb_host_data *host = dev_get_priv(dev);
struct da8xx_musb_platdata *platdata = dev_get_platdata(dev);
struct da8xx_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;
void *base = dev_read_addr_ptr(dev);
/* Get the phy info from the device tree */
ret = generic_phy_get_by_name(dev, "usb-phy", &platdata->phy);
ret = generic_phy_get_by_name(dev, "usb-phy", &plat->phy);
if (ret)
return ret;
/* Initialize the phy */
ret = generic_phy_init(&platdata->phy);
ret = generic_phy_init(&plat->phy);
if (ret)
return ret;
@@ -302,14 +302,14 @@ static int da8xx_musb_probe(struct udevice *dev)
lpsc_on(33);
/* Enable phy */
generic_phy_power_on(&platdata->phy);
generic_phy_power_on(&plat->phy);
priv->desc_before_addr = true;
otg_board_data = &platdata->otg_board_data;
otg_board_data = &plat->otg_board_data;
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) {
ret = -ENODEV;
goto shutdown; /* Shutdown what we started */
@@ -321,7 +321,7 @@ static int da8xx_musb_probe(struct udevice *dev)
return 0;
shutdown:
/* Turn off the phy if we fail */
generic_phy_power_off(&platdata->phy);
generic_phy_power_off(&plat->phy);
lpsc_disable(33);
return ret;
}
@@ -348,6 +348,6 @@ U_BOOT_DRIVER(da8xx_musb) = {
.probe = da8xx_musb_probe,
.remove = da8xx_musb_remove,
.ops = &musb_usb_ops,
.platdata_auto = sizeof(struct da8xx_musb_platdata),
.plat_auto = sizeof(struct da8xx_musb_platdata),
.priv_auto = sizeof(struct musb_host_data),
};

View File

@@ -414,6 +414,6 @@ U_BOOT_DRIVER(mtk_musb) = {
#ifdef CONFIG_USB_MUSB_HOST
.ops = &musb_usb_ops,
#endif
.platdata_auto = sizeof(struct usb_platdata),
.plat_auto = sizeof(struct usb_platdata),
.priv_auto = sizeof(struct mtk_musb_glue),
};

View File

@@ -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),
};

View File

@@ -288,6 +288,6 @@ U_BOOT_DRIVER(usb_musb) = {
#ifdef CONFIG_USB_MUSB_HOST
.ops = &musb_usb_ops,
#endif
.platdata_auto = sizeof(struct usb_platdata),
.plat_auto = sizeof(struct usb_platdata),
.priv_auto = sizeof(struct pic32_musb_data),
};

View File

@@ -552,6 +552,6 @@ U_BOOT_DRIVER(usb_musb) = {
#ifdef CONFIG_USB_MUSB_HOST
.ops = &musb_usb_ops,
#endif
.platdata_auto = sizeof(struct usb_platdata),
.plat_auto = sizeof(struct usb_platdata),
.priv_auto = sizeof(struct sunxi_glue),
};

View File

@@ -33,17 +33,17 @@ DECLARE_GLOBAL_DATA_PTR;
static void ti_musb_set_phy_power(struct udevice *dev, u8 on)
{
struct ti_musb_platdata *platdata = dev_get_platdata(dev);
struct ti_musb_platdata *plat = dev_get_platdata(dev);
if (!platdata->ctrl_mod_base)
if (!plat->ctrl_mod_base)
return;
if (on) {
clrsetbits_le32(platdata->ctrl_mod_base,
clrsetbits_le32(plat->ctrl_mod_base,
CM_PHY_PWRDN | CM_PHY_OTG_PWRDN,
OTGVDET_EN | OTGSESSENDEN);
} else {
clrsetbits_le32(platdata->ctrl_mod_base, 0,
clrsetbits_le32(plat->ctrl_mod_base, 0,
CM_PHY_PWRDN | CM_PHY_OTG_PWRDN);
}
}
@@ -79,7 +79,7 @@ static int ti_musb_get_usb_index(int node)
static int ti_musb_ofdata_to_platdata(struct udevice *dev)
{
struct ti_musb_platdata *platdata = dev_get_platdata(dev);
struct ti_musb_platdata *plat = dev_get_platdata(dev);
const void *fdt = gd->fdt_blob;
int node = dev_of_offset(dev);
int phys;
@@ -87,18 +87,18 @@ static int ti_musb_ofdata_to_platdata(struct udevice *dev)
int usb_index;
struct musb_hdrc_config *musb_config;
platdata->base = (void *)devfdt_get_addr_index(dev, 1);
plat->base = (void *)devfdt_get_addr_index(dev, 1);
phys = fdtdec_lookup_phandle(fdt, node, "phys");
ctrl_mod = fdtdec_lookup_phandle(fdt, phys, "ti,ctrl_mod");
platdata->ctrl_mod_base = (void *)fdtdec_get_addr(fdt, ctrl_mod, "reg");
plat->ctrl_mod_base = (void *)fdtdec_get_addr(fdt, ctrl_mod, "reg");
usb_index = ti_musb_get_usb_index(node);
switch (usb_index) {
case 1:
platdata->ctrl_mod_base += AM335X_USB1_CTRL;
plat->ctrl_mod_base += AM335X_USB1_CTRL;
break;
case 0:
platdata->ctrl_mod_base += AM335X_USB0_CTRL;
plat->ctrl_mod_base += AM335X_USB0_CTRL;
break;
default:
break;
@@ -130,15 +130,15 @@ static int ti_musb_ofdata_to_platdata(struct udevice *dev)
return -ENOENT;
}
platdata->plat.config = musb_config;
plat->plat.config = musb_config;
platdata->plat.power = fdtdec_get_int(fdt, node, "mentor,power", -1);
if (platdata->plat.power < 0) {
plat->plat.power = fdtdec_get_int(fdt, node, "mentor,power", -1);
if (plat->plat.power < 0) {
pr_err("MUSB mentor,power DT entry missing\n");
return -ENOENT;
}
platdata->plat.platform_ops = &musb_dsps_ops;
plat->plat.platform_ops = &musb_dsps_ops;
return 0;
}
@@ -147,15 +147,15 @@ static int ti_musb_ofdata_to_platdata(struct udevice *dev)
static int ti_musb_host_probe(struct udevice *dev)
{
struct musb_host_data *host = dev_get_priv(dev);
struct ti_musb_platdata *platdata = dev_get_platdata(dev);
struct ti_musb_platdata *plat = dev_get_platdata(dev);
struct usb_bus_priv *priv = dev_get_uclass_priv(dev);
int ret;
priv->desc_before_addr = true;
host->host = musb_init_controller(&platdata->plat,
host->host = musb_init_controller(&plat->plat,
NULL,
platdata->base);
plat->base);
if (!host->host)
return -EIO;
@@ -178,18 +178,18 @@ static int ti_musb_host_remove(struct udevice *dev)
#if CONFIG_IS_ENABLED(OF_CONTROL)
static int ti_musb_host_ofdata_to_platdata(struct udevice *dev)
{
struct ti_musb_platdata *platdata = dev_get_platdata(dev);
struct ti_musb_platdata *plat = dev_get_platdata(dev);
const void *fdt = gd->fdt_blob;
int node = dev_of_offset(dev);
int ret;
ret = ti_musb_ofdata_to_platdata(dev);
if (ret) {
pr_err("platdata dt parse error\n");
pr_err("plat dt parse error\n");
return ret;
}
platdata->plat.mode = MUSB_HOST;
plat->plat.mode = MUSB_HOST;
return 0;
}
@@ -204,7 +204,7 @@ U_BOOT_DRIVER(ti_musb_host) = {
.probe = ti_musb_host_probe,
.remove = ti_musb_host_remove,
.ops = &musb_usb_ops,
.platdata_auto = sizeof(struct ti_musb_platdata),
.plat_auto = sizeof(struct ti_musb_platdata),
.priv_auto = sizeof(struct musb_host_data),
};
@@ -216,17 +216,17 @@ struct ti_musb_peripheral {
#if CONFIG_IS_ENABLED(OF_CONTROL)
static int ti_musb_peripheral_ofdata_to_platdata(struct udevice *dev)
{
struct ti_musb_platdata *platdata = dev_get_platdata(dev);
struct ti_musb_platdata *plat = dev_get_platdata(dev);
const void *fdt = gd->fdt_blob;
int node = dev_of_offset(dev);
int ret;
ret = ti_musb_ofdata_to_platdata(dev);
if (ret) {
pr_err("platdata dt parse error\n");
pr_err("plat dt parse error\n");
return ret;
}
platdata->plat.mode = MUSB_PERIPHERAL;
plat->plat.mode = MUSB_PERIPHERAL;
return 0;
}
@@ -244,12 +244,12 @@ int dm_usb_gadget_handle_interrupts(struct udevice *dev)
static int ti_musb_peripheral_probe(struct udevice *dev)
{
struct ti_musb_peripheral *priv = dev_get_priv(dev);
struct ti_musb_platdata *platdata = dev_get_platdata(dev);
struct ti_musb_platdata *plat = dev_get_platdata(dev);
int ret;
priv->periph = musb_init_controller(&platdata->plat,
priv->periph = musb_init_controller(&plat->plat,
NULL,
platdata->base);
plat->base);
if (!priv->periph)
return -EIO;
@@ -277,7 +277,7 @@ U_BOOT_DRIVER(ti_musb_peripheral) = {
.probe = ti_musb_peripheral_probe,
.remove = ti_musb_peripheral_remove,
.ops = &musb_usb_ops,
.platdata_auto = sizeof(struct ti_musb_platdata),
.plat_auto = sizeof(struct ti_musb_platdata),
.priv_auto = sizeof(struct ti_musb_peripheral),
.flags = DM_FLAG_PRE_RELOC,
};