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>
U_BOOT_DEVICE(imx6_thermal) = {
.name = "imx_thermal",
- .platdata = &imx6_thermal_plat,
+ .plat = &imx6_thermal_plat,
};
#endif
U_BOOT_DEVICE(imx7_thermal) = {
.name = "imx_thermal",
- .platdata = &imx7_thermal_plat,
+ .plat = &imx7_thermal_plat,
};
#endif
U_BOOT_DEVICE(am33xx_spi) = {
.name = "omap3_spi",
- .platdata = &omap3_spi_pdata,
+ .plat = &omap3_spi_pdata,
};
#endif
#endif
dev;
device_find_next_child(&dev)) {
if (device_get_uclass_id(dev) == UCLASS_BLK) {
- desc = dev_get_uclass_platdata(dev);
+ desc = dev_get_uclass_plat(dev);
break;
}
}
void board_boot_order(u32 *spl_boot_list)
{
- /* In case of no fdt (or only platdata), use spl_boot_device() */
+ /* In case of no fdt (or only plat), use spl_boot_device() */
if (!CONFIG_IS_ENABLED(OF_CONTROL) || CONFIG_IS_ENABLED(OF_PLATDATA)) {
spl_boot_list[0] = spl_boot_device();
return;
.id = UCLASS_MISC,
.of_match = stm32mp_bsec_ids,
.ofdata_to_platdata = stm32mp_bsec_ofdata_to_platdata,
- .platdata_auto = sizeof(struct stm32mp_bsec_platdata),
+ .plat_auto = sizeof(struct stm32mp_bsec_platdata),
.ops = &stm32mp_bsec_ops,
.probe = stm32mp_bsec_probe,
};
static int stm32mp_pwr_regulator_probe(struct udevice *dev)
{
const struct stm32mp_pwr_reg_info **p = stm32mp_pwr_reg_infos;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
while (*p) {
int rc;
static int stm32mp_pwr_regulator_set_value(struct udevice *dev, int uV)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (!uc_pdata)
return -ENXIO;
static int stm32mp_pwr_regulator_get_value(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (!uc_pdata)
return -ENXIO;
.ofdata_to_platdata = apl_hostbridge_ofdata_to_platdata,
.probe = apl_hostbridge_probe,
.remove = apl_hostbridge_remove,
- .platdata_auto = sizeof(struct apl_hostbridge_platdata),
+ .plat_auto = sizeof(struct apl_hostbridge_platdata),
ACPI_OPS_PTR(&apl_hostbridge_acpi_ops)
.flags = DM_FLAG_OS_PREPARE,
};
.ofdata_to_platdata = apl_pmc_ofdata_to_uc_platdata,
.probe = apl_pmc_probe,
.ops = &apl_pmc_ops,
- .platdata_auto = sizeof(struct apl_pmc_platdata),
+ .plat_auto = sizeof(struct apl_pmc_platdata),
};
/*
* Manually set the parent of the SPI flash to SPI, since dtoc doesn't. We also
- * need to allocate the parent_platdata since by the time this function is
+ * need to allocate the parent_plat since by the time this function is
* called device_bind() has already gone past that step.
*/
static int apl_flash_bind(struct udevice *dev)
plat = calloc(sizeof(*plat), 1);
if (!plat)
return -ENOMEM;
- dev->parent_platdata = plat;
+ dev->parent_plat = plat;
}
return 0;
struct ns16550_platdata *plat;
/*
- * Convert our platdata to the ns16550's platdata, so we can just use
+ * Convert our plat to the ns16550's plat, so we can just use
* that driver
*/
plat = malloc(sizeof(*plat));
plat->clock = dtplat->clock_frequency;
plat->fcr = UART_FCR_DEFVAL;
plat->bdf = pci_ofplat_get_devfn(dtplat->reg[0]);
- dev->platdata = plat;
+ dev->plat = plat;
#else
int ret;
.name = "intel_apl_ns16550",
.id = UCLASS_SERIAL,
.of_match = apl_ns16550_serial_ids,
- .platdata_auto = sizeof(struct ns16550_platdata),
+ .plat_auto = sizeof(struct ns16550_platdata),
.priv_auto = sizeof(struct NS16550),
.ops = &ns16550_serial_ops,
.ofdata_to_platdata = apl_ns16550_ofdata_to_platdata,
.of_match = broadwell_ahci_ids,
.ofdata_to_platdata = broadwell_sata_ofdata_to_platdata,
.probe = broadwell_sata_probe,
- .platdata_auto = sizeof(struct sata_platdata),
+ .plat_auto = sizeof(struct sata_platdata),
};
int cpu_x86_bind(struct udevice *dev)
{
- struct cpu_platdata *plat = dev_get_parent_platdata(dev);
+ struct cpu_platdata *plat = dev_get_parent_plat(dev);
struct cpuid_result res;
plat->cpu_id = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
.ops = &itss_ops,
.bind = itss_bind,
.ofdata_to_platdata = itss_ofdata_to_platdata,
- .platdata_auto = sizeof(struct itss_platdata),
+ .plat_auto = sizeof(struct itss_platdata),
.priv_auto = sizeof(struct itss_priv),
};
static int p2sb_child_post_bind(struct udevice *dev)
{
#if !CONFIG_IS_ENABLED(OF_PLATDATA)
- struct p2sb_child_platdata *pplat = dev_get_parent_platdata(dev);
+ struct p2sb_child_platdata *pplat = dev_get_parent_plat(dev);
int ret;
u32 pid;
.remove = p2sb_remove,
.ops = &p2sb_ops,
.ofdata_to_platdata = p2sb_ofdata_to_platdata,
- .platdata_auto = sizeof(struct p2sb_platdata),
- .per_child_platdata_auto =
+ .plat_auto = sizeof(struct p2sb_platdata),
+ .per_child_plat_auto =
sizeof(struct p2sb_child_platdata),
.child_post_bind = p2sb_child_post_bind,
.flags = DM_FLAG_OS_PREPARE,
for (uclass_find_first_device(UCLASS_CPU, &dev);
dev;
uclass_find_next_device(&dev)) {
- struct cpu_platdata *plat = dev_get_parent_platdata(dev);
+ struct cpu_platdata *plat = dev_get_parent_plat(dev);
if (plat->cpu_id == apic_id) {
*devp = dev;
static int mp_init_cpu(struct udevice *cpu, void *unused)
{
- struct cpu_platdata *plat = dev_get_parent_platdata(cpu);
+ struct cpu_platdata *plat = dev_get_parent_plat(cpu);
plat->ucode_version = microcode_read_rev();
plat->device_id = gd->arch.x86_device;
printf("binding cpu@%d failed: %d\n", cpu_num, ret);
return ret;
}
- plat = dev_get_parent_platdata(dev);
+ plat = dev_get_parent_plat(dev);
plat->cpu_id = cpu_num;
}
return 0;
{
const efi_guid_t guid = SBL_SERIAL_PORT_INFO_GUID;
struct sbl_serial_port_info *data;
- struct ns16550_platdata *plat = dev->platdata;
+ struct ns16550_platdata *plat = dev->plat;
if (!gd->arch.hob_list)
panic("hob list not found!");
.id = UCLASS_SERIAL,
.of_match = slimbootloader_serial_ids,
.ofdata_to_platdata = slimbootloader_serial_ofdata_to_platdata,
- .platdata_auto = sizeof(struct ns16550_platdata),
+ .plat_auto = sizeof(struct ns16550_platdata),
.priv_auto = sizeof(struct NS16550),
.probe = ns16550_serial_probe,
.ops = &ns16550_serial_ops,
int intel_pinctrl_probe(struct udevice *dev);
/**
- * intel_pinctrl_ofdata_to_platdata() - Handle common platdata setup
+ * intel_pinctrl_ofdata_to_platdata() - Handle common plat setup
*
* @dev: Pinctrl device
* @comm: Pad community for this device
for (uclass_find_first_device(UCLASS_CPU, &dev);
dev;
uclass_find_next_device(&dev)) {
- struct cpu_platdata *plat = dev_get_parent_platdata(dev);
+ struct cpu_platdata *plat = dev_get_parent_plat(dev);
int length;
length = acpi_create_madt_lapic(
static int fsp_video_probe(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
struct vesa_mode_info *vesa = &mode_info.vesa;
int ret;
static int fsp_video_bind(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
/* Set the maximum supported resolution */
plat->size = 2560 * 1600 * 4;
for (uclass_find_first_device(UCLASS_CPU, &dev);
dev;
uclass_find_next_device(&dev)) {
- struct cpu_platdata *plat = dev_get_parent_platdata(dev);
+ struct cpu_platdata *plat = dev_get_parent_plat(dev);
u8 cpuflag = MPC_CPU_EN;
if (!device_active(dev))
for (uclass_find_first_device(UCLASS_CPU, &dev);
dev;
uclass_find_next_device(&dev)) {
- struct cpu_platdata *plat = dev_get_parent_platdata(dev);
+ struct cpu_platdata *plat = dev_get_parent_plat(dev);
if (!device_active(dev))
continue;
U_BOOT_DEVICE(integrator_serials) = {
.name = "serial_pl01x",
- .platdata = &serial_platdata,
+ .plat = &serial_platdata,
};
void peripheral_power_enable (void);
U_BOOT_DEVICE(total_compute_serials) = {
.name = "serial_pl01x",
- .platdata = &serial_platdata,
+ .plat = &serial_platdata,
};
static struct mm_region total_compute_mem_map[] = {
U_BOOT_DEVICE(vexpress_serials) = {
.name = "serial_pl01x",
- .platdata = &serial_platdata,
+ .plat = &serial_platdata,
};
static struct mm_region vexpress64_mem_map[] = {
U_BOOT_DEVICE(at91sam9260_serial) = {
.name = "serial_atmel",
- .platdata = &at91sam9260_serial_plat,
+ .plat = &at91sam9260_serial_plat,
};
U_BOOT_DEVICE(at91sam9260_serial) = {
.name = "serial_atmel",
- .platdata = &at91sam9260_serial_plat,
+ .plat = &at91sam9260_serial_plat,
};
U_BOOT_DEVICE(ethoc) = {
.name = "ethoc",
- .platdata = ðoc_pdata,
+ .plat = ðoc_pdata,
};
U_BOOT_DEVICE(thunderx_serial0) = {
.name = "serial_pl01x",
- .platdata = &serial0,
+ .plat = &serial0,
};
static const struct pl01x_serial_platdata serial1 = {
U_BOOT_DEVICE(thunderx_serial1) = {
.name = "serial_pl01x",
- .platdata = &serial1,
+ .plat = &serial1,
};
#endif
U_BOOT_DEVICE(cm_fx6_serial) = {
.name = "serial_mxc",
- .platdata = &cm_fx6_mxc_serial_plat,
+ .plat = &cm_fx6_mxc_serial_plat,
};
#if CONFIG_IS_ENABLED(AHCI)
U_BOOT_DEVICE(omapl138_uart) = {
.name = "ns16550_serial",
- .platdata = &serial_pdata,
+ .plat = &serial_pdata,
};
static const struct davinci_mmc_plat mmc_platdata = {
};
U_BOOT_DEVICE(omapl138_mmc) = {
.name = "ti_da830_mmc",
- .platdata = &mmc_platdata,
+ .plat = &mmc_platdata,
};
void spl_board_init(void)
U_BOOT_DEVICE(ls1012a_pfe0) = {
.name = "pfe_eth",
- .platdata = &pfe_pdata0,
+ .plat = &pfe_pdata0,
};
U_BOOT_DEVICE(ls1012a_pfe1) = {
.name = "pfe_eth",
- .platdata = &pfe_pdata1,
+ .plat = &pfe_pdata1,
};
U_BOOT_DEVICE(ls1012a_pfe0) = {
.name = "pfe_eth",
- .platdata = &pfe_pdata0,
+ .plat = &pfe_pdata0,
};
U_BOOT_DEVICE(ls1012a_pfe1) = {
.name = "pfe_eth",
- .platdata = &pfe_pdata1,
+ .plat = &pfe_pdata1,
};
U_BOOT_DEVICE(ls1012a_pfe0) = {
.name = "pfe_eth",
- .platdata = &pfe_pdata0,
+ .plat = &pfe_pdata0,
};
U_BOOT_DEVICE(ls1012a_pfe1) = {
.name = "pfe_eth",
- .platdata = &pfe_pdata1,
+ .plat = &pfe_pdata1,
};
U_BOOT_DEVICE(nxp_serial0) = {
.name = "serial_pl01x",
- .platdata = &serial0,
+ .plat = &serial0,
};
static struct pl01x_serial_platdata serial1 = {
U_BOOT_DEVICE(nxp_serial1) = {
.name = "serial_pl01x",
- .platdata = &serial1,
+ .plat = &serial1,
};
int select_i2c_ch_pca9547(u8 ch)
U_BOOT_DEVICE(ventana_serial) = {
.name = "serial_mxc",
- .platdata = &ventana_mxc_serial_plat,
+ .plat = &ventana_mxc_serial_plat,
};
U_BOOT_DEVICE(hikey_seriala) = {
.name = "serial_pl01x",
- .platdata = &serial_platdata,
+ .plat = &serial_platdata,
};
#endif
U_BOOT_DEVICE(hikey960_serial0) = {
.name = "serial_pl01x",
- .platdata = &serial_platdata,
+ .plat = &serial_platdata,
};
#endif
U_BOOT_DEVICE(poplar_serial) = {
.name = "serial_pl01x",
- .platdata = &serial_platdata,
+ .plat = &serial_platdata,
};
#endif
U_BOOT_DEVICE(sniper_serial) = {
.name = "ns16550_serial",
- .platdata = &serial_omap_platdata
+ .plat = &serial_omap_platdata
};
static struct musb_hdrc_config musb_config = {
U_BOOT_DEVICE(at91sam9260_serial) = {
.name = "serial_atmel",
- .platdata = &at91sam9260_serial_plat,
+ .plat = &at91sam9260_serial_plat,
};
U_BOOT_DEVICE(stv09911_serials) = {
.name = "serial_pl01x",
- .platdata = &serial_platdata,
+ .plat = &serial_platdata,
};
#endif
U_BOOT_DEVICE(coldfire_serial) = {
.name = "serial_coldfire",
- .platdata = &mcf5307_serial_plat,
+ .plat = &mcf5307_serial_plat,
};
}
#endif
-/* CPSW platdata */
+/* CPSW plat */
#if !CONFIG_IS_ENABLED(OF_CONTROL)
struct cpsw_slave_data slave_data[] = {
{
U_BOOT_DEVICE(am335x_eth) = {
.name = "eth_cpsw",
- .platdata = &cpsw_pdata,
+ .plat = &cpsw_pdata,
};
#endif
U_BOOT_DEVICE(am335x_mmc0) = {
.name = "omap_hsmmc",
- .platdata = &am335x_mmc0_platdata,
+ .plat = &am335x_mmc0_platdata,
};
static const struct omap_hsmmc_plat am335x_mmc1_platdata = {
U_BOOT_DEVICE(am335x_mmc1) = {
.name = "omap_hsmmc",
- .platdata = &am335x_mmc1_platdata,
+ .plat = &am335x_mmc1_platdata,
};
#endif
U_BOOT_DEVICE(mxc_serial) = {
.name = "serial_mxc",
- .platdata = &mxc_serial_plat,
+ .plat = &mxc_serial_plat,
};
U_BOOT_DEVICE(mxc_serial) = {
.name = "serial_mxc",
- .platdata = &mxc_serial_plat,
+ .plat = &mxc_serial_plat,
};
U_BOOT_DEVICE(mxc_serial) = {
.name = "serial_mxc",
- .platdata = &mxc_serial_plat,
+ .plat = &mxc_serial_plat,
};
U_BOOT_DEVICE(pxa_mmcs) = {
.name = "pxa_mmc",
- .platdata = &mmc_platdata,
+ .plat = &mmc_platdata,
};
#endif /* !CONFIG_IS_ENABLED(DM_MMC) */
#endif
U_BOOT_DEVICE(pxa_serials) = {
.name = "serial_pxa",
- .platdata = &serial_platdata,
+ .plat = &serial_platdata,
};
The '-f' (force) option can be used for set the value which exceeds
the limits, which are found in device-tree and are kept in regulator's
- uclass platdata structure.
+ uclass plat structure.
endmenu
for (uclass_find_first_device(UCLASS_BUTTON, &dev);
dev;
uclass_find_next_device(&dev)) {
- struct button_uc_plat *plat = dev_get_uclass_platdata(dev);
+ struct button_uc_plat *plat = dev_get_uclass_plat(dev);
if (!plat->label)
continue;
for (uclass_first_device(UCLASS_CPU, &dev);
dev;
uclass_next_device(&dev)) {
- struct cpu_platdata *plat = dev_get_parent_platdata(dev);
+ struct cpu_platdata *plat = dev_get_parent_plat(dev);
struct cpu_info info;
bool first = true;
int ret, i;
for (i = 0, ret = uclass_first_device(UCLASS_DEMO, &dev);
dev;
ret = uclass_next_device(&dev)) {
- printf("entry %d - instance %08x, ops %08x, platdata %08x\n",
+ printf("entry %d - instance %08x, ops %08x, plat %08x\n",
i++, (uint)map_to_sysmem(dev),
(uint)map_to_sysmem(dev->driver->ops),
(uint)map_to_sysmem(dev_get_platdata(dev)));
ret = i2c_set_chip_offset_len(dev, alen);
if (ret)
return i2c_report_err(ret, I2C_ERR_WRITE);
- i2c_chip = dev_get_parent_platdata(dev);
+ i2c_chip = dev_get_parent_plat(dev);
if (!i2c_chip)
return i2c_report_err(ret, I2C_ERR_WRITE);
#endif
for (device_find_first_child(bus, &dev);
dev;
device_find_next_child(&dev)) {
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
printf(" %02x: %s, offset len %x, flags %x\n",
chip->chip_addr, dev->name, chip->offset_len,
for (uclass_find_first_device(UCLASS_LED, &dev);
dev;
uclass_find_next_device(&dev)) {
- struct led_uc_plat *plat = dev_get_uclass_platdata(dev);
+ struct led_uc_plat *plat = dev_get_uclass_plat(dev);
if (!plat->label)
continue;
uclass_foreach_dev(udev, uc) {
if (udev->driver != entry)
continue;
- desc = dev_get_uclass_platdata(udev);
+ desc = dev_get_uclass_plat(udev);
printf("%c %s %u", i ? ',' : ':',
blk_get_if_type_name(desc->if_type),
desc->devnum);
device_find_next_child(&dev)) {
struct pci_child_platdata *pplat;
- pplat = dev_get_parent_platdata(dev);
+ pplat = dev_get_parent_plat(dev);
if (short_listing) {
printf("%02x.%02x.%02x ", bus->seq,
PCI_DEV(pplat->devfn), PCI_FUNC(pplat->devfn));
static int do_dev(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
const char *name;
int ret = -ENXIO;
return CMD_RET_USAGE;
}
- uc_pdata = dev_get_uclass_platdata(currdev);
+ uc_pdata = dev_get_uclass_plat(currdev);
if (!uc_pdata) {
printf("%s: no regulator platform data!\n", currdev->name);
return failure(ret);
}
static int curr_dev_and_platdata(struct udevice **devp,
- struct dm_regulator_uclass_platdata **uc_pdata,
+ struct dm_regulator_uclass_plat **uc_pdata,
bool allow_type_fixed)
{
*devp = NULL;
*devp = currdev;
- *uc_pdata = dev_get_uclass_platdata(*devp);
+ *uc_pdata = dev_get_uclass_plat(*devp);
if (!*uc_pdata) {
pr_err("Regulator: %s - missing platform data!\n", currdev->name);
return CMD_RET_FAILURE;
static int do_list(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
struct udevice *dev;
int ret;
if (ret)
continue;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
printf("| %-*.*s| %-*.*s| %s\n",
LIMIT_DEVNAME, LIMIT_DEVNAME, dev->name,
LIMIT_OFNAME, LIMIT_OFNAME, uc_pdata->name,
char *const argv[])
{
struct udevice *dev;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
struct dm_regulator_mode *modes;
const char *parent_uc;
int mode_count;
}
static void do_status_detail(struct udevice *dev,
- struct dm_regulator_uclass_platdata *uc_pdata)
+ struct dm_regulator_uclass_plat *uc_pdata)
{
int current, value, mode;
const char *mode_name;
static void do_status_line(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *pdata;
+ struct dm_regulator_uclass_plat *pdata;
int current, value, mode;
const char *mode_name;
bool enabled;
- pdata = dev_get_uclass_platdata(dev);
+ pdata = dev_get_uclass_plat(dev);
enabled = regulator_get_enable(dev);
value = regulator_get_value(dev);
current = regulator_get_current(dev);
static int do_status(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
struct udevice *dev;
int ret;
char *const argv[])
{
struct udevice *dev;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
int value;
int force;
int ret;
char *const argv[])
{
struct udevice *dev;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
int current;
int ret;
char *const argv[])
{
struct udevice *dev;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
int mode;
int ret;
char *const argv[])
{
struct udevice *dev;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
int ret;
ret = curr_dev_and_platdata(&dev, &uc_pdata, true);
char *const argv[])
{
struct udevice *dev;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
int ret;
ret = curr_dev_and_platdata(&dev, &uc_pdata, true);
struct dm_rproc_uclass_pdata *uc_pdata;
const struct dm_rproc_ops *ops = rproc_get_ops(dev);
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
/* Do not print if rproc is not probed */
if (!(dev->flags & DM_FLAG_ACTIVATED))
if (ret)
return ret;
uc_priv = dev_get_uclass_priv(dev);
- plat = dev_get_uclass_platdata(dev);
+ plat = dev_get_uclass_plat(dev);
xsize = uc_priv->xsize;
ysize = uc_priv->ysize;
bpix = uc_priv->bpix;
.post_probe = usb_hub_post_probe,
.child_pre_probe = usb_child_pre_probe,
.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),
.per_device_auto = sizeof(struct usb_hub_device),
};
for (blk_first_device(IF_TYPE_USB, &dev);
dev;
blk_next_device(&dev)) {
- struct blk_desc *desc = dev_get_uclass_platdata(dev);
+ struct blk_desc *desc = dev_get_uclass_plat(dev);
printf(" Device %d: ", desc->devnum);
dev_print(desc);
debug("\n\nProbing for storage\n");
#if CONFIG_IS_ENABLED(BLK)
/*
- * We store the us_data in the mass storage device's platdata. It
+ * We store the us_data in the mass storage device's plat. It
* is shared by all LUNs (block devices) attached to this mass storage
* device.
*/
return ret;
}
- blkdev = dev_get_uclass_platdata(dev);
+ blkdev = dev_get_uclass_plat(dev);
blkdev->target = 0xff;
blkdev->lun = lun;
return 0;
/* Setup device */
#if CONFIG_IS_ENABLED(BLK)
- block_dev = dev_get_uclass_platdata(dev);
+ block_dev = dev_get_uclass_plat(dev);
udev = dev_get_parent_priv(dev_get_parent(dev));
debug("\nusb_read: udev %d\n", block_dev->devnum);
#else
/* Setup device */
#if CONFIG_IS_ENABLED(BLK)
- block_dev = dev_get_uclass_platdata(dev);
+ block_dev = dev_get_uclass_plat(dev);
udev = dev_get_parent_priv(dev_get_parent(dev));
debug("\nusb_read: udev %d\n", block_dev->devnum);
#else
.of_match = usb_mass_storage_ids,
.probe = usb_mass_storage_probe,
#if CONFIG_IS_ENABLED(BLK)
- .platdata_auto = sizeof(struct us_data),
+ .plat_auto = sizeof(struct us_data),
#endif
};
The demo class is pretty simple, but not trivial. The intention is that it
can be used for testing, so it will implement all driver model features and
provide good code coverage of them. It does have multiple drivers, it
-handles parameter data and platdata (data which tells the driver how
+handles parameter data and plat (data which tells the driver how
to operate on a particular platform) and it uses private driver data.
To try it, see the example session below::
* bind - make the driver model aware of a device (bind it to its driver)
* unbind - make the driver model forget the device
- * ofdata_to_platdata - convert device tree data to platdata - see later
+ * ofdata_to_platdata - convert device tree data to plat - see later
* probe - make a device ready for use
* remove - remove a device so it cannot be used until probed again
basically a communication scheme between the board-specific code and
the generic drivers, which are intended to work on any board.
-Drivers can access their data via dev->info->platdata. Here is
+Drivers can access their data via dev->info->plat. Here is
the declaration for the platform data, which would normally appear
in the board file.
static const struct driver_info info[] = {
{
.name = "demo_shape_drv",
- .platdata = &red_square,
+ .plat = &red_square,
},
};
Device Tree
-----------
-While platdata is useful, a more flexible way of providing device data is
+While plat is useful, a more flexible way of providing device data is
by using device tree. In U-Boot you should use this where possible. Avoid
sending patches which make use of the U_BOOT_DEVICE() macro unless strictly
necessary.
.. code-block:: c
- .platdata_auto = sizeof(struct dm_test_pdata),
+ .plat_auto = sizeof(struct dm_test_pdata),
.ofdata_to_platdata = testfdt_ofdata_to_platdata,
-The 'auto' feature allowed space for the platdata to be allocated
+The 'auto' feature allowed space for the plat to be allocated
and zeroed before the driver's ofdata_to_platdata() method is called. The
ofdata_to_platdata() method, which the driver write supplies, should parse
-the device tree node for this device and place it in dev->platdata. Thus
+the device tree node for this device and place it in dev->plat. Thus
when the probe method is called later (to set up the device ready for use)
the platform data will be present.
probe method it will be called next. See Driver Lifecycle below for more
details.
-If you don't want to have the platdata automatically allocated then you
-can leave out platdata_auto. In this case you can use malloc
+If you don't want to have the plat automatically allocated then you
+can leave out plat_auto. In this case you can use malloc
in your ofdata_to_platdata (or probe) method to allocate the required memory,
and you should free it in the remove method.
The bus device wants to store this address and some other information such
as the bus speed for each device.
-To achieve this, the bus device can use dev->parent_platdata in each of its
+To achieve this, the bus device can use dev->parent_plat in each of its
three children. This can be auto-allocated if the bus driver (or bus uclass)
-has a non-zero value for per_child_platdata_auto. If not, then
+has a non-zero value for per_child_plat_auto. If not, then
the bus device or uclass can allocate the space itself before the child
device is probed.
- Scan the U_BOOT_DEVICE() definitions. U-Boot looks up the name specified
by each, to find the appropriate U_BOOT_DRIVER() definition. In this case,
there is no path by which driver_data may be provided, but the U_BOOT_DEVICE()
- may provide platdata.
+ may provide plat.
- Scan through the device tree definitions. U-Boot looks at top-level
nodes in the the device tree. It looks at the compatible string in each node
and uses the of_match table of the U_BOOT_DRIVER() structure to find the
right driver for each node. In this case, the of_match table may provide a
- driver_data value, but platdata cannot be provided until later.
+ driver_data value, but plat cannot be provided until later.
For each device that is discovered, U-Boot then calls device_bind() to create a
new device, initializes various core fields of the device object such as name,
uclass & driver, initializes any optional fields of the device object that are
-applicable such as of_offset, driver_data & platdata, and finally calls the
+applicable such as of_offset, driver_data & plat, and finally calls the
driver's bind() method if one is defined.
At this point all the devices are known, and bound to their drivers. There
is a 'struct udevice' allocated for all devices. However, nothing has been
activated (except for the root device). Each bound device that was created
-from a U_BOOT_DEVICE() declaration will hold the platdata pointer specified
+from a U_BOOT_DEVICE() declaration will hold the plat pointer specified
in that declaration. For a bound device created from the device tree,
-platdata will be NULL, but of_offset will be the offset of the device tree
+plat will be NULL, but of_offset will be the offset of the device tree
node that caused the device to be created. The uclass is set correctly for
the device.
operation. This is called 'ofdata' (Open-Firmware data).
The device's_ofdata_to_platdata() implemnents allocation and reading of
-platdata. A parent's ofdata is always read before a child.
+plat. A parent's ofdata is always read before a child.
The steps are:
it for run-time information, not platform data (which should be static
and known before the device is probed).
- 2. If platdata_auto is non-zero, then the platform data space
+ 2. If plat_auto is non-zero, then the platform data space
is allocated. This is only useful for device tree operation, since
otherwise you would have to specific the platform data in the
U_BOOT_DEVICE() declaration. The space is allocated for the device and
- zeroed. It will be accessible as dev->platdata.
+ zeroed. It will be accessible as dev->plat.
3. If the device's uclass specifies a non-zero per_device_auto,
then this space is allocated and zeroed also. It is allocated for and
5. If the driver provides an ofdata_to_platdata() method, then this is
called to convert the device tree data into platform data. This should
do various calls like dev_read_u32(dev, ...) to access the node and store
- the resulting information into dev->platdata. After this point, the device
+ the resulting information into dev->plat. After this point, the device
works the same way whether it was bound using a device tree node or
U_BOOT_DEVICE() structure. In either case, the platform data is now stored
- in the platdata structure. Typically you will use the
- platdata_auto feature to specify the size of the platform data
+ in the plat structure. Typically you will use the
+ plat_auto feature to specify the size of the platform data
structure, and U-Boot will automatically allocate and zero it for you before
entry to ofdata_to_platdata(). But if not, you can allocate it yourself in
ofdata_to_platdata(). Note that it is preferable to do all the device tree
that U-Boot will cache platform data for devices which are regularly
de/activated).
- 5. The device is marked 'platdata valid'.
+ 6. The device is marked 'plat valid'.
Note that ofdata reading is always done (for a child and all its parents)
before probing starts. Thus devices go through two distinct states when
hardware and setting up hardware registers to initial values. The code
in probe() can access:
- - platform data in dev->platdata (for configuration)
+ - platform data in dev->plat (for configuration)
- private data in dev->priv (for run-time state)
- uclass data in dev->uclass_priv (for things the uclass stores
about this device)
Note: If you don't use priv_auto then you will need to
allocate the priv space here yourself. The same applies also to
- platdata_auto. Remember to free them in the remove() method.
+ plat_auto. Remember to free them in the remove() method.
5. The device is marked 'activated'
be dynamically allocated, and thus needs to be deallocated during the
remove() method, either:
- - if the platdata_auto is non-zero, the deallocation
+ - if the plat_auto is non-zero, the deallocation
happens automatically within the driver model core; or
- - when platdata_auto is 0, both the allocation (in probe()
+ - when plat_auto is 0, both the allocation (in probe()
or preferably ofdata_to_platdata()) and the deallocation in remove()
are the responsibility of the driver author.
the driver operations structure in the driver, rather than passing it
to the driver bind function.
- Rename some structures to make them more similar to Linux (struct udevice
- instead of struct instance, struct platdata, etc.)
+ instead of struct instance, struct plat, etc.)
- Change the name 'core' to 'uclass', meaning U-Boot class. It seems that
this concept relates to a class of drivers (or a subsystem). We shouldn't
use 'class' since it is a C++ reserved word, so U-Boot class (uclass) seems
better than 'core'.
- Remove 'struct driver_instance' and just use a single 'struct udevice'.
This removes a level of indirection that doesn't seem necessary.
-- Built in device tree support, to avoid the need for platdata
+- Built in device tree support, to avoid the need for plat
- Removed the concept of driver relocation, and just make it possible for
the new driver (created after relocation) to access the old driver data.
I feel that relocation is a very special case and will only apply to a few
.probe = eth_ape_probe,
.ops = ð_ape_ops,
.priv_auto = sizeof(struct eth_ape_priv),
- .platdata_auto = sizeof(struct eth_ape_pdata),
+ .plat_auto = sizeof(struct eth_ape_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
a hardware variant, the MAC address. ``struct eth_pdata eth_pdata``
as the first member of this struct helps to avoid duplicated code.
If you don't need any more platform data beside the standard member,
-just use sizeof(struct eth_pdata) for the platdata_auto.
+just use sizeof(struct eth_pdata) for the plat_auto.
PCI devices add a line pointing to supported vendor/device ID pairs:
and/or PHY, and waiting for the link to autonegotiate. You should also take
the opportunity to program the device's MAC address with the enetaddr member
of the generic struct eth_pdata (which would be the first member of your
-own platdata struct). This allows the rest of U-Boot to dynamically change
+own plat struct). This allows the rest of U-Boot to dynamically change
the MAC address and have the new settings be respected.
The **send** function does what you think -- transmit the specified packet
U_BOOT_DEVICE(dwmmc_at_ff0c0000) = {
.name = "rockchip_rk3288_dw_mshc",
- .platdata = &dtv_dwmmc_at_ff0c0000,
- .platdata_size = sizeof(dtv_dwmmc_at_ff0c0000),
+ .plat = &dtv_dwmmc_at_ff0c0000,
+ .plat_size = sizeof(dtv_dwmmc_at_ff0c0000),
.parent_idx = -1,
};
Drivers should always support device tree as an option. The of-platdata
feature is intended as a add-on to existing drivers.
-Your driver should convert the platdata struct in its probe() method. The
+Your driver should convert the plat struct in its probe() method. The
existing device tree decoding logic should be kept in the
ofdata_to_platdata() method and wrapped with #if.
.ofdata_to_platdata = mmc_ofdata_to_platdata,
.probe = mmc_probe,
.priv_auto = sizeof(struct mmc_priv),
- .platdata_auto = sizeof(struct mmc_platdata),
+ .plat_auto = sizeof(struct mmc_platdata),
};
U_BOOT_DRIVER_ALIAS(mmc_drv, vendor_mmc) /* matches compatible string */
There is just one driver C file for each struct, that can convert from the
of-platdata struct to the standard one used by the driver.
-In the case where SPL_OF_PLATDATA is enabled, platdata_auto is
+In the case where SPL_OF_PLATDATA is enabled, plat_auto is
still used to allocate space for the platform data. This is different from
the normal behaviour and is triggered by the use of of-platdata (strictly
speaking it is a non-zero platdata_size which triggers this).
prevents them being used inadvertently. All usage must be bracketed with
#if CONFIG_IS_ENABLED(OF_PLATDATA).
-The dt-platdata.c file contains the device declarations and is is built in
-spl/dt-platdata.c. It additionally contains the definition of
+The dt-plat.c file contains the device declarations and is is built in
+spl/dt-plat.c. It additionally contains the definition of
dm_populate_phandle_data() which is responsible of filling the phandle
information by adding references to U_BOOT_DEVICE by using DM_GET_DEVICE
U_BOOT_DEVICE(proc_3_demo) = {
.name = "sandbox_test_proc",
- .platdata = &proc_3_test,
+ .plat = &proc_3_test,
};
There can be additional data that may be desired depending on the
U_BOOT_DRIVER(spi_exynos) = {
...
- .platdata_auto = sizeof(struct exynos_spi_platdata),
+ .plat_auto = sizeof(struct exynos_spi_platdata),
Here is a sample function. It gets a pointer to the platform data and
static int exynos_spi_ofdata_to_platdata(struct udevice *bus)
{
- struct exynos_spi_platdata *plat = bus->platdata;
+ struct exynos_spi_platdata *plat = bus->plat;
const void *blob = gd->fdt_blob;
int node = dev_of_offset(bus);
U_BOOT_DEVICE(board_spi0) = {
.name = "exynos_spi",
- .platdata = &platdata_spi0,
+ .plat = &platdata_spi0,
};
You will unfortunately need to put the struct definition into a header file
static int exynos_spi_set_speed(struct udevice *bus, uint speed)
{
- struct exynos_spi_platdata *plat = bus->platdata;
+ struct exynos_spi_platdata *plat = bus->plat;
struct exynos_spi_priv *priv = dev_get_priv(bus);
int ret;
The SPI uclass keeps some information about each device 'dev' on the bus:
struct dm_spi_slave_platdata:
- This is device_get_parent_platdata(dev).
+ This is device_get_parent_plat(dev).
This is where the chip select number is stored, along with
the default bus speed and mode. It is automatically read
from the device tree in spi_child_post_bind(). It must not
.probe = tegra_ehci_usb_probe,
.remove = tegra_ehci_usb_remove,
.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,
};
- struct usb_dev_platdata:
This holds platform data for a device. You can access it for a
- device 'dev' with dev_get_parent_platdata(dev). It holds the device
+ device 'dev' with dev_get_parent_plat(dev). It holds the device
address and speed - anything that can be determined before the device
driver is actually set up. When probing the bus this structure is
used to provide essential information to the device driver.
#include <linux/delay.h>
#include <power/regulator.h>
-#define ADC_UCLASS_PLATDATA_SIZE sizeof(struct adc_uclass_platdata)
+#define ADC_UCLASS_PLATDATA_SIZE sizeof(struct adc_uclass_plat)
#define CHECK_NUMBER true
#define CHECK_MASK (!CHECK_NUMBER)
static int check_channel(struct udevice *dev, int value, bool number_or_mask,
const char *caller_function)
{
- struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+ struct adc_uclass_plat *uc_pdata = dev_get_uclass_plat(dev);
unsigned mask = number_or_mask ? (1 << value) : value;
/* For the real ADC hardware, some ADC channels can be inactive.
static int adc_supply_enable(struct udevice *dev)
{
- struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+ struct adc_uclass_plat *uc_pdata = dev_get_uclass_plat(dev);
const char *supply_type;
int ret = 0;
int adc_data_mask(struct udevice *dev, unsigned int *data_mask)
{
- struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+ struct adc_uclass_plat *uc_pdata = dev_get_uclass_plat(dev);
if (!uc_pdata)
return -ENOSYS;
int adc_channel_mask(struct udevice *dev, unsigned int *channel_mask)
{
- struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+ struct adc_uclass_plat *uc_pdata = dev_get_uclass_plat(dev);
if (!uc_pdata)
return -ENOSYS;
int adc_channel_data(struct udevice *dev, int channel, unsigned int *data)
{
- struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+ struct adc_uclass_plat *uc_pdata = dev_get_uclass_plat(dev);
const struct adc_ops *ops = dev_get_driver_ops(dev);
unsigned int timeout_us = uc_pdata->data_timeout_us;
int ret;
int adc_channels_data(struct udevice *dev, unsigned int channel_mask,
struct adc_channel *channels)
{
- struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+ struct adc_uclass_plat *uc_pdata = dev_get_uclass_plat(dev);
unsigned int timeout_us = uc_pdata->multidata_timeout_us;
const struct adc_ops *ops = dev_get_driver_ops(dev);
int ret;
static int adc_vdd_platdata_update(struct udevice *dev)
{
- struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+ struct adc_uclass_plat *uc_pdata = dev_get_uclass_plat(dev);
int ret;
/* Warning!
static int adc_vss_platdata_update(struct udevice *dev)
{
- struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+ struct adc_uclass_plat *uc_pdata = dev_get_uclass_plat(dev);
int ret;
if (!uc_pdata->vss_supply)
int adc_vdd_value(struct udevice *dev, int *uV)
{
- struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+ struct adc_uclass_plat *uc_pdata = dev_get_uclass_plat(dev);
int ret, value_sign = uc_pdata->vdd_polarity_negative ? -1 : 1;
/* Update the regulator Value. */
int adc_vss_value(struct udevice *dev, int *uV)
{
- struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+ struct adc_uclass_plat *uc_pdata = dev_get_uclass_plat(dev);
int ret, value_sign = uc_pdata->vss_polarity_negative ? -1 : 1;
/* Update the regulator Value. */
static int adc_vdd_platdata_set(struct udevice *dev)
{
- struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+ struct adc_uclass_plat *uc_pdata = dev_get_uclass_plat(dev);
int ret;
char *prop;
static int adc_vss_platdata_set(struct udevice *dev)
{
- struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+ struct adc_uclass_plat *uc_pdata = dev_get_uclass_plat(dev);
int ret;
char *prop;
{
int ret;
- /* Set ADC VDD platdata: polarity, uV, regulator (phandle). */
+ /* Set ADC VDD plat: polarity, uV, regulator (phandle). */
ret = adc_vdd_platdata_set(dev);
if (ret)
pr_err("%s: Can't update Vdd. Error: %d", dev->name, ret);
- /* Set ADC VSS platdata: polarity, uV, regulator (phandle). */
+ /* Set ADC VSS plat: polarity, uV, regulator (phandle). */
ret = adc_vss_platdata_set(dev);
if (ret)
pr_err("%s: Can't update Vss. Error: %d", dev->name, ret);
.id = UCLASS_ADC,
.name = "adc",
.pre_probe = adc_pre_probe,
- .per_device_platdata_auto = ADC_UCLASS_PLATDATA_SIZE,
+ .per_device_plat_auto = ADC_UCLASS_PLATDATA_SIZE,
};
int exynos_adc_ofdata_to_platdata(struct udevice *dev)
{
- struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+ struct adc_uclass_plat *uc_pdata = dev_get_uclass_plat(dev);
struct exynos_adc_priv *priv = dev_get_priv(dev);
priv->regs = dev_read_addr_ptr(dev);
int meson_saradc_ofdata_to_platdata(struct udevice *dev)
{
- struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+ struct adc_uclass_plat *uc_pdata = dev_get_uclass_plat(dev);
struct meson_saradc_priv *priv = dev_get_priv(dev);
priv->data = (struct meson_saradc_data *)dev_get_driver_data(dev);
unsigned int *data)
{
struct rockchip_saradc_priv *priv = dev_get_priv(dev);
- struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+ struct adc_uclass_plat *uc_pdata = dev_get_uclass_plat(dev);
if (channel != priv->active_channel) {
pr_err("Requested channel is not active!");
int rockchip_saradc_ofdata_to_platdata(struct udevice *dev)
{
- struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+ struct adc_uclass_plat *uc_pdata = dev_get_uclass_plat(dev);
struct rockchip_saradc_priv *priv = dev_get_priv(dev);
struct rockchip_saradc_data *data;
int sandbox_adc_ofdata_to_platdata(struct udevice *dev)
{
- struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+ struct adc_uclass_plat *uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->data_mask = SANDBOX_ADC_DATA_MASK;
uc_pdata->data_format = ADC_DATA_FORMAT_BIN;
static int stm32_adc_start_channel(struct udevice *dev, int channel)
{
- struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+ struct adc_uclass_plat *uc_pdata = dev_get_uclass_plat(dev);
struct stm32_adc_common *common = dev_get_priv(dev_get_parent(dev));
struct stm32_adc *adc = dev_get_priv(dev);
int ret;
static int stm32_adc_chan_of_init(struct udevice *dev)
{
- struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+ struct adc_uclass_plat *uc_pdata = dev_get_uclass_plat(dev);
struct stm32_adc *adc = dev_get_priv(dev);
u32 chans[STM32_ADC_CH_MAX];
unsigned int i, num_channels;
static int stm32_adc_probe(struct udevice *dev)
{
- struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+ struct adc_uclass_plat *uc_pdata = dev_get_uclass_plat(dev);
struct stm32_adc_common *common = dev_get_priv(dev_get_parent(dev));
struct stm32_adc *adc = dev_get_priv(dev);
int offset;
#if !defined(CONFIG_SCSI_AHCI_PLAT) && !defined(CONFIG_DM_SCSI)
# ifdef CONFIG_DM_PCI
struct udevice *dev = uc_priv->dev;
- struct pci_child_platdata *pplat = dev_get_parent_platdata(dev);
+ struct pci_child_platdata *pplat = dev_get_parent_plat(dev);
# else
pci_dev_t pdev = uc_priv->dev;
unsigned short vendor;
pci_write_config_byte(dev, 0x41, 0xa1);
#endif
#else
- struct scsi_platdata *plat = dev_get_uclass_platdata(dev);
+ struct scsi_platdata *plat = dev_get_uclass_plat(dev);
uc_priv->mmio_base = (void *)plat->base;
#endif
device_find_first_child(ahci_dev, &dev);
if (!dev)
return -ENODEV;
- uc_plat = dev_get_uclass_platdata(dev);
+ uc_plat = dev_get_uclass_plat(dev);
uc_plat->base = base;
uc_plat->max_lun = 1;
uc_plat->max_id = 2;
}
}
- desc = dev_get_uclass_platdata(blk);
+ desc = dev_get_uclass_plat(blk);
ret = dwc_ahsata_scan_common(uc_priv, desc);
if (ret) {
debug("%s: Failed to scan bus\n", __func__);
static ulong dwc_ahsata_read(struct udevice *blk, lbaint_t blknr,
lbaint_t blkcnt, void *buffer)
{
- struct blk_desc *desc = dev_get_uclass_platdata(blk);
+ struct blk_desc *desc = dev_get_uclass_plat(blk);
struct udevice *dev = dev_get_parent(blk);
struct ahci_uc_priv *uc_priv;
static ulong dwc_ahsata_write(struct udevice *blk, lbaint_t blknr,
lbaint_t blkcnt, const void *buffer)
{
- struct blk_desc *desc = dev_get_uclass_platdata(blk);
+ struct blk_desc *desc = dev_get_uclass_plat(blk);
struct udevice *dev = dev_get_parent(blk);
struct ahci_uc_priv *uc_priv;
#else
static int scan_sata(struct udevice *dev)
{
- struct blk_desc *desc = dev_get_uclass_platdata(dev);
+ struct blk_desc *desc = dev_get_uclass_plat(dev);
struct fsl_ata_priv *priv = dev_get_platdata(dev);
fsl_sata_t *sata = priv->fsl_sata;
#endif
.name = "sata_fsl_blk",
.id = UCLASS_BLK,
.ops = &sata_fsl_blk_ops,
- .platdata_auto = sizeof(struct fsl_ata_priv),
+ .plat_auto = sizeof(struct fsl_ata_priv),
};
static int fsl_ata_ofdata_to_platdata(struct udevice *dev)
static u32 ata_low_level_rw(struct udevice *dev, int port, lbaint_t blknr,
lbaint_t blkcnt, void *buffer, int is_write)
{
- struct blk_desc *desc = dev_get_uclass_platdata(dev);
+ struct blk_desc *desc = dev_get_uclass_plat(dev);
lbaint_t start, blks;
u8 *addr;
int max_blks;
static int sata_mv_scan_sata(struct udevice *dev, int port)
{
- struct blk_desc *desc = dev_get_uclass_platdata(dev);
+ struct blk_desc *desc = dev_get_uclass_plat(dev);
struct mv_priv *priv = dev_get_platdata(dev);
unsigned char serial[ATA_ID_SERNO_LEN + 1];
unsigned char firmware[ATA_ID_FW_REV_LEN + 1];
.name = "sata_mv_blk",
.id = UCLASS_BLK,
.ops = &sata_mv_blk_ops,
- .platdata_auto = sizeof(struct mv_priv),
+ .plat_auto = sizeof(struct mv_priv),
};
static int sata_mv_probe(struct udevice *dev)
#else
static int scan_sata(struct udevice *blk_dev, int dev)
{
- struct blk_desc *desc = dev_get_uclass_platdata(blk_dev);
+ struct blk_desc *desc = dev_get_uclass_plat(blk_dev);
struct sil_sata_priv *priv = dev_get_platdata(blk_dev);
struct sil_sata *sata = priv->sil_sata_desc[dev];
#endif
.name = "sata_sil_blk",
.id = UCLASS_BLK,
.ops = &sata_sil_blk_ops,
- .platdata_auto = sizeof(struct sil_sata_priv),
+ .plat_auto = sizeof(struct sil_sata_priv),
};
static int sil_unbind_device(struct udevice *dev)
ret = blk_get_device(if_type, devnum, &dev);
if (ret)
return NULL;
- desc = dev_get_uclass_platdata(dev);
+ desc = dev_get_uclass_plat(dev);
return desc;
}
if (ret)
return NULL;
uclass_foreach_dev(dev, uc) {
- struct blk_desc *desc = dev_get_uclass_platdata(dev);
+ struct blk_desc *desc = dev_get_uclass_plat(dev);
debug("%s: if_type=%d, devnum=%d: %s, %d, %d\n", __func__,
if_type, devnum, dev->name, desc->if_type, desc->devnum);
if (device_get_uclass_id(child_dev) != UCLASS_BLK)
continue;
- return dev_get_uclass_platdata(child_dev);
+ return dev_get_uclass_plat(child_dev);
}
debug("%s: No block device found\n", __func__);
if (ret)
return ret;
uclass_foreach_dev(dev, uc) {
- struct blk_desc *desc = dev_get_uclass_platdata(dev);
+ struct blk_desc *desc = dev_get_uclass_plat(dev);
debug("%s: if_type=%d, devnum=%d: %s, %d, %d\n", __func__,
if_type, devnum, dev->name, desc->if_type, desc->devnum);
if (!*devp)
return -ENODEV;
do {
- desc = dev_get_uclass_platdata(*devp);
+ desc = dev_get_uclass_plat(*devp);
if (desc->if_type == if_type)
return 0;
ret = uclass_find_next_device(devp);
struct blk_desc *desc;
int ret, if_type;
- desc = dev_get_uclass_platdata(*devp);
+ desc = dev_get_uclass_plat(*devp);
if_type = desc->if_type;
do {
ret = uclass_find_next_device(devp);
return ret;
if (!*devp)
return -ENODEV;
- desc = dev_get_uclass_platdata(*devp);
+ desc = dev_get_uclass_plat(*devp);
if (desc->if_type == if_type)
return 0;
} while (1);
if (ret)
return ret;
uclass_foreach_dev(dev, uc) {
- struct blk_desc *desc = dev_get_uclass_platdata(dev);
+ struct blk_desc *desc = dev_get_uclass_plat(dev);
debug("%s: if_type=%d, devnum=%d: %s, %d, %d\n", __func__,
if_type, devnum, dev->name, desc->if_type, desc->devnum);
if (ret)
return ret;
uclass_foreach_dev(dev, uc) {
- struct blk_desc *desc = dev_get_uclass_platdata(dev);
+ struct blk_desc *desc = dev_get_uclass_plat(dev);
if (desc->if_type == if_type && desc->devnum > max_devnum)
max_devnum = desc->devnum;
if (ret)
return ret;
uclass_foreach_dev(dev, uc) {
- struct blk_desc *desc = dev_get_uclass_platdata(dev);
+ struct blk_desc *desc = dev_get_uclass_plat(dev);
if (desc->if_type == if_type && desc->devnum == devnum) {
int next = blk_next_free_devnum(if_type);
ret = device_bind_driver(parent, drv_name, name, &dev);
if (ret)
return ret;
- desc = dev_get_uclass_platdata(dev);
+ desc = dev_get_uclass_plat(dev);
desc->if_type = if_type;
desc->blksz = blksz;
desc->log2blksz = LOG2(desc->blksz);
if (ret)
return ret;
uclass_foreach_dev_safe(dev, next, uc) {
- struct blk_desc *desc = dev_get_uclass_platdata(dev);
+ struct blk_desc *desc = dev_get_uclass_plat(dev);
if (desc->if_type == if_type) {
ret = device_remove(dev, DM_REMOVE_NORMAL);
{
if (IS_ENABLED(CONFIG_PARTITIONS) &&
IS_ENABLED(CONFIG_HAVE_BLOCK_DEVICE)) {
- struct blk_desc *desc = dev_get_uclass_platdata(dev);
+ struct blk_desc *desc = dev_get_uclass_plat(dev);
part_init(desc);
}
.id = UCLASS_BLK,
.name = "blk",
.post_probe = blk_post_probe,
- .per_device_platdata_auto = sizeof(struct blk_desc),
+ .per_device_plat_auto = sizeof(struct blk_desc),
};
#endif
{
#ifdef CONFIG_BLK
- struct blk_desc *block_dev = dev_get_uclass_platdata(dev);
+ struct blk_desc *block_dev = dev_get_uclass_plat(dev);
#endif
int device = block_dev->devnum;
ulong n = 0;
#endif
{
#ifdef CONFIG_BLK
- struct blk_desc *block_dev = dev_get_uclass_platdata(dev);
+ struct blk_desc *block_dev = dev_get_uclass_plat(dev);
#endif
int device = block_dev->devnum;
ulong n = 0;
#ifdef CONFIG_BLK
static int ide_blk_probe(struct udevice *udev)
{
- struct blk_desc *desc = dev_get_uclass_platdata(udev);
+ struct blk_desc *desc = dev_get_uclass_plat(udev);
/* fill in device vendor/product/rev strings */
strncpy(desc->vendor, ide_dev_desc[desc->devnum].vendor,
void *buffer)
{
struct host_block_dev *host_dev = dev_get_platdata(dev);
- struct blk_desc *block_dev = dev_get_uclass_platdata(dev);
+ struct blk_desc *block_dev = dev_get_uclass_plat(dev);
#else
static unsigned long host_block_read(struct blk_desc *block_dev,
const void *buffer)
{
struct host_block_dev *host_dev = dev_get_platdata(dev);
- struct blk_desc *block_dev = dev_get_uclass_platdata(dev);
+ struct blk_desc *block_dev = dev_get_uclass_plat(dev);
#else
static unsigned long host_block_write(struct blk_desc *block_dev,
unsigned long start, lbaint_t blkcnt,
ret = blk_get_device(IF_TYPE_HOST, devnum, &dev);
if (ret)
return ret;
- *blk_devp = dev_get_uclass_platdata(dev);
+ *blk_devp = dev_get_uclass_plat(dev);
#else
struct host_block_dev *host_dev = find_host_device(devnum);
.name = "sandbox_host_blk",
.id = UCLASS_BLK,
.ops = &sandbox_host_blk_ops,
- .platdata_auto = sizeof(struct host_block_dev),
+ .plat_auto = sizeof(struct host_block_dev),
};
#else
U_BOOT_LEGACY_BLK(sandbox_host) = {
static int button_gpio_probe(struct udevice *dev)
{
- struct button_uc_plat *uc_plat = dev_get_uclass_platdata(dev);
+ struct button_uc_plat *uc_plat = dev_get_uclass_plat(dev);
struct button_gpio_priv *priv = dev_get_priv(dev);
int ret;
node, &dev);
if (ret)
return ret;
- uc_plat = dev_get_uclass_platdata(dev);
+ uc_plat = dev_get_uclass_plat(dev);
uc_plat->label = label;
}
struct uclass *uc;
uclass_id_foreach_dev(UCLASS_BUTTON, dev, uc) {
- struct button_uc_plat *uc_plat = dev_get_uclass_platdata(dev);
+ struct button_uc_plat *uc_plat = dev_get_uclass_plat(dev);
/* Ignore the top-level button node */
if (uc_plat->label && !strcmp(label, uc_plat->label))
UCLASS_DRIVER(button) = {
.id = UCLASS_BUTTON,
.name = "button",
- .per_device_platdata_auto = sizeof(struct button_uc_plat),
+ .per_device_plat_auto = sizeof(struct button_uc_plat),
};
.of_match = v5l2_cache_ids,
.ofdata_to_platdata = v5l2_ofdata_to_platdata,
.probe = v5l2_probe,
- .platdata_auto = sizeof(struct v5l2_plat),
+ .plat_auto = sizeof(struct v5l2_plat),
.ops = &v5l2_cache_ops,
.flags = DM_FLAG_PRE_RELOC,
};
.ops = &socfpga_clk_ops,
.probe = socfpga_clk_probe,
.ofdata_to_platdata = socfpga_clk_ofdata_to_platdata,
- .platdata_auto = sizeof(struct socfpga_clk_platdata),
+ .plat_auto = sizeof(struct socfpga_clk_platdata),
};
.probe = socfpga_a10_clk_probe,
.ofdata_to_platdata = socfpga_a10_ofdata_to_platdata,
- .platdata_auto = sizeof(struct socfpga_a10_clk_platdata),
+ .plat_auto = sizeof(struct socfpga_a10_clk_platdata),
};
.id = UCLASS_CLK,
.of_match = main_osc_clk_match,
.probe = main_osc_clk_probe,
- .platdata_auto = sizeof(struct pmc_platdata),
+ .plat_auto = sizeof(struct pmc_platdata),
.ops = &main_osc_clk_ops,
};
.id = UCLASS_CLK,
.of_match = plla_clk_match,
.probe = plla_clk_probe,
- .platdata_auto = sizeof(struct pmc_platdata),
+ .plat_auto = sizeof(struct pmc_platdata),
.ops = &plla_clk_ops,
};
.id = UCLASS_CLK,
.of_match = at91_plladiv_clk_match,
.probe = at91_plladiv_clk_probe,
- .platdata_auto = sizeof(struct pmc_platdata),
+ .plat_auto = sizeof(struct pmc_platdata),
.ops = &at91_plladiv_clk_ops,
};
.name = "system-clk",
.id = UCLASS_CLK,
.probe = at91_clk_probe,
- .platdata_auto = sizeof(struct pmc_platdata),
+ .plat_auto = sizeof(struct pmc_platdata),
.ops = &system_clk_ops,
};
U_BOOT_DRIVER(clk_periph) = {
.name = "periph-clk",
.id = UCLASS_CLK,
- .platdata_auto = sizeof(struct pmc_platdata),
+ .plat_auto = sizeof(struct pmc_platdata),
.probe = at91_clk_probe,
.ops = &periph_clk_ops,
};
.of_match = utmi_clk_match,
.probe = utmi_clk_probe,
.ofdata_to_platdata = utmi_clk_ofdata_to_platdata,
- .platdata_auto = sizeof(struct pmc_platdata),
+ .plat_auto = sizeof(struct pmc_platdata),
.ops = &utmi_clk_ops,
};
.id = UCLASS_CLK,
.of_match = sama5d4_h32mx_clk_match,
.probe = sama5d4_h32mx_clk_probe,
- .platdata_auto = sizeof(struct pmc_platdata),
+ .plat_auto = sizeof(struct pmc_platdata),
.ops = &sama5d4_h32mx_clk_ops,
};
.probe = at91_clk_probe,
.ofdata_to_platdata = generic_clk_ofdata_to_platdata,
.priv_auto = sizeof(struct generic_clk_priv),
- .platdata_auto = sizeof(struct pmc_platdata),
+ .plat_auto = sizeof(struct pmc_platdata),
.ops = &generic_clk_ops,
};
.probe = at91_usb_clk_probe,
.ofdata_to_platdata = at91_usb_clk_ofdata_to_platdata,
.priv_auto = sizeof(struct at91_usb_clk_priv),
- .platdata_auto = sizeof(struct pmc_platdata),
+ .plat_auto = sizeof(struct pmc_platdata),
.ops = &at91_usb_clk_ops,
};
.id = UCLASS_CLK,
.of_match = clk_boston_match,
.ofdata_to_platdata = clk_boston_ofdata_to_platdata,
- .platdata_auto = sizeof(struct clk_boston),
+ .plat_auto = sizeof(struct clk_boston),
.ops = &clk_boston_ops,
};
.id = UCLASS_CLK,
.of_match = clk_fixed_factor_match,
.ofdata_to_platdata = clk_fixed_factor_ofdata_to_platdata,
- .platdata_auto = sizeof(struct clk_fixed_factor),
+ .plat_auto = sizeof(struct clk_fixed_factor),
.ops = &clk_fixed_factor_ops,
};
.id = UCLASS_CLK,
.of_match = clk_fixed_rate_match,
.ofdata_to_platdata = clk_fixed_rate_ofdata_to_platdata,
- .platdata_auto = sizeof(struct clk_fixed_rate),
+ .plat_auto = sizeof(struct clk_fixed_rate),
.ops = &clk_fixed_rate_ops,
.flags = DM_FLAG_PRE_RELOC,
};
.id = UCLASS_CLK,
.of_match = rk3188_clk_ids,
.priv_auto = sizeof(struct rk3188_clk_priv),
- .platdata_auto = sizeof(struct rk3188_clk_plat),
+ .plat_auto = sizeof(struct rk3188_clk_plat),
.ops = &rk3188_clk_ops,
.bind = rk3188_clk_bind,
.ofdata_to_platdata = rk3188_clk_ofdata_to_platdata,
.id = UCLASS_CLK,
.of_match = rk3288_clk_ids,
.priv_auto = sizeof(struct rk3288_clk_priv),
- .platdata_auto = sizeof(struct rk3288_clk_plat),
+ .plat_auto = sizeof(struct rk3288_clk_plat),
.ops = &rk3288_clk_ops,
.bind = rk3288_clk_bind,
.ofdata_to_platdata = rk3288_clk_ofdata_to_platdata,
.of_match = rk3368_clk_ids,
.priv_auto = sizeof(struct rk3368_clk_priv),
#if CONFIG_IS_ENABLED(OF_PLATDATA)
- .platdata_auto = sizeof(struct rk3368_clk_plat),
+ .plat_auto = sizeof(struct rk3368_clk_plat),
#endif
.ofdata_to_platdata = rk3368_clk_ofdata_to_platdata,
.ops = &rk3368_clk_ops,
.bind = rk3399_clk_bind,
.probe = rk3399_clk_probe,
#if CONFIG_IS_ENABLED(OF_PLATDATA)
- .platdata_auto = sizeof(struct rk3399_clk_plat),
+ .plat_auto = sizeof(struct rk3399_clk_plat),
#endif
};
.probe = rk3399_pmuclk_probe,
.bind = rk3399_pmuclk_bind,
#if CONFIG_IS_ENABLED(OF_PLATDATA)
- .platdata_auto = sizeof(struct rk3399_pmuclk_plat),
+ .plat_auto = sizeof(struct rk3399_pmuclk_plat),
#endif
};
return log_msg_ret("child unbind", ret);
if (dev->flags & DM_FLAG_ALLOC_PDATA) {
- free(dev->platdata);
- dev->platdata = NULL;
+ free(dev->plat);
+ dev->plat = NULL;
}
if (dev->flags & DM_FLAG_ALLOC_UCLASS_PDATA) {
- free(dev->uclass_platdata);
- dev->uclass_platdata = NULL;
+ free(dev->uclass_plat);
+ dev->uclass_plat = NULL;
}
if (dev->flags & DM_FLAG_ALLOC_PARENT_PDATA) {
- free(dev->parent_platdata);
- dev->parent_platdata = NULL;
+ free(dev->parent_plat);
+ dev->parent_plat = NULL;
}
ret = uclass_unbind_device(dev);
if (ret)
DECLARE_GLOBAL_DATA_PTR;
static int device_bind_common(struct udevice *parent, const struct driver *drv,
- const char *name, void *platdata,
+ const char *name, void *plat,
ulong driver_data, ofnode node,
uint of_platdata_size, struct udevice **devp)
{
#ifdef CONFIG_DEVRES
INIT_LIST_HEAD(&dev->devres_head);
#endif
- dev->platdata = platdata;
+ dev->plat = plat;
dev->driver_data = driver_data;
dev->name = name;
dev->node = node;
}
}
- if (drv->platdata_auto) {
- bool alloc = !platdata;
+ if (drv->plat_auto) {
+ bool alloc = !plat;
if (CONFIG_IS_ENABLED(OF_PLATDATA)) {
if (of_platdata_size) {
dev->flags |= DM_FLAG_OF_PLATDATA;
- if (of_platdata_size < drv->platdata_auto)
+ if (of_platdata_size < drv->plat_auto)
alloc = true;
}
}
if (alloc) {
dev->flags |= DM_FLAG_ALLOC_PDATA;
- dev->platdata = calloc(1, drv->platdata_auto);
- if (!dev->platdata) {
+ dev->plat = calloc(1, drv->plat_auto);
+ if (!dev->plat) {
ret = -ENOMEM;
goto fail_alloc1;
}
- if (CONFIG_IS_ENABLED(OF_PLATDATA) && platdata) {
- memcpy(dev->platdata, platdata,
+ if (CONFIG_IS_ENABLED(OF_PLATDATA) && plat) {
+ memcpy(dev->plat, plat,
of_platdata_size);
}
}
}
- size = uc->uc_drv->per_device_platdata_auto;
+ size = uc->uc_drv->per_device_plat_auto;
if (size) {
dev->flags |= DM_FLAG_ALLOC_UCLASS_PDATA;
- dev->uclass_platdata = calloc(1, size);
- if (!dev->uclass_platdata) {
+ dev->uclass_plat = calloc(1, size);
+ if (!dev->uclass_plat) {
ret = -ENOMEM;
goto fail_alloc2;
}
}
if (parent) {
- size = parent->driver->per_child_platdata_auto;
+ size = parent->driver->per_child_plat_auto;
if (!size) {
- size = parent->uclass->uc_drv->per_child_platdata_auto;
+ size = parent->uclass->uc_drv->per_child_plat_auto;
}
if (size) {
dev->flags |= DM_FLAG_ALLOC_PARENT_PDATA;
- dev->parent_platdata = calloc(1, size);
- if (!dev->parent_platdata) {
+ dev->parent_plat = calloc(1, size);
+ if (!dev->parent_plat) {
ret = -ENOMEM;
goto fail_alloc3;
}
if (CONFIG_IS_ENABLED(DM_DEVICE_REMOVE)) {
list_del(&dev->sibling_node);
if (dev->flags & DM_FLAG_ALLOC_PARENT_PDATA) {
- free(dev->parent_platdata);
- dev->parent_platdata = NULL;
+ free(dev->parent_plat);
+ dev->parent_plat = NULL;
}
}
fail_alloc3:
if (dev->flags & DM_FLAG_ALLOC_UCLASS_PDATA) {
- free(dev->uclass_platdata);
- dev->uclass_platdata = NULL;
+ free(dev->uclass_plat);
+ dev->uclass_plat = NULL;
}
fail_alloc2:
if (dev->flags & DM_FLAG_ALLOC_PDATA) {
- free(dev->platdata);
- dev->platdata = NULL;
+ free(dev->plat);
+ dev->plat = NULL;
}
fail_alloc1:
devres_release_all(dev);
}
int device_bind(struct udevice *parent, const struct driver *drv,
- const char *name, void *platdata, ofnode node,
+ const char *name, void *plat, ofnode node,
struct udevice **devp)
{
- return device_bind_common(parent, drv, name, platdata, 0, node, 0,
+ return device_bind_common(parent, drv, name, plat, 0, node, 0,
devp);
}
#if CONFIG_IS_ENABLED(OF_PLATDATA)
platdata_size = info->platdata_size;
#endif
- ret = device_bind_common(parent, drv, info->name,
- (void *)info->platdata, 0, ofnode_null(),
- platdata_size, devp);
+ ret = device_bind_common(parent, drv, info->name, (void *)info->plat, 0,
+ ofnode_null(), platdata_size, devp);
if (ret)
return ret;
return NULL;
}
- return dev->platdata;
+ return dev->plat;
}
-void *dev_get_parent_platdata(const struct udevice *dev)
+void *dev_get_parent_plat(const struct udevice *dev)
{
if (!dev) {
dm_warn("%s: null device\n", __func__);
return NULL;
}
- return dev->parent_platdata;
+ return dev->parent_plat;
}
-void *dev_get_uclass_platdata(const struct udevice *dev)
+void *dev_get_uclass_plat(const struct udevice *dev)
{
if (!dev) {
dm_warn("%s: null device\n", __func__);
return NULL;
}
- return dev->uclass_platdata;
+ return dev->uclass_plat;
}
void *dev_get_priv(const struct udevice *dev)
puts("---------------------------------\n");
for (entry = drv; entry != drv + n_ents; entry++) {
printf("%-25.25s @%08lx\n", entry->name,
- (ulong)map_to_sysmem(entry->platdata));
+ (ulong)map_to_sysmem(entry->plat));
}
}
struct driver_info *entry;
for (entry = dev; entry != dev + n_ents; entry++) {
- if (entry->platdata)
- entry->platdata += gd->reloc_off;
+ if (entry->plat)
+ entry->plat += gd->reloc_off;
}
}
fdt_addr_t simple_bus_translate(struct udevice *dev, fdt_addr_t addr)
{
- struct simple_bus_plat *plat = dev_get_uclass_platdata(dev);
+ struct simple_bus_plat *plat = dev_get_uclass_plat(dev);
if (addr >= plat->base && addr < plat->base + plat->size)
addr = (addr - plat->base) + plat->target;
ret = dev_read_u32_array(dev, "ranges", cell, ARRAY_SIZE(cell));
if (!ret) {
- struct simple_bus_plat *plat = dev_get_uclass_platdata(dev);
+ struct simple_bus_plat *plat = dev_get_uclass_plat(dev);
plat->base = cell[0];
plat->target = cell[1];
.id = UCLASS_SIMPLE_BUS,
.name = "simple_bus",
.post_bind = simple_bus_post_bind,
- .per_device_platdata_auto = sizeof(struct simple_bus_plat),
+ .per_device_plat_auto = sizeof(struct simple_bus_plat),
};
static const struct udevice_id generic_simple_bus_ids[] = {
.of_match = at91_cpu_ids,
.ops = &at91_cpu_ops,
.probe = at91_cpu_probe,
- .platdata_auto = sizeof(struct at91_cpu_platdata),
+ .plat_auto = sizeof(struct at91_cpu_platdata),
.flags = DM_FLAG_PRE_RELOC,
};
/* BMIPS CPU driver */
int bmips_cpu_bind(struct udevice *dev)
{
- struct cpu_platdata *plat = dev_get_parent_platdata(dev);
+ struct cpu_platdata *plat = dev_get_parent_plat(dev);
plat->cpu_id = dev_read_u32_default(dev, "reg", -1);
plat->device_id = read_c0_prid();
U_BOOT_DRIVER(cpu_bus) = {
.name = "cpu_bus",
.id = UCLASS_SIMPLE_BUS,
- .per_child_platdata_auto = sizeof(struct cpu_platdata),
+ .per_child_plat_auto = sizeof(struct cpu_platdata),
};
static int uclass_cpu_init(struct uclass *uc)
static int cpu_sandbox_bind(struct udevice *dev)
{
int ret;
- struct cpu_platdata *plat = dev_get_parent_platdata(dev);
+ struct cpu_platdata *plat = dev_get_parent_plat(dev);
/* first examine the property in current cpu node */
ret = dev_read_u32(dev, "timebase-frequency", &plat->timebase_freq);
.of_match = cpu_imx8_ids,
.ops = &cpu_imx8_ops,
.probe = imx8_cpu_probe,
- .platdata_auto = sizeof(struct cpu_imx_platdata),
+ .plat_auto = sizeof(struct cpu_imx_platdata),
.flags = DM_FLAG_PRE_RELOC,
};
static int riscv_cpu_bind(struct udevice *dev)
{
- struct cpu_platdata *plat = dev_get_parent_platdata(dev);
+ struct cpu_platdata *plat = dev_get_parent_plat(dev);
struct driver *drv;
int ret;
int sdram_mmr_init_full(struct udevice *dev)
{
- struct altera_sdram_platdata *plat = dev->platdata;
+ struct altera_sdram_platdata *plat = dev->plat;
struct altera_sdram_priv *priv = dev_get_priv(dev);
u32 i;
int ret;
static int altera_gen5_sdram_ofdata_to_platdata(struct udevice *dev)
{
- struct altera_gen5_sdram_platdata *plat = dev->platdata;
+ struct altera_gen5_sdram_platdata *plat = dev->plat;
plat->sdr = (struct socfpga_sdr *)devfdt_get_addr_index(dev, 0);
if (!plat->sdr)
{
int ret;
unsigned long sdram_size;
- struct altera_gen5_sdram_platdata *plat = dev->platdata;
+ struct altera_gen5_sdram_platdata *plat = dev->plat;
struct altera_gen5_sdram_priv *priv = dev_get_priv(dev);
struct socfpga_sdr_ctrl *sdr_ctrl = &plat->sdr->sdr_ctrl;
struct reset_ctl_bulk resets;
.of_match = altera_gen5_sdram_ids,
.ops = &altera_gen5_sdram_ops,
.ofdata_to_platdata = altera_gen5_sdram_ofdata_to_platdata,
- .platdata_auto = sizeof(struct altera_gen5_sdram_platdata),
+ .plat_auto = sizeof(struct altera_gen5_sdram_platdata),
.probe = altera_gen5_sdram_probe,
.priv_auto = sizeof(struct altera_gen5_sdram_priv),
};
*/
int sdram_mmr_init_full(struct udevice *dev)
{
- struct altera_sdram_platdata *plat = dev->platdata;
+ struct altera_sdram_platdata *plat = dev->plat;
struct altera_sdram_priv *priv = dev_get_priv(dev);
u32 update_value, io48_value, ddrioctl;
u32 i;
static int altera_sdram_ofdata_to_platdata(struct udevice *dev)
{
- struct altera_sdram_platdata *plat = dev->platdata;
+ struct altera_sdram_platdata *plat = dev->plat;
fdt_addr_t addr;
addr = dev_read_addr_index(dev, 0);
.of_match = altera_sdram_ids,
.ops = &altera_sdram_ops,
.ofdata_to_platdata = altera_sdram_ofdata_to_platdata,
- .platdata_auto = sizeof(struct altera_sdram_platdata),
+ .plat_auto = sizeof(struct altera_sdram_platdata),
.probe = altera_sdram_probe,
.priv_auto = sizeof(struct altera_sdram_priv),
};
U_BOOT_DEVICE(demo0) = {
.name = "demo_shape_drv",
- .platdata = &red_square,
+ .plat = &red_square,
};
U_BOOT_DEVICE(demo1) = {
.name = "demo_simple_drv",
- .platdata = &red_square,
+ .plat = &red_square,
};
U_BOOT_DEVICE(demo2) = {
.name = "demo_shape_drv",
- .platdata = &green_triangle,
+ .plat = &green_triangle,
};
U_BOOT_DEVICE(demo3) = {
.name = "demo_simple_drv",
- .platdata = &yellow_hexagon,
+ .plat = &yellow_hexagon,
};
U_BOOT_DEVICE(demo4) = {
.name = "demo_shape_drv",
- .platdata = &yellow_hexagon,
+ .plat = &yellow_hexagon,
};
.probe = dm_shape_probe,
.remove = dm_shape_remove,
.priv_auto = sizeof(struct shape_data),
- .platdata_auto = sizeof(struct dm_demo_pdata),
+ .plat_auto = sizeof(struct dm_demo_pdata),
};
.id = UCLASS_DEMO,
.ofdata_to_platdata = demo_shape_ofdata_to_platdata,
.ops = &simple_ops,
- .platdata_auto = sizeof(struct dm_demo_pdata),
+ .plat_auto = sizeof(struct dm_demo_pdata),
};
.of_match = altera_pio_ids,
.ops = &altera_pio_ops,
.ofdata_to_platdata = altera_pio_ofdata_to_platdata,
- .platdata_auto = sizeof(struct altera_pio_platdata),
+ .plat_auto = sizeof(struct altera_pio_platdata),
.probe = altera_pio_probe,
};
.id = UCLASS_GPIO,
#if CONFIG_IS_ENABLED(OF_CONTROL)
.of_match = at91_gpio_ids,
- .platdata_auto = sizeof(struct at91_port_platdata),
+ .plat_auto = sizeof(struct at91_port_platdata),
#endif
.ops = &gpio_at91_ops,
.probe = at91_gpio_probe,
.probe = atmel_pio4_probe,
.bind = atmel_pio4_bind,
.of_match = atmel_pio4_ids,
- .platdata_auto = sizeof(struct atmel_pio4_platdata),
+ .plat_auto = sizeof(struct atmel_pio4_platdata),
};
#endif
.name = "gpio_bcm2835",
.id = UCLASS_GPIO,
.ofdata_to_platdata = of_match_ptr(bcm2835_gpio_ofdata_to_platdata),
- .platdata_auto = sizeof(struct bcm2835_gpio_platdata),
+ .plat_auto = sizeof(struct bcm2835_gpio_platdata),
.ops = &gpio_bcm2835_ops,
.probe = bcm2835_gpio_probe,
.flags = DM_FLAG_PRE_RELOC,
.ofdata_to_platdata = of_match_ptr(davinci_gpio_ofdata_to_platdata),
.of_match = davinci_gpio_ids,
.bind = dm_scan_fdt_dev,
- .platdata_auto = sizeof(struct davinci_gpio_platdata),
+ .plat_auto = sizeof(struct davinci_gpio_platdata),
.probe = davinci_gpio_probe,
.priv_auto = sizeof(struct davinci_gpio_bank),
};
static int gpio_dwapb_probe(struct udevice *dev)
{
struct gpio_dev_priv *priv = dev_get_uclass_priv(dev);
- struct gpio_dwapb_platdata *plat = dev->platdata;
+ struct gpio_dwapb_platdata *plat = dev->plat;
if (!plat) {
/* Reset on parent device only */
.ofdata_to_platdata = gpio_hog_ofdata_to_platdata,
.probe = gpio_hog_probe,
.priv_auto = sizeof(struct gpio_hog_priv),
- .platdata_auto = sizeof(struct gpio_hog_data),
+ .plat_auto = sizeof(struct gpio_hog_data),
};
#else
int gpio_hog_lookup_name(const char *name, struct gpio_desc **desc)
.ops = &hsdk_creg_gpio_ops,
.probe = hsdk_creg_gpio_probe,
.of_match = hsdk_creg_gpio_ids,
- .platdata_auto = sizeof(struct hsdk_creg_gpio),
+ .plat_auto = sizeof(struct hsdk_creg_gpio),
};
static int imx_rgpio2p_bind(struct udevice *dev)
{
- struct imx_rgpio2p_plat *plat = dev->platdata;
+ struct imx_rgpio2p_plat *plat = dev->plat;
fdt_addr_t addr;
/*
- * If platdata already exsits, directly return.
- * Actually only when DT is not supported, platdata
+ * If plat already exsits, directly return.
+ * Actually only when DT is not supported, plat
* is statically initialized in U_BOOT_DEVICES.Here
* will return.
*/
* TODO:
* When every board is converted to driver model and DT is supported,
* this can be done by auto-alloc feature, but not using calloc
- * to alloc memory for platdata.
+ * to alloc memory for plat.
*
* For example imx_rgpio2p_plat uses platform data rather than device
* tree.
plat->regs = (struct gpio_regs *)addr;
plat->bank_index = dev->req_seq;
- dev->platdata = plat;
+ dev->plat = plat;
return 0;
}
.ofdata_to_platdata = broadwell_gpio_ofdata_to_platdata,
.probe = broadwell_gpio_probe,
.priv_auto = sizeof(struct broadwell_bank_priv),
- .platdata_auto = sizeof(struct broadwell_bank_platdata),
+ .plat_auto = sizeof(struct broadwell_bank_platdata),
};
.ofdata_to_platdata = gpio_ich6_ofdata_to_platdata,
.probe = ich6_gpio_probe,
.priv_auto = sizeof(struct ich6_bank_priv),
- .platdata_auto = sizeof(struct ich6_bank_platdata),
+ .plat_auto = sizeof(struct ich6_bank_platdata),
};
.of_match = iproc_gpio_ids,
.ops = &iproc_gpio_ops,
.ofdata_to_platdata = iproc_gpio_ofdata_to_platdata,
- .platdata_auto = sizeof(struct iproc_gpio_platdata),
+ .plat_auto = sizeof(struct iproc_gpio_platdata),
};
.ops = &mpc83xx_spisel_boot_ops,
#if CONFIG_IS_ENABLED(OF_CONTROL)
.ofdata_to_platdata = mpc83xx_spisel_boot_ofdata_to_platdata,
- .platdata_auto = sizeof(struct mpc8xxx_gpio_plat),
+ .plat_auto = sizeof(struct mpc8xxx_gpio_plat),
.of_match = mpc83xx_spisel_boot_ids,
#endif
.probe = mpc83xx_spisel_boot_probe,
.ops = &gpio_mpc8xxx_ops,
#if CONFIG_IS_ENABLED(OF_CONTROL)
.ofdata_to_platdata = mpc8xxx_gpio_ofdata_to_platdata,
- .platdata_auto = sizeof(struct mpc8xxx_gpio_plat),
+ .plat_auto = sizeof(struct mpc8xxx_gpio_plat),
.of_match = mpc8xxx_gpio_ids,
#endif
.probe = mpc8xxx_gpio_probe,
*/
static int gpio_mediatek_bind(struct udevice *parent)
{
- struct mediatek_gpio_platdata *plat = parent->platdata;
+ struct mediatek_gpio_platdata *plat = parent->plat;
ofnode node;
int bank = 0;
int ret;
.ops = &gpio_mxc_ops,
.probe = mxc_gpio_probe,
.ofdata_to_platdata = mxc_gpio_ofdata_to_platdata,
- .platdata_auto = sizeof(struct mxc_gpio_plat),
+ .plat_auto = sizeof(struct mxc_gpio_plat),
.priv_auto = sizeof(struct mxc_bank_info),
.of_match = mxc_gpio_ids,
.bind = mxc_gpio_bind,
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
static int mxs_ofdata_to_platdata(struct udevice *dev)
{
- struct mxs_gpio_platdata *plat = dev->platdata;
+ struct mxs_gpio_platdata *plat = dev->plat;
struct fdtdec_phandle_args args;
int node = dev_of_offset(dev);
int ret;
.ops = &gpio_mxs_ops,
.probe = mxs_gpio_probe,
.priv_auto = sizeof(struct mxs_gpio_priv),
- .platdata_auto = sizeof(struct mxs_gpio_platdata),
+ .plat_auto = sizeof(struct mxs_gpio_platdata),
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
.of_match = mxs_gpio_ids,
.ofdata_to_platdata = mxs_ofdata_to_platdata,
.of_match = nx_gpio_ids,
.ops = &nx_gpio_ops,
.ofdata_to_platdata = nx_gpio_ofdata_to_platdata,
- .platdata_auto = sizeof(struct nx_gpio_platdata),
+ .plat_auto = sizeof(struct nx_gpio_platdata),
.probe = nx_gpio_probe,
};
* TODO:
* When every board is converted to driver model and DT is
* supported, this can be done by auto-alloc feature, but
- * not using calloc to alloc memory for platdata.
+ * not using calloc to alloc memory for plat.
*
* For example am33xx_gpio uses platform data rather than device tree.
*
plat->base = base_addr;
plat->port_name = fdt_get_name(gd->fdt_blob, dev_of_offset(dev), NULL);
- dev->platdata = plat;
+ dev->plat = plat;
return 0;
}
#if !CONFIG_IS_ENABLED(OF_PLATDATA)
.of_match = omap_gpio_ids,
.ofdata_to_platdata = of_match_ptr(omap_gpio_ofdata_to_platdata),
- .platdata_auto = sizeof(struct omap_gpio_platdata),
+ .plat_auto = sizeof(struct omap_gpio_platdata),
#endif
#else
.bind = omap_gpio_bind,
.id = UCLASS_GPIO,
.ops = &pca953x_ops,
.probe = pca953x_probe,
- .platdata_auto = sizeof(struct pca953x_info),
+ .plat_auto = sizeof(struct pca953x_info),
.of_match = pca953x_ids,
};
static int pcf8575_i2c_write_le16(struct udevice *dev, unsigned int word)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
u8 buf[2] = { word & 0xff, word >> 8, };
int ret;
static int pcf8575_i2c_read_le16(struct udevice *dev)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
u8 buf[2];
int ret;
.of_match = pcf8575_gpio_ids,
.ofdata_to_platdata = pcf8575_ofdata_platdata,
.probe = pcf8575_gpio_probe,
- .platdata_auto = sizeof(struct pcf8575_chip),
+ .plat_auto = sizeof(struct pcf8575_chip),
};
{
struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
struct exynos_bank_info *priv = dev->priv;
- struct exynos_gpio_platdata *plat = dev->platdata;
+ struct exynos_gpio_platdata *plat = dev->plat;
/* Only child devices have ports */
if (!plat)
*/
static int gpio_exynos_bind(struct udevice *parent)
{
- struct exynos_gpio_platdata *plat = parent->platdata;
+ struct exynos_gpio_platdata *plat = parent->plat;
struct s5p_gpio_bank *bank, *base;
const void *blob = gd->fdt_blob;
int node;
.id = UCLASS_GPIO,
.of_match = sifive_gpio_match,
.ofdata_to_platdata = of_match_ptr(sifive_gpio_ofdata_to_platdata),
- .platdata_auto = sizeof(struct sifive_gpio_platdata),
+ .plat_auto = sizeof(struct sifive_gpio_platdata),
.ops = &sifive_gpio_ops,
.probe = sifive_gpio_probe,
};
{
struct sunxi_gpio_soc_data *soc_data =
(struct sunxi_gpio_soc_data *)dev_get_driver_data(parent);
- struct sunxi_gpio_platdata *plat = parent->platdata;
+ struct sunxi_gpio_platdata *plat = parent->plat;
struct sunxi_gpio_reg *ctlr;
int bank, ret;
static uint32_t *tegra186_gpio_reg(struct udevice *dev, uint32_t reg,
uint32_t gpio)
{
- struct tegra186_gpio_platdata *plat = dev->platdata;
+ struct tegra186_gpio_platdata *plat = dev->plat;
uint32_t index = (reg + (gpio * TEGRA186_GPIO_PER_GPIO_STRIDE)) / 4;
return &(plat->regs[index]);
*/
static int tegra186_gpio_bind(struct udevice *parent)
{
- struct tegra186_gpio_platdata *parent_plat = parent->platdata;
+ struct tegra186_gpio_platdata *parent_plat = parent->plat;
struct tegra186_gpio_ctlr_data *ctlr_data =
(struct tegra186_gpio_ctlr_data *)dev_get_driver_data(parent);
uint32_t *regs;
static int tegra186_gpio_probe(struct udevice *dev)
{
- struct tegra186_gpio_platdata *plat = dev->platdata;
+ struct tegra186_gpio_platdata *plat = dev->plat;
struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
/* Only child devices have ports */
{
struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
struct tegra_port_info *priv = dev->priv;
- struct tegra_gpio_platdata *plat = dev->platdata;
+ struct tegra_gpio_platdata *plat = dev->plat;
/* Only child devices have ports */
if (!plat)
*/
static int gpio_tegra_bind(struct udevice *parent)
{
- struct tegra_gpio_platdata *plat = parent->platdata;
+ struct tegra_gpio_platdata *plat = parent->plat;
struct gpio_ctlr *ctlr;
int bank_count;
int bank;
.ofdata_to_platdata = vybrid_gpio_odata_to_platdata,
.probe = vybrid_gpio_probe,
.priv_auto = sizeof(struct vybrid_gpios),
- .platdata_auto = sizeof(struct vybrid_gpio_platdata),
+ .plat_auto = sizeof(struct vybrid_gpio_platdata),
};
static int xilinx_gpio_get_bank_pin(unsigned offset, u32 *bank_num,
u32 *bank_pin_num, struct udevice *dev)
{
- struct xilinx_gpio_platdata *platdata = dev_get_platdata(dev);
+ struct xilinx_gpio_platdata *plat = dev_get_platdata(dev);
u32 bank, max_pins;
/* the first gpio is 0 not 1 */
u32 pin_num = offset;
for (bank = 0; bank < XILINX_GPIO_MAX_BANK; bank++) {
- max_pins = platdata->bank_max[bank];
+ max_pins = plat->bank_max[bank];
if (pin_num < max_pins) {
debug("%s: found at bank 0x%x pin 0x%x\n", __func__,
bank, pin_num);
static int xilinx_gpio_set_value(struct udevice *dev, unsigned offset,
int value)
{
- struct xilinx_gpio_platdata *platdata = dev_get_platdata(dev);
+ struct xilinx_gpio_platdata *plat = dev_get_platdata(dev);
struct xilinx_gpio_privdata *priv = dev_get_priv(dev);
int val, ret;
u32 bank, pin;
val = priv->output_val[bank];
debug("%s: regs: %lx, value: %x, gpio: %x, bank %x, pin %x, out %x\n",
- __func__, (ulong)platdata->regs, value, offset, bank, pin, val);
+ __func__, (ulong)plat->regs, value, offset, bank, pin, val);
if (value)
val = val | (1 << pin);
else
val = val & ~(1 << pin);
- writel(val, &platdata->regs->gpiodata + bank * 2);
+ writel(val, &plat->regs->gpiodata + bank * 2);
priv->output_val[bank] = val;
static int xilinx_gpio_get_value(struct udevice *dev, unsigned offset)
{
- struct xilinx_gpio_platdata *platdata = dev_get_platdata(dev);
+ struct xilinx_gpio_platdata *plat = dev_get_platdata(dev);
struct xilinx_gpio_privdata *priv = dev_get_priv(dev);
int val, ret;
u32 bank, pin;
return ret;
debug("%s: regs: %lx, gpio: %x, bank %x, pin %x\n", __func__,
- (ulong)platdata->regs, offset, bank, pin);
+ (ulong)plat->regs, offset, bank, pin);
- if (platdata->bank_output[bank]) {
+ if (plat->bank_output[bank]) {
debug("%s: Read saved output value\n", __func__);
val = priv->output_val[bank];
} else {
debug("%s: Read input value from reg\n", __func__);
- val = readl(&platdata->regs->gpiodata + bank * 2);
+ val = readl(&plat->regs->gpiodata + bank * 2);
}
val = !!(val & (1 << pin));
static int xilinx_gpio_get_function(struct udevice *dev, unsigned offset)
{
- struct xilinx_gpio_platdata *platdata = dev_get_platdata(dev);
+ struct xilinx_gpio_platdata *plat = dev_get_platdata(dev);
int val, ret;
u32 bank, pin;
return ret;
/* Check if all pins are inputs */
- if (platdata->bank_input[bank])
+ if (plat->bank_input[bank])
return GPIOF_INPUT;
/* Check if all pins are outputs */
- if (platdata->bank_output[bank])
+ if (plat->bank_output[bank])
return GPIOF_OUTPUT;
/* FIXME test on dual */
- val = readl(&platdata->regs->gpiodir + bank * 2);
+ val = readl(&plat->regs->gpiodir + bank * 2);
val = !(val & (1 << pin));
/* input is 1 in reg but GPIOF_INPUT is 0 */
static int xilinx_gpio_direction_output(struct udevice *dev, unsigned offset,
int value)
{
- struct xilinx_gpio_platdata *platdata = dev_get_platdata(dev);
+ struct xilinx_gpio_platdata *plat = dev_get_platdata(dev);
int val, ret;
u32 bank, pin;
return ret;
/* can't change it if all is input by default */
- if (platdata->bank_input[bank])
+ if (plat->bank_input[bank])
return -EINVAL;
xilinx_gpio_set_value(dev, offset, value);
- if (!platdata->bank_output[bank]) {
- val = readl(&platdata->regs->gpiodir + bank * 2);
+ if (!plat->bank_output[bank]) {
+ val = readl(&plat->regs->gpiodir + bank * 2);
val = val & ~(1 << pin);
- writel(val, &platdata->regs->gpiodir + bank * 2);
+ writel(val, &plat->regs->gpiodir + bank * 2);
}
return 0;
static int xilinx_gpio_direction_input(struct udevice *dev, unsigned offset)
{
- struct xilinx_gpio_platdata *platdata = dev_get_platdata(dev);
+ struct xilinx_gpio_platdata *plat = dev_get_platdata(dev);
int val, ret;
u32 bank, pin;
return ret;
/* Already input */
- if (platdata->bank_input[bank])
+ if (plat->bank_input[bank])
return 0;
/* can't change it if all is output by default */
- if (platdata->bank_output[bank])
+ if (plat->bank_output[bank])
return -EINVAL;
- val = readl(&platdata->regs->gpiodir + bank * 2);
+ val = readl(&plat->regs->gpiodir + bank * 2);
val = val | (1 << pin);
- writel(val, &platdata->regs->gpiodir + bank * 2);
+ writel(val, &plat->regs->gpiodir + bank * 2);
return 0;
}
static int xilinx_gpio_xlate(struct udevice *dev, struct gpio_desc *desc,
struct ofnode_phandle_args *args)
{
- struct xilinx_gpio_platdata *platdata = dev_get_platdata(dev);
+ struct xilinx_gpio_platdata *plat = dev_get_platdata(dev);
desc->offset = args->args[0];
* add amount of pins in second channel if present.
*/
if (args->args[1]) {
- if (!platdata->bank_max[1]) {
+ if (!plat->bank_max[1]) {
printf("%s: %s has no second channel\n",
__func__, dev->name);
return -EINVAL;
}
- desc->offset += platdata->bank_max[0];
+ desc->offset += plat->bank_max[0];
}
/* The third cell is optional */
static int xilinx_gpio_probe(struct udevice *dev)
{
- struct xilinx_gpio_platdata *platdata = dev_get_platdata(dev);
+ struct xilinx_gpio_platdata *plat = dev_get_platdata(dev);
struct xilinx_gpio_privdata *priv = dev_get_priv(dev);
struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
const void *label_ptr;
uc_priv->bank_name = dev->name;
}
- uc_priv->gpio_count = platdata->bank_max[0] + platdata->bank_max[1];
+ uc_priv->gpio_count = plat->bank_max[0] + plat->bank_max[1];
- priv->output_val[0] = platdata->dout_default[0];
+ priv->output_val[0] = plat->dout_default[0];
- if (platdata->bank_max[1])
- priv->output_val[1] = platdata->dout_default[1];
+ if (plat->bank_max[1])
+ priv->output_val[1] = plat->dout_default[1];
return 0;
}
static int xilinx_gpio_ofdata_to_platdata(struct udevice *dev)
{
- struct xilinx_gpio_platdata *platdata = dev_get_platdata(dev);
+ struct xilinx_gpio_platdata *plat = dev_get_platdata(dev);
int is_dual;
- platdata->regs = (struct gpio_regs *)dev_read_addr(dev);
+ plat->regs = (struct gpio_regs *)dev_read_addr(dev);
- platdata->bank_max[0] = dev_read_u32_default(dev,
- "xlnx,gpio-width", 0);
- platdata->bank_input[0] = dev_read_u32_default(dev,
- "xlnx,all-inputs", 0);
- platdata->bank_output[0] = dev_read_u32_default(dev,
- "xlnx,all-outputs", 0);
- platdata->dout_default[0] = dev_read_u32_default(dev,
- "xlnx,dout-default",
- 0);
+ plat->bank_max[0] = dev_read_u32_default(dev, "xlnx,gpio-width", 0);
+ plat->bank_input[0] = dev_read_u32_default(dev, "xlnx,all-inputs", 0);
+ plat->bank_output[0] = dev_read_u32_default(dev, "xlnx,all-outputs", 0);
+ plat->dout_default[0] = dev_read_u32_default(dev, "xlnx,dout-default",
+ 0);
is_dual = dev_read_u32_default(dev, "xlnx,is-dual", 0);
if (is_dual) {
- platdata->bank_max[1] = dev_read_u32_default(dev,
- "xlnx,gpio2-width", 0);
- platdata->bank_input[1] = dev_read_u32_default(dev,
+ plat->bank_max[1] = dev_read_u32_default(dev,
+ "xlnx,gpio2-width", 0);
+ plat->bank_input[1] = dev_read_u32_default(dev,
"xlnx,all-inputs-2", 0);
- platdata->bank_output[1] = dev_read_u32_default(dev,
+ plat->bank_output[1] = dev_read_u32_default(dev,
"xlnx,all-outputs-2", 0);
- platdata->dout_default[1] = dev_read_u32_default(dev,
+ plat->dout_default[1] = dev_read_u32_default(dev,
"xlnx,dout-default-2", 0);
}
.of_match = xilinx_gpio_ids,
.ofdata_to_platdata = xilinx_gpio_ofdata_to_platdata,
.probe = xilinx_gpio_probe,
- .platdata_auto = sizeof(struct xilinx_gpio_platdata),
+ .plat_auto = sizeof(struct xilinx_gpio_platdata),
.priv_auto = sizeof(struct xilinx_gpio_privdata),
};
unsigned int *bank_pin_num,
struct udevice *dev)
{
- struct zynq_gpio_platdata *platdata = dev_get_platdata(dev);
+ struct zynq_gpio_platdata *plat = dev_get_platdata(dev);
u32 bank;
- for (bank = 0; bank < platdata->p_data->max_bank; bank++) {
- if (pin_num >= platdata->p_data->bank_min[bank] &&
- pin_num <= platdata->p_data->bank_max[bank]) {
+ for (bank = 0; bank < plat->p_data->max_bank; bank++) {
+ if (pin_num >= plat->p_data->bank_min[bank] &&
+ pin_num <= plat->p_data->bank_max[bank]) {
*bank_num = bank;
*bank_pin_num = pin_num -
- platdata->p_data->bank_min[bank];
+ plat->p_data->bank_min[bank];
return;
}
}
- if (bank >= platdata->p_data->max_bank) {
+ if (bank >= plat->p_data->max_bank) {
printf("Invalid bank and pin num\n");
*bank_num = 0;
*bank_pin_num = 0;
static int gpio_is_valid(unsigned gpio, struct udevice *dev)
{
- struct zynq_gpio_platdata *platdata = dev_get_platdata(dev);
+ struct zynq_gpio_platdata *plat = dev_get_platdata(dev);
- return gpio < platdata->p_data->ngpio;
+ return gpio < plat->p_data->ngpio;
}
static int check_gpio(unsigned gpio, struct udevice *dev)
{
u32 data;
unsigned int bank_num, bank_pin_num;
- struct zynq_gpio_platdata *platdata = dev_get_platdata(dev);
+ struct zynq_gpio_platdata *plat = dev_get_platdata(dev);
if (check_gpio(gpio, dev) < 0)
return -1;
zynq_gpio_get_bank_pin(gpio, &bank_num, &bank_pin_num, dev);
- data = readl(platdata->base +
+ data = readl(plat->base +
ZYNQ_GPIO_DATA_RO_OFFSET(bank_num));
return (data >> bank_pin_num) & 1;
static int zynq_gpio_set_value(struct udevice *dev, unsigned gpio, int value)
{
unsigned int reg_offset, bank_num, bank_pin_num;
- struct zynq_gpio_platdata *platdata = dev_get_platdata(dev);
+ struct zynq_gpio_platdata *plat = dev_get_platdata(dev);
if (check_gpio(gpio, dev) < 0)
return -1;
value = ~(1 << (bank_pin_num + ZYNQ_GPIO_MID_PIN_NUM)) &
((value << bank_pin_num) | ZYNQ_GPIO_UPPER_MASK);
- writel(value, platdata->base + reg_offset);
+ writel(value, plat->base + reg_offset);
return 0;
}
{
u32 reg;
unsigned int bank_num, bank_pin_num;
- struct zynq_gpio_platdata *platdata = dev_get_platdata(dev);
+ struct zynq_gpio_platdata *plat = dev_get_platdata(dev);
if (check_gpio(gpio, dev) < 0)
return -1;
return -1;
/* clear the bit in direction mode reg to set the pin as input */
- reg = readl(platdata->base + ZYNQ_GPIO_DIRM_OFFSET(bank_num));
+ reg = readl(plat->base + ZYNQ_GPIO_DIRM_OFFSET(bank_num));
reg &= ~BIT(bank_pin_num);
- writel(reg, platdata->base + ZYNQ_GPIO_DIRM_OFFSET(bank_num));
+ writel(reg, plat->base + ZYNQ_GPIO_DIRM_OFFSET(bank_num));
return 0;
}
{
u32 reg;
unsigned int bank_num, bank_pin_num;
- struct zynq_gpio_platdata *platdata = dev_get_platdata(dev);
+ struct zynq_gpio_platdata *plat = dev_get_platdata(dev);
if (check_gpio(gpio, dev) < 0)
return -1;
zynq_gpio_get_bank_pin(gpio, &bank_num, &bank_pin_num, dev);
/* set the GPIO pin as output */
- reg = readl(platdata->base + ZYNQ_GPIO_DIRM_OFFSET(bank_num));
+ reg = readl(plat->base + ZYNQ_GPIO_DIRM_OFFSET(bank_num));
reg |= BIT(bank_pin_num);
- writel(reg, platdata->base + ZYNQ_GPIO_DIRM_OFFSET(bank_num));
+ writel(reg, plat->base + ZYNQ_GPIO_DIRM_OFFSET(bank_num));
/* configure the output enable reg for the pin */
- reg = readl(platdata->base + ZYNQ_GPIO_OUTEN_OFFSET(bank_num));
+ reg = readl(plat->base + ZYNQ_GPIO_OUTEN_OFFSET(bank_num));
reg |= BIT(bank_pin_num);
- writel(reg, platdata->base + ZYNQ_GPIO_OUTEN_OFFSET(bank_num));
+ writel(reg, plat->base + ZYNQ_GPIO_OUTEN_OFFSET(bank_num));
/* set the state of the pin */
zynq_gpio_set_value(dev, gpio, value);
{
u32 reg;
unsigned int bank_num, bank_pin_num;
- struct zynq_gpio_platdata *platdata = dev_get_platdata(dev);
+ struct zynq_gpio_platdata *plat = dev_get_platdata(dev);
if (check_gpio(offset, dev) < 0)
return -1;
zynq_gpio_get_bank_pin(offset, &bank_num, &bank_pin_num, dev);
/* set the GPIO pin as output */
- reg = readl(platdata->base + ZYNQ_GPIO_DIRM_OFFSET(bank_num));
+ reg = readl(plat->base + ZYNQ_GPIO_DIRM_OFFSET(bank_num));
reg &= BIT(bank_pin_num);
if (reg)
return GPIOF_OUTPUT;
static int zynq_gpio_probe(struct udevice *dev)
{
- struct zynq_gpio_platdata *platdata = dev_get_platdata(dev);
+ struct zynq_gpio_platdata *plat = dev_get_platdata(dev);
struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
const void *label_ptr;
uc_priv->bank_name = dev->name;
}
- if (platdata->p_data)
- uc_priv->gpio_count = platdata->p_data->ngpio;
+ if (plat->p_data)
+ uc_priv->gpio_count = plat->p_data->ngpio;
return 0;
}
static int zynq_gpio_ofdata_to_platdata(struct udevice *dev)
{
- struct zynq_gpio_platdata *platdata = dev_get_platdata(dev);
+ struct zynq_gpio_platdata *plat = dev_get_platdata(dev);
- platdata->base = (phys_addr_t)dev_read_addr(dev);
+ plat->base = (phys_addr_t)dev_read_addr(dev);
- platdata->p_data =
+ plat->p_data =
(struct zynq_platform_data *)dev_get_driver_data(dev);
return 0;
.of_match = zynq_gpio_ids,
.ofdata_to_platdata = zynq_gpio_ofdata_to_platdata,
.probe = zynq_gpio_probe,
- .platdata_auto = sizeof(struct zynq_gpio_platdata),
+ .plat_auto = sizeof(struct zynq_gpio_platdata),
};
Enable driver model for I2C. The I2C uclass interface: probe, read,
write and speed, is implemented with the bus drivers operations,
which provide methods for bus setting and data transfer. Each chip
- device (bus child) info is kept as parent platdata. The interface
+ device (bus child) info is kept as parent plat. The interface
is defined in include/i2c.h.
config I2C_CROS_EC_TUNNEL
/* Use name specified in priv or build one from I2C address */
static int acpi_i2c_get_name(const struct udevice *dev, char *out_name)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
struct acpi_i2c_priv *priv = dev_get_priv(dev);
snprintf(out_name, ACPI_NAME_MAX,
* i2c emulation works using an 'emul' node at the bus level. Each device in
* that node is in the UCLASS_I2C_EMUL uclass, and emulates one i2c device. A
* pointer to the device it emulates is in the 'dev' property of the emul device
- * uclass platdata (struct i2c_emul_platdata), put there by i2c_emul_find().
+ * uclass plat (struct i2c_emul_platdata), put there by i2c_emul_find().
* When sandbox wants an emulator for a device, it calls i2c_emul_find() which
* searches for the emulator with the correct address. To find the device for an
* emulator, call i2c_emul_get_device().
* struct i2c_emul_uc_platdata - information about the emulator for this device
*
* This is used by devices in UCLASS_I2C_EMUL to record information about the
- * device being emulated. It is accessible with dev_get_uclass_platdata()
+ * device being emulated. It is accessible with dev_get_uclass_plat()
*
* @dev: Device being emulated
*/
struct udevice *i2c_emul_get_device(struct udevice *emul)
{
- struct i2c_emul_uc_platdata *uc_plat = dev_get_uclass_platdata(emul);
+ struct i2c_emul_uc_platdata *uc_plat = dev_get_uclass_plat(emul);
return uc_plat->dev;
}
log_err("No emulators for device '%s'\n", dev->name);
return ret;
}
- uc_plat = dev_get_uclass_platdata(emul);
+ uc_plat = dev_get_uclass_plat(emul);
uc_plat->dev = dev;
*emulp = emul;
UCLASS_DRIVER(i2c_emul) = {
.id = UCLASS_I2C_EMUL,
.name = "i2c_emul",
- .per_device_platdata_auto =
+ .per_device_plat_auto =
sizeof(struct i2c_emul_uc_platdata),
};
/*
- * This uclass is a child of the i2c bus. Its platdata is not defined here so
+ * This uclass is a child of the i2c bus. Its plat is not defined here so
* is defined by its parent, UCLASS_I2C, which uses struct dm_i2c_chip. See
- * per_child_platdata_auto in UCLASS_DRIVER(i2c).
+ * per_child_plat_auto in UCLASS_DRIVER(i2c).
*/
UCLASS_DRIVER(i2c_emul_parent) = {
.id = UCLASS_I2C_EMUL_PARENT,
static int i2c_read_bytewise(struct udevice *dev, uint offset,
uint8_t *buffer, int len)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
struct udevice *bus = dev_get_parent(dev);
struct dm_i2c_ops *ops = i2c_get_ops(bus);
struct i2c_msg msg[2], *ptr;
static int i2c_write_bytewise(struct udevice *dev, uint offset,
const uint8_t *buffer, int len)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
struct udevice *bus = dev_get_parent(dev);
struct dm_i2c_ops *ops = i2c_get_ops(bus);
struct i2c_msg msg[1];
int dm_i2c_read(struct udevice *dev, uint offset, uint8_t *buffer, int len)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
struct udevice *bus = dev_get_parent(dev);
struct dm_i2c_ops *ops = i2c_get_ops(bus);
struct i2c_msg msg[2], *ptr;
int dm_i2c_write(struct udevice *dev, uint offset, const uint8_t *buffer,
int len)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
struct udevice *bus = dev_get_parent(dev);
struct dm_i2c_ops *ops = i2c_get_ops(bus);
struct i2c_msg msg[1];
goto err_bind;
/* Tell the device what we know about it */
- chip = dev_get_parent_platdata(dev);
+ chip = dev_get_parent_plat(dev);
chip->chip_addr = chip_addr;
chip->offset_len = offset_len;
ret = device_probe(dev);
bus->name, chip_addr);
for (device_find_first_child(bus, &dev); dev;
device_find_next_child(&dev)) {
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
int ret;
if (chip->chip_addr == (chip_addr &
int i2c_set_chip_flags(struct udevice *dev, uint flags)
{
struct udevice *bus = dev->parent;
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
struct dm_i2c_ops *ops = i2c_get_ops(bus);
int ret;
int i2c_get_chip_flags(struct udevice *dev, uint *flagsp)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
*flagsp = chip->flags;
int i2c_set_chip_offset_len(struct udevice *dev, uint offset_len)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
if (offset_len > I2C_MAX_OFFSET_LEN)
return log_ret(-EINVAL);
int i2c_get_chip_offset_len(struct udevice *dev)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
return chip->offset_len;
}
int i2c_set_chip_addr_offset_mask(struct udevice *dev, uint mask)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
chip->chip_addr_offset_mask = mask;
uint i2c_get_chip_addr_offset_mask(struct udevice *dev)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
return chip->chip_addr_offset_mask;
}
static int i2c_child_post_bind(struct udevice *dev)
{
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
- struct dm_i2c_chip *plat = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *plat = dev_get_parent_plat(dev);
if (!dev_of_valid(dev))
return 0;
.pre_probe = i2c_pre_probe,
.post_probe = i2c_post_probe,
.per_device_auto = sizeof(struct dm_i2c_bus),
- .per_child_platdata_auto = sizeof(struct dm_i2c_chip),
+ .per_child_plat_auto = sizeof(struct dm_i2c_chip),
.child_post_bind = i2c_child_post_bind,
};
/* Find out the mux channel number */
static int i2c_mux_child_post_bind(struct udevice *dev)
{
- struct i2c_mux_bus *plat = dev_get_parent_platdata(dev);
+ struct i2c_mux_bus *plat = dev_get_parent_plat(dev);
int channel;
channel = dev_read_u32_default(dev, "reg", -1);
int i2c_mux_select(struct udevice *dev)
{
- struct i2c_mux_bus *plat = dev_get_parent_platdata(dev);
+ struct i2c_mux_bus *plat = dev_get_parent_plat(dev);
struct udevice *mux = dev->parent;
struct i2c_mux_ops *ops = i2c_mux_get_ops(mux);
int i2c_mux_deselect(struct udevice *dev)
{
- struct i2c_mux_bus *plat = dev_get_parent_platdata(dev);
+ struct i2c_mux_bus *plat = dev_get_parent_plat(dev);
struct udevice *mux = dev->parent;
struct i2c_mux_ops *ops = i2c_mux_get_ops(mux);
.post_bind = i2c_mux_post_bind,
.post_probe = i2c_mux_post_probe,
.per_device_auto = sizeof(struct i2c_mux),
- .per_child_platdata_auto = sizeof(struct i2c_mux_bus),
+ .per_child_plat_auto = sizeof(struct i2c_mux_bus),
.child_post_bind = i2c_mux_child_post_bind,
};
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
.of_match = omap_i2c_ids,
.ofdata_to_platdata = omap_i2c_ofdata_to_platdata,
- .platdata_auto = sizeof(struct omap_i2c_platdata),
+ .plat_auto = sizeof(struct omap_i2c_platdata),
#endif
.probe = omap_i2c_probe,
.priv_auto = sizeof(struct omap_i2c),
*devp = NULL;
*opsp = NULL;
- plat = dev_get_parent_platdata(dev);
+ plat = dev_get_parent_plat(dev);
if (!plat->emul) {
ret = i2c_emul_find(dev, &plat->emul);
if (ret)
if (ret)
return ret;
uclass_foreach_dev(dev, uc) {
- struct led_uc_plat *uc_plat = dev_get_uclass_platdata(dev);
+ struct led_uc_plat *uc_plat = dev_get_uclass_plat(dev);
/* Ignore the top-level LED node */
if (uc_plat->label && !strcmp(label, uc_plat->label))
UCLASS_DRIVER(led) = {
.id = UCLASS_LED,
.name = "led",
- .per_device_platdata_auto = sizeof(struct led_uc_plat),
+ .per_device_plat_auto = sizeof(struct led_uc_plat),
};
static int bcm6328_led_probe(struct udevice *dev)
{
- struct led_uc_plat *uc_plat = dev_get_uclass_platdata(dev);
+ struct led_uc_plat *uc_plat = dev_get_uclass_plat(dev);
/* Top-level LED node */
if (!uc_plat->label) {
if (ret)
return ret;
- uc_plat = dev_get_uclass_platdata(dev);
+ uc_plat = dev_get_uclass_plat(dev);
uc_plat->label = label;
}
static int bcm6358_led_probe(struct udevice *dev)
{
- struct led_uc_plat *uc_plat = dev_get_uclass_platdata(dev);
+ struct led_uc_plat *uc_plat = dev_get_uclass_plat(dev);
/* Top-level LED node */
if (!uc_plat->label) {
if (ret)
return ret;
- uc_plat = dev_get_uclass_platdata(dev);
+ uc_plat = dev_get_uclass_plat(dev);
uc_plat->label = label;
}
static int bcm6858_led_probe(struct udevice *dev)
{
- struct led_uc_plat *uc_plat = dev_get_uclass_platdata(dev);
+ struct led_uc_plat *uc_plat = dev_get_uclass_plat(dev);
/* Top-level LED node */
if (!uc_plat->label) {
if (ret)
return ret;
- uc_plat = dev_get_uclass_platdata(dev);
+ uc_plat = dev_get_uclass_plat(dev);
uc_plat->label = label;
}
static int ca_led_ofdata_to_platdata(struct udevice *dev)
{
- struct led_uc_plat *uc_plat = dev_get_uclass_platdata(dev);
+ struct led_uc_plat *uc_plat = dev_get_uclass_plat(dev);
/* Top-level LED node */
if (!uc_plat->label) {
static int cortina_led_probe(struct udevice *dev)
{
- struct led_uc_plat *uc_plat = dev_get_uclass_platdata(dev);
+ struct led_uc_plat *uc_plat = dev_get_uclass_plat(dev);
/* Top-level LED node */
if (!uc_plat->label) {
- struct cortina_led_platdata *platdata = dev_get_platdata(dev);
+ struct cortina_led_platdata *plat = dev_get_platdata(dev);
u32 reg_value, val;
u16 rate1, rate2;
- if (!platdata->ctrl_regs)
+ if (!plat->ctrl_regs)
return -EINVAL;
reg_value = 0;
reg_value |= LED_CLK_POLARITY;
- rate1 = platdata->rate1;
- rate2 = platdata->rate2;
+ rate1 = plat->rate1;
+ rate2 = plat->rate2;
val = rate1 / 16 - 1;
rate1 = val > LED_MAX_HW_BLINK ?
reg_value |= (rate2 & LED_BLINK_RATE2_MASK) <<
LED_BLINK_RATE2_SHIFT;
- cortina_led_write(platdata->ctrl_regs, reg_value);
+ cortina_led_write(plat->ctrl_regs, reg_value);
} else {
struct cortina_led_cfg *priv = dev_get_priv(dev);
node, &dev);
if (ret)
return ret;
- uc_plat = dev_get_uclass_platdata(dev);
+ uc_plat = dev_get_uclass_plat(dev);
uc_plat->label = label;
}
.ofdata_to_platdata = ca_led_ofdata_to_platdata,
.bind = cortina_led_bind,
.probe = cortina_led_probe,
- .platdata_auto = sizeof(struct cortina_led_platdata),
+ .plat_auto = sizeof(struct cortina_led_platdata),
.priv_auto = sizeof(struct cortina_led_cfg),
.ops = &cortina_led_ops,
};
static int led_gpio_probe(struct udevice *dev)
{
- struct led_uc_plat *uc_plat = dev_get_uclass_platdata(dev);
+ struct led_uc_plat *uc_plat = dev_get_uclass_plat(dev);
struct led_gpio_priv *priv = dev_get_priv(dev);
int ret;
node, &dev);
if (ret)
return ret;
- uc_plat = dev_get_uclass_platdata(dev);
+ uc_plat = dev_get_uclass_plat(dev);
uc_plat->label = label;
}
static int altera_sysid_read(struct udevice *dev,
int offset, void *buf, int size)
{
- struct altera_sysid_platdata *plat = dev->platdata;
+ struct altera_sysid_platdata *plat = dev->plat;
struct altera_sysid_regs *const regs = plat->regs;
u32 *sysid = buf;
.id = UCLASS_MISC,
.of_match = altera_sysid_ids,
.ofdata_to_platdata = altera_sysid_ofdata_to_platdata,
- .platdata_auto = sizeof(struct altera_sysid_platdata),
+ .plat_auto = sizeof(struct altera_sysid_platdata),
.ops = &altera_sysid_ops,
};
static int cros_ec_i2c_packet(struct udevice *udev, int out_bytes, int in_bytes)
{
struct cros_ec_dev *dev = dev_get_uclass_priv(udev);
- struct dm_i2c_chip *chip = dev_get_parent_platdata(udev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(udev);
struct ec_host_request_i2c *ec_request_i2c =
(struct ec_host_request_i2c *)dev->dout;
struct ec_host_response_i2c *ec_response_i2c =
int dout_len, uint8_t **dinp, int din_len)
{
struct cros_ec_dev *dev = dev_get_uclass_priv(udev);
- struct dm_i2c_chip *chip = dev_get_parent_platdata(udev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(udev);
struct i2c_msg i2c_msg[2];
/* version8, cmd8, arglen8, out8[dout_len], csum8 */
int out_bytes = dout_len + 4;
else
ret = -ENODEV;
} else {
- ret = select_fs_dev(dev->platdata);
+ ret = select_fs_dev(dev->plat);
}
if (ret)
if (ofnode_valid(fs_loader_node)) {
struct device_platdata *plat;
- plat = dev->platdata;
+ plat = dev->plat;
if (!ofnode_read_u32_array(fs_loader_node,
"phandlepart",
phandlepart, 2)) {
{
#if CONFIG_IS_ENABLED(DM) && CONFIG_IS_ENABLED(BLK)
int ret;
- struct device_platdata *plat = dev->platdata;
+ struct device_platdata *plat = dev->plat;
if (plat->phandlepart.phandle) {
ofnode node = ofnode_get_by_phandle(plat->phandlepart.phandle);
.of_match = fs_loader_ids,
.probe = fs_loader_probe,
.ofdata_to_platdata = fs_loader_ofdata_to_platdata,
- .platdata_auto = sizeof(struct device_platdata),
+ .plat_auto = sizeof(struct device_platdata),
.priv_auto = sizeof(struct firmware),
};
.probe = sandbox_i2c_eeprom_probe,
.remove = sandbox_i2c_eeprom_remove,
.priv_auto = sizeof(struct sandbox_i2c_flash),
- .platdata_auto = sizeof(struct sandbox_i2c_flash_plat_data),
+ .plat_auto = sizeof(struct sandbox_i2c_flash_plat_data),
.ops = &sandbox_i2c_emul_ops,
};
.bind = imx8_scu_bind,
.remove = imx8_scu_remove,
.ops = &imx8_scu_ops,
- .platdata_auto = sizeof(struct imx8_scu),
+ .plat_auto = sizeof(struct imx8_scu),
.flags = DM_FLAG_PRE_RELOC,
};
.id = UCLASS_MISC,
.of_match = microchip_flexcom_ids,
.ofdata_to_platdata = microchip_flexcom_ofdata_to_platdata,
- .platdata_auto = sizeof(struct microchip_flexcom_platdata),
+ .plat_auto = sizeof(struct microchip_flexcom_platdata),
};
void *pcr_reg_address(struct udevice *dev, uint offset)
{
- struct p2sb_child_platdata *pplat = dev_get_parent_platdata(dev);
+ struct p2sb_child_platdata *pplat = dev_get_parent_plat(dev);
struct udevice *p2sb = dev_get_parent(dev);
struct p2sb_uc_priv *upriv = dev_get_uclass_priv(p2sb);
uintptr_t reg_addr;
int p2sb_get_port_id(struct udevice *dev)
{
- struct p2sb_child_platdata *pplat = dev_get_parent_platdata(dev);
+ struct p2sb_child_platdata *pplat = dev_get_parent_plat(dev);
return pplat->pid;
}
* We must allocate this, since when the device was bound it did
* not have a parent.
*/
- dev->parent_platdata = malloc(sizeof(*pplat));
- if (!dev->parent_platdata)
+ dev->parent_plat = malloc(sizeof(*pplat));
+ if (!dev->parent_plat)
return -ENOMEM;
}
- pplat = dev_get_parent_platdata(dev);
+ pplat = dev_get_parent_plat(dev);
pplat->pid = portid;
return 0;
static int p2sb_child_post_bind(struct udevice *dev)
{
#if !CONFIG_IS_ENABLED(OF_PLATDATA)
- struct p2sb_child_platdata *pplat = dev_get_parent_platdata(dev);
+ struct p2sb_child_platdata *pplat = dev_get_parent_plat(dev);
int ret;
u32 pid;
.per_device_auto = sizeof(struct p2sb_uc_priv),
.post_bind = p2sb_post_bind,
.child_post_bind = p2sb_child_post_bind,
- .per_child_platdata_auto =
+ .per_child_plat_auto =
sizeof(struct p2sb_child_platdata),
};
device_foreach_child(dev, p2sb) {
struct p2sb_child_platdata *pplat =
- dev_get_parent_platdata(dev);
+ dev_get_parent_plat(dev);
log_debug(" - child %s, pid %d, want %d\n", dev->name,
pplat->pid, pid);
.of_match = sandbox_p2sb_emul_ids,
.ops = &sandbox_p2sb_emul_emul_ops,
.priv_auto = sizeof(struct p2sb_emul_priv),
- .platdata_auto = sizeof(struct p2sb_emul_platdata),
+ .plat_auto = sizeof(struct p2sb_emul_platdata),
};
static struct pci_device_id sandbox_p2sb_emul_supported[] = {
.id = UCLASS_MISC,
.of_match = rockchip_efuse_ids,
.ofdata_to_platdata = rockchip_efuse_ofdata_to_platdata,
- .platdata_auto = sizeof(struct rockchip_efuse_platdata),
+ .plat_auto = sizeof(struct rockchip_efuse_platdata),
.ops = &rockchip_efuse_ops,
};
.of_match = rockchip_otp_ids,
.ops = &rockchip_otp_ops,
.ofdata_to_platdata = rockchip_otp_ofdata_to_platdata,
- .platdata_auto = sizeof(struct rockchip_otp_platdata),
+ .plat_auto = sizeof(struct rockchip_otp_platdata),
};
int sandbox_adder_read(struct udevice *dev, ulong address, void *data,
enum axi_size_t size)
{
- struct p2sb_child_platdata *pplat = dev_get_parent_platdata(dev);
+ struct p2sb_child_platdata *pplat = dev_get_parent_plat(dev);
u32 *val = data;
*val = pplat->pid << 24 | address;
.id = UCLASS_MISC,
.of_match = sifive_otp_ids,
.ofdata_to_platdata = sifive_otp_ofdata_to_platdata,
- .platdata_auto = sizeof(struct sifive_otp_platdata),
+ .plat_auto = sizeof(struct sifive_otp_platdata),
.ops = &sifive_otp_ops,
};
.of_match = sandbox_swap_case_ids,
.ops = &sandbox_swap_case_emul_ops,
.priv_auto = sizeof(struct swap_case_priv),
- .platdata_auto = sizeof(struct swap_case_platdata),
+ .plat_auto = sizeof(struct swap_case_platdata),
};
static struct pci_device_id sandbox_swap_case_supported[] = {
.bind = am654_sdhci_bind,
.probe = am654_sdhci_probe,
.priv_auto = sizeof(struct sdhci_host),
- .platdata_auto = sizeof(struct am654_sdhci_plat),
+ .plat_auto = sizeof(struct am654_sdhci_plat),
};
.ofdata_to_platdata = arm_pl180_mmc_ofdata_to_platdata,
.bind = arm_pl180_mmc_bind,
.priv_auto = sizeof(struct pl180_mmc_host),
- .platdata_auto = sizeof(struct arm_pl180_mmc_plat),
+ .plat_auto = sizeof(struct arm_pl180_mmc_plat),
};
#endif
.bind = aspeed_sdhci_bind,
.probe = aspeed_sdhci_probe,
.priv_auto = sizeof(struct sdhci_host),
- .platdata_auto = sizeof(struct aspeed_sdhci_plat),
+ .plat_auto = sizeof(struct aspeed_sdhci_plat),
};
.bind = atmel_sdhci_bind,
.probe = atmel_sdhci_probe,
.priv_auto = sizeof(struct sdhci_host),
- .platdata_auto = sizeof(struct atmel_sdhci_plat),
+ .plat_auto = sizeof(struct atmel_sdhci_plat),
};
#endif
.bind = bcm2835_sdhci_bind,
.probe = bcm2835_sdhci_probe,
.priv_auto = sizeof(struct bcm2835_sdhci_host),
- .platdata_auto = sizeof(struct bcm2835_sdhci_plat),
+ .plat_auto = sizeof(struct bcm2835_sdhci_plat),
.ops = &sdhci_ops,
};
.bind = bcm2835_bind,
.probe = bcm2835_probe,
.priv_auto = sizeof(struct bcm2835_host),
- .platdata_auto = sizeof(struct bcm2835_plat),
+ .plat_auto = sizeof(struct bcm2835_plat),
.ops = &bcm2835_ops,
};
.bind = sdhci_bcmstb_bind,
.probe = sdhci_bcmstb_probe,
.priv_auto = sizeof(struct sdhci_host),
- .platdata_auto = sizeof(struct sdhci_bcmstb_plat),
+ .plat_auto = sizeof(struct sdhci_bcmstb_plat),
};
.ops = &ca_dwmci_dm_ops,
.probe = ca_dwmmc_probe,
.priv_auto = sizeof(struct ca_dwmmc_priv_data),
- .platdata_auto = sizeof(struct ca_mmc_plat),
+ .plat_auto = sizeof(struct ca_mmc_plat),
};
.id = UCLASS_MMC,
#if CONFIG_IS_ENABLED(OF_CONTROL)
.of_match = davinci_mmc_ids,
- .platdata_auto = sizeof(struct davinci_mmc_plat),
+ .plat_auto = sizeof(struct davinci_mmc_plat),
.ofdata_to_platdata = davinci_mmc_ofdata_to_platdata,
#endif
#if CONFIG_BLK
.ops = &dm_dwmci_ops,
.probe = exynos_dwmmc_probe,
.priv_auto = sizeof(struct dwmci_exynos_priv_data),
- .platdata_auto = sizeof(struct exynos_mmc_plat),
+ .plat_auto = sizeof(struct exynos_mmc_plat),
};
#endif
.ops = &fsl_esdhc_ops,
.bind = fsl_esdhc_bind,
.probe = fsl_esdhc_probe,
- .platdata_auto = sizeof(struct fsl_esdhc_plat),
+ .plat_auto = sizeof(struct fsl_esdhc_plat),
.priv_auto = sizeof(struct fsl_esdhc_priv),
};
#endif
.bind = fsl_esdhc_bind,
#endif
.probe = fsl_esdhc_probe,
- .platdata_auto = sizeof(struct fsl_esdhc_plat),
+ .plat_auto = sizeof(struct fsl_esdhc_plat),
.priv_auto = sizeof(struct fsl_esdhc_priv),
};
.bind = ftsdc010_mmc_bind,
.probe = ftsdc010_mmc_probe,
.priv_auto = sizeof(struct ftsdc_priv),
- .platdata_auto = sizeof(struct ftsdc010_plat),
+ .plat_auto = sizeof(struct ftsdc010_plat),
};
.of_match = atmel_mci_ids,
.bind = atmel_mci_bind,
.probe = atmel_mci_probe,
- .platdata_auto = sizeof(struct atmel_mci_plat),
+ .plat_auto = sizeof(struct atmel_mci_plat),
.priv_auto = sizeof(struct atmel_mci_priv),
.ops = &atmel_mci_mmc_ops,
};
.bind = hi6220_dwmmc_bind,
.probe = hi6220_dwmmc_probe,
.priv_auto = sizeof(struct hi6220_dwmmc_priv_data),
- .platdata_auto = sizeof(struct hi6220_dwmmc_plat),
+ .plat_auto = sizeof(struct hi6220_dwmmc_plat),
};
.bind = iproc_sdhci_bind,
.probe = iproc_sdhci_probe,
.priv_auto = sizeof(struct sdhci_host),
- .platdata_auto = sizeof(struct iproc_sdhci_plat),
+ .plat_auto = sizeof(struct iproc_sdhci_plat),
};
.bind = jz_mmc_bind,
.probe = jz_mmc_probe,
.priv_auto = sizeof(struct jz_mmc_priv),
- .platdata_auto = sizeof(struct jz_mmc_plat),
+ .plat_auto = sizeof(struct jz_mmc_plat),
.ops = &jz_msc_ops,
};
#endif /* CONFIG_DM_MMC */
.probe = meson_mmc_probe,
.bind = meson_mmc_bind,
.ofdata_to_platdata = meson_mmc_ofdata_to_platdata,
- .platdata_auto = sizeof(struct meson_mmc_platdata),
+ .plat_auto = sizeof(struct meson_mmc_platdata),
};
#ifdef CONFIG_PWRSEQ
device_find_first_child(mmc->dev, &dev);
if (!dev)
return NULL;
- desc = dev_get_uclass_platdata(dev);
+ desc = dev_get_uclass_plat(dev);
return desc;
}
debug("Cannot create block device\n");
return ret;
}
- bdesc = dev_get_uclass_platdata(bdev);
+ bdesc = dev_get_uclass_plat(bdev);
mmc->cfg = cfg;
mmc->priv = dev;
{
struct udevice *mmc_dev = dev_get_parent(bdev);
struct mmc *mmc = mmc_get_mmc_dev(mmc_dev);
- struct blk_desc *desc = dev_get_uclass_platdata(bdev);
+ struct blk_desc *desc = dev_get_uclass_plat(bdev);
int ret;
if (desc->hwpart == hwpart)
#endif
{
#if CONFIG_IS_ENABLED(BLK)
- struct blk_desc *block_dev = dev_get_uclass_platdata(dev);
+ struct blk_desc *block_dev = dev_get_uclass_plat(dev);
#endif
int dev_num = block_dev->devnum;
int err;
.ops = &mmc_spi_ops,
.probe = mmc_spi_probe,
.bind = mmc_spi_bind,
- .platdata_auto = sizeof(struct mmc_spi_plat),
+ .plat_auto = sizeof(struct mmc_spi_plat),
.priv_auto = sizeof(struct mmc_spi_priv),
};
#endif
{
#if CONFIG_IS_ENABLED(BLK)
- struct blk_desc *block_dev = dev_get_uclass_platdata(dev);
+ struct blk_desc *block_dev = dev_get_uclass_plat(dev);
#endif
int dev_num = block_dev->devnum;
int err = 0;
#endif
{
#if CONFIG_IS_ENABLED(BLK)
- struct blk_desc *block_dev = dev_get_uclass_platdata(dev);
+ struct blk_desc *block_dev = dev_get_uclass_plat(dev);
#endif
int dev_num = block_dev->devnum;
lbaint_t cur, blocks_todo = blkcnt;
.probe = msm_sdc_probe,
.remove = msm_sdc_remove,
.priv_auto = sizeof(struct msm_sdhc),
- .platdata_auto = sizeof(struct msm_sdhc_plat),
+ .plat_auto = sizeof(struct msm_sdhc_plat),
};
.bind = msdc_drv_bind,
.probe = msdc_drv_probe,
.ops = &msdc_ops,
- .platdata_auto = sizeof(struct msdc_plat),
+ .plat_auto = sizeof(struct msdc_plat),
.priv_auto = sizeof(struct msdc_host),
};
.probe = mv_sdhci_probe,
.ops = &sdhci_ops,
.priv_auto = sizeof(struct sdhci_host),
- .platdata_auto = sizeof(struct mv_sdhci_plat),
+ .plat_auto = sizeof(struct mv_sdhci_plat),
};
#endif /* CONFIG_DM_MMC */
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
static int mxsmmc_ofdata_to_platdata(struct udevice *bus)
{
- struct mxsmmc_platdata *plat = bus->platdata;
+ struct mxsmmc_platdata *plat = bus->plat;
u32 prop[2];
int ret;
#endif
.probe = mxsmmc_probe,
.priv_auto = sizeof(struct mxsmmc_priv),
- .platdata_auto = sizeof(struct mxsmmc_platdata),
+ .plat_auto = sizeof(struct mxsmmc_platdata),
};
U_BOOT_DRIVER_ALIAS(fsl_imx23_mmc, fsl_imx28_mmc)
.bind = nexell_dwmmc_bind,
.probe = nexell_dwmmc_probe,
.priv_auto = sizeof(struct nexell_dwmmc_priv),
- .platdata_auto = sizeof(struct nexell_mmc_plat),
+ .plat_auto = sizeof(struct nexell_mmc_plat),
};
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
.of_match = omap_hsmmc_ids,
.ofdata_to_platdata = omap_hsmmc_ofdata_to_platdata,
- .platdata_auto = sizeof(struct omap_hsmmc_plat),
+ .plat_auto = sizeof(struct omap_hsmmc_plat),
#endif
#ifdef CONFIG_BLK
.bind = omap_hsmmc_bind,
.probe = pci_mmc_probe,
.ops = &sdhci_ops,
.priv_auto = sizeof(struct pci_mmc_priv),
- .platdata_auto = sizeof(struct pci_mmc_plat),
+ .plat_auto = sizeof(struct pci_mmc_plat),
ACPI_OPS_PTR(&pci_mmc_acpi_ops)
};
.bind = pic32_sdhci_bind,
.probe = pic32_sdhci_probe,
.priv_auto = sizeof(struct sdhci_host),
- .platdata_auto = sizeof(struct pic32_sdhci_plat)
+ .plat_auto = sizeof(struct pic32_sdhci_plat)
};
.bind = tmio_sd_bind,
.probe = renesas_sdhi_probe,
.priv_auto = sizeof(struct tmio_sd_priv),
- .platdata_auto = sizeof(struct tmio_sd_plat),
+ .plat_auto = sizeof(struct tmio_sd_plat),
.ops = &renesas_sdhi_ops,
};
.bind = rockchip_dwmmc_bind,
.probe = rockchip_dwmmc_probe,
.priv_auto = sizeof(struct rockchip_dwmmc_priv),
- .platdata_auto = sizeof(struct rockchip_mmc_plat),
+ .plat_auto = sizeof(struct rockchip_mmc_plat),
};
U_BOOT_DRIVER_ALIAS(rockchip_rk3288_dw_mshc, rockchip_rk3328_dw_mshc)
.bind = rockchip_sdhci_bind,
.probe = arasan_sdhci_probe,
.priv_auto = sizeof(struct rockchip_sdhc),
- .platdata_auto = sizeof(struct rockchip_sdhc_plat),
+ .plat_auto = sizeof(struct rockchip_sdhc_plat),
};
.ops = &sdhci_ops,
.probe = s5p_sdhci_probe,
.priv_auto = sizeof(struct sdhci_host),
- .platdata_auto = sizeof(struct s5p_sdhci_plat),
+ .plat_auto = sizeof(struct s5p_sdhci_plat),
};
#endif /* CONFIG_DM_MMC */
.bind = sandbox_mmc_bind,
.unbind = sandbox_mmc_unbind,
.probe = sandbox_mmc_probe,
- .platdata_auto = sizeof(struct sandbox_mmc_plat),
+ .plat_auto = sizeof(struct sandbox_mmc_plat),
};
.bind = sdhci_cdns_bind,
.probe = sdhci_cdns_probe,
.priv_auto = sizeof(struct sdhci_host),
- .platdata_auto = sizeof(struct sdhci_cdns_plat),
+ .plat_auto = sizeof(struct sdhci_cdns_plat),
.ops = &sdhci_cdns_mmc_ops,
};
.bind = sh_mmcif_dm_bind,
.probe = sh_mmcif_dm_probe,
.priv_auto = sizeof(struct sh_mmcif_host),
- .platdata_auto = sizeof(struct sh_mmcif_plat),
+ .plat_auto = sizeof(struct sh_mmcif_plat),
.ops = &sh_mmcif_dm_ops,
};
#endif
.bind = sh_sdhi_dm_bind,
.probe = sh_sdhi_dm_probe,
.priv_auto = sizeof(struct sh_sdhi_host),
- .platdata_auto = sizeof(struct sh_sdhi_plat),
+ .plat_auto = sizeof(struct sh_sdhi_plat),
.ops = &sh_sdhi_dm_ops,
};
#endif
.bind = snps_dwmmc_bind,
.probe = snps_dwmmc_probe,
.priv_auto = sizeof(struct snps_dwmci_priv_data),
- .platdata_auto = sizeof(struct snps_dwmci_plat),
+ .plat_auto = sizeof(struct snps_dwmci_plat),
};
.bind = socfpga_dwmmc_bind,
.probe = socfpga_dwmmc_probe,
.priv_auto = sizeof(struct dwmci_socfpga_priv_data),
- .platdata_auto = sizeof(struct socfpga_dwmci_plat),
+ .plat_auto = sizeof(struct socfpga_dwmci_plat),
};
.ofdata_to_platdata = sti_sdhci_ofdata_to_platdata,
.probe = sti_sdhci_probe,
.priv_auto = sizeof(struct sdhci_host),
- .platdata_auto = sizeof(struct sti_sdhci_plat),
+ .plat_auto = sizeof(struct sti_sdhci_plat),
};
.probe = stm32_sdmmc2_probe,
.bind = stm32_sdmmc_bind,
.priv_auto = sizeof(struct stm32_sdmmc2_priv),
- .platdata_auto = sizeof(struct stm32_sdmmc2_plat),
+ .plat_auto = sizeof(struct stm32_sdmmc2_plat),
};
.bind = sunxi_mmc_bind,
.probe = sunxi_mmc_probe,
.ops = &sunxi_mmc_ops,
- .platdata_auto = sizeof(struct sunxi_mmc_plat),
+ .plat_auto = sizeof(struct sunxi_mmc_plat),
.priv_auto = sizeof(struct sunxi_mmc_priv),
};
#endif
.probe = sdhci_tangier_probe,
.ops = &sdhci_ops,
.priv_auto = sizeof(struct sdhci_host),
- .platdata_auto = sizeof(struct sdhci_tangier_plat),
+ .plat_auto = sizeof(struct sdhci_tangier_plat),
};
.bind = tegra_mmc_bind,
.probe = tegra_mmc_probe,
.ops = &tegra_mmc_ops,
- .platdata_auto = sizeof(struct tegra_mmc_plat),
+ .plat_auto = sizeof(struct tegra_mmc_plat),
.priv_auto = sizeof(struct tegra_mmc_priv),
};
.bind = tmio_sd_bind,
.probe = uniphier_sd_probe,
.priv_auto = sizeof(struct tmio_sd_priv),
- .platdata_auto = sizeof(struct tmio_sd_plat),
+ .plat_auto = sizeof(struct tmio_sd_plat),
.ops = &uniphier_sd_ops,
};
.bind = xenon_sdhci_bind,
.probe = xenon_sdhci_probe,
.priv_auto = sizeof(struct xenon_sdhci_priv),
- .platdata_auto = sizeof(struct xenon_sdhci_plat),
+ .plat_auto = sizeof(struct xenon_sdhci_plat),
};
.bind = arasan_sdhci_bind,
.probe = arasan_sdhci_probe,
.priv_auto = sizeof(struct arasan_sdhci_priv),
- .platdata_auto = sizeof(struct arasan_sdhci_plat),
+ .plat_auto = sizeof(struct arasan_sdhci_plat),
};
.id = UCLASS_MTD,
.of_match = altera_qspi_ids,
.ofdata_to_platdata = altera_qspi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct altera_qspi_platdata),
+ .plat_auto = sizeof(struct altera_qspi_platdata),
.probe = altera_qspi_probe,
};
to handle the common case when only a single serial
flash is present on the system.
Not used for boot with device tree; the SPI driver reads
- speed and mode from platdata values computed from
+ speed and mode from plat values computed from
available node.
config SF_DEFAULT_SPEED
to handle the common case when only a single serial
flash is present on the system.
Not used for boot with device tree; the SPI driver reads
- speed and mode from platdata values computed from
+ speed and mode from plat values computed from
available node.
if SPI_FLASH
dev->name);
return ret;
}
- slave_plat = dev_get_parent_platdata(dev);
+ slave_plat = dev_get_parent_plat(dev);
cs = slave_plat->cs;
debug("found at cs %d\n", cs);
.probe = sandbox_sf_probe,
.remove = sandbox_sf_remove,
.priv_auto = sizeof(struct sandbox_spi_flash),
- .platdata_auto = sizeof(struct sandbox_spi_flash_plat_data),
+ .plat_auto = sizeof(struct sandbox_spi_flash_plat_data),
.ops = &sandbox_sf_emul_ops,
};
.remove = ag7xxx_eth_remove,
.ops = &ag7xxx_eth_ops,
.priv_auto = sizeof(struct ar7xxx_eth_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
.of_match = altera_tse_ids,
.ops = &altera_tse_ops,
.ofdata_to_platdata = altera_tse_ofdata_to_platdata,
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.priv_auto = sizeof(struct altera_tse_priv),
.probe = altera_tse_probe,
};
.id = UCLASS_ETH,
.of_match = bcm6348_eth_ids,
.ops = &bcm6348_eth_ops,
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.priv_auto = sizeof(struct bcm6348_eth_priv),
.probe = bcm6348_eth_probe,
};
.id = UCLASS_ETH,
.of_match = bcm6368_eth_ids,
.ops = &bcm6368_eth_ops,
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.priv_auto = sizeof(struct bcm6368_eth_priv),
.probe = bcm6368_eth_probe,
};
.probe = bcmgenet_eth_probe,
.ops = &bcmgenet_gmac_eth_ops,
.priv_auto = sizeof(struct bcmgenet_eth_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
.probe = dc2114x_probe,
.ops = &dc2114x_ops,
.priv_auto = sizeof(struct dc2114x_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
U_BOOT_PCI_DEVICE(eth_dc2114x, supported);
#ifdef CONFIG_DM_PCI
/*
* If we are on PCI bus, either directly attached to a PCI root port,
- * or via a PCI bridge, fill in platdata before we probe the hardware.
+ * or via a PCI bridge, fill in plat before we probe the hardware.
*/
if (device_is_on_pci_bus(dev)) {
dm_pci_read_config32(dev, PCI_BASE_ADDRESS_0, &iobase);
.remove = designware_eth_remove,
.ops = &designware_eth_ops,
.priv_auto = sizeof(struct dw_eth_dev),
- .platdata_auto = sizeof(struct dw_eth_pdata),
+ .plat_auto = sizeof(struct dw_eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
.remove = eqos_remove,
.ops = &eqos_ops,
.priv_auto = sizeof(struct eqos_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
.probe = dwmac_s700_probe,
.ops = &designware_eth_ops,
.priv_auto = sizeof(struct dw_eth_dev),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
.probe = dwmac_socfpga_probe,
.ops = &designware_eth_ops,
.priv_auto = sizeof(struct dw_eth_dev),
- .platdata_auto = sizeof(struct dwmac_socfpga_platdata),
+ .plat_auto = sizeof(struct dwmac_socfpga_platdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
.probe = e1000_eth_probe,
.ops = &e1000_eth_ops,
.priv_auto = sizeof(struct e1000_hw),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
U_BOOT_PCI_DEVICE(eth_e1000, e1000_supported);
.probe = eepro100_probe,
.ops = &eepro100_ops,
.priv_auto = sizeof(struct eepro100_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
U_BOOT_PCI_DEVICE(eth_eepro100, supported);
.remove = ethoc_remove,
.ops = ðoc_ops,
.priv_auto = sizeof(struct ethoc),
- .platdata_auto = sizeof(struct ethoc_eth_pdata),
+ .plat_auto = sizeof(struct ethoc_eth_pdata),
};
#else
.remove = fecmxc_remove,
.ops = &fecmxc_ops,
.priv_auto = sizeof(struct fec_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
#endif
.remove = fm_eth_remove,
.ops = &fm_eth_ops,
.priv_auto = sizeof(struct fm_eth),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
#endif /* CONFIG_DM_ETH */
.remove = fm_mdio_remove,
.ops = &fm_mdio_ops,
.priv_auto = sizeof(struct fm_mdio_priv),
- .platdata_auto = sizeof(struct mdio_perdev_priv),
+ .plat_auto = sizeof(struct mdio_perdev_priv),
};
#endif /* CONFIG_PHYLIB && CONFIG_DM_MDIO */
#endif /* CONFIG_DM_ETH */
continue;
pdata = dev_get_platdata(dev);
- ppdata = dev_get_parent_platdata(dev);
+ ppdata = dev_get_parent_plat(dev);
devfn = PCI_FUNC(ppdata->devfn);
enetc_set_ierb_primary_mac(dev, devfn, pdata->enetaddr);
static int enetc_ls1028a_write_hwaddr(struct udevice *dev)
{
- struct pci_child_platdata *ppdata = dev_get_parent_platdata(dev);
+ struct pci_child_platdata *ppdata = dev_get_parent_plat(dev);
const int devfn_to_pf[] = {0, 1, 2, -1, -1, -1, 3};
struct eth_pdata *plat = dev_get_platdata(dev);
int devfn = PCI_FUNC(ppdata->devfn);
.remove = enetc_remove,
.ops = &enetc_ops,
.priv_auto = sizeof(struct enetc_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
static struct pci_device_id enetc_ids[] = {
.remove = mcdmafec_remove,
.ops = &mcdmafec_ops,
.priv_auto = sizeof(struct fec_info_dma),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
.remove = tsec_mdio_remove,
.ops = &tsec_mdio_ops,
.priv_auto = sizeof(struct tsec_mdio_priv),
- .platdata_auto = sizeof(struct mdio_perdev_priv),
+ .plat_auto = sizeof(struct mdio_perdev_priv),
};
#endif /* CONFIG_PHYLIB */
#endif /* CONFIG_DM_MDIO */
.remove = ftgmac100_remove,
.ops = &ftgmac100_ops,
.priv_auto = sizeof(struct ftgmac100_data),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
.probe = ftmac100_probe,
.ops = &ftmac100_ops,
.priv_auto = sizeof(struct ftmac100_data),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
#endif
.probe = gmac_rockchip_probe,
.ops = &gmac_rockchip_eth_ops,
.priv_auto = sizeof(struct dw_eth_dev),
- .platdata_auto = sizeof(struct gmac_rockchip_platdata),
+ .plat_auto = sizeof(struct gmac_rockchip_platdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
.remove = higmac_remove,
.ops = &higmac_ops,
.priv_auto = sizeof(struct higmac_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
.probe = ks8851_probe,
.ops = &ks8851_ops,
.priv_auto = sizeof(struct ks_net),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
#endif
.probe = ldpaa_eth_probe,
.ops = &ldpaa_eth_ops,
.priv_auto = sizeof(struct ldpaa_eth_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
#else
.remove = macb_eth_remove,
.ops = &macb_eth_ops,
.priv_auto = sizeof(struct macb_device),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
#endif
.remove = mcffec_remove,
.ops = &mcffec_ops,
.priv_auto = sizeof(struct fec_info_s),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
.remove = jr2_remove,
.ops = &jr2_ops,
.priv_auto = sizeof(struct jr2_private),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
.remove = luton_remove,
.ops = &luton_ops,
.priv_auto = sizeof(struct luton_private),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
.remove = ocelot_remove,
.ops = &ocelot_ops,
.priv_auto = sizeof(struct ocelot_private),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
.remove = serval_remove,
.ops = &serval_ops,
.priv_auto = sizeof(struct serval_private),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
.remove = servalt_remove,
.ops = &servalt_ops,
.priv_auto = sizeof(struct servalt_private),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
.probe = mt7628_eth_probe,
.ops = &mt7628_eth_ops,
.priv_auto = sizeof(struct mt7628_eth_dev),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
.id = UCLASS_ETH,
.of_match = mtk_eth_ids,
.ofdata_to_platdata = mtk_eth_ofdata_to_platdata,
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.probe = mtk_eth_probe,
.remove = mtk_eth_remove,
.ops = &mtk_eth_ops,
.probe = mvgbe_probe,
.ops = &mvgbe_ops,
.priv_auto = sizeof(struct mvgbe_device),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
#endif /* CONFIG_DM_ETH */
.probe = mvneta_probe,
.ops = &mvneta_ops,
.priv_auto = sizeof(struct mvneta_port),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
.remove = mvpp2_remove,
.ops = &mvpp2_ops,
.priv_auto = sizeof(struct mvpp2_port),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ACTIVE_DMA,
};
.probe = octeontx_vnic_probe,
.ops = &octeontx_vnic_ops,
.priv_auto = sizeof(struct nicvf),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
static struct pci_device_id octeontx_vnic_supported[] = {
.remove = rvu_pf_remove,
.ops = &nix_eth_ops,
.priv_auto = sizeof(struct rvu_pf),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
static struct pci_device_id rvu_pf_supported[] = {
.remove = pch_gbe_remove,
.ops = &pch_gbe_ops,
.priv_auto = sizeof(struct pch_gbe_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
.probe = pcnet_probe,
.ops = &pcnet_ops,
.priv_auto = sizeof(struct pcnet_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.flags = DM_UC_FLAG_ALLOC_PRIV_DMA,
};
.remove = pfe_eth_remove,
.ops = &pfe_eth_ops,
.priv_auto = sizeof(struct pfe_eth_dev),
- .platdata_auto = sizeof(struct pfe_eth_pdata)
+ .plat_auto = sizeof(struct pfe_eth_pdata)
};
.remove = pic32_eth_remove,
.ops = &pic32_eth_ops,
.priv_auto = sizeof(struct pic32eth_dev),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
.remove = qe_uec_remove,
.ops = &qe_uec_eth_ops,
.priv_auto = sizeof(struct qe_uec_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
.remove = ravb_remove,
.ops = &ravb_ops,
.priv_auto = sizeof(struct ravb_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
.probe = rtl8139_probe,
.ops = &rtl8139_ops,
.priv_auto = sizeof(struct rtl8139_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
U_BOOT_PCI_DEVICE(eth_rtl8139, supported);
#ifdef CONFIG_DM_ETH
static int rtl8169_eth_probe(struct udevice *dev)
{
- struct pci_child_platdata *pplat = dev_get_parent_platdata(dev);
+ struct pci_child_platdata *pplat = dev_get_parent_plat(dev);
struct rtl8169_private *priv = dev_get_priv(dev);
struct eth_pdata *plat = dev_get_platdata(dev);
u32 iobase;
.probe = rtl8169_eth_probe,
.ops = &rtl8169_eth_ops,
.priv_auto = sizeof(struct rtl8169_private),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
U_BOOT_PCI_DEVICE(eth_rtl8169, supported);
.ofdata_to_platdata = sb_eth_raw_ofdata_to_platdata,
.ops = &sb_eth_raw_ops,
.priv_auto = sizeof(struct eth_sandbox_raw_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
.remove = sb_eth_remove,
.ops = &sb_eth_ops,
.priv_auto = sizeof(struct eth_sandbox_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
.remove = sh_ether_remove,
.ops = &sh_ether_ops,
.priv_auto = sizeof(struct sh_ether_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
#endif
.probe = smc911x_probe,
.ops = &smc911x_ops,
.priv_auto = sizeof(struct smc911x_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
#endif
.ofdata_to_platdata = ave_ofdata_to_platdata,
.ops = &ave_ops,
.priv_auto = sizeof(struct ave_private),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
.probe = sun8i_emac_eth_probe,
.ops = &sun8i_emac_eth_ops,
.priv_auto = sizeof(struct emac_eth_dev),
- .platdata_auto = sizeof(struct sun8i_eth_pdata),
+ .plat_auto = sizeof(struct sun8i_eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
.probe = sunxi_emac_eth_probe,
.ops = &sunxi_emac_eth_ops,
.priv_auto = sizeof(struct emac_eth_dev),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
.probe = am65_cpsw_probe_cpsw,
.ops = &am65_cpsw_ops,
.priv_auto = sizeof(struct am65_cpsw_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
#if CONFIG_IS_ENABLED(OF_CONTROL)
.of_match = cpsw_eth_ids,
.ofdata_to_platdata = cpsw_eth_ofdata_to_platdata,
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
#endif
.probe = cpsw_eth_probe,
.ops = &cpsw_eth_ops,
.of_match = davinci_emac_ids,
.probe = davinci_emac_probe,
.ops = &davinci_emac_ops,
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
.remove = ks2_eth_remove,
.ops = &ks2_eth_ops,
.priv_auto = sizeof(struct ks2_eth_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
.remove = ks2_eth_remove,
.ops = &ks2_eth_ops,
.priv_auto = sizeof(struct ks2_eth_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
.remove = tsec_remove,
.ops = &tsec_ops,
.priv_auto = sizeof(struct tsec_private),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
#endif /* CONFIG_DM_ETH */
.remove = axi_emac_remove,
.ops = &axi_emac_ops,
.priv_auto = sizeof(struct axidma_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
.remove = emaclite_remove,
.ops = &emaclite_ops,
.priv_auto = sizeof(struct xemaclite),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
.remove = zynq_gem_remove,
.ops = &zynq_gem_ops,
.priv_auto = sizeof(struct zynq_gem_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
};
static int nvme_blk_probe(struct udevice *udev)
{
struct nvme_dev *ndev = dev_get_priv(udev->parent);
- struct blk_desc *desc = dev_get_uclass_platdata(udev);
+ struct blk_desc *desc = dev_get_uclass_plat(udev);
struct nvme_ns *ns = dev_get_priv(udev);
u8 flbas;
struct pci_child_platdata *pplat;
desc->log2blksz = ns->lba_shift;
desc->blksz = 1 << ns->lba_shift;
desc->bdev = udev;
- pplat = dev_get_parent_platdata(udev->parent);
+ pplat = dev_get_parent_plat(udev->parent);
sprintf(desc->vendor, "0x%.4x", pplat->vendor);
memcpy(desc->product, ndev->serial, sizeof(ndev->serial));
memcpy(desc->revision, ndev->firmware_rev, sizeof(ndev->firmware_rev));
struct nvme_ns *ns = dev_get_priv(udev);
struct nvme_dev *dev = ns->dev;
struct nvme_command c;
- struct blk_desc *desc = dev_get_uclass_platdata(udev);
+ struct blk_desc *desc = dev_get_uclass_plat(udev);
int status;
u64 prp2;
u64 total_len = blkcnt << desc->log2blksz;
};
/*
- * This uclass is a child of the pci bus. Its platdata is not defined here so
+ * This uclass is a child of the pci bus. Its plat is not defined here so
* is defined by its parent, UCLASS_PCI, which uses struct pci_child_platdata.
- * See per_child_platdata_auto in UCLASS_DRIVER(pci).
+ * See per_child_plat_auto in UCLASS_DRIVER(pci).
*/
UCLASS_DRIVER(pci_emul_parent) = {
.id = UCLASS_PCI_EMUL_PARENT,
.ops = &rcar_gen3_pcie_ops,
.probe = rcar_gen3_pcie_probe,
.ofdata_to_platdata = rcar_gen3_pcie_ofdata_to_platdata,
- .platdata_auto = sizeof(struct rcar_gen3_pcie_priv),
+ .plat_auto = sizeof(struct rcar_gen3_pcie_priv),
};
pci_dev_t dm_pci_get_bdf(const struct udevice *dev)
{
- struct pci_child_platdata *pplat = dev_get_parent_platdata(dev);
+ struct pci_child_platdata *pplat = dev_get_parent_plat(dev);
struct udevice *bus = dev->parent;
/*
device_find_next_child(&dev)) {
struct pci_child_platdata *pplat;
- pplat = dev_get_parent_platdata(dev);
+ pplat = dev_get_parent_plat(dev);
if (pplat && pplat->devfn == find_devfn) {
*devp = dev;
return 0;
struct pci_child_platdata *pplat;
int i;
- pplat = dev_get_parent_platdata(dev);
+ pplat = dev_get_parent_plat(dev);
if (!pplat)
return -EINVAL;
for (i = 0; ids[i].vendor != 0; i++) {
for (device_find_first_child(bus, &dev);
dev;
device_find_next_child(&dev)) {
- pplat = dev_get_parent_platdata(dev);
+ pplat = dev_get_parent_plat(dev);
if (pplat->vendor == vendor && pplat->device == device) {
if (!(*indexp)--) {
*devp = dev;
for (pci_find_first_device(&dev);
dev;
pci_find_next_device(&dev)) {
- struct pci_child_platdata *pplat = dev_get_parent_platdata(dev);
+ struct pci_child_platdata *pplat = dev_get_parent_plat(dev);
if (pplat->class == find_class && !index--) {
*devp = dev;
max_bus = ret;
sub_bus = max(sub_bus, max_bus);
- pplat = dev_get_parent_platdata(dev);
+ pplat = dev_get_parent_plat(dev);
if (pplat->class == (PCI_CLASS_DISPLAY_VGA << 8))
set_vga_bridge_bits(dev);
}
/*
* 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
return ret;
/* Update the platform data */
- pplat = dev_get_parent_platdata(dev);
+ pplat = dev_get_parent_plat(dev);
pplat->devfn = PCI_MASK_BUS(bdf);
pplat->vendor = vendor;
pplat->device = device;
if (!dev_of_valid(dev))
return 0;
- pplat = dev_get_parent_platdata(dev);
+ pplat = dev_get_parent_plat(dev);
/* Extract vendor id and device id if available */
ofnode_read_pci_vendev(dev_ofnode(dev), &pplat->vendor, &pplat->device);
void *dm_pci_map_bar(struct udevice *dev, int bar, int flags)
{
- struct pci_child_platdata *pdata = dev_get_parent_platdata(dev);
+ struct pci_child_platdata *pdata = dev_get_parent_plat(dev);
struct udevice *udev = dev;
pci_addr_t pci_bus_addr;
u32 bar_response;
}
/* Update the platform data */
- pplat = dev_get_parent_platdata(dev);
+ pplat = dev_get_parent_plat(dev);
pplat->devfn = PCI_MASK_BUS(bdf);
pplat->vendor = vendor;
pplat->device = device;
.post_probe = pci_uclass_post_probe,
.child_post_bind = pci_uclass_child_post_bind,
.per_device_auto = sizeof(struct pci_controller),
- .per_child_platdata_auto =
+ .per_child_plat_auto =
sizeof(struct pci_child_platdata),
};
.ops = &mvebu_pcie_ops,
.probe = mvebu_pcie_probe,
.ofdata_to_platdata = mvebu_pcie_ofdata_to_platdata,
- .platdata_auto = sizeof(struct mvebu_pcie),
+ .plat_auto = sizeof(struct mvebu_pcie),
};
/*
static int pci_rom_probe(struct udevice *dev, struct pci_rom_header **hdrp)
{
- struct pci_child_platdata *pplat = dev_get_parent_platdata(dev);
+ struct pci_child_platdata *pplat = dev_get_parent_plat(dev);
struct pci_rom_header *rom_header;
struct pci_rom_data *rom_data;
u16 rom_vendor, rom_device;
int dm_pci_run_vga_bios(struct udevice *dev, int (*int15_handler)(void),
int exec_method)
{
- struct pci_child_platdata *pplat = dev_get_parent_platdata(dev);
+ struct pci_child_platdata *pplat = dev_get_parent_plat(dev);
struct pci_rom_header *rom = NULL, *ram = NULL;
int vesa_mode = -1;
bool emulate, alloced;
int vbe_setup_video(struct udevice *dev, int (*int15_handler)(void))
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
int ret;
/* Attach an emulator if we can */
.child_post_bind = dm_scan_fdt_dev,
- .per_child_platdata_auto =
+ .per_child_plat_auto =
sizeof(struct pci_child_platdata),
};
while (dev->parent->seq != 0)
dev = dev->parent;
- pplat = dev_get_parent_platdata(dev);
+ pplat = dev_get_parent_plat(dev);
}
list_for_each_entry(port, &pcie->ports, list) {
.of_match = sun4i_usb_phy_ids,
.ops = &sun4i_usb_phy_ops,
.probe = sun4i_usb_phy_probe,
- .platdata_auto = sizeof(struct sun4i_usb_phy_plat[MAX_PHYS]),
+ .plat_auto = sizeof(struct sun4i_usb_phy_plat[MAX_PHYS]),
.priv_auto = sizeof(struct sun4i_usb_phy_data),
};
.probe = sr_pcie_phy_probe,
.of_match = sr_pcie_phy_match_table,
.ops = &sr_pcie_phy_ops,
- .platdata_auto = sizeof(struct sr_pcie_phy_core),
+ .plat_auto = sizeof(struct sr_pcie_phy_core),
.priv_auto = sizeof(struct sr_pcie_phy_core),
};
const struct pad_community *comm,
int num_cfgs)
{
- struct p2sb_child_platdata *pplat = dev_get_parent_platdata(dev);
+ struct p2sb_child_platdata *pplat = dev_get_parent_plat(dev);
struct intel_pinctrl_priv *priv = dev_get_priv(dev);
if (!comm) {
return log_msg_ret("Could not set port id", ret);
#endif
/* Attach this device to its community structure */
- pplat = dev_get_parent_platdata(dev);
+ pplat = dev_get_parent_plat(dev);
for (i = 0; i < ARRAY_SIZE(apl_gpio_communities); i++) {
if (apl_gpio_communities[i].port == pplat->pid)
comm = &apl_gpio_communities[i];
#endif
.ofdata_to_platdata = apl_pinctrl_ofdata_to_platdata,
.priv_auto = sizeof(struct intel_pinctrl_priv),
- .platdata_auto = sizeof(struct apl_gpio_platdata),
+ .plat_auto = sizeof(struct apl_gpio_platdata),
};
.id = UCLASS_PINCTRL,
.of_match = atmel_pinctrl_match,
.probe = atmel_pinctrl_probe,
- .platdata_auto = sizeof(struct atmel_pio4_platdata),
+ .plat_auto = sizeof(struct atmel_pio4_platdata),
.ops = &atmel_pinctrl_ops,
};
#else
static int qe_io_ofdata_to_platdata(struct udevice *dev)
{
- struct qe_io_platdata *plat = dev->platdata;
+ struct qe_io_platdata *plat = dev->plat;
fdt_addr_t addr;
addr = dev_read_addr(dev);
*/
static int par_io_of_config_node(struct udevice *dev, ofnode pio)
{
- struct qe_io_platdata *plat = dev->platdata;
+ struct qe_io_platdata *plat = dev->plat;
qepio83xx_t *par_io = plat->base;
const unsigned int *pio_map;
int pio_map_len;
.of_match = of_match_ptr(par_io_pinctrl_match),
.probe = par_io_pinctrl_probe,
.ofdata_to_platdata = qe_io_ofdata_to_platdata,
- .platdata_auto = sizeof(struct qe_io_platdata),
+ .plat_auto = sizeof(struct qe_io_platdata),
.ops = &par_io_pinctrl_ops,
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
.flags = DM_FLAG_PRE_RELOC,
const struct single_fdt_pin_cfg *pins,
int size)
{
- struct single_pdata *pdata = dev->platdata;
+ struct single_pdata *pdata = dev->plat;
int count = size / sizeof(struct single_fdt_pin_cfg);
phys_addr_t n, reg;
u32 val;
const struct single_fdt_bits_cfg *pins,
int size)
{
- struct single_pdata *pdata = dev->platdata;
+ struct single_pdata *pdata = dev->plat;
int count = size / sizeof(struct single_fdt_bits_cfg);
phys_addr_t n, reg;
u32 val, mask;
fdt_addr_t addr;
u32 of_reg[2];
int res;
- struct single_pdata *pdata = dev->platdata;
+ struct single_pdata *pdata = dev->plat;
pdata->width =
dev_read_u32_default(dev, "pinctrl-single,register-width", 0);
.id = UCLASS_PINCTRL,
.of_match = single_pinctrl_match,
.ops = &single_pinctrl_ops,
- .platdata_auto = sizeof(struct single_pdata),
+ .plat_auto = sizeof(struct single_pdata),
.ofdata_to_platdata = single_ofdata_to_platdata,
};
.of_match = sti_pinctrl_ids,
.ops = &sti_pinctrl_ops,
.probe = sti_pinctrl_probe,
- .platdata_auto = sizeof(struct sti_pinctrl_platdata),
+ .plat_auto = sizeof(struct sti_pinctrl_platdata),
.ops = &sti_pinctrl_ops,
};
.bind = stmfx_pinctrl_bind,
.probe = stmfx_pinctrl_probe,
.ops = &stmfx_pinctrl_ops,
- .platdata_auto = sizeof(struct stmfx_pinctrl),
+ .plat_auto = sizeof(struct stmfx_pinctrl),
};
static int stmfx_chip_init(struct udevice *dev)
u8 id;
u8 version[2];
int ret;
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
ret = dm_i2c_reg_read(dev, STMFX_REG_CHIP_ID);
if (ret < 0) {
.id = UCLASS_PINCTRL,
.of_match = r7s72100_pfc_match,
.probe = r7s72100_pfc_probe,
- .platdata_auto = sizeof(struct r7s72100_pfc_platdata),
+ .plat_auto = sizeof(struct r7s72100_pfc_platdata),
.ops = &r7s72100_pfc_ops,
};
.ops = &sandbox_pmc_emul_emul_ops,
.probe = sandbox_pmc_probe,
.priv_auto = sizeof(struct pmc_emul_priv),
- .platdata_auto = sizeof(struct pmc_emul_platdata),
+ .plat_auto = sizeof(struct pmc_emul_platdata),
};
static struct pci_device_id sandbox_pmc_emul_supported[] = {
.bind = imx8_power_domain_bind,
.probe = imx8_power_domain_probe,
.ofdata_to_platdata = imx8_power_domain_ofdata_to_platdata,
- .platdata_auto = sizeof(struct imx8_power_domain_platdata),
+ .plat_auto = sizeof(struct imx8_power_domain_platdata),
.priv_auto = sizeof(struct imx8_power_domain_priv),
.ops = &imx8_power_domain_ops,
.flags = DM_FLAG_DEFAULT_PD_CTRL_OFF,
.bind = imx8m_power_domain_bind,
.probe = imx8m_power_domain_probe,
.ofdata_to_platdata = imx8m_power_domain_ofdata_to_platdata,
- .platdata_auto = sizeof(struct imx8m_power_domain_platdata),
+ .plat_auto = sizeof(struct imx8m_power_domain_platdata),
.ops = &imx8m_power_domain_ops,
};
.of_match = sandbox_i2c_pmic_ids,
.ofdata_to_platdata = sandbox_i2c_pmic_ofdata_to_platdata,
.probe = sandbox_i2c_pmic_probe,
- .platdata_auto = sizeof(struct sandbox_i2c_pmic_plat_data),
+ .plat_auto = sizeof(struct sandbox_i2c_pmic_plat_data),
.ops = &sandbox_i2c_pmic_emul_ops,
};
static int act8846_reg_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
int reg = dev->driver_data;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = reg <= 4 ? REGULATOR_TYPE_BUCK : REGULATOR_TYPE_LDO;
uc_pdata->mode_count = 0;
static int as3722_stepdown_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_BUCK;
static int as3722_ldo_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_LDO;
{
struct bd71837_platdata *plat = dev_get_platdata(dev);
int i, ret;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
int type;
struct bd71837_platdata *init_data;
int data_amnt;
* the initial state matches dt flags and then
* write the SEL bit
*/
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ret = bd71837_set_enable(dev,
!!(uc_pdata->boot_on ||
uc_pdata->always_on));
.id = UCLASS_REGULATOR,
.ops = &bd71837_regulator_ops,
.probe = bd71837_regulator_probe,
- .platdata_auto = sizeof(struct bd71837_platdata),
+ .plat_auto = sizeof(struct bd71837_platdata),
};
static int da9063_ldo_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
struct da9063_priv *priv = dev->priv;
/* LDOs are named numerically in DT so can directly index */
return -EINVAL;
priv->reg_info = &da9063_ldo_info[dev->driver_data - 1];
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_LDO;
uc_pdata->mode = da9063_ldo_modes;
uc_pdata->mode_count = ARRAY_SIZE(da9063_ldo_modes);
static int da9063_buck_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
struct da9063_priv *priv = dev->priv;
int i;
if (!priv->reg_info)
return -ENODEV;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_BUCK;
uc_pdata->mode = da9063_buck_modes;
uc_pdata->mode_count = ARRAY_SIZE(da9063_buck_modes);
static int fan53555_regulator_ofdata_to_platdata(struct udevice *dev)
{
struct fan53555_platdata *dev_pdata = dev_get_platdata(dev);
- struct dm_regulator_uclass_platdata *uc_pdata =
- dev_get_uclass_platdata(dev);
+ struct dm_regulator_uclass_plat *uc_pdata =
+ dev_get_uclass_plat(dev);
u32 sleep_vsel;
/* This is a buck regulator */
.id = UCLASS_REGULATOR,
.ops = &fan53555_regulator_ops,
.ofdata_to_platdata = fan53555_regulator_ofdata_to_platdata,
- .platdata_auto = sizeof(struct fan53555_platdata),
+ .plat_auto = sizeof(struct fan53555_platdata),
.priv_auto = sizeof(struct fan53555_priv),
.probe = fan53555_probe,
};
static int fixed_regulator_ofdata_to_platdata(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
struct regulator_common_platdata *dev_pdata;
dev_pdata = dev_get_platdata(dev);
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (!uc_pdata)
return -ENXIO;
static int fixed_regulator_get_value(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (!uc_pdata)
return -ENXIO;
static int fixed_regulator_get_current(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (!uc_pdata)
return -ENXIO;
.ops = &fixed_regulator_ops,
.of_match = fixed_regulator_ids,
.ofdata_to_platdata = fixed_regulator_ofdata_to_platdata,
- .platdata_auto = sizeof(struct regulator_common_platdata),
+ .plat_auto = sizeof(struct regulator_common_platdata),
};
static int gpio_regulator_ofdata_to_platdata(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
struct gpio_regulator_platdata *dev_pdata;
struct gpio_desc *gpio;
int ret, count, i, j;
u32 states_array[GPIO_REGULATOR_MAX_STATES * 2];
dev_pdata = dev_get_platdata(dev);
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (!uc_pdata)
return -ENXIO;
static int gpio_regulator_get_value(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
struct gpio_regulator_platdata *dev_pdata = dev_get_platdata(dev);
int enable;
if (!dev_pdata->gpio.dev)
return -ENOSYS;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (uc_pdata->min_uV > uc_pdata->max_uV) {
debug("Invalid constraints for: %s\n", uc_pdata->name);
return -EINVAL;
.ops = &gpio_regulator_ops,
.of_match = gpio_regulator_ids,
.ofdata_to_platdata = gpio_regulator_ofdata_to_platdata,
- .platdata_auto = sizeof(struct gpio_regulator_platdata),
+ .plat_auto = sizeof(struct gpio_regulator_platdata),
};
{
int ret;
unsigned int adr;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
adr = uc_pdata->ctrl_reg;
ret = pmic_reg_read(dev->parent, adr);
{
unsigned int hex, adr;
int ret;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (op == PMIC_OP_GET)
*uV = 0;
{
int ret;
unsigned int adr;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
adr = uc_pdata->ctrl_reg;
ret = pmic_reg_read(dev->parent, adr);
unsigned int hex, adr;
int ret;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
if (op == PMIC_OP_GET)
*uV = 0;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
adr = uc_pdata->volt_reg;
static int lp873x_ldo_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_LDO;
int idx = dev->driver_data;
static int lp873x_buck_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
int idx;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_BUCK;
idx = dev->driver_data;
{
int ret;
unsigned int adr;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
adr = uc_pdata->ctrl_reg;
ret = pmic_reg_read(dev->parent, adr);
{
unsigned int hex, adr;
int ret;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (op == PMIC_OP_GET)
*uV = 0;
static int lp87565_buck_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
int idx;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_BUCK;
idx = dev->driver_data;
static int max77686_ldo_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_LDO;
uc_pdata->mode_count = max77686_ldo_modes(dev->driver_data,
static int max77686_buck_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_BUCK;
uc_pdata->mode_count = max77686_buck_modes(dev->driver_data,
{
int ret;
unsigned int adr;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
adr = uc_pdata->ctrl_reg;
ret = pmic_reg_read(dev->parent, adr);
unsigned int hex, adr;
int ret;
bool range;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (op == PMIC_OP_GET)
*uV = 0;
static int palmas_ldo_bypass_enable(struct udevice *dev, bool enabled)
{
int type = dev_get_driver_data(dev_get_parent(dev));
- struct dm_regulator_uclass_platdata *p;
+ struct dm_regulator_uclass_plat *p;
unsigned int adr;
int reg;
return -ENOTSUPP;
}
- p = dev_get_uclass_platdata(dev);
+ p = dev_get_uclass_plat(dev);
adr = p->ctrl_reg;
reg = pmic_reg_read(dev->parent, adr);
{
int ret;
unsigned int adr;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
adr = uc_pdata->ctrl_reg;
ret = pmic_reg_read(dev->parent, adr);
unsigned int hex, adr;
int ret;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
if (op == PMIC_OP_GET)
*uV = 0;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
adr = uc_pdata->volt_reg;
static int palmas_ldo_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
struct udevice *parent;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
parent = dev_get_parent(dev);
int type = dev_get_driver_data(parent);
static int palmas_smps_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
struct udevice *parent;
int idx;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
parent = dev_get_parent(dev);
int type = dev_get_driver_data(parent);
static int pbias_regulator_probe(struct udevice *dev)
{
const struct pbias_reg_info **p = pbias_reg_infos;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
while (*p) {
int rc;
static int pfuze100_regulator_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
struct pfuze100_regulator_platdata *plat = dev_get_platdata(dev);
struct pfuze100_regulator_desc *desc;
}
plat->desc = desc;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = desc->type;
if (uc_pdata->type == REGULATOR_TYPE_BUCK) {
{
int val;
int ret, on_off;
- struct dm_regulator_uclass_platdata *uc_pdata =
- dev_get_uclass_platdata(dev);
+ struct dm_regulator_uclass_plat *uc_pdata =
+ dev_get_uclass_plat(dev);
if (op == PMIC_OP_GET) {
if (!strcmp(dev->name, "vrefddr")) {
int val;
struct pfuze100_regulator_platdata *plat = dev_get_platdata(dev);
struct pfuze100_regulator_desc *desc = plat->desc;
- struct dm_regulator_uclass_platdata *uc_pdata =
- dev_get_uclass_platdata(dev);
+ struct dm_regulator_uclass_plat *uc_pdata =
+ dev_get_uclass_plat(dev);
if (op == PMIC_OP_GET) {
*uV = 0;
.id = UCLASS_REGULATOR,
.ops = &pfuze100_regulator_ops,
.probe = pfuze100_regulator_probe,
- .platdata_auto = sizeof(struct pfuze100_regulator_platdata),
+ .plat_auto = sizeof(struct pfuze100_regulator_platdata),
};
static int pwm_regulator_probe(struct udevice *dev)
{
struct pwm_regulator_info *priv = dev_get_priv(dev);
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_BUCK;
uc_pdata->mode_count = 0;
int regulator_mode(struct udevice *dev, struct dm_regulator_mode **modep)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
*modep = NULL;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (!uc_pdata)
return -ENXIO;
int regulator_set_value(struct udevice *dev, int uV)
{
const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
int ret, old_uV = uV, is_enabled = 0;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (uc_pdata->min_uV != -ENODATA && uV < uc_pdata->min_uV)
return -EINVAL;
if (uc_pdata->max_uV != -ENODATA && uV > uc_pdata->max_uV)
int regulator_set_suspend_value(struct udevice *dev, int uV)
{
const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (uc_pdata->min_uV != -ENODATA && uV < uc_pdata->min_uV)
return -EINVAL;
if (uc_pdata->max_uV != -ENODATA && uV > uc_pdata->max_uV)
int regulator_set_current(struct udevice *dev, int uA)
{
const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (uc_pdata->min_uA != -ENODATA && uA < uc_pdata->min_uA)
return -EINVAL;
if (uc_pdata->max_uA != -ENODATA && uA > uc_pdata->max_uA)
int regulator_set_enable(struct udevice *dev, bool enable)
{
const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
int ret, old_enable = 0;
if (!ops || !ops->set_enable)
return -ENOSYS;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (!enable && uc_pdata->always_on)
return -EACCES;
int regulator_get_by_platname(const char *plat_name, struct udevice **devp)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
struct udevice *dev;
int ret;
continue;
}
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (!uc_pdata || strcmp(plat_name, uc_pdata->name))
continue;
int regulator_autoset(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
int ret = 0;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ret = regulator_set_suspend_enable(dev, uc_pdata->suspend_on);
if (!ret && uc_pdata->suspend_on) {
static void regulator_show(struct udevice *dev, int ret)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
printf("%s@%s: ", dev->name, uc_pdata->name);
if (uc_pdata->flags & REGULATOR_FLAG_AUTOSET_UV)
static bool regulator_name_is_unique(struct udevice *check_dev,
const char *check_name)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
struct udevice *dev;
int check_len = strlen(check_name);
int ret;
if (ret || dev == check_dev)
continue;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
len = strlen(uc_pdata->name);
if (len != check_len)
continue;
static int regulator_post_bind(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
const char *property = "regulator-name";
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
/* Regulator's mandatory constraint */
uc_pdata->name = dev_read_string(dev, property);
static int regulator_pre_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
ofnode node;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (!uc_pdata)
return -ENXIO;
.name = "regulator",
.post_bind = regulator_post_bind,
.pre_probe = regulator_pre_probe,
- .per_device_platdata_auto =
- sizeof(struct dm_regulator_uclass_platdata),
+ .per_device_plat_auto =
+ sizeof(struct dm_regulator_uclass_plat),
};
static int rk8xx_buck_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_BUCK;
uc_pdata->mode_count = 0;
static int rk8xx_ldo_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_LDO;
uc_pdata->mode_count = 0;
static int rk8xx_switch_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_FIXED;
uc_pdata->mode_count = 0;
static int s2mps11_buck_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_BUCK;
uc_pdata->mode = s2mps11_buck_modes;
static int s2mps11_ldo_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_LDO;
uc_pdata->mode = s2mps11_ldo_modes;
uc_pdata->mode_count = ARRAY_SIZE(s2mps11_ldo_modes);
static int s5m8767_ldo_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_LDO;
uc_pdata->mode_count = 0;
static int s5m8767_buck_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_BUCK;
uc_pdata->mode_count = 0;
static int out_get_mode(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
uint8_t reg_val;
uint reg;
int ret;
int i;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
reg = (dev->driver_data - 1) * OUT_REG_COUNT + OUT_REG_OM;
ret = pmic_read(dev->parent, reg, ®_val, 1);
static int out_set_mode(struct udevice *dev, int mode)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
int reg_val = -1;
uint reg;
int ret;
int i;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (mode >= uc_pdata->mode_count)
return -EINVAL;
static int sandbox_buck_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_BUCK;
uc_pdata->mode = sandbox_buck_modes;
static int sandbox_ldo_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_LDO;
uc_pdata->mode = sandbox_ldo_modes;
static int stpmic1_buck_set_enable(struct udevice *dev, bool enable)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
int delay = enable ? STPMIC1_DEFAULT_START_UP_DELAY_MS :
STPMIC1_DEFAULT_STOP_DELAY_MS;
int ret, uv;
return 0;
if (enable) {
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uv = stpmic1_buck_get_value(dev);
if (uv < uc_pdata->min_uV || uv > uc_pdata->max_uV)
stpmic1_buck_set_value(dev, uc_pdata->min_uV);
static int stpmic1_buck_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
if (!dev->driver_data || dev->driver_data > STPMIC1_MAX_BUCK)
return -EINVAL;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_BUCK;
uc_pdata->mode = (struct dm_regulator_mode *)buck_modes;
static int stpmic1_ldo_set_enable(struct udevice *dev, bool enable)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
int delay = enable ? STPMIC1_DEFAULT_START_UP_DELAY_MS :
STPMIC1_DEFAULT_STOP_DELAY_MS;
int ret, uv;
return 0;
if (enable) {
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uv = stpmic1_ldo_get_value(dev);
if (uv < uc_pdata->min_uV || uv > uc_pdata->max_uV)
stpmic1_ldo_set_value(dev, uc_pdata->min_uV);
static int stpmic1_ldo_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
if (!dev->driver_data || dev->driver_data > STPMIC1_MAX_LDO)
return -EINVAL;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_LDO;
if (dev->driver_data - 1 == STPMIC1_LDO3) {
static int stpmic1_vref_ddr_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_FIXED;
uc_pdata->mode_count = 0;
static int stpmic1_boost_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_FIXED;
uc_pdata->mode_count = 0;
static int stpmic1_pwr_sw_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
if (!dev->driver_data || dev->driver_data > STPMIC1_MAX_PWR_SW)
return -EINVAL;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_FIXED;
uc_pdata->mode_count = 0;
.id = UCLASS_REGULATOR,
.ops = &tps62360_regulator_ops,
.of_match = tps62360_regulator_ids,
- .platdata_auto = sizeof(struct tps62360_regulator_pdata),
+ .plat_auto = sizeof(struct tps62360_regulator_pdata),
.probe = tps62360_regulator_probe,
};
static int tps65090_fet_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_OTHER;
uc_pdata->mode_count = 0;
{
int ret, reg_vdd, gain;
int val;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
struct tps65910_regulator_pdata *pdata = dev_get_platdata(dev);
switch (pdata->unit) {
default:
return -EINVAL;
}
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
/* check setpoint is within limits */
if (uV < uc_pdata->min_uV) {
.name = TPS65910_BOOST_DRIVER,
.id = UCLASS_REGULATOR,
.ops = &tps65910_boost_ops,
- .platdata_auto = sizeof(struct tps65910_regulator_pdata),
+ .plat_auto = sizeof(struct tps65910_regulator_pdata),
.ofdata_to_platdata = tps65910_regulator_ofdata_to_platdata,
};
.name = TPS65910_BUCK_DRIVER,
.id = UCLASS_REGULATOR,
.ops = &tps65910_buck_ops,
- .platdata_auto = sizeof(struct tps65910_regulator_pdata),
+ .plat_auto = sizeof(struct tps65910_regulator_pdata),
.ofdata_to_platdata = tps65910_regulator_ofdata_to_platdata,
};
.name = TPS65910_LDO_DRIVER,
.id = UCLASS_REGULATOR,
.ops = &tps65910_ldo_ops,
- .platdata_auto = sizeof(struct tps65910_regulator_pdata),
+ .plat_auto = sizeof(struct tps65910_regulator_pdata),
.ofdata_to_platdata = tps65910_regulator_ofdata_to_platdata,
};
{
int ret;
unsigned int adr;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
adr = uc_pdata->ctrl_reg;
ret = pmic_reg_read(dev->parent, adr);
{
unsigned int hex, adr;
int ret, delta, uwait, slew;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (op == PMIC_OP_GET)
*uV = 0;
{
int ret;
unsigned int adr;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
adr = uc_pdata->ctrl_reg;
ret = pmic_reg_read(dev->parent, adr);
{
unsigned int hex, adr;
int ret;
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (op == PMIC_OP_GET)
*uV = 0;
static int tps65941_ldo_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
int idx;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_LDO;
idx = dev->driver_data;
static int tps65941_buck_probe(struct udevice *dev)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
int idx;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->type = REGULATOR_TYPE_BUCK;
idx = dev->driver_data;
.ops = &imxrt_semc_ops,
.ofdata_to_platdata = imxrt_semc_ofdata_to_platdata,
.probe = imxrt_semc_probe,
- .platdata_auto = sizeof(struct imxrt_sdram_params),
+ .plat_auto = sizeof(struct imxrt_sdram_params),
};
.of_match = octeon_ids,
.ops = &octeon_ops,
.probe = octeon_ddr_probe,
- .platdata_auto = sizeof(struct ddr_priv),
+ .plat_auto = sizeof(struct ddr_priv),
};
.ofdata_to_platdata = rk3368_dmc_ofdata_to_platdata,
.probe = rk3368_dmc_probe,
.priv_auto = sizeof(struct dram_info),
- .platdata_auto = sizeof(struct rk3368_sdram_params),
+ .plat_auto = sizeof(struct rk3368_sdram_params),
};
.probe = rk3188_dmc_probe,
.priv_auto = sizeof(struct dram_info),
#ifdef CONFIG_SPL_BUILD
- .platdata_auto = sizeof(struct rk3188_sdram_params),
+ .plat_auto = sizeof(struct rk3188_sdram_params),
#endif
};
.probe = rk322x_dmc_probe,
.priv_auto = sizeof(struct dram_info),
#ifdef CONFIG_TPL_BUILD
- .platdata_auto = sizeof(struct rk322x_sdram_params),
+ .plat_auto = sizeof(struct rk322x_sdram_params),
#endif
};
.priv_auto = sizeof(struct dram_info),
#if defined(CONFIG_TPL_BUILD) || \
(!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD))
- .platdata_auto = sizeof(struct rk3288_sdram_params),
+ .plat_auto = sizeof(struct rk3288_sdram_params),
#endif
};
.probe = rk3328_dmc_probe,
.priv_auto = sizeof(struct dram_info),
#ifdef CONFIG_TPL_BUILD
- .platdata_auto = sizeof(struct rockchip_dmc_plat),
+ .plat_auto = sizeof(struct rockchip_dmc_plat),
#endif
};
.priv_auto = sizeof(struct dram_info),
#if defined(CONFIG_TPL_BUILD) || \
(!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD))
- .platdata_auto = sizeof(struct rockchip_dmc_plat),
+ .plat_auto = sizeof(struct rockchip_dmc_plat),
#endif
};
.probe = fu540_ddr_probe,
.priv_auto = sizeof(struct fu540_ddr_info),
#if defined(CONFIG_SPL_BUILD)
- .platdata_auto = sizeof(struct sifive_dmc_plat),
+ .plat_auto = sizeof(struct sifive_dmc_plat),
#endif
};
.ops = &stm32_fmc_ops,
.ofdata_to_platdata = stm32_fmc_ofdata_to_platdata,
.probe = stm32_fmc_probe,
- .platdata_auto = sizeof(struct stm32_sdram_params),
+ .plat_auto = sizeof(struct stm32_sdram_params),
};
ret = uclass_find_next_device(&dev)) {
if (ret || dev == skip_dev)
continue;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ret = fn(dev, uc_pdata, data);
if (ret)
return ret;
struct dm_rproc_uclass_pdata *uc_pdata;
const struct dm_rproc_ops *ops;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
/* See if we need to populate via fdt */
- if (!dev->platdata) {
+ if (!dev->plat) {
#if CONFIG_IS_ENABLED(OF_CONTROL)
int node = dev_of_offset(dev);
const void *blob = gd->fdt_blob;
#endif
} else {
- struct dm_rproc_uclass_pdata *pdata = dev->platdata;
+ struct dm_rproc_uclass_pdata *pdata = dev->plat;
debug("'%s': using legacy data\n", dev->name);
if (pdata->name)
.flags = DM_UC_FLAG_SEQ_ALIAS,
.pre_probe = rproc_pre_probe,
.post_probe = rproc_post_probe,
- .per_device_platdata_auto =
+ .per_device_plat_auto =
sizeof(struct dm_rproc_uclass_pdata),
};
return ret;
}
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ops = rproc_get_ops(dev);
if (!ops) {
return ret;
}
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ops = rproc_get_ops(dev);
if (!ops) {
struct sandbox_test_devdata *ddata;
int ret;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ddata = dev_get_priv(dev);
if (!ddata) {
debug("%s: platform private data missing\n", uc_pdata->name);
struct dm_rproc_uclass_pdata *uc_pdata;
int ret;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ret = sandbox_dev_move_to_state(dev, sb_init);
struct dm_rproc_uclass_pdata *uc_pdata;
int ret;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ret = sandbox_dev_move_to_state(dev, sb_reset);
struct dm_rproc_uclass_pdata *uc_pdata;
int ret;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ret = sandbox_dev_move_to_state(dev, sb_loaded);
struct dm_rproc_uclass_pdata *uc_pdata;
int ret;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ret = sandbox_dev_move_to_state(dev, sb_running);
struct dm_rproc_uclass_pdata *uc_pdata;
int ret;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ret = sandbox_dev_move_to_state(dev, sb_init);
struct sandbox_test_devdata *ddata;
int ret = 1;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ddata = dev_get_priv(dev);
if (ddata->current_state == sb_running)
struct sandbox_test_devdata *ddata;
int ret;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ddata = dev_get_priv(dev);
if (ddata->current_state == sb_running)
U_BOOT_DEVICE(proc_3_demo) = {
.name = "sandbox_test_proc",
- .platdata = &proc_3_test,
+ .plat = &proc_3_test,
};
struct ti_powerproc_privdata *priv;
int ret;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
priv = dev_get_priv(dev);
ret = ti_of_to_priv(dev, priv);
struct ti_powerproc_privdata *priv;
int ret;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (!uc_pdata) {
debug("%s: no uc pdata!\n", dev->name);
return -EINVAL;
struct ti_powerproc_privdata *priv;
int ret;
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
if (!uc_pdata) {
debug("%s: no uc pdata!\n", dev->name);
return -EINVAL;
.ops = &meson_rng_ops,
.probe = meson_rng_probe,
.remove = meson_rng_remove,
- .platdata_auto = sizeof(struct meson_rng_platdata),
+ .plat_auto = sizeof(struct meson_rng_platdata),
.ofdata_to_platdata = meson_rng_ofdata_to_platdata,
};
.ops = &stm32_rng_ops,
.probe = stm32_rng_probe,
.remove = stm32_rng_remove,
- .platdata_auto = sizeof(struct stm32_rng_platdata),
+ .plat_auto = sizeof(struct stm32_rng_platdata),
.ofdata_to_platdata = stm32_rng_ofdata_to_platdata,
};
.of_match = sandbox_i2c_rtc_ids,
.bind = sandbox_i2c_rtc_bind,
.priv_auto = sizeof(struct sandbox_i2c_rtc),
- .platdata_auto = sizeof(struct sandbox_i2c_rtc_plat_data),
+ .plat_auto = sizeof(struct sandbox_i2c_rtc_plat_data),
.ops = &sandbox_i2c_rtc_emul_ops,
};
static int pcf2127_rtc_read(struct udevice *dev, uint offset, u8 *buffer, uint len)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
struct i2c_msg msg;
int ret;
.of_match = pl031_ids,
.probe = pl031_probe,
.ofdata_to_platdata = pl031_ofdata_to_platdata,
- .platdata_auto = sizeof(struct pl031_platdata),
+ .plat_auto = sizeof(struct pl031_platdata),
.ops = &pl031_ops,
};
UCLASS_DRIVER(scsi) = {
.id = UCLASS_SCSI,
.name = "scsi",
- .per_device_platdata_auto = sizeof(struct scsi_platdata),
+ .per_device_plat_auto = sizeof(struct scsi_platdata),
};
static ulong scsi_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
void *buffer)
{
- struct blk_desc *block_dev = dev_get_uclass_platdata(dev);
+ struct blk_desc *block_dev = dev_get_uclass_plat(dev);
struct udevice *bdev = dev->parent;
- struct scsi_platdata *uc_plat = dev_get_uclass_platdata(bdev);
+ struct scsi_platdata *uc_plat = dev_get_uclass_plat(bdev);
lbaint_t start, blks, max_blks;
uintptr_t buf_addr;
unsigned short smallblks = 0;
static ulong scsi_write(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
const void *buffer)
{
- struct blk_desc *block_dev = dev_get_uclass_platdata(dev);
+ struct blk_desc *block_dev = dev_get_uclass_plat(dev);
struct udevice *bdev = dev->parent;
- struct scsi_platdata *uc_plat = dev_get_uclass_platdata(bdev);
+ struct scsi_platdata *uc_plat = dev_get_uclass_plat(bdev);
lbaint_t start, blks, max_blks;
uintptr_t buf_addr;
unsigned short smallblks;
return ret;
}
- bdesc = dev_get_uclass_platdata(bdev);
+ bdesc = dev_get_uclass_plat(bdev);
bdesc->target = id;
bdesc->lun = lun;
bdesc->removable = bd.removable;
int scsi_scan_dev(struct udevice *dev, bool verbose)
{
- struct scsi_platdata *uc_plat; /* scsi controller platdata */
+ struct scsi_platdata *uc_plat; /* scsi controller plat */
int ret;
int i;
int lun;
if (ret)
return ret;
- /* Get controller platdata */
- uc_plat = dev_get_uclass_platdata(dev);
+ /* Get controller plat */
+ uc_plat = dev_get_uclass_plat(dev);
for (i = 0; i < uc_plat->max_id; i++)
for (lun = 0; lun < uc_plat->max_lun; lun++)
static int altera_jtaguart_putc(struct udevice *dev, const char ch)
{
- struct altera_jtaguart_platdata *plat = dev->platdata;
+ struct altera_jtaguart_platdata *plat = dev->plat;
struct altera_jtaguart_regs *const regs = plat->regs;
u32 st = readl(®s->control);
static int altera_jtaguart_pending(struct udevice *dev, bool input)
{
- struct altera_jtaguart_platdata *plat = dev->platdata;
+ struct altera_jtaguart_platdata *plat = dev->plat;
struct altera_jtaguart_regs *const regs = plat->regs;
u32 st = readl(®s->control);
static int altera_jtaguart_getc(struct udevice *dev)
{
- struct altera_jtaguart_platdata *plat = dev->platdata;
+ struct altera_jtaguart_platdata *plat = dev->plat;
struct altera_jtaguart_regs *const regs = plat->regs;
u32 val;
static int altera_jtaguart_probe(struct udevice *dev)
{
#ifdef CONFIG_ALTERA_JTAG_UART_BYPASS
- struct altera_jtaguart_platdata *plat = dev->platdata;
+ struct altera_jtaguart_platdata *plat = dev->plat;
struct altera_jtaguart_regs *const regs = plat->regs;
writel(ALTERA_JTAG_AC, ®s->control); /* clear AC flag */
.id = UCLASS_SERIAL,
.of_match = altera_jtaguart_ids,
.ofdata_to_platdata = altera_jtaguart_ofdata_to_platdata,
- .platdata_auto = sizeof(struct altera_jtaguart_platdata),
+ .plat_auto = sizeof(struct altera_jtaguart_platdata),
.probe = altera_jtaguart_probe,
.ops = &altera_jtaguart_ops,
};
static int altera_uart_setbrg(struct udevice *dev, int baudrate)
{
- struct altera_uart_platdata *plat = dev->platdata;
+ struct altera_uart_platdata *plat = dev->plat;
struct altera_uart_regs *const regs = plat->regs;
u32 div;
static int altera_uart_putc(struct udevice *dev, const char ch)
{
- struct altera_uart_platdata *plat = dev->platdata;
+ struct altera_uart_platdata *plat = dev->plat;
struct altera_uart_regs *const regs = plat->regs;
if (!(readl(®s->status) & ALTERA_UART_TRDY))
static int altera_uart_pending(struct udevice *dev, bool input)
{
- struct altera_uart_platdata *plat = dev->platdata;
+ struct altera_uart_platdata *plat = dev->plat;
struct altera_uart_regs *const regs = plat->regs;
u32 st = readl(®s->status);
static int altera_uart_getc(struct udevice *dev)
{
- struct altera_uart_platdata *plat = dev->platdata;
+ struct altera_uart_platdata *plat = dev->plat;
struct altera_uart_regs *const regs = plat->regs;
if (!(readl(®s->status) & ALTERA_UART_RRDY))
.id = UCLASS_SERIAL,
.of_match = altera_uart_ids,
.ofdata_to_platdata = altera_uart_ofdata_to_platdata,
- .platdata_auto = sizeof(struct altera_uart_platdata),
+ .plat_auto = sizeof(struct altera_uart_platdata),
.probe = altera_uart_probe,
.ops = &altera_uart_ops,
};
static int atmel_serial_probe(struct udevice *dev)
{
- struct atmel_serial_platdata *plat = dev->platdata;
+ struct atmel_serial_platdata *plat = dev->plat;
struct atmel_serial_priv *priv = dev_get_priv(dev);
int ret;
#if CONFIG_IS_ENABLED(OF_CONTROL)
.id = UCLASS_SERIAL,
#if CONFIG_IS_ENABLED(OF_CONTROL)
.of_match = atmel_serial_ids,
- .platdata_auto = sizeof(struct atmel_serial_platdata),
+ .plat_auto = sizeof(struct atmel_serial_platdata),
#endif
.probe = atmel_serial_probe,
.ops = &atmel_serial_ops,
static int lpc32xx_hsuart_probe(struct udevice *dev)
{
- struct lpc32xx_hsuart_platdata *platdata = dev_get_platdata(dev);
+ struct lpc32xx_hsuart_platdata *plat = dev_get_platdata(dev);
struct lpc32xx_hsuart_priv *priv = dev_get_priv(dev);
- priv->hsuart = (struct hsuart_regs *)platdata->base;
+ priv->hsuart = (struct hsuart_regs *)plat->base;
lpc32xx_serial_init(priv->hsuart);
int ns16550_serial_probe(struct udevice *dev)
{
- struct ns16550_platdata *plat = dev->platdata;
+ struct ns16550_platdata *plat = dev->plat;
struct NS16550 *const com_port = dev_get_priv(dev);
struct reset_ctl_bulk reset_bulk;
fdt_addr_t addr;
/*
* If we are on PCI bus, either directly attached to a PCI root port,
- * or via a PCI bridge, assign platdata->base before probing hardware.
+ * or via a PCI bridge, assign plat->base before probing hardware.
*/
if (device_is_on_pci_bus(dev)) {
addr = devfdt_get_addr_pci(dev);
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
{
- struct ns16550_platdata *plat = dev->platdata;
+ struct ns16550_platdata *plat = dev->plat;
const u32 port_type = dev_get_driver_data(dev);
fdt_addr_t addr;
struct clk clk;
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
.of_match = ns16550_serial_ids,
.ofdata_to_platdata = ns16550_serial_ofdata_to_platdata,
- .platdata_auto = sizeof(struct ns16550_platdata),
+ .plat_auto = sizeof(struct ns16550_platdata),
#endif
.priv_auto = sizeof(struct NS16550),
.probe = ns16550_serial_probe,
static int sandbox_serial_remove(struct udevice *dev)
{
- struct sandbox_serial_platdata *plat = dev->platdata;
+ struct sandbox_serial_platdata *plat = dev->plat;
if (plat->colour != -1)
output_ansi_reset();
static int sandbox_serial_putc(struct udevice *dev, const char ch)
{
struct sandbox_serial_priv *priv = dev_get_priv(dev);
- struct sandbox_serial_platdata *plat = dev->platdata;
+ struct sandbox_serial_platdata *plat = dev->plat;
/* With of-platdata we don't real the colour correctly, so disable it */
if (!CONFIG_IS_ENABLED(OF_PLATDATA) && priv->start_of_line &&
static int sandbox_serial_ofdata_to_platdata(struct udevice *dev)
{
- struct sandbox_serial_platdata *plat = dev->platdata;
+ struct sandbox_serial_platdata *plat = dev->plat;
const char *colour;
int i;
.id = UCLASS_SERIAL,
.of_match = sandbox_serial_ids,
.ofdata_to_platdata = sandbox_serial_ofdata_to_platdata,
- .platdata_auto = sizeof(struct sandbox_serial_platdata),
+ .plat_auto = sizeof(struct sandbox_serial_platdata),
.priv_auto = sizeof(struct sandbox_serial_priv),
.probe = sandbox_serial_probe,
.remove = sandbox_serial_remove,
U_BOOT_DEVICE(serial_sandbox_non_fdt) = {
.name = "sandbox_serial",
- .platdata = &platdata_non_fdt,
+ .plat = &platdata_non_fdt,
};
#endif
static int arc_serial_setbrg(struct udevice *dev, int baudrate)
{
- struct arc_serial_platdata *plat = dev->platdata;
+ struct arc_serial_platdata *plat = dev->plat;
struct arc_serial_regs *const regs = plat->reg;
int arc_console_baud = gd->cpu_clk / (baudrate * 4) - 1;
static int arc_serial_putc(struct udevice *dev, const char c)
{
- struct arc_serial_platdata *plat = dev->platdata;
+ struct arc_serial_platdata *plat = dev->plat;
struct arc_serial_regs *const regs = plat->reg;
while (!(readb(®s->status) & UART_TXEMPTY))
static int arc_serial_pending(struct udevice *dev, bool input)
{
- struct arc_serial_platdata *plat = dev->platdata;
+ struct arc_serial_platdata *plat = dev->plat;
struct arc_serial_regs *const regs = plat->reg;
uint32_t status = readb(®s->status);
static int arc_serial_getc(struct udevice *dev)
{
- struct arc_serial_platdata *plat = dev->platdata;
+ struct arc_serial_platdata *plat = dev->plat;
struct arc_serial_regs *const regs = plat->reg;
while (!arc_serial_tstc(regs))
.id = UCLASS_SERIAL,
.of_match = arc_serial_ids,
.ofdata_to_platdata = arc_serial_ofdata_to_platdata,
- .platdata_auto = sizeof(struct arc_serial_platdata),
+ .plat_auto = sizeof(struct arc_serial_platdata),
.probe = arc_serial_probe,
.ops = &arc_serial_ops,
};
.name = "serial_bcm283x_mu",
.id = UCLASS_SERIAL,
.of_match = of_match_ptr(bcm283x_mu_serial_id),
- .platdata_auto = sizeof(struct bcm283x_mu_serial_platdata),
+ .plat_auto = sizeof(struct bcm283x_mu_serial_platdata),
.probe = bcm283x_mu_serial_probe,
.ops = &bcm283x_mu_serial_ops,
#if !CONFIG_IS_ENABLED(OF_CONTROL) || CONFIG_IS_ENABLED(OF_BOARD)
.id = UCLASS_SERIAL,
.of_match = of_match_ptr(bcm283x_pl011_serial_id),
.probe = bcm283x_pl011_serial_probe,
- .platdata_auto = sizeof(struct pl01x_serial_platdata),
+ .plat_auto = sizeof(struct pl01x_serial_platdata),
.ops = &bcm283x_pl011_serial_ops,
#if !CONFIG_IS_ENABLED(OF_CONTROL) || CONFIG_IS_ENABLED(OF_BOARD)
.flags = DM_FLAG_PRE_RELOC,
.id = UCLASS_SERIAL,
.of_match = coreboot_serial_ids,
.priv_auto = sizeof(struct NS16550),
- .platdata_auto = sizeof(struct ns16550_platdata),
+ .plat_auto = sizeof(struct ns16550_platdata),
.ofdata_to_platdata = coreboot_ofdata_to_platdata,
.probe = ns16550_serial_probe,
.ops = &ns16550_serial_ops,
.id = UCLASS_SERIAL,
.of_match = mid_serial_ids,
.ofdata_to_platdata = ns16550_serial_ofdata_to_platdata,
- .platdata_auto = sizeof(struct ns16550_platdata),
+ .plat_auto = sizeof(struct ns16550_platdata),
.priv_auto = sizeof(struct NS16550),
.probe = mid_serial_probe,
.ops = &ns16550_serial_ops,
static int linflex_serial_probe(struct udevice *dev)
{
- struct linflex_serial_platdata *plat = dev->platdata;
+ struct linflex_serial_platdata *plat = dev->plat;
struct linflex_serial_priv *priv = dev_get_priv(dev);
priv->lfuart = (struct linflex_fsl *)plat->base_addr;
static bool is_lpuart32(struct udevice *dev)
{
- struct lpuart_serial_platdata *plat = dev->platdata;
+ struct lpuart_serial_platdata *plat = dev->plat;
return plat->flags & LPUART_FLAG_REGMAP_32BIT_REG;
}
static int lpuart_serial_getc(struct udevice *dev)
{
- struct lpuart_serial_platdata *plat = dev->platdata;
+ struct lpuart_serial_platdata *plat = dev->plat;
if (is_lpuart32(dev))
return _lpuart32_serial_getc(plat);
static int lpuart_serial_putc(struct udevice *dev, const char c)
{
- struct lpuart_serial_platdata *plat = dev->platdata;
+ struct lpuart_serial_platdata *plat = dev->plat;
if (is_lpuart32(dev))
_lpuart32_serial_putc(plat, c);
static int lpuart_serial_pending(struct udevice *dev, bool input)
{
- struct lpuart_serial_platdata *plat = dev->platdata;
+ struct lpuart_serial_platdata *plat = dev->plat;
struct lpuart_fsl *reg = plat->reg;
struct lpuart_fsl_reg32 *reg32 = plat->reg;
u32 stat;
static int lpuart_serial_ofdata_to_platdata(struct udevice *dev)
{
- struct lpuart_serial_platdata *plat = dev->platdata;
+ struct lpuart_serial_platdata *plat = dev->plat;
const void *blob = gd->fdt_blob;
int node = dev_of_offset(dev);
fdt_addr_t addr;
.id = UCLASS_SERIAL,
.of_match = lpuart_serial_ids,
.ofdata_to_platdata = lpuart_serial_ofdata_to_platdata,
- .platdata_auto = sizeof(struct lpuart_serial_platdata),
+ .plat_auto = sizeof(struct lpuart_serial_platdata),
.probe = lpuart_serial_probe,
.ops = &lpuart_serial_ops,
};
static int coldfire_serial_probe(struct udevice *dev)
{
- struct coldfire_serial_platdata *plat = dev->platdata;
+ struct coldfire_serial_platdata *plat = dev->plat;
plat->port = dev->seq;
static int coldfire_serial_putc(struct udevice *dev, const char ch)
{
- struct coldfire_serial_platdata *plat = dev->platdata;
+ struct coldfire_serial_platdata *plat = dev->plat;
uart_t *uart = (uart_t *)plat->base;
/* Wait for last character to go. */
static int coldfire_serial_getc(struct udevice *dev)
{
- struct coldfire_serial_platdata *plat = dev->platdata;
+ struct coldfire_serial_platdata *plat = dev->plat;
uart_t *uart = (uart_t *)(plat->base);
/* Wait for a character to arrive. */
int coldfire_serial_setbrg(struct udevice *dev, int baudrate)
{
- struct coldfire_serial_platdata *plat = dev->platdata;
+ struct coldfire_serial_platdata *plat = dev->plat;
uart_t *uart = (uart_t *)(plat->base);
mcf_serial_setbrg_common(uart, baudrate);
static int coldfire_serial_pending(struct udevice *dev, bool input)
{
- struct coldfire_serial_platdata *plat = dev->platdata;
+ struct coldfire_serial_platdata *plat = dev->plat;
uart_t *uart = (uart_t *)(plat->base);
if (input)
.id = UCLASS_SERIAL,
.of_match = coldfire_serial_ids,
.ofdata_to_platdata = coldfire_ofdata_to_platdata,
- .platdata_auto = sizeof(struct coldfire_serial_platdata),
+ .plat_auto = sizeof(struct coldfire_serial_platdata),
.probe = coldfire_serial_probe,
.ops = &coldfire_serial_ops,
.flags = DM_FLAG_PRE_RELOC,
static int meson_serial_probe(struct udevice *dev)
{
- struct meson_serial_platdata *plat = dev->platdata;
+ struct meson_serial_platdata *plat = dev->plat;
struct meson_uart *const uart = plat->reg;
meson_serial_init(uart);
static void meson_serial_rx_error(struct udevice *dev)
{
- struct meson_serial_platdata *plat = dev->platdata;
+ struct meson_serial_platdata *plat = dev->plat;
struct meson_uart *const uart = plat->reg;
u32 val = readl(&uart->control);
static int meson_serial_getc(struct udevice *dev)
{
- struct meson_serial_platdata *plat = dev->platdata;
+ struct meson_serial_platdata *plat = dev->plat;
struct meson_uart *const uart = plat->reg;
uint32_t status = readl(&uart->status);
static int meson_serial_putc(struct udevice *dev, const char ch)
{
- struct meson_serial_platdata *plat = dev->platdata;
+ struct meson_serial_platdata *plat = dev->plat;
struct meson_uart *const uart = plat->reg;
if (readl(&uart->status) & AML_UART_TX_FULL)
static int meson_serial_pending(struct udevice *dev, bool input)
{
- struct meson_serial_platdata *plat = dev->platdata;
+ struct meson_serial_platdata *plat = dev->plat;
struct meson_uart *const uart = plat->reg;
uint32_t status = readl(&uart->status);
static int meson_serial_ofdata_to_platdata(struct udevice *dev)
{
- struct meson_serial_platdata *plat = dev->platdata;
+ struct meson_serial_platdata *plat = dev->plat;
fdt_addr_t addr;
addr = dev_read_addr(dev);
.probe = meson_serial_probe,
.ops = &meson_serial_ops,
.ofdata_to_platdata = meson_serial_ofdata_to_platdata,
- .platdata_auto = sizeof(struct meson_serial_platdata),
+ .plat_auto = sizeof(struct meson_serial_platdata),
};
#ifdef CONFIG_DEBUG_UART_MESON
.id = UCLASS_SERIAL,
.of_match = mvebu_serial_ids,
.ofdata_to_platdata = mvebu_serial_ofdata_to_platdata,
- .platdata_auto = sizeof(struct mvebu_platdata),
+ .plat_auto = sizeof(struct mvebu_platdata),
.probe = mvebu_serial_probe,
.ops = &mvebu_serial_ops,
};
int mxc_serial_setbrg(struct udevice *dev, int baudrate)
{
- struct mxc_serial_platdata *plat = dev->platdata;
+ struct mxc_serial_platdata *plat = dev->plat;
u32 clk = imx_get_uartclk();
_mxc_serial_setbrg(plat->reg, clk, baudrate, plat->use_dte);
static int mxc_serial_probe(struct udevice *dev)
{
- struct mxc_serial_platdata *plat = dev->platdata;
+ struct mxc_serial_platdata *plat = dev->plat;
_mxc_serial_init(plat->reg, plat->use_dte);
static int mxc_serial_getc(struct udevice *dev)
{
- struct mxc_serial_platdata *plat = dev->platdata;
+ struct mxc_serial_platdata *plat = dev->plat;
struct mxc_uart *const uart = plat->reg;
if (readl(&uart->ts) & UTS_RXEMPTY)
static int mxc_serial_putc(struct udevice *dev, const char ch)
{
- struct mxc_serial_platdata *plat = dev->platdata;
+ struct mxc_serial_platdata *plat = dev->plat;
struct mxc_uart *const uart = plat->reg;
if (!(readl(&uart->ts) & UTS_TXEMPTY))
static int mxc_serial_pending(struct udevice *dev, bool input)
{
- struct mxc_serial_platdata *plat = dev->platdata;
+ struct mxc_serial_platdata *plat = dev->plat;
struct mxc_uart *const uart = plat->reg;
uint32_t sr2 = readl(&uart->sr2);
#if CONFIG_IS_ENABLED(OF_CONTROL)
static int mxc_serial_ofdata_to_platdata(struct udevice *dev)
{
- struct mxc_serial_platdata *plat = dev->platdata;
+ struct mxc_serial_platdata *plat = dev->plat;
fdt_addr_t addr;
addr = dev_read_addr(dev);
#if CONFIG_IS_ENABLED(OF_CONTROL)
.of_match = mxc_serial_ids,
.ofdata_to_platdata = mxc_serial_ofdata_to_platdata,
- .platdata_auto = sizeof(struct mxc_serial_platdata),
+ .plat_auto = sizeof(struct mxc_serial_platdata),
#endif
.probe = mxc_serial_probe,
.ops = &mxc_serial_ops,
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
static int omap_serial_ofdata_to_platdata(struct udevice *dev)
{
- struct ns16550_platdata *plat = dev->platdata;
+ struct ns16550_platdata *plat = dev->plat;
fdt_addr_t addr;
struct clk clk;
int err;
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
.of_match = omap_serial_ids,
.ofdata_to_platdata = omap_serial_ofdata_to_platdata,
- .platdata_auto = sizeof(struct ns16550_platdata),
+ .plat_auto = sizeof(struct ns16550_platdata),
#endif
.priv_auto = sizeof(struct NS16550),
.probe = ns16550_serial_probe,
.id = UCLASS_SERIAL,
.of_match = of_match_ptr(pl01x_serial_id),
.ofdata_to_platdata = of_match_ptr(pl01x_serial_ofdata_to_platdata),
- .platdata_auto = sizeof(struct pl01x_serial_platdata),
+ .plat_auto = sizeof(struct pl01x_serial_platdata),
.probe = pl01x_serial_probe,
.ops = &pl01x_serial_ops,
.flags = DM_FLAG_PRE_RELOC,
#ifdef CONFIG_DM_SERIAL
static int pxa_serial_probe(struct udevice *dev)
{
- struct pxa_serial_platdata *plat = dev->platdata;
+ struct pxa_serial_platdata *plat = dev->plat;
pxa_setbrg_common((struct pxa_uart_regs *)plat->base, plat->port,
plat->baudrate);
static int pxa_serial_putc(struct udevice *dev, const char ch)
{
- struct pxa_serial_platdata *plat = dev->platdata;
+ struct pxa_serial_platdata *plat = dev->plat;
struct pxa_uart_regs *uart_regs = (struct pxa_uart_regs *)plat->base;
/* Wait for last character to go. */
static int pxa_serial_getc(struct udevice *dev)
{
- struct pxa_serial_platdata *plat = dev->platdata;
+ struct pxa_serial_platdata *plat = dev->plat;
struct pxa_uart_regs *uart_regs = (struct pxa_uart_regs *)plat->base;
/* Wait for a character to arrive. */
int pxa_serial_setbrg(struct udevice *dev, int baudrate)
{
- struct pxa_serial_platdata *plat = dev->platdata;
+ struct pxa_serial_platdata *plat = dev->plat;
struct pxa_uart_regs *uart_regs = (struct pxa_uart_regs *)plat->base;
int port = plat->port;
static int pxa_serial_pending(struct udevice *dev, bool input)
{
- struct pxa_serial_platdata *plat = dev->platdata;
+ struct pxa_serial_platdata *plat = dev->plat;
struct pxa_uart_regs *uart_regs = (struct pxa_uart_regs *)plat->base;
if (input)
plat->plat.reg_shift = plat->dtplat.reg_shift;
plat->plat.clock = plat->dtplat.clock_frequency;
plat->plat.fcr = UART_FCR_DEFVAL;
- dev->platdata = &plat->plat;
+ dev->plat = &plat->plat;
return ns16550_serial_probe(dev);
}
.name = "rockchip_rk3188_uart",
.id = UCLASS_SERIAL,
.priv_auto = sizeof(struct NS16550),
- .platdata_auto = sizeof(struct rockchip_uart_platdata),
+ .plat_auto = sizeof(struct rockchip_uart_platdata),
.probe = rockchip_serial_probe,
.ops = &ns16550_serial_ops,
.flags = DM_FLAG_PRE_RELOC,
.name = "rockchip_rk3288_uart",
.id = UCLASS_SERIAL,
.priv_auto = sizeof(struct NS16550),
- .platdata_auto = sizeof(struct rockchip_uart_platdata),
+ .plat_auto = sizeof(struct rockchip_uart_platdata),
.probe = rockchip_serial_probe,
.ops = &ns16550_serial_ops,
.flags = DM_FLAG_PRE_RELOC,
#ifndef CONFIG_SPL_BUILD
int s5p_serial_setbrg(struct udevice *dev, int baudrate)
{
- struct s5p_serial_platdata *plat = dev->platdata;
+ struct s5p_serial_platdata *plat = dev->plat;
struct s5p_uart *const uart = plat->reg;
u32 uclk;
static int s5p_serial_probe(struct udevice *dev)
{
- struct s5p_serial_platdata *plat = dev->platdata;
+ struct s5p_serial_platdata *plat = dev->plat;
struct s5p_uart *const uart = plat->reg;
s5p_serial_init(uart);
static int s5p_serial_getc(struct udevice *dev)
{
- struct s5p_serial_platdata *plat = dev->platdata;
+ struct s5p_serial_platdata *plat = dev->plat;
struct s5p_uart *const uart = plat->reg;
if (!(readl(&uart->ufstat) & RX_FIFO_COUNT_MASK))
static int s5p_serial_putc(struct udevice *dev, const char ch)
{
- struct s5p_serial_platdata *plat = dev->platdata;
+ struct s5p_serial_platdata *plat = dev->plat;
struct s5p_uart *const uart = plat->reg;
if (readl(&uart->ufstat) & TX_FIFO_FULL)
static int s5p_serial_pending(struct udevice *dev, bool input)
{
- struct s5p_serial_platdata *plat = dev->platdata;
+ struct s5p_serial_platdata *plat = dev->plat;
struct s5p_uart *const uart = plat->reg;
uint32_t ufstat = readl(&uart->ufstat);
static int s5p_serial_ofdata_to_platdata(struct udevice *dev)
{
- struct s5p_serial_platdata *plat = dev->platdata;
+ struct s5p_serial_platdata *plat = dev->plat;
fdt_addr_t addr;
addr = dev_read_addr(dev);
.id = UCLASS_SERIAL,
.of_match = s5p_serial_ids,
.ofdata_to_platdata = s5p_serial_ofdata_to_platdata,
- .platdata_auto = sizeof(struct s5p_serial_platdata),
+ .plat_auto = sizeof(struct s5p_serial_platdata),
.probe = s5p_serial_probe,
.ops = &s5p_serial_ops,
};
.id = UCLASS_SERIAL,
.of_match = of_match_ptr(sh_serial_id),
.ofdata_to_platdata = of_match_ptr(sh_serial_ofdata_to_platdata),
- .platdata_auto = sizeof(struct sh_serial_platdata),
+ .plat_auto = sizeof(struct sh_serial_platdata),
.probe = sh_serial_probe,
.ops = &sh_serial_ops,
#if !CONFIG_IS_ENABLED(OF_CONTROL)
{
int ret;
struct clk clk;
- struct sifive_uart_platdata *platdata = dev_get_platdata(dev);
+ struct sifive_uart_platdata *plat = dev_get_platdata(dev);
u32 clock = 0;
ret = clk_get_by_index(dev, 0, &clk);
return 0;
}
}
- platdata->clock = clock;
- _sifive_serial_setbrg(platdata->regs, platdata->clock, baudrate);
+ plat->clock = clock;
+ _sifive_serial_setbrg(plat->regs, plat->clock, baudrate);
return 0;
}
static int sifive_serial_probe(struct udevice *dev)
{
- struct sifive_uart_platdata *platdata = dev_get_platdata(dev);
+ struct sifive_uart_platdata *plat = dev_get_platdata(dev);
/* No need to reinitialize the UART after relocation */
if (gd->flags & GD_FLG_RELOC)
return 0;
- _sifive_serial_init(platdata->regs);
+ _sifive_serial_init(plat->regs);
return 0;
}
static int sifive_serial_getc(struct udevice *dev)
{
int c;
- struct sifive_uart_platdata *platdata = dev_get_platdata(dev);
- struct uart_sifive *regs = platdata->regs;
+ struct sifive_uart_platdata *plat = dev_get_platdata(dev);
+ struct uart_sifive *regs = plat->regs;
while ((c = _sifive_serial_getc(regs)) == -EAGAIN) ;
static int sifive_serial_putc(struct udevice *dev, const char ch)
{
int rc;
- struct sifive_uart_platdata *platdata = dev_get_platdata(dev);
+ struct sifive_uart_platdata *plat = dev_get_platdata(dev);
- while ((rc = _sifive_serial_putc(platdata->regs, ch)) == -EAGAIN) ;
+ while ((rc = _sifive_serial_putc(plat->regs, ch)) == -EAGAIN) ;
return rc;
}
static int sifive_serial_pending(struct udevice *dev, bool input)
{
- struct sifive_uart_platdata *platdata = dev_get_platdata(dev);
- struct uart_sifive *regs = platdata->regs;
+ struct sifive_uart_platdata *plat = dev_get_platdata(dev);
+ struct uart_sifive *regs = plat->regs;
if (input)
return (readl(®s->ip) & UART_IP_RXWM);
static int sifive_serial_ofdata_to_platdata(struct udevice *dev)
{
- struct sifive_uart_platdata *platdata = dev_get_platdata(dev);
+ struct sifive_uart_platdata *plat = dev_get_platdata(dev);
- platdata->regs = (struct uart_sifive *)dev_read_addr(dev);
- if (IS_ERR(platdata->regs))
- return PTR_ERR(platdata->regs);
+ plat->regs = (struct uart_sifive *)dev_read_addr(dev);
+ if (IS_ERR(plat->regs))
+ return PTR_ERR(plat->regs);
return 0;
}
.id = UCLASS_SERIAL,
.of_match = sifive_serial_ids,
.ofdata_to_platdata = sifive_serial_ofdata_to_platdata,
- .platdata_auto = sizeof(struct sifive_uart_platdata),
+ .plat_auto = sizeof(struct sifive_uart_platdata),
.probe = sifive_serial_probe,
.ops = &sifive_serial_ops,
};
.id = UCLASS_SERIAL,
.of_match = of_match_ptr(stm32_serial_id),
.ofdata_to_platdata = of_match_ptr(stm32_serial_ofdata_to_platdata),
- .platdata_auto = sizeof(struct stm32x7_serial_platdata),
+ .plat_auto = sizeof(struct stm32x7_serial_platdata),
.ops = &stm32_serial_ops,
.probe = stm32_serial_probe,
#if !CONFIG_IS_ENABLED(OF_CONTROL)
.id = UCLASS_SERIAL,
.of_match = uartlite_serial_ids,
.ofdata_to_platdata = uartlite_serial_ofdata_to_platdata,
- .platdata_auto = sizeof(struct uartlite_platdata),
+ .plat_auto = sizeof(struct uartlite_platdata),
.probe = uartlite_serial_probe,
.ops = &uartlite_serial_ops,
};
static int zynq_serial_setbrg(struct udevice *dev, int baudrate)
{
- struct zynq_uart_platdata *platdata = dev_get_platdata(dev);
+ struct zynq_uart_platdata *plat = dev_get_platdata(dev);
unsigned long clock;
int ret;
return ret;
}
- _uart_zynq_serial_setbrg(platdata->regs, clock, baudrate);
+ _uart_zynq_serial_setbrg(plat->regs, clock, baudrate);
return 0;
}
static int zynq_serial_probe(struct udevice *dev)
{
- struct zynq_uart_platdata *platdata = dev_get_platdata(dev);
- struct uart_zynq *regs = platdata->regs;
+ struct zynq_uart_platdata *plat = dev_get_platdata(dev);
+ struct uart_zynq *regs = plat->regs;
u32 val;
/* No need to reinitialize the UART if TX already enabled */
if (val & ZYNQ_UART_CR_TX_EN)
return 0;
- _uart_zynq_serial_init(platdata->regs);
+ _uart_zynq_serial_init(plat->regs);
return 0;
}
static int zynq_serial_getc(struct udevice *dev)
{
- struct zynq_uart_platdata *platdata = dev_get_platdata(dev);
- struct uart_zynq *regs = platdata->regs;
+ struct zynq_uart_platdata *plat = dev_get_platdata(dev);
+ struct uart_zynq *regs = plat->regs;
if (readl(®s->channel_sts) & ZYNQ_UART_SR_RXEMPTY)
return -EAGAIN;
static int zynq_serial_putc(struct udevice *dev, const char ch)
{
- struct zynq_uart_platdata *platdata = dev_get_platdata(dev);
+ struct zynq_uart_platdata *plat = dev_get_platdata(dev);
- return _uart_zynq_serial_putc(platdata->regs, ch);
+ return _uart_zynq_serial_putc(plat->regs, ch);
}
static int zynq_serial_pending(struct udevice *dev, bool input)
{
- struct zynq_uart_platdata *platdata = dev_get_platdata(dev);
- struct uart_zynq *regs = platdata->regs;
+ struct zynq_uart_platdata *plat = dev_get_platdata(dev);
+ struct uart_zynq *regs = plat->regs;
if (input)
return !(readl(®s->channel_sts) & ZYNQ_UART_SR_RXEMPTY);
static int zynq_serial_ofdata_to_platdata(struct udevice *dev)
{
- struct zynq_uart_platdata *platdata = dev_get_platdata(dev);
+ struct zynq_uart_platdata *plat = dev_get_platdata(dev);
- platdata->regs = (struct uart_zynq *)dev_read_addr(dev);
- if (IS_ERR(platdata->regs))
- return PTR_ERR(platdata->regs);
+ plat->regs = (struct uart_zynq *)dev_read_addr(dev);
+ if (IS_ERR(plat->regs))
+ return PTR_ERR(plat->regs);
return 0;
}
.id = UCLASS_SERIAL,
.of_match = zynq_serial_ids,
.ofdata_to_platdata = zynq_serial_ofdata_to_platdata,
- .platdata_auto = sizeof(struct zynq_uart_platdata),
+ .plat_auto = sizeof(struct zynq_uart_platdata),
.probe = zynq_serial_probe,
.ops = &zynq_serial_ops,
};
.ops = &soc_ti_k3_ops,
.of_match = soc_ti_k3_ids,
.probe = soc_ti_k3_probe,
- .platdata_auto = sizeof(struct soc_ti_k3_platdata),
+ .plat_auto = sizeof(struct soc_ti_k3_platdata),
};
dm_pci_clrset_config32(dev, 0xd0, 1U << 31, 0);
/* Additional step on Panther Point */
- plat = dev_get_parent_platdata(dev);
+ plat = dev_get_parent_plat(dev);
if (plat->device == PCI_DEVICE_ID_INTEL_PANTHERPOINT_HDA)
dm_pci_clrset_config32(dev, 0xc4, 0, 1 << 17);
struct udevice *bus = dev->parent;
struct altera_spi_priv *priv = dev_get_priv(bus);
struct altera_spi_regs *const regs = priv->regs;
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
/* assume spi core configured to do 8 bit transfers */
unsigned int bytes = bitlen / 8;
.of_match = altera_spi_ids,
.ops = &altera_spi_ops,
.ofdata_to_platdata = altera_spi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct altera_spi_platdata),
+ .plat_auto = sizeof(struct altera_spi_platdata),
.priv_auto = sizeof(struct altera_spi_priv),
.probe = altera_spi_probe,
};
static int atcspi200_spi_claim_bus(struct udevice *dev)
{
struct dm_spi_slave_platdata *slave_plat =
- dev_get_parent_platdata(dev);
+ dev_get_parent_plat(dev);
struct udevice *bus = dev->parent;
struct nds_spi_slave *ns = dev_get_priv(bus);
{
struct udevice *bus = dev_get_parent(dev);
struct ath79_spi_priv *priv = dev_get_priv(bus);
- struct dm_spi_slave_platdata *slave = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave = dev_get_parent_plat(dev);
u8 *rx = din;
const u8 *tx = dout;
u8 curbyte, curbitlen, restbits;
struct udevice *bus = dev_get_parent(dev);
struct atmel_spi_platdata *bus_plat = dev_get_platdata(bus);
struct atmel_spi_priv *priv = dev_get_priv(bus);
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
struct at91_spi *reg_base = bus_plat->regs;
u32 cs = slave_plat->cs;
u32 freq = priv->freq;
#if CONFIG_IS_ENABLED(DM_GPIO)
struct udevice *bus = dev_get_parent(dev);
struct atmel_spi_priv *priv = dev_get_priv(bus);
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
u32 cs = slave_plat->cs;
if (!dm_gpio_is_valid(&priv->cs_gpios[cs]))
#if CONFIG_IS_ENABLED(DM_GPIO)
struct udevice *bus = dev_get_parent(dev);
struct atmel_spi_priv *priv = dev_get_priv(bus);
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
u32 cs = slave_plat->cs;
if (!dm_gpio_is_valid(&priv->cs_gpios[cs]))
.id = UCLASS_SPI,
.of_match = atmel_spi_ids,
.ops = &atmel_spi_ops,
- .platdata_auto = sizeof(struct atmel_spi_platdata),
+ .plat_auto = sizeof(struct atmel_spi_platdata),
.priv_auto = sizeof(struct atmel_spi_priv),
.probe = atmel_spi_probe,
};
const void *dout, void *din, unsigned long flags)
{
struct bcm63xx_hsspi_priv *priv = dev_get_priv(dev->parent);
- struct dm_spi_slave_platdata *plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *plat = dev_get_parent_plat(dev);
size_t data_bytes = bitlen / 8;
size_t step_size = HSSPI_FIFO_SIZE;
uint16_t opcode = 0;
static int bcm63xx_hsspi_child_pre_probe(struct udevice *dev)
{
struct bcm63xx_hsspi_priv *priv = dev_get_priv(dev->parent);
- struct dm_spi_slave_platdata *plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *plat = dev_get_parent_plat(dev);
/* check cs */
if (plat->cs >= priv->num_cs) {
if (flags & SPI_XFER_END) {
struct dm_spi_slave_platdata *plat =
- dev_get_parent_platdata(dev);
+ dev_get_parent_plat(dev);
uint16_t val, cmd;
int ret;
struct bcm63xx_spi_priv *priv = dev_get_priv(dev->parent);
const unsigned long *regs = priv->regs;
struct spi_slave *slave = dev_get_parent_priv(dev);
- struct dm_spi_slave_platdata *plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *plat = dev_get_parent_plat(dev);
/* check cs */
if (plat->cs >= priv->num_cs) {
.ops = &bcmstb_spi_ops,
.ofdata_to_platdata = bcmstb_spi_ofdata_to_platdata,
.probe = bcmstb_spi_probe,
- .platdata_auto = sizeof(struct bcmstb_spi_platdata),
+ .plat_auto = sizeof(struct bcmstb_spi_platdata),
.priv_auto = sizeof(struct bcmstb_spi_priv),
};
static int cadence_spi_write_speed(struct udevice *bus, uint hz)
{
- struct cadence_spi_platdata *plat = bus->platdata;
+ struct cadence_spi_platdata *plat = bus->plat;
struct cadence_spi_priv *priv = dev_get_priv(bus);
cadence_qspi_apb_config_baudrate_div(priv->regbase,
static int cadence_spi_set_speed(struct udevice *bus, uint hz)
{
- struct cadence_spi_platdata *plat = bus->platdata;
+ struct cadence_spi_platdata *plat = bus->plat;
struct cadence_spi_priv *priv = dev_get_priv(bus);
int err;
static int cadence_spi_probe(struct udevice *bus)
{
- struct cadence_spi_platdata *plat = bus->platdata;
+ struct cadence_spi_platdata *plat = bus->plat;
struct cadence_spi_priv *priv = dev_get_priv(bus);
struct clk clk;
int ret;
static int cadence_spi_set_mode(struct udevice *bus, uint mode)
{
- struct cadence_spi_platdata *plat = bus->platdata;
+ struct cadence_spi_platdata *plat = bus->plat;
struct cadence_spi_priv *priv = dev_get_priv(bus);
/* Disable QSPI */
const struct spi_mem_op *op)
{
struct udevice *bus = spi->dev->parent;
- struct cadence_spi_platdata *plat = bus->platdata;
+ struct cadence_spi_platdata *plat = bus->plat;
struct cadence_spi_priv *priv = dev_get_priv(bus);
void *base = priv->regbase;
int err = 0;
static int cadence_spi_ofdata_to_platdata(struct udevice *bus)
{
- struct cadence_spi_platdata *plat = bus->platdata;
+ struct cadence_spi_platdata *plat = bus->plat;
ofnode subnode;
plat->regbase = (void *)devfdt_get_addr_index(bus, 0);
.of_match = cadence_spi_ids,
.ops = &cadence_spi_ops,
.ofdata_to_platdata = cadence_spi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct cadence_spi_platdata),
+ .plat_auto = sizeof(struct cadence_spi_platdata),
.priv_auto = sizeof(struct cadence_spi_priv),
.probe = cadence_spi_probe,
.remove = cadence_spi_remove,
struct coldfire_spi_priv *cfspi = dev_get_priv(bus);
struct dspi *dspi = cfspi->regs;
struct dm_spi_slave_platdata *slave_plat =
- dev_get_parent_platdata(dev);
+ dev_get_parent_plat(dev);
if ((in_be32(&dspi->sr) & DSPI_SR_TXRXS) != DSPI_SR_TXRXS)
return -1;
struct coldfire_spi_priv *cfspi = dev_get_priv(bus);
struct dspi *dspi = cfspi->regs;
struct dm_spi_slave_platdata *slave_plat =
- dev_get_parent_platdata(dev);
+ dev_get_parent_plat(dev);
/* Clear FIFO */
clrbits_be32(&dspi->mcr, DSPI_MCR_CTXF | DSPI_MCR_CRXF);
{
struct udevice *bus = dev_get_parent(dev);
struct coldfire_spi_priv *cfspi = dev_get_priv(bus);
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
u16 *spi_rd16 = NULL, *spi_wr16 = NULL;
u8 *spi_rd = NULL, *spi_wr = NULL;
static u32 ctrl;
static int coldfire_dspi_ofdata_to_platdata(struct udevice *bus)
{
fdt_addr_t addr;
- struct coldfire_spi_platdata *plat = bus->platdata;
+ struct coldfire_spi_platdata *plat = bus->plat;
const void *blob = gd->fdt_blob;
int node = dev_of_offset(bus);
int *ctar, len;
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
.of_match = coldfire_spi_ids,
.ofdata_to_platdata = coldfire_dspi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct coldfire_spi_platdata),
+ .plat_auto = sizeof(struct coldfire_spi_platdata),
#endif
.probe = coldfire_spi_probe,
.ops = &coldfire_spi_ops,
static int davinci_spi_claim_bus(struct udevice *dev)
{
struct dm_spi_slave_platdata *slave_plat =
- dev_get_parent_platdata(dev);
+ dev_get_parent_plat(dev);
struct udevice *bus = dev->parent;
struct davinci_spi_slave *ds = dev_get_priv(bus);
unsigned long flags)
{
struct dm_spi_slave_platdata *slave =
- dev_get_parent_platdata(dev);
+ dev_get_parent_plat(dev);
struct udevice *bus = dev->parent;
struct davinci_spi_slave *ds = dev_get_priv(bus);
static int davinci_spi_probe(struct udevice *bus)
{
struct davinci_spi_slave *ds = dev_get_priv(bus);
- struct davinci_spi_platdata *plat = bus->platdata;
+ struct davinci_spi_platdata *plat = bus->plat;
ds->regs = plat->regs;
ds->num_cs = plat->num_cs;
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
static int davinci_ofdata_to_platadata(struct udevice *bus)
{
- struct davinci_spi_platdata *plat = bus->platdata;
+ struct davinci_spi_platdata *plat = bus->plat;
fdt_addr_t addr;
addr = dev_read_addr(bus);
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
.of_match = davinci_spi_ids,
.ofdata_to_platdata = davinci_ofdata_to_platadata,
- .platdata_auto = sizeof(struct davinci_spi_platdata),
+ .plat_auto = sizeof(struct davinci_spi_platdata),
#endif
.probe = davinci_spi_probe,
.ops = &davinci_spi_ops,
static int dw_spi_ofdata_to_platdata(struct udevice *bus)
{
- struct dw_spi_platdata *plat = bus->platdata;
+ struct dw_spi_platdata *plat = bus->plat;
plat->regs = dev_read_addr_ptr(bus);
static int dw_spi_set_speed(struct udevice *bus, uint speed)
{
- struct dw_spi_platdata *plat = bus->platdata;
+ struct dw_spi_platdata *plat = bus->plat;
struct dw_spi_priv *priv = dev_get_priv(bus);
u16 clk_div;
.of_match = dw_spi_ids,
.ops = &dw_spi_ops,
.ofdata_to_platdata = dw_spi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct dw_spi_platdata),
+ .plat_auto = sizeof(struct dw_spi_platdata),
.priv_auto = sizeof(struct dw_spi_priv),
.probe = dw_spi_probe,
.remove = dw_spi_remove,
static int exynos_spi_ofdata_to_platdata(struct udevice *bus)
{
- struct exynos_spi_platdata *plat = bus->platdata;
+ struct exynos_spi_platdata *plat = bus->plat;
const void *blob = gd->fdt_blob;
int node = dev_of_offset(bus);
static int exynos_spi_set_speed(struct udevice *bus, uint speed)
{
- struct exynos_spi_platdata *plat = bus->platdata;
+ struct exynos_spi_platdata *plat = bus->plat;
struct exynos_spi_priv *priv = dev_get_priv(bus);
int ret;
.of_match = exynos_spi_ids,
.ops = &exynos_spi_ops,
.ofdata_to_platdata = exynos_spi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct exynos_spi_platdata),
+ .plat_auto = sizeof(struct exynos_spi_platdata),
.priv_auto = sizeof(struct exynos_spi_priv),
.probe = exynos_spi_probe,
};
static int fsl_dspi_child_pre_probe(struct udevice *dev)
{
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
struct fsl_dspi_priv *priv = dev_get_priv(dev->parent);
u32 cs_sck_delay = 0, sck_cs_delay = 0;
unsigned char pcssck = 0, cssck = 0;
struct fsl_dspi_priv *priv;
struct udevice *bus = dev->parent;
struct dm_spi_slave_platdata *slave_plat =
- dev_get_parent_platdata(dev);
+ dev_get_parent_plat(dev);
priv = dev_get_priv(bus);
struct udevice *bus = dev->parent;
struct fsl_dspi_priv *priv = dev_get_priv(bus);
struct dm_spi_slave_platdata *slave_plat =
- dev_get_parent_platdata(dev);
+ dev_get_parent_plat(dev);
/* halt module */
dspi_halt(priv, 1);
static int fsl_dspi_ofdata_to_platdata(struct udevice *bus)
{
fdt_addr_t addr;
- struct fsl_dspi_platdata *plat = bus->platdata;
+ struct fsl_dspi_platdata *plat = bus->plat;
const void *blob = gd->fdt_blob;
int node = dev_of_offset(bus);
const void *dout, void *din, unsigned long flags)
{
struct fsl_dspi_priv *priv;
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
struct udevice *bus;
bus = dev->parent;
.of_match = fsl_dspi_ids,
.ops = &fsl_dspi_ops,
.ofdata_to_platdata = fsl_dspi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct fsl_dspi_platdata),
+ .plat_auto = sizeof(struct fsl_dspi_platdata),
.priv_auto = sizeof(struct fsl_dspi_priv),
.probe = fsl_dspi_probe,
.child_pre_probe = fsl_dspi_child_pre_probe,
static int fsl_espi_child_pre_probe(struct udevice *dev)
{
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
struct udevice *bus = dev->parent;
struct fsl_spi_slave *fsl = dev_get_priv(bus);
static int fsl_espi_ofdata_to_platdata(struct udevice *bus)
{
fdt_addr_t addr;
- struct fsl_espi_platdata *plat = bus->platdata;
+ struct fsl_espi_platdata *plat = bus->plat;
const void *blob = gd->fdt_blob;
int node = dev_of_offset(bus);
.ofdata_to_platdata = fsl_espi_ofdata_to_platdata,
#endif
.ops = &fsl_espi_ops,
- .platdata_auto = sizeof(struct fsl_espi_platdata),
+ .plat_auto = sizeof(struct fsl_espi_platdata),
.priv_auto = sizeof(struct fsl_spi_slave),
.probe = fsl_espi_probe,
.child_pre_probe = fsl_espi_child_pre_probe,
static void fsl_qspi_select_mem(struct fsl_qspi *q, struct spi_slave *slave)
{
struct dm_spi_slave_platdata *plat =
- dev_get_parent_platdata(slave->dev);
+ dev_get_parent_plat(slave->dev);
if (q->selected == plat->cs)
return;
* 1. Using of-platdata, in which case we have the BDF and can access the
* registers by reading the BAR
* 2. Not using of-platdata, but still with a SPI controller that is on its own
- * PCI PDF. In this case we read the BDF from the parent platdata and again get
+ * PCI PDF. In this case we read the BDF from the parent plat and again get
* the registers by reading the BAR
* 3. Using a SPI controller that is a child of the PCH, in which case we try
* to find the registers by asking the PCH. This only works if the PCH has
if (device_is_on_pci_bus(bus)) {
struct pci_child_platdata *pplat;
- pplat = dev_get_parent_platdata(bus);
+ pplat = dev_get_parent_plat(bus);
spi_bdf = pplat->devfn;
} else {
enum ich_version ich_version;
.of_match = ich_spi_ids,
.ops = &ich_spi_ops,
.ofdata_to_platdata = ich_spi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct ich_spi_platdata),
+ .plat_auto = sizeof(struct ich_spi_platdata),
.priv_auto = sizeof(struct ich_spi_priv),
.child_pre_probe = ich_spi_child_pre_probe,
.probe = ich_spi_probe,
.of_match = mvebu_spi_ids,
.ops = &mvebu_spi_ops,
.ofdata_to_platdata = mvebu_spi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct mvebu_spi_platdata),
+ .plat_auto = sizeof(struct mvebu_spi_platdata),
.priv_auto = sizeof(struct mvebu_spi_priv),
.probe = mvebu_spi_probe,
};
static void mpc8xxx_spi_cs_activate(struct udevice *dev)
{
struct mpc8xxx_priv *priv = dev_get_priv(dev->parent);
- struct dm_spi_slave_platdata *platdata = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *plat = dev_get_parent_plat(dev);
- dm_gpio_set_value(&priv->gpios[platdata->cs], 1);
+ dm_gpio_set_value(&priv->gpios[plat->cs], 1);
}
static void mpc8xxx_spi_cs_deactivate(struct udevice *dev)
{
struct mpc8xxx_priv *priv = dev_get_priv(dev->parent);
- struct dm_spi_slave_platdata *platdata = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *plat = dev_get_parent_plat(dev);
- dm_gpio_set_value(&priv->gpios[platdata->cs], 0);
+ dm_gpio_set_value(&priv->gpios[plat->cs], 0);
}
static int mpc8xxx_spi_xfer(struct udevice *dev, uint bitlen,
struct udevice *bus = dev->parent;
struct mpc8xxx_priv *priv = dev_get_priv(bus);
spi8xxx_t *spi = priv->spi;
- struct dm_spi_slave_platdata *platdata = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *plat = dev_get_parent_plat(dev);
u32 tmpdin = 0, tmpdout = 0, n;
const u8 *cout = dout;
u8 *cin = din;
debug("%s: slave %s:%u dout %08X din %08X bitlen %u\n", __func__,
- bus->name, platdata->cs, (uint)dout, (uint)din, bitlen);
- if (platdata->cs >= priv->cs_count) {
+ bus->name, plat->cs, (uint)dout, (uint)din, bitlen);
+ if (plat->cs >= priv->cs_count) {
dev_err(dev, "chip select index %d too large (cs_count=%d)\n",
- platdata->cs, priv->cs_count);
+ plat->cs, priv->cs_count);
return -EINVAL;
}
if (bitlen % 8) {
const void *dout, void *din, unsigned long flags)
{
struct udevice *bus = dev_get_parent(dev);
- struct dm_spi_slave_platdata *plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *plat = dev_get_parent_plat(dev);
struct mscc_bb_priv *priv = dev_get_priv(bus);
u32 i, count;
const u8 *txd = dout;
.of_match = mvebu_spi_ids,
.ops = &mvebu_spi_ops,
.ofdata_to_platdata = mvebu_spi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct mvebu_spi_platdata),
+ .plat_auto = sizeof(struct mvebu_spi_platdata),
.probe = mvebu_spi_probe,
.remove = mvebu_spi_remove,
};
{
#if CONFIG_IS_ENABLED(DM_SPI)
struct udevice *dev = mxcs->dev;
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
u32 cs = slave_plat->cs;
{
#if CONFIG_IS_ENABLED(DM_SPI)
struct udevice *dev = mxcs->dev;
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
u32 cs = slave_plat->cs;
static int mxc_spi_claim_bus(struct udevice *dev)
{
struct mxc_spi_slave *mxcs = dev_get_platdata(dev->parent);
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
mxcs->dev = dev;
.id = UCLASS_SPI,
.of_match = mxc_spi_ids,
.ops = &mxc_spi_ops,
- .platdata_auto = sizeof(struct mxc_spi_slave),
+ .plat_auto = sizeof(struct mxc_spi_slave),
.probe = mxc_spi_probe,
};
#endif
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
static int mxs_ofdata_to_platdata(struct udevice *bus)
{
- struct mxs_spi_platdata *plat = bus->platdata;
+ struct mxs_spi_platdata *plat = bus->plat;
u32 prop[2];
int ret;
.of_match = mxs_spi_ids,
.ofdata_to_platdata = mxs_ofdata_to_platdata,
#endif
- .platdata_auto = sizeof(struct mxs_spi_platdata),
+ .plat_auto = sizeof(struct mxs_spi_platdata),
.ops = &mxs_spi_ops,
.priv_auto = sizeof(struct mxs_spi_priv),
.probe = mxs_spi_probe,
{
struct nxp_fspi *f;
struct udevice *bus;
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
bus = dev->parent;
f = dev_get_priv(bus);
static u64 octeon_spi_set_mpicfg(struct udevice *dev)
{
- struct dm_spi_slave_platdata *slave = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave = dev_get_parent_plat(dev);
struct udevice *bus = dev_get_parent(dev);
struct octeon_spi *priv = dev_get_priv(bus);
u64 mpi_cfg;
{
struct udevice *bus = dev->parent;
struct omap3_spi_priv *priv = dev_get_priv(bus);
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
priv->cs = slave_plat->cs;
priv->freq = slave_plat->max_hz;
{
struct udevice *bus = dev->parent;
struct omap3_spi_priv *priv = dev_get_priv(bus);
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
priv->cs = slave_plat->cs;
priv->wordlen = wordlen;
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
.of_match = omap3_spi_ids,
.ofdata_to_platdata = omap3_spi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct omap3_spi_plat),
+ .plat_auto = sizeof(struct omap3_spi_plat),
#endif
.probe = omap3_spi_probe,
.ops = &omap3_spi_ops,
ulong tbase;
priv = dev_get_priv(bus);
- slave_plat = dev_get_parent_platdata(slave);
+ slave_plat = dev_get_parent_plat(slave);
debug("spi_xfer: bus:%i cs:%i flags:%lx\n",
bus->seq, slave_plat->cs, flags);
#if !CONFIG_IS_ENABLED(OF_PLATDATA)
static int pl022_spi_ofdata_to_platdata(struct udevice *bus)
{
- struct pl022_spi_pdata *plat = bus->platdata;
+ struct pl022_spi_pdata *plat = bus->plat;
const void *fdt = gd->fdt_blob;
int node = dev_of_offset(bus);
struct clk clkdev;
.ofdata_to_platdata = pl022_spi_ofdata_to_platdata,
#endif
.ops = &pl022_spi_ops,
- .platdata_auto = sizeof(struct pl022_spi_pdata),
+ .plat_auto = sizeof(struct pl022_spi_pdata),
.priv_auto = sizeof(struct pl022_spi_slave),
.probe = pl022_spi_probe,
};
.of_match = rpc_spi_ids,
.ops = &rpc_spi_ops,
.ofdata_to_platdata = rpc_spi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct rpc_spi_platdata),
+ .plat_auto = sizeof(struct rpc_spi_platdata),
.priv_auto = sizeof(struct rpc_spi_priv),
.bind = rpc_spi_bind,
.probe = rpc_spi_probe,
static void spi_cs_activate(struct udevice *dev, uint cs)
{
struct udevice *bus = dev->parent;
- struct rockchip_spi_platdata *plat = bus->platdata;
+ struct rockchip_spi_platdata *plat = bus->plat;
struct rockchip_spi_priv *priv = dev_get_priv(bus);
struct rockchip_spi *regs = priv->regs;
static void spi_cs_deactivate(struct udevice *dev, uint cs)
{
struct udevice *bus = dev->parent;
- struct rockchip_spi_platdata *plat = bus->platdata;
+ struct rockchip_spi_platdata *plat = bus->plat;
struct rockchip_spi_priv *priv = dev_get_priv(bus);
struct rockchip_spi *regs = priv->regs;
#if CONFIG_IS_ENABLED(OF_PLATDATA)
static int conv_of_platdata(struct udevice *dev)
{
- struct rockchip_spi_platdata *plat = dev->platdata;
+ struct rockchip_spi_platdata *plat = dev->plat;
struct dtd_rockchip_rk3288_spi *dtplat = &plat->of_plat;
struct rockchip_spi_priv *priv = dev_get_priv(dev);
int ret;
struct udevice *bus = dev->parent;
struct rockchip_spi_priv *priv = dev_get_priv(bus);
struct rockchip_spi *regs = priv->regs;
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
int len = bitlen >> 3;
const u8 *out = dout;
u8 *in = din;
.of_match = rockchip_spi_ids,
.ops = &rockchip_spi_ops,
.ofdata_to_platdata = rockchip_spi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct rockchip_spi_platdata),
+ .plat_auto = sizeof(struct rockchip_spi_platdata),
.priv_auto = sizeof(struct rockchip_spi_priv),
.probe = rockchip_spi_probe,
};
.of_match = sh_qspi_ids,
.ops = &sh_qspi_ops,
.ofdata_to_platdata = sh_qspi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct sh_qspi_slave),
+ .plat_auto = sizeof(struct sh_qspi_slave),
.probe = sh_qspi_probe,
};
#endif
static int soft_spi_ofdata_to_platdata(struct udevice *dev)
{
- struct soft_spi_platdata *plat = dev->platdata;
+ struct soft_spi_platdata *plat = dev->plat;
const void *blob = gd->fdt_blob;
int node = dev_of_offset(dev);
static int soft_spi_probe(struct udevice *dev)
{
struct spi_slave *slave = dev_get_parent_priv(dev);
- struct soft_spi_platdata *plat = dev->platdata;
+ struct soft_spi_platdata *plat = dev->plat;
int cs_flags, clk_flags;
int ret;
.of_match = soft_spi_ids,
.ops = &soft_spi_ops,
.ofdata_to_platdata = soft_spi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct soft_spi_platdata),
+ .plat_auto = sizeof(struct soft_spi_platdata),
.priv_auto = sizeof(struct soft_spi_priv),
.probe = soft_spi_probe,
};
const void *dout, void *din, unsigned long flags)
{
struct udevice *bus = dev_get_parent(dev);
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
unsigned int len;
const u8 *txp = dout;
u8 *rxp = din;
{
struct udevice *bus = dev->parent;
struct sifive_spi *spi = dev_get_priv(bus);
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
const u8 *tx_ptr = dout;
u8 *rx_ptr = din;
u32 remaining_len;
{
struct udevice *bus = dev->parent;
struct sun4i_spi_priv *priv = dev_get_priv(bus);
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
u32 len = bitlen / 8;
u32 rx_fifocnt;
.of_match = sun4i_spi_ids,
.ops = &sun4i_spi_ops,
.ofdata_to_platdata = sun4i_spi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct sun4i_spi_platdata),
+ .plat_auto = sizeof(struct sun4i_spi_platdata),
.priv_auto = sizeof(struct sun4i_spi_priv),
.probe = sun4i_spi_probe,
};
#if !CONFIG_IS_ENABLED(OF_PLATDATA)
static int spi_child_post_bind(struct udevice *dev)
{
- struct dm_spi_slave_platdata *plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *plat = dev_get_parent_plat(dev);
if (!dev_of_valid(dev))
return 0;
static int spi_child_pre_probe(struct udevice *dev)
{
- struct dm_spi_slave_platdata *plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *plat = dev_get_parent_plat(dev);
struct spi_slave *slave = dev_get_parent_priv(dev);
/*
int spi_chip_select(struct udevice *dev)
{
- struct dm_spi_slave_platdata *plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *plat = dev_get_parent_plat(dev);
return plat ? plat->cs : -ENOENT;
}
device_find_next_child(&dev)) {
struct dm_spi_slave_platdata *plat;
- plat = dev_get_parent_platdata(dev);
+ plat = dev_get_parent_plat(dev);
debug("%s: plat=%p, cs=%d\n", __func__, plat, plat->cs);
if (plat->cs == cs) {
*devp = dev;
ret);
return ret;
}
- plat = dev_get_parent_platdata(dev);
+ plat = dev_get_parent_plat(dev);
plat->cs = cs;
if (speed) {
plat->max_hz = speed;
.child_pre_probe = spi_child_pre_probe,
.per_device_auto = sizeof(struct dm_spi_bus),
.per_child_auto = sizeof(struct spi_slave),
- .per_child_platdata_auto =
+ .per_child_plat_auto =
sizeof(struct dm_spi_slave_platdata),
#if !CONFIG_IS_ENABLED(OF_PLATDATA)
.child_post_bind = spi_child_post_bind,
static int stm32_qspi_claim_bus(struct udevice *dev)
{
struct stm32_qspi_priv *priv = dev_get_priv(dev->parent);
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
int slave_cs = slave_plat->cs;
if (slave_cs >= STM32_QSPI_MAX_CHIP)
debug("%s: priv->tx_len=%d priv->rx_len=%d\n", __func__,
priv->tx_len, priv->rx_len);
- slave_plat = dev_get_parent_platdata(slave);
+ slave_plat = dev_get_parent_plat(slave);
if (flags & SPI_XFER_BEGIN)
stm32_spi_set_cs(bus, slave_plat->cs, false);
static int tegra114_spi_ofdata_to_platdata(struct udevice *bus)
{
- struct tegra_spi_platdata *plat = bus->platdata;
+ struct tegra_spi_platdata *plat = bus->plat;
plat->base = dev_read_addr(bus);
plat->periph_id = clock_decode_periph_id(bus);
static int tegra114_spi_set_speed(struct udevice *bus, uint speed)
{
- struct tegra_spi_platdata *plat = bus->platdata;
+ struct tegra_spi_platdata *plat = bus->plat;
struct tegra114_spi_priv *priv = dev_get_priv(bus);
if (speed > plat->frequency)
.of_match = tegra114_spi_ids,
.ops = &tegra114_spi_ops,
.ofdata_to_platdata = tegra114_spi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct tegra_spi_platdata),
+ .plat_auto = sizeof(struct tegra_spi_platdata),
.priv_auto = sizeof(struct tegra114_spi_priv),
.probe = tegra114_spi_probe,
};
static int tegra20_sflash_ofdata_to_platdata(struct udevice *bus)
{
- struct tegra_spi_platdata *plat = bus->platdata;
+ struct tegra_spi_platdata *plat = bus->plat;
const void *blob = gd->fdt_blob;
int node = dev_of_offset(bus);
static int tegra20_sflash_set_speed(struct udevice *bus, uint speed)
{
- struct tegra_spi_platdata *plat = bus->platdata;
+ struct tegra_spi_platdata *plat = bus->plat;
struct tegra20_sflash_priv *priv = dev_get_priv(bus);
if (speed > plat->frequency)
.of_match = tegra20_sflash_ids,
.ops = &tegra20_sflash_ops,
.ofdata_to_platdata = tegra20_sflash_ofdata_to_platdata,
- .platdata_auto = sizeof(struct tegra_spi_platdata),
+ .plat_auto = sizeof(struct tegra_spi_platdata),
.priv_auto = sizeof(struct tegra20_sflash_priv),
.probe = tegra20_sflash_probe,
};
static int tegra30_spi_ofdata_to_platdata(struct udevice *bus)
{
- struct tegra_spi_platdata *plat = bus->platdata;
+ struct tegra_spi_platdata *plat = bus->plat;
const void *blob = gd->fdt_blob;
int node = dev_of_offset(bus);
static int tegra30_spi_set_speed(struct udevice *bus, uint speed)
{
- struct tegra_spi_platdata *plat = bus->platdata;
+ struct tegra_spi_platdata *plat = bus->plat;
struct tegra30_spi_priv *priv = dev_get_priv(bus);
if (speed > plat->frequency)
.of_match = tegra30_spi_ids,
.ops = &tegra30_spi_ops,
.ofdata_to_platdata = tegra30_spi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct tegra_spi_platdata),
+ .plat_auto = sizeof(struct tegra_spi_platdata),
.priv_auto = sizeof(struct tegra30_spi_priv),
.probe = tegra30_spi_probe,
};
static int tegra210_qspi_ofdata_to_platdata(struct udevice *bus)
{
- struct tegra_spi_platdata *plat = bus->platdata;
+ struct tegra_spi_platdata *plat = bus->plat;
plat->base = dev_read_addr(bus);
plat->periph_id = clock_decode_periph_id(bus);
static int tegra210_qspi_set_speed(struct udevice *bus, uint speed)
{
- struct tegra_spi_platdata *plat = bus->platdata;
+ struct tegra_spi_platdata *plat = bus->plat;
struct tegra210_qspi_priv *priv = dev_get_priv(bus);
if (speed > plat->frequency)
.of_match = tegra210_qspi_ids,
.ops = &tegra210_qspi_ops,
.ofdata_to_platdata = tegra210_qspi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct tegra_spi_platdata),
+ .plat_auto = sizeof(struct tegra_spi_platdata),
.priv_auto = sizeof(struct tegra210_qspi_priv),
.per_child_auto = sizeof(struct spi_slave),
.probe = tegra210_qspi_probe,
static int ti_qspi_xfer(struct udevice *dev, unsigned int bitlen,
const void *dout, void *din, unsigned long flags)
{
- struct dm_spi_slave_platdata *slave = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave = dev_get_parent_plat(dev);
struct ti_qspi_priv *priv;
struct udevice *bus;
uint words = bitlen >> 3; /* fixed 8-bit word length */
bus = slave->dev->parent;
priv = dev_get_priv(bus);
- slave_plat = dev_get_parent_platdata(slave->dev);
+ slave_plat = dev_get_parent_plat(slave->dev);
/* Only optimize read path. */
if (!op->data.nbytes || op->data.dir != SPI_MEM_DATA_IN ||
static int ti_qspi_claim_bus(struct udevice *dev)
{
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
struct ti_qspi_priv *priv;
struct udevice *bus;
static int ti_qspi_release_bus(struct udevice *dev)
{
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
struct ti_qspi_priv *priv;
struct udevice *bus;
static void spi_cs_activate(struct udevice *dev)
{
struct udevice *bus = dev->parent;
- struct uniphier_spi_platdata *plat = bus->platdata;
+ struct uniphier_spi_platdata *plat = bus->plat;
struct uniphier_spi_priv *priv = dev_get_priv(bus);
ulong delay_us; /* The delay completed so far */
u32 val;
static void spi_cs_deactivate(struct udevice *dev)
{
struct udevice *bus = dev->parent;
- struct uniphier_spi_platdata *plat = bus->platdata;
+ struct uniphier_spi_platdata *plat = bus->plat;
struct uniphier_spi_priv *priv = dev_get_priv(bus);
u32 val;
static int uniphier_spi_set_speed(struct udevice *bus, uint speed)
{
- struct uniphier_spi_platdata *plat = bus->platdata;
+ struct uniphier_spi_platdata *plat = bus->plat;
struct uniphier_spi_priv *priv = dev_get_priv(bus);
u32 val, ckdiv;
static int uniphier_spi_ofdata_to_platdata(struct udevice *bus)
{
- struct uniphier_spi_platdata *plat = bus->platdata;
+ struct uniphier_spi_platdata *plat = bus->plat;
const void *blob = gd->fdt_blob;
int node = dev_of_offset(bus);
.of_match = uniphier_spi_ids,
.ops = &uniphier_spi_ops,
.ofdata_to_platdata = uniphier_spi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct uniphier_spi_platdata),
+ .plat_auto = sizeof(struct uniphier_spi_platdata),
.priv_auto = sizeof(struct uniphier_spi_priv),
.probe = uniphier_spi_probe,
};
struct udevice *bus = dev_get_parent(dev);
struct xilinx_spi_priv *priv = dev_get_priv(bus);
struct xilinx_spi_regs *regs = priv->regs;
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
const unsigned char *txp = dout;
unsigned char *rxp = din;
u32 reg;
struct udevice *bus = dev_get_parent(dev);
struct xilinx_spi_priv *priv = dev_get_priv(bus);
struct xilinx_spi_regs *regs = priv->regs;
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
/* assume spi core configured to do 8 bit transfers */
unsigned int bytes = bitlen / XILSPI_MAX_XFER_BITS;
const unsigned char *txp = dout;
static int zynq_qspi_ofdata_to_platdata(struct udevice *bus)
{
- struct zynq_qspi_platdata *plat = bus->platdata;
+ struct zynq_qspi_platdata *plat = bus->plat;
const void *blob = gd->fdt_blob;
int node = dev_of_offset(bus);
{
struct udevice *bus = dev->parent;
struct zynq_qspi_priv *priv = dev_get_priv(bus);
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
priv->cs = slave_plat->cs;
priv->tx_buf = dout;
static int zynq_qspi_set_speed(struct udevice *bus, uint speed)
{
- struct zynq_qspi_platdata *plat = bus->platdata;
+ struct zynq_qspi_platdata *plat = bus->plat;
struct zynq_qspi_priv *priv = dev_get_priv(bus);
struct zynq_qspi_regs *regs = priv->regs;
uint32_t confr;
.of_match = zynq_qspi_ids,
.ops = &zynq_qspi_ops,
.ofdata_to_platdata = zynq_qspi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct zynq_qspi_platdata),
+ .plat_auto = sizeof(struct zynq_qspi_platdata),
.priv_auto = sizeof(struct zynq_qspi_priv),
.probe = zynq_qspi_probe,
};
static int zynq_spi_ofdata_to_platdata(struct udevice *bus)
{
- struct zynq_spi_platdata *plat = bus->platdata;
+ struct zynq_spi_platdata *plat = bus->plat;
const void *blob = gd->fdt_blob;
int node = dev_of_offset(bus);
static void spi_cs_activate(struct udevice *dev)
{
struct udevice *bus = dev->parent;
- struct zynq_spi_platdata *plat = bus->platdata;
+ struct zynq_spi_platdata *plat = bus->plat;
struct zynq_spi_priv *priv = dev_get_priv(bus);
struct zynq_spi_regs *regs = priv->regs;
u32 cr;
static void spi_cs_deactivate(struct udevice *dev)
{
struct udevice *bus = dev->parent;
- struct zynq_spi_platdata *plat = bus->platdata;
+ struct zynq_spi_platdata *plat = bus->plat;
struct zynq_spi_priv *priv = dev_get_priv(bus);
struct zynq_spi_regs *regs = priv->regs;
struct udevice *bus = dev->parent;
struct zynq_spi_priv *priv = dev_get_priv(bus);
struct zynq_spi_regs *regs = priv->regs;
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
u32 len = bitlen / 8;
u32 tx_len = len, rx_len = len, tx_tvl;
const u8 *tx_buf = dout;
static int zynq_spi_set_speed(struct udevice *bus, uint speed)
{
- struct zynq_spi_platdata *plat = bus->platdata;
+ struct zynq_spi_platdata *plat = bus->plat;
struct zynq_spi_priv *priv = dev_get_priv(bus);
struct zynq_spi_regs *regs = priv->regs;
uint32_t confr;
.of_match = zynq_spi_ids,
.ops = &zynq_spi_ops,
.ofdata_to_platdata = zynq_spi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct zynq_spi_platdata),
+ .plat_auto = sizeof(struct zynq_spi_platdata),
.priv_auto = sizeof(struct zynq_spi_priv),
.probe = zynq_spi_probe,
};
static int zynqmp_qspi_ofdata_to_platdata(struct udevice *bus)
{
- struct zynqmp_qspi_platdata *plat = bus->platdata;
+ struct zynqmp_qspi_platdata *plat = bus->plat;
debug("%s\n", __func__);
void zynqmp_qspi_set_tapdelay(struct udevice *bus, u32 baudrateval)
{
- struct zynqmp_qspi_platdata *plat = bus->platdata;
+ struct zynqmp_qspi_platdata *plat = bus->plat;
struct zynqmp_qspi_priv *priv = dev_get_priv(bus);
struct zynqmp_qspi_regs *regs = priv->regs;
u32 tapdlybypass = 0, lpbkdlyadj = 0, datadlyadj = 0, clk_rate;
static int zynqmp_qspi_set_speed(struct udevice *bus, uint speed)
{
- struct zynqmp_qspi_platdata *plat = bus->platdata;
+ struct zynqmp_qspi_platdata *plat = bus->plat;
struct zynqmp_qspi_priv *priv = dev_get_priv(bus);
struct zynqmp_qspi_regs *regs = priv->regs;
u32 confr;
.of_match = zynqmp_qspi_ids,
.ops = &zynqmp_qspi_ops,
.ofdata_to_platdata = zynqmp_qspi_ofdata_to_platdata,
- .platdata_auto = sizeof(struct zynqmp_qspi_platdata),
+ .plat_auto = sizeof(struct zynqmp_qspi_platdata),
.priv_auto = sizeof(struct zynqmp_qspi_priv),
.probe = zynqmp_qspi_probe,
};
.of_match = x86_sysreset_ids,
.ops = &x86_sysreset_ops,
.probe = x86_sysreset_probe,
- .platdata_auto = sizeof(struct x86_sysreset_platdata),
+ .plat_auto = sizeof(struct x86_sysreset_platdata),
};
.ofdata_to_platdata = optee_ofdata_to_platdata,
.probe = optee_probe,
.ops = &optee_ops,
- .platdata_auto = sizeof(struct optee_pdata),
+ .plat_auto = sizeof(struct optee_pdata),
.priv_auto = sizeof(struct optee_private),
};
.bind = imx_sc_thermal_bind,
.probe = imx_sc_thermal_probe,
.ofdata_to_platdata = imx_sc_thermal_ofdata_to_platdata,
- .platdata_auto = sizeof(struct imx_sc_thermal_plat),
+ .plat_auto = sizeof(struct imx_sc_thermal_plat),
.flags = DM_FLAG_PRE_RELOC,
};
.of_match = imx_tmu_ids,
.bind = imx_tmu_bind,
.probe = imx_tmu_probe,
- .platdata_auto = sizeof(struct imx_tmu_plat),
+ .plat_auto = sizeof(struct imx_tmu_plat),
.flags = DM_FLAG_PRE_RELOC,
};
static u64 atftmr_timer_get_count(struct udevice *dev)
{
- struct atftmr_timer_platdata *plat = dev->platdata;
+ struct atftmr_timer_platdata *plat = dev->plat;
struct atftmr_timer_regs *const regs = plat->regs;
u32 val;
val = readl(®s->t3_counter);
static int atftmr_timer_probe(struct udevice *dev)
{
- struct atftmr_timer_platdata *plat = dev->platdata;
+ struct atftmr_timer_platdata *plat = dev->plat;
struct atftmr_timer_regs *const regs = plat->regs;
u32 cr;
writel(0, ®s->t3_load);
.id = UCLASS_TIMER,
.of_match = ag101p_timer_ids,
.ofdata_to_platdata = atftme_timer_ofdata_to_platdata,
- .platdata_auto = sizeof(struct atftmr_timer_platdata),
+ .plat_auto = sizeof(struct atftmr_timer_platdata),
.probe = atftmr_timer_probe,
.ops = &ag101p_timer_ops,
};
static u64 altera_timer_get_count(struct udevice *dev)
{
- struct altera_timer_platdata *plat = dev->platdata;
+ struct altera_timer_platdata *plat = dev->plat;
struct altera_timer_regs *const regs = plat->regs;
u32 val;
static int altera_timer_probe(struct udevice *dev)
{
- struct altera_timer_platdata *plat = dev->platdata;
+ struct altera_timer_platdata *plat = dev->plat;
struct altera_timer_regs *const regs = plat->regs;
writel(0, ®s->status);
.id = UCLASS_TIMER,
.of_match = altera_timer_ids,
.ofdata_to_platdata = altera_timer_ofdata_to_platdata,
- .platdata_auto = sizeof(struct altera_timer_platdata),
+ .plat_auto = sizeof(struct altera_timer_platdata),
.probe = altera_timer_probe,
.ops = &altera_timer_ops,
};
.id = UCLASS_TIMER,
.of_match = atcpit_timer_ids,
.ofdata_to_platdata = atcpit_timer_ofdata_to_platdata,
- .platdata_auto = sizeof(struct atcpit_timer_platdata),
+ .plat_auto = sizeof(struct atcpit_timer_platdata),
.probe = atcpit_timer_probe,
.ops = &atcpit_timer_ops,
};
.id = UCLASS_TIMER,
.of_match = atmel_pit_ids,
.ofdata_to_platdata = atmel_pit_ofdata_to_platdata,
- .platdata_auto = sizeof(struct atmel_pit_platdata),
+ .plat_auto = sizeof(struct atmel_pit_platdata),
.probe = atmel_pit_probe,
.ops = &atmel_pit_ops,
};
.ops = &rockchip_timer_ops,
.priv_auto = sizeof(struct rockchip_timer_priv),
#if CONFIG_IS_ENABLED(OF_PLATDATA)
- .platdata_auto = sizeof(struct rockchip_timer_plat),
+ .plat_auto = sizeof(struct rockchip_timer_plat),
#endif
.ofdata_to_platdata = rockchip_clk_ofdata_to_platdata,
};
if (!cpu)
return -ENODEV;
- cpu_plat = dev_get_parent_platdata(cpu);
+ cpu_plat = dev_get_parent_plat(cpu);
if (!cpu_plat)
return -ENODEV;
static int cr50_i2c_get_desc(struct udevice *dev, char *buf, int size)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
struct cr50_priv *priv = dev_get_priv(dev);
return snprintf(buf, size, "cr50 TPM 2.0 (i2c %02x id %x) irq=%d",
.remove = st33zp24_spi_remove,
.ops = &st33zp24_spi_tpm_ops,
.priv_auto = sizeof(struct tpm_chip),
- .platdata_auto = sizeof(struct st33zp24_spi_phy),
+ .plat_auto = sizeof(struct st33zp24_spi_phy),
};
if (!scsi_dev)
return -ENODEV;
- scsi_plat = dev_get_uclass_platdata(scsi_dev);
+ scsi_plat = dev_get_uclass_plat(scsi_dev);
scsi_plat->max_id = UFSHCD_MAX_ID;
scsi_plat->max_lun = UFS_MAX_LUNS;
scsi_plat->max_bytes_per_req = UFS_MAX_BYTES;
.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,
};
.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
.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,
};
.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),
};
.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),
};
.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),
};
.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),
};
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,
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;
.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,
};
.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),
};
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
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);
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);
}
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);
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;
.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),
};
.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[] = {
.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[] = {
.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[] = {
.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[] = {
.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,
};
.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[] = {
.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[] = {
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;
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;
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);
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) {
}
}
- 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);
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,
}
}
- ret = dwc2_udc_probe(platdata);
+ ret = dwc2_udc_probe(plat);
if (ret)
return ret;
.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;
}
.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 */
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;
.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,
};
.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,
};
.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,
};
.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,
};
.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,
};
.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,
};
.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,
};
.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,
};
.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,
};
.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,
.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,
};
.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,
};
.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,
};
.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,
};
.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,
};
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
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;
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))
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;
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))
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) {
.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) = {
.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,
};
.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
.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,
};
.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,
};
.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,
};
.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,
};
.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,
};
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;
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 */
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;
}
.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),
};
#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),
};
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;
}
#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;
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
#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),
};
#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),
};
#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),
};
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);
}
}
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;
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;
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;
}
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;
#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;
}
.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),
};
#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;
}
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;
.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,
};
static int am335x_fb_remove(struct udevice *dev)
{
- struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *uc_plat = dev_get_uclass_plat(dev);
uc_plat->base -= 0x20;
uc_plat->size += 0x20;
static int am335x_fb_probe(struct udevice *dev)
{
- struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *uc_plat = dev_get_uclass_plat(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
struct am335x_fb_priv *priv = dev_get_priv(dev);
struct am335x_lcdhw *regs = priv->regs;
static int am335x_fb_bind(struct udevice *dev)
{
- struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *uc_plat = dev_get_uclass_plat(dev);
uc_plat->size = ((LCD_MAX_WIDTH * LCD_MAX_HEIGHT *
(1 << LCD_MAX_LOG2_BPP)) >> 3) + 0x20;
static void atmel_hlcdc_init(struct udevice *dev)
{
- struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *uc_plat = dev_get_uclass_plat(dev);
struct atmel_hlcdc_priv *priv = dev_get_priv(dev);
struct atmel_hlcd_regs *regs = priv->regs;
struct display_timing *timing = &priv->timing;
static int atmel_hlcdc_bind(struct udevice *dev)
{
- struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *uc_plat = dev_get_uclass_plat(dev);
uc_plat->size = LCD_MAX_WIDTH * LCD_MAX_HEIGHT *
(1 << LCD_MAX_LOG2_BPP) / 8;
#ifdef CONFIG_DM_VIDEO
static int atmel_fb_lcd_probe(struct udevice *dev)
{
- struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *uc_plat = dev_get_uclass_plat(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
struct atmel_fb_priv *priv = dev_get_priv(dev);
struct display_timing *timing = &priv->timing;
static int atmel_fb_lcd_bind(struct udevice *dev)
{
- struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *uc_plat = dev_get_uclass_plat(dev);
uc_plat->size = LCD_MAX_WIDTH * LCD_MAX_HEIGHT *
(1 << VIDEO_BPP16) / 8;
.bind = atmel_fb_lcd_bind,
.ofdata_to_platdata = atmel_fb_ofdata_to_platdata,
.probe = atmel_fb_lcd_probe,
- .platdata_auto = sizeof(struct atmel_lcd_platdata),
+ .plat_auto = sizeof(struct atmel_lcd_platdata),
.priv_auto = sizeof(struct atmel_fb_priv),
};
#endif
static int bcm2835_video_probe(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
int ret;
int w, h, pitch;
static int anx6345_write_r0(struct udevice *dev, unsigned char reg_addr,
unsigned char value)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
return anx6345_write(dev, chip->chip_addr, reg_addr, value);
}
static int anx6345_read_r0(struct udevice *dev, unsigned char reg_addr,
unsigned char *value)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
return anx6345_read(dev, chip->chip_addr, reg_addr, value);
}
static int anx6345_write_r1(struct udevice *dev, unsigned char reg_addr,
unsigned char value)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
return anx6345_write(dev, chip->chip_addr + 1, reg_addr, value);
}
static int anx6345_read_r1(struct udevice *dev, unsigned char reg_addr,
unsigned char *value)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
return anx6345_read(dev, chip->chip_addr + 1, reg_addr, value);
}
static int ps8622_write(struct udevice *dev, unsigned addr_off,
unsigned char reg_addr, unsigned char value)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
uint8_t buf[2];
struct i2c_msg msg;
int ret;
static int broadwell_igd_probe(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
bool is_broadwell;
ulong fbbase;
static int broadwell_igd_bind(struct udevice *dev)
{
- struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *uc_plat = dev_get_uclass_plat(dev);
/* Set the maximum supported resolution */
uc_plat->size = 2560 * 1600 * 4;
.bind = broadwell_igd_bind,
.probe = broadwell_igd_probe,
.priv_auto = sizeof(struct broadwell_igd_priv),
- .platdata_auto = sizeof(struct broadwell_igd_plat),
+ .plat_auto = sizeof(struct broadwell_igd_plat),
};
static int coreboot_video_probe(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
struct cb_framebuffer *fb = lib_sysinfo.framebuffer;
struct vesa_mode_info *vesa = &mode_info.vesa;
if (ret)
return ret;
- disp_uc_plat = dev_get_uclass_platdata(dev);
+ disp_uc_plat = dev_get_uclass_plat(dev);
disp_uc_plat->in_use = true;
return 0;
bool display_in_use(struct udevice *dev)
{
- struct display_plat *disp_uc_plat = dev_get_uclass_platdata(dev);
+ struct display_plat *disp_uc_plat = dev_get_uclass_plat(dev);
return disp_uc_plat->in_use;
}
UCLASS_DRIVER(display) = {
.id = UCLASS_DISPLAY,
.name = "display",
- .per_device_platdata_auto = sizeof(struct display_plat),
+ .per_device_plat_auto = sizeof(struct display_plat),
};
static int efi_video_probe(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
struct vesa_mode_info *vesa = &mode_info.vesa;
int ret;
void exynos_fimd_lcd_init(struct udevice *dev)
{
struct exynos_fb_priv *priv = dev_get_priv(dev);
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
struct exynos_fb *reg = priv->reg;
unsigned int cfg = 0, rgb_mode;
unsigned int offset;
static int exynos_fb_bind(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
/* This is the maximum panel size we expect to see */
plat->size = 1920 * 1080 * 2;
static int fsl_dcu_video_probe(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
struct fb_info fbinfo = { 0 };
unsigned int win_x;
static int fsl_dcu_video_bind(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
unsigned int win_x;
unsigned int win_y;
unsigned int depth = 0, freq = 0;
static int mxcfb_map_video_memory(struct fb_info *fbi)
{
struct mxcfb_info *mxc_fbi = (struct mxcfb_info *)fbi->par;
- struct video_uc_platdata *plat = dev_get_uclass_platdata(mxc_fbi->udev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(mxc_fbi->udev);
if (fbi->fix.smem_len < fbi->var.yres_virtual * fbi->fix.line_length) {
fbi->fix.smem_len = fbi->var.yres_virtual *
static int ipuv3_video_probe(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
#if defined(CONFIG_DISPLAY)
struct udevice *disp_dev;
static int ipuv3_video_bind(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
plat->size = LCD_MAX_WIDTH * LCD_MAX_HEIGHT *
(1 << VIDEO_BPP32) / 8;
static int bd82x6x_video_probe(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
ulong fbbase;
void *gtt_bar;
int ret, rev;
static int bd82x6x_video_bind(struct udevice *dev)
{
- struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *uc_plat = dev_get_uclass_plat(dev);
/* Set the maximum supported resolution */
uc_plat->size = 2560 * 1600 * 4;
static int malidp_probe(struct udevice *dev)
{
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
- struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *uc_plat = dev_get_uclass_plat(dev);
ofnode framebuffer = ofnode_find_subnode(dev_ofnode(dev), "framebuffer");
struct malidp_priv *priv = dev_get_priv(dev);
struct display_timing timings;
static int malidp_bind(struct udevice *dev)
{
- struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *uc_plat = dev_get_uclass_plat(dev);
/* choose max possible size: 2K x 2K, XRGB888 framebuffer */
uc_plat->size = 4 * 2048 * 2048;
void meson_vpu_setup_plane(struct udevice *dev, bool is_interlaced)
{
- struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *uc_plat = dev_get_uclass_plat(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
struct meson_vpu_priv *priv = dev_get_priv(dev);
u32 osd1_ctrl_stat;
static int meson_vpu_setup_mode(struct udevice *dev, struct udevice *disp)
{
- struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *uc_plat = dev_get_uclass_plat(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
struct display_timing timing;
bool is_cvbs = false;
static int meson_vpu_bind(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
plat->size = VPU_MAX_WIDTH * VPU_MAX_HEIGHT *
(1 << VPU_MAX_LOG2_BPP) / 8;
static int mvebu_video_probe(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
struct mvebu_video_priv *priv = dev_get_priv(dev);
struct mvebu_lcd_info lcd_info;
static int mvebu_video_bind(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
plat->size = LCD_MAX_WIDTH * LCD_MAX_HEIGHT *
(1 << LCD_MAX_LOG2_BPP) / 8;
static int mxs_video_probe(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
struct display_timing timings;
static int mxs_video_bind(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
struct display_timing timings;
u32 bpp = 0;
u32 bytes_pp = 0;
static int mxs_video_remove(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
mxs_remove_common(plat->base);
__func__);
return NULL;
}
- plat = dev_get_uclass_platdata(dev);
+ plat = dev_get_uclass_plat(dev);
if (!dev) {
- debug("%s(): dev_get_uclass_platdata(dev) == NULL --> return NULL\n",
+ debug("%s(): dev_get_uclass_plat(dev) == NULL --> return NULL\n",
__func__);
return NULL;
}
static int nx_display_probe(struct udevice *dev)
{
- struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *uc_plat = dev_get_uclass_plat(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
struct nx_display_platdata *plat = dev_get_platdata(dev);
static GraphicDevice *graphic_device;
static int nx_display_bind(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
debug("%s()\n", __func__);
.name = "nexell-display",
.id = UCLASS_VIDEO,
.of_match = nx_display_ids,
- .platdata_auto =
+ .plat_auto =
sizeof(struct nx_display_platdata),
.bind = nx_display_bind,
.probe = nx_display_probe,
.ops = &otm8009a_panel_ops,
.ofdata_to_platdata = otm8009a_panel_ofdata_to_platdata,
.probe = otm8009a_panel_probe,
- .platdata_auto = sizeof(struct mipi_dsi_panel_plat),
+ .plat_auto = sizeof(struct mipi_dsi_panel_plat),
.priv_auto = sizeof(struct otm8009a_panel_priv),
};
switch (seq) {
case 0:
if (priv->reg) {
- __maybe_unused struct dm_regulator_uclass_platdata
+ __maybe_unused struct dm_regulator_uclass_plat
*plat;
- plat = dev_get_uclass_platdata(priv->reg);
+ plat = dev_get_uclass_plat(priv->reg);
log_debug("Enable '%s', regulator '%s'/'%s'\n",
dev->name, priv->reg->name, plat->name);
ret = regulator_set_enable(priv->reg, true);
.ops = &rm68200_panel_ops,
.ofdata_to_platdata = rm68200_panel_ofdata_to_platdata,
.probe = rm68200_panel_probe,
- .platdata_auto = sizeof(struct mipi_dsi_panel_plat),
+ .plat_auto = sizeof(struct mipi_dsi_panel_plat),
.priv_auto = sizeof(struct rm68200_panel_priv),
};
const struct display_timing *edid)
{
struct rk_hdmi_priv *priv = dev_get_priv(dev);
- struct display_plat *uc_plat = dev_get_uclass_platdata(dev);
+ struct display_plat *uc_plat = dev_get_uclass_plat(dev);
int vop_id = uc_plat->source_id;
struct rk3288_grf *grf = priv->grf;
static int rk3288_clk_config(struct udevice *dev)
{
- struct display_plat *uc_plat = dev_get_uclass_platdata(dev);
+ struct display_plat *uc_plat = dev_get_uclass_plat(dev);
struct clk clk;
int ret;
{
struct rk_mipi_priv *priv = dev_get_priv(dev);
struct rk3288_grf *grf = priv->grf;
- struct display_plat *disp_uc_plat = dev_get_uclass_platdata(dev);
+ struct display_plat *disp_uc_plat = dev_get_uclass_plat(dev);
/* Select the video source */
switch (disp_uc_plat->source_id) {
const struct display_timing *edid)
{
struct rk_hdmi_priv *priv = dev_get_priv(dev);
- struct display_plat *uc_plat = dev_get_uclass_platdata(dev);
+ struct display_plat *uc_plat = dev_get_uclass_plat(dev);
int vop_id = uc_plat->source_id;
struct rk3399_grf_regs *grf = priv->grf;
{
struct rk_mipi_priv *priv = dev_get_priv(dev);
struct rk3399_grf_regs *grf = priv->grf;
- struct display_plat *disp_uc_plat = dev_get_uclass_platdata(dev);
+ struct display_plat *disp_uc_plat = dev_get_uclass_plat(dev);
/* Select the video source */
switch (disp_uc_plat->source_id) {
static int rk_edp_probe(struct udevice *dev)
{
- struct display_plat *uc_plat = dev_get_uclass_platdata(dev);
+ struct display_plat *uc_plat = dev_get_uclass_plat(dev);
struct rk_edp_priv *priv = dev_get_priv(dev);
struct rk3288_edp *regs = priv->regs;
struct clk clk;
const struct display_timing *edid)
{
struct rk_lvds_priv *priv = dev_get_priv(dev);
- struct display_plat *uc_plat = dev_get_uclass_platdata(dev);
+ struct display_plat *uc_plat = dev_get_uclass_plat(dev);
int ret = 0;
unsigned int val = 0;
break;
};
- disp_uc_plat = dev_get_uclass_platdata(disp);
+ disp_uc_plat = dev_get_uclass_plat(disp);
debug("Found device '%s', disp_uc_priv=%p\n", disp->name, disp_uc_plat);
if (display_in_use(disp)) {
debug(" - device in use\n");
int rk_vop_probe(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
struct rk_vop_priv *priv = dev_get_priv(dev);
int ret = 0;
ofnode port, node;
int rk_vop_bind(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
plat->size = 4 * (CONFIG_VIDEO_ROCKCHIP_MAX_XRES *
CONFIG_VIDEO_ROCKCHIP_MAX_YRES);
static int sandbox_sdl_probe(struct udevice *dev)
{
- struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *uc_plat = dev_get_uclass_plat(dev);
struct sandbox_sdl_plat *plat = dev_get_platdata(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
struct sandbox_state *state = state_get_current();
static int sandbox_sdl_bind(struct udevice *dev)
{
- struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *uc_plat = dev_get_uclass_plat(dev);
struct sandbox_sdl_plat *plat = dev_get_platdata(dev);
int ret = 0;
.of_match = sandbox_sdl_ids,
.bind = sandbox_sdl_bind,
.probe = sandbox_sdl_probe,
- .platdata_auto = sizeof(struct sandbox_sdl_plat),
+ .plat_auto = sizeof(struct sandbox_sdl_plat),
};
static int simple_video_probe(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
const void *blob = gd->fdt_blob;
const int node = dev_of_offset(dev);
static int stm32_ltdc_probe(struct udevice *dev)
{
- struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *uc_plat = dev_get_uclass_plat(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
struct stm32_ltdc_priv *priv = dev_get_priv(dev);
struct udevice *bridge = NULL;
static int stm32_ltdc_bind(struct udevice *dev)
{
- struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *uc_plat = dev_get_uclass_plat(dev);
uc_plat->size = CONFIG_VIDEO_STM32_MAX_XRES *
CONFIG_VIDEO_STM32_MAX_YRES *
struct display_plat *disp_uc_plat;
int ret;
- disp_uc_plat = dev_get_uclass_platdata(disp);
+ disp_uc_plat = dev_get_uclass_plat(disp);
debug("Using device '%s', disp_uc_priv=%p\n", disp->name, disp_uc_plat);
if (display_in_use(disp)) {
debug(" - device in use\n");
static int sunxi_de2_probe(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
struct udevice *disp;
int ret;
static int sunxi_de2_bind(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
plat->size = LCD_MAX_WIDTH * LCD_MAX_HEIGHT *
(1 << LCD_MAX_LOG2_BPP) / 8;
}
de2_priv = dev_get_uclass_priv(de2);
- de2_plat = dev_get_uclass_platdata(de2);
+ de2_plat = dev_get_uclass_plat(de2);
offset = sunxi_simplefb_fdt_match(blob, pipeline);
if (offset < 0) {
static int sunxi_dw_hdmi_probe(struct udevice *dev)
{
- struct display_plat *uc_plat = dev_get_uclass_platdata(dev);
+ struct display_plat *uc_plat = dev_get_uclass_plat(dev);
struct sunxi_dw_hdmi_priv *priv = dev_get_priv(dev);
struct sunxi_ccm_reg * const ccm =
(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
static int tegra_lcd_probe(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
struct tegra_lcd_priv *priv = dev_get_priv(dev);
const void *blob = gd->fdt_blob;
static int tegra_lcd_bind(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
const void *blob = gd->fdt_blob;
int node = dev_of_offset(dev);
int rgb;
return ret;
}
- disp_uc_plat = dev_get_uclass_platdata(dp_dev);
+ disp_uc_plat = dev_get_uclass_plat(dp_dev);
debug("Found device '%s', disp_uc_priv=%p\n", dp_dev->name,
disp_uc_plat);
disp_uc_plat->src_dev = dev;
static int tegra124_lcd_probe(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
ulong start;
int ret;
static int tegra124_lcd_bind(struct udevice *dev)
{
- struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *uc_plat = dev_get_uclass_plat(dev);
uc_plat->size = LCD_MAX_WIDTH * LCD_MAX_HEIGHT *
(1 << VIDEO_BPP16) / 8;
{
struct tegra_dp_plat *plat = dev_get_platdata(dev);
struct tegra_dp_priv *priv = dev_get_priv(dev);
- struct display_plat *disp_uc_plat = dev_get_uclass_platdata(dev);
+ struct display_plat *disp_uc_plat = dev_get_uclass_plat(dev);
priv->regs = (struct dpaux_ctlr *)plat->base;
priv->enabled = false;
.probe = dp_tegra_probe,
.ops = &dp_tegra_ops,
.priv_auto = sizeof(struct tegra_dp_priv),
- .platdata_auto = sizeof(struct tegra_dp_plat),
+ .plat_auto = sizeof(struct tegra_dp_plat),
};
static int vesa_video_probe(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
ulong fbbase;
int ret;
static int vesa_video_bind(struct udevice *dev)
{
- struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *uc_plat = dev_get_uclass_plat(dev);
/* Set the maximum supported resolution */
uc_plat->size = 2560 * 1600 * 4;
static ulong alloc_fb(struct udevice *dev, ulong *addrp)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
ulong base, align, size;
if (!plat->size)
/* Set up the display ready for use */
static int video_post_probe(struct udevice *dev)
{
- struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
struct video_priv *priv = dev_get_uclass_priv(dev);
char name[30], drv[15], *str;
const char *drv_name = drv;
.pre_remove = video_pre_remove,
.priv_auto = sizeof(struct video_uc_priv),
.per_device_auto = sizeof(struct video_priv),
- .per_device_platdata_auto = sizeof(struct video_uc_platdata),
+ .per_device_plat_auto = sizeof(struct video_uc_platdata),
};
static int virtio_blk_bind(struct udevice *dev)
{
struct virtio_dev_priv *uc_priv = dev_get_uclass_priv(dev->parent);
- struct blk_desc *desc = dev_get_uclass_platdata(dev);
+ struct blk_desc *desc = dev_get_uclass_plat(dev);
int devnum;
desc->if_type = IF_TYPE_VIRTIO;
static int virtio_blk_probe(struct udevice *dev)
{
struct virtio_blk_priv *priv = dev_get_priv(dev);
- struct blk_desc *desc = dev_get_uclass_platdata(dev);
+ struct blk_desc *desc = dev_get_uclass_plat(dev);
u64 cap;
int ret;
.remove = virtio_reset,
.ops = &virtio_net_ops,
.priv_auto = sizeof(struct virtio_net_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ACTIVE_DMA,
};
static int virtio_pci_probe(struct udevice *udev)
{
- struct pci_child_platdata *pplat = dev_get_parent_platdata(udev);
+ struct pci_child_platdata *pplat = dev_get_parent_plat(udev);
struct virtio_dev_priv *uc_priv = dev_get_uclass_priv(udev);
struct virtio_pci_priv *priv = dev_get_priv(udev);
u16 subvendor, subdevice;
static int virtio_pci_probe(struct udevice *udev)
{
- struct pci_child_platdata *pplat = dev_get_parent_platdata(udev);
+ struct pci_child_platdata *pplat = dev_get_parent_plat(udev);
struct virtio_dev_priv *uc_priv = dev_get_uclass_priv(udev);
struct virtio_pci_priv *priv = dev_get_priv(udev);
u16 subvendor;
{
struct w1_device *w1;
- w1 = dev_get_parent_platdata(dev);
+ w1 = dev_get_parent_plat(dev);
w1->id = 0;
return 0;
}
{
struct w1_device *w1;
- w1 = dev_get_parent_platdata(dev);
+ w1 = dev_get_parent_plat(dev);
w1->id = 0;
return 0;
}
if (dev_get_driver_data(dev) == family) {
struct w1_device *w1;
- w1 = dev_get_parent_platdata(dev);
+ w1 = dev_get_parent_plat(dev);
if (w1->id) /* device already in use */
continue;
w1->id = id;
int w1_eeprom_get_id(struct udevice *dev, u64 *id)
{
- struct w1_device *w1 = dev_get_parent_platdata(dev);
+ struct w1_device *w1 = dev_get_parent_plat(dev);
if (!w1)
return -ENODEV;
.of_match = mxc_w1_id,
.ofdata_to_platdata = mxc_w1_ofdata_to_platdata,
.ops = &mxc_w1_ops,
- .platdata_auto = sizeof(struct mxc_w1_pdata),
+ .plat_auto = sizeof(struct mxc_w1_pdata),
.probe = mxc_w1_probe,
};
.of_match = w1_gpio_id,
.ofdata_to_platdata = w1_gpio_ofdata_to_platdata,
.ops = &w1_gpio_ops,
- .platdata_auto = sizeof(struct w1_gpio_pdata),
+ .plat_auto = sizeof(struct w1_gpio_pdata),
};
u8 w1_get_device_family(struct udevice *dev)
{
- struct w1_device *w1 = dev_get_parent_platdata(dev);
+ struct w1_device *w1 = dev_get_parent_plat(dev);
return w1->id & 0xff;
}
int w1_reset_select(struct udevice *dev)
{
- struct w1_device *w1 = dev_get_parent_platdata(dev);
+ struct w1_device *w1 = dev_get_parent_plat(dev);
struct udevice *bus = dev_get_parent(dev);
const struct w1_ops *ops = device_get_ops(bus);
int i;
#if CONFIG_IS_ENABLED(OF_CONTROL)
.post_bind = dm_scan_fdt_dev,
#endif
- .per_child_platdata_auto = sizeof(struct w1_device),
+ .per_child_plat_auto = sizeof(struct w1_device),
};
static int xlnx_wdt_reset(struct udevice *dev)
{
u32 reg;
- struct xlnx_wdt_platdata *platdata = dev_get_platdata(dev);
+ struct xlnx_wdt_platdata *plat = dev_get_platdata(dev);
debug("%s ", __func__);
/* Read the current contents of TCSR0 */
- reg = readl(&platdata->regs->twcsr0);
+ reg = readl(&plat->regs->twcsr0);
/* Clear the watchdog WDS bit */
if (reg & (XWT_CSR0_EWDT1_MASK | XWT_CSRX_EWDT2_MASK))
- writel(reg | XWT_CSR0_WDS_MASK, &platdata->regs->twcsr0);
+ writel(reg | XWT_CSR0_WDS_MASK, &plat->regs->twcsr0);
return 0;
}
static int xlnx_wdt_stop(struct udevice *dev)
{
u32 reg;
- struct xlnx_wdt_platdata *platdata = dev_get_platdata(dev);
+ struct xlnx_wdt_platdata *plat = dev_get_platdata(dev);
- if (platdata->enable_once) {
+ if (plat->enable_once) {
debug("Can't stop Xilinx watchdog.\n");
return -EBUSY;
}
/* Read the current contents of TCSR0 */
- reg = readl(&platdata->regs->twcsr0);
+ reg = readl(&plat->regs->twcsr0);
- writel(reg & ~XWT_CSR0_EWDT1_MASK, &platdata->regs->twcsr0);
- writel(~XWT_CSRX_EWDT2_MASK, &platdata->regs->twcsr1);
+ writel(reg & ~XWT_CSR0_EWDT1_MASK, &plat->regs->twcsr0);
+ writel(~XWT_CSRX_EWDT2_MASK, &plat->regs->twcsr1);
debug("Watchdog disabled!\n");
static int xlnx_wdt_start(struct udevice *dev, u64 timeout, ulong flags)
{
- struct xlnx_wdt_platdata *platdata = dev_get_platdata(dev);
+ struct xlnx_wdt_platdata *plat = dev_get_platdata(dev);
debug("%s:\n", __func__);
writel((XWT_CSR0_WRS_MASK | XWT_CSR0_WDS_MASK | XWT_CSR0_EWDT1_MASK),
- &platdata->regs->twcsr0);
+ &plat->regs->twcsr0);
- writel(XWT_CSRX_EWDT2_MASK, &platdata->regs->twcsr1);
+ writel(XWT_CSRX_EWDT2_MASK, &plat->regs->twcsr1);
return 0;
}
static int xlnx_wdt_ofdata_to_platdata(struct udevice *dev)
{
- struct xlnx_wdt_platdata *platdata = dev_get_platdata(dev);
+ struct xlnx_wdt_platdata *plat = dev_get_platdata(dev);
- platdata->regs = (struct watchdog_regs *)dev_read_addr(dev);
- if (IS_ERR(platdata->regs))
- return PTR_ERR(platdata->regs);
+ plat->regs = (struct watchdog_regs *)dev_read_addr(dev);
+ if (IS_ERR(plat->regs))
+ return PTR_ERR(plat->regs);
- platdata->enable_once = dev_read_u32_default(dev,
- "xlnx,wdt-enable-once", 0);
+ plat->enable_once = dev_read_u32_default(dev, "xlnx,wdt-enable-once",
+ 0);
- debug("%s: wdt-enable-once %d\n", __func__, platdata->enable_once);
+ debug("%s: wdt-enable-once %d\n", __func__, plat->enable_once);
return 0;
}
.id = UCLASS_WDT,
.of_match = xlnx_wdt_ids,
.probe = xlnx_wdt_probe,
- .platdata_auto = sizeof(struct xlnx_wdt_platdata),
+ .plat_auto = sizeof(struct xlnx_wdt_platdata),
.ofdata_to_platdata = xlnx_wdt_ofdata_to_platdata,
.ops = &xlnx_wdt_ops,
};
static int xlnx_wwdt_probe(struct udevice *dev)
{
int ret;
- struct xlnx_wwdt_platdata *platdata = dev_get_platdata(dev);
+ struct xlnx_wwdt_platdata *plat = dev_get_platdata(dev);
struct xlnx_wwdt_priv *wdt = dev_get_priv(dev);
dev_dbg(dev, "%s: Probing wdt%u\n", __func__, dev->seq);
return ret;
}
- wdt->enable_once = platdata->enable_once;
+ wdt->enable_once = plat->enable_once;
ret = clk_get_by_index(dev, 0, &wdt->clk);
if (ret < 0)
static int xlnx_wwdt_ofdata_to_platdata(struct udevice *dev)
{
- struct xlnx_wwdt_platdata *platdata = dev_get_platdata(dev);
+ struct xlnx_wwdt_platdata *plat = dev_get_platdata(dev);
- platdata->enable_once = dev_read_u32_default(dev,
- "xlnx,wdt-enable-once", 0);
- dev_dbg(dev, "wdt-enable-once %d\n", platdata->enable_once);
+ plat->enable_once = dev_read_u32_default(dev, "xlnx,wdt-enable-once",
+ 0);
+ dev_dbg(dev, "wdt-enable-once %d\n", plat->enable_once);
return 0;
}
.of_match = xlnx_wwdt_ids,
.probe = xlnx_wwdt_probe,
.priv_auto = sizeof(struct xlnx_wwdt_priv),
- .platdata_auto = sizeof(struct xlnx_wwdt_platdata),
+ .plat_auto = sizeof(struct xlnx_wwdt_platdata),
.ofdata_to_platdata = xlnx_wwdt_ofdata_to_platdata,
.ops = &xlnx_wwdt_ops,
};
lbaint_t blkcnt, void *buffer, int write)
{
struct blkfront_dev *blk_dev = dev_get_priv(udev);
- struct blk_desc *desc = dev_get_uclass_platdata(udev);
+ struct blk_desc *desc = dev_get_uclass_plat(udev);
struct blkfront_aiocb aiocb;
lbaint_t blocks_todo;
bool unaligned;
static int pvblock_blk_bind(struct udevice *udev)
{
- struct blk_desc *desc = dev_get_uclass_platdata(udev);
+ struct blk_desc *desc = dev_get_uclass_plat(udev);
int devnum;
desc->if_type = IF_TYPE_PVBLOCK;
static int pvblock_blk_probe(struct udevice *udev)
{
struct blkfront_dev *blk_dev = dev_get_priv(udev);
- struct blkfront_platdata *platdata = dev_get_platdata(udev);
- struct blk_desc *desc = dev_get_uclass_platdata(udev);
+ struct blkfront_platdata *plat = dev_get_platdata(udev);
+ struct blk_desc *desc = dev_get_uclass_plat(udev);
int ret, devid;
- devid = platdata->devid;
- free(platdata);
+ devid = plat->devid;
+ free(plat);
ret = init_blkfront(devid, blk_dev);
if (ret < 0)
{
struct driver_info info;
struct udevice *udev;
- struct blkfront_platdata *platdata;
+ struct blkfront_platdata *plat;
int ret;
debug("New " DRV_NAME_BLK ", device ID %d\n", devid);
- platdata = malloc(sizeof(struct blkfront_platdata));
- if (!platdata) {
+ plat = malloc(sizeof(struct blkfront_platdata));
+ if (!plat) {
printf("Failed to allocate platform data\n");
return -ENOMEM;
}
- platdata->devid = devid;
+ plat->devid = devid;
info.name = DRV_NAME_BLK;
- info.platdata = platdata;
+ info.plat = plat;
ret = device_bind_by_name(parent, false, &info, &udev);
if (ret < 0) {
printf("Failed to bind " DRV_NAME_BLK " to device with ID %d, ret: %d\n",
devid, ret);
- free(platdata);
+ free(plat);
}
return ret;
}
class_name = uclass_get_name(UCLASS_PVBLOCK);
for (blk_first_device(IF_TYPE_PVBLOCK, &udev); udev;
blk_next_device(&udev), first = false) {
- struct blk_desc *desc = dev_get_uclass_platdata(udev);
+ struct blk_desc *desc = dev_get_uclass_plat(udev);
if (!first)
puts(", ");
};
/**
- * struct adc_uclass_platdata - basic ADC info
+ * struct adc_uclass_plat - basic ADC info
*
* Note: The positive/negative reference Voltage is only a name and it doesn't
* provide an information about the value polarity. It is possible, for both
* @vdd_microvolts - positive reference Voltage value
* @vss_microvolts - negative reference Voltage value
*/
-struct adc_uclass_platdata {
+struct adc_uclass_plat {
int data_format;
unsigned int data_mask;
unsigned int data_timeout_us;
/*
* With driver model (CONFIG_BLK) this is uclass platform data, accessible
- * with dev_get_uclass_platdata(dev)
+ * with dev_get_uclass_plat(dev)
*/
struct blk_desc {
/*
* @timebase_freq: the current frequency at which the cpu timer timebase
* registers are updated (in Hz)
*
- * This can be accessed with dev_get_parent_platdata() for any UCLASS_CPU
+ * This can be accessed with dev_get_parent_plat() for any UCLASS_CPU
* device.
*/
struct cpu_platdata {
* device_bind() - Create a device and bind it to a driver
*
* Called to set up a new device attached to a driver. The device will either
- * have platdata, or a device tree node which can be used to create the
- * platdata.
+ * have plat, or a device tree node which can be used to create the
+ * plat.
*
* Once bound a device exists but is not yet active until device_probe() is
* called.
* @parent: Pointer to device's parent, under which this driver will exist
* @drv: Device's driver
* @name: Name of device (e.g. device tree node name)
- * @platdata: Pointer to data for this device - the structure is device-
+ * @plat: Pointer to data for this device - the structure is device-
* specific but may include the device's I/O address, etc.. This is NULL for
* devices which use device tree.
* @ofnode: Devicetree node for this device. This is ofnode_null() for
* @return 0 if OK, -ve on error
*/
int device_bind(struct udevice *parent, const struct driver *drv,
- const char *name, void *platdata, ofnode node,
+ const char *name, void *plat, ofnode node,
struct udevice **devp);
/**
* @parent: Pointer to device's parent
* @pre_reloc_only: If true, bind the driver only if its DM_FLAG_PRE_RELOC flag
* is set. If false bind the driver always.
- * @info: Name and platdata for this device
+ * @info: Name and plat for this device
* @devp: if non-NULL, returns a pointer to the bound device
* @return 0 if OK, -ve on error
*/
/* Driver is active (probed). Cleared when it is removed */
#define DM_FLAG_ACTIVATED (1 << 0)
-/* DM is responsible for allocating and freeing platdata */
+/* DM is responsible for allocating and freeing plat */
#define DM_FLAG_ALLOC_PDATA (1 << 1)
/* DM should init this device prior to relocation */
#define DM_FLAG_PRE_RELOC (1 << 2)
-/* DM is responsible for allocating and freeing parent_platdata */
+/* DM is responsible for allocating and freeing parent_plat */
#define DM_FLAG_ALLOC_PARENT_PDATA (1 << 3)
-/* DM is responsible for allocating and freeing uclass_platdata */
+/* DM is responsible for allocating and freeing uclass_plat */
#define DM_FLAG_ALLOC_UCLASS_PDATA (1 << 4)
/* Allocate driver private data on a DMA boundary */
/* DM does not enable/disable the power domains corresponding to this device */
#define DM_FLAG_DEFAULT_PD_CTRL_OFF (1 << 11)
-/* Driver platdata has been read. Cleared when the device is removed */
+/* Driver plat has been read. Cleared when the device is removed */
#define DM_FLAG_PLATDATA_VALID (1 << 12)
/*
* particular port or peripheral (essentially a driver instance).
*
* A device will come into existence through a 'bind' call, either due to
- * a U_BOOT_DEVICE() macro (in which case platdata is non-NULL) or a node
+ * a U_BOOT_DEVICE() macro (in which case plat is non-NULL) or a node
* in the device tree (in which case of_offset is >= 0). In the latter case
- * we translate the device tree information into platdata in a function
+ * we translate the device tree information into plat in a function
* implemented by the driver ofdata_to_platdata method (called just before the
* probe method if the device has a device tree node.
*
- * All three of platdata, priv and uclass_priv can be allocated by the
- * driver, or you can use the 'auto' members of struct driver and
+ * All three of plat, priv and uclass_priv can be allocated by the
+ * driver, or you can use the auto_alloc_size members of struct driver and
* struct uclass_driver to have driver model do this automatically.
*
* @driver: The driver used by this device
* @name: Name of device, typically the FDT node name
- * @platdata: Configuration data for this device
- * @parent_platdata: The parent bus's configuration data for this device
- * @uclass_platdata: The uclass's configuration data for this device
+ * @plat: Configuration data for this device
+ * @parent_plat: The parent bus's configuration data for this device
+ * @uclass_plat: The uclass's configuration data for this device
* @node: Reference to device tree node for this device
* @driver_data: Driver data word for the entry that matched this device with
* its driver
struct udevice {
const struct driver *driver;
const char *name;
- void *platdata;
- void *parent_platdata;
- void *uclass_platdata;
+ void *plat;
+ void *parent_plat;
+ void *uclass_plat;
ofnode node;
ulong driver_data;
struct udevice *parent;
*
* This holds methods for setting up a new device, and also removing it.
* The device needs information to set itself up - this is provided either
- * by platdata or a device tree node (which we find by looking up
+ * by plat or a device tree node (which we find by looking up
* matching compatible strings with of_match).
*
* Drivers all belong to a uclass, representing a class of devices of the
* @priv_auto: If non-zero this is the size of the private data
* to be allocated in the device's ->priv pointer. If zero, then the driver
* is responsible for allocating any data required.
- * @platdata_auto: If non-zero this is the size of the
- * platform data to be allocated in the device's ->platdata pointer.
+ * @plat_auto: If non-zero this is the size of the
+ * platform data to be allocated in the device's ->plat pointer.
* This is typically only useful for device-tree-aware drivers (those with
- * an of_match), since drivers which use platdata will have the data
+ * an of_match), since drivers which use plat will have the data
* provided in the U_BOOT_DEVICE() instantiation.
* @per_child_auto: Each device can hold private data owned by
* its parent. If required this will be automatically allocated if this
* value is non-zero.
- * @per_child_platdata_auto: A bus likes to store information about
+ * @per_child_plat_auto: A bus likes to store information about
* its children. If non-zero this is the size of this data, to be allocated
- * in the child's parent_platdata pointer.
+ * in the child's parent_plat pointer.
* @ops: Driver-specific operations. This is typically a list of function
* pointers defined by the driver, to implement driver functions required by
* the uclass.
int (*child_pre_probe)(struct udevice *dev);
int (*child_post_remove)(struct udevice *dev);
int priv_auto;
- int platdata_auto;
+ int plat_auto;
int per_child_auto;
- int per_child_platdata_auto;
+ int per_child_plat_auto;
const void *ops; /* driver-specific operations */
uint32_t flags;
#if CONFIG_IS_ENABLED(ACPIGEN)
void *dev_get_platdata(const struct udevice *dev);
/**
- * dev_get_parent_platdata() - Get the parent platform data for a device
+ * dev_get_parent_plat() - Get the parent platform data for a device
*
* This checks that dev is not NULL, but no other checks for now
*
* @dev Device to check
* @return parent's platform data, or NULL if none
*/
-void *dev_get_parent_platdata(const struct udevice *dev);
+void *dev_get_parent_plat(const struct udevice *dev);
/**
- * dev_get_uclass_platdata() - Get the uclass platform data for a device
+ * dev_get_uclass_plat() - Get the uclass platform data for a device
*
* This checks that dev is not NULL, but no other checks for now
*
* @dev Device to check
* @return uclass's platform data, or NULL if none
*/
-void *dev_get_uclass_platdata(const struct udevice *dev);
+void *dev_get_uclass_plat(const struct udevice *dev);
/**
* dev_get_priv() - Get the private data for a device
struct udevice **devp);
/**
- * device_first_child_ofdata_err() - Find the first child and reads its platdata
+ * device_first_child_ofdata_err() - Find the first child and reads its plat
*
* The ofdata_to_platdata() method is called on the child before it is returned,
* but the child is not probed.
struct udevice **devp);
/*
- * device_next_child_ofdata_err() - Find the next child and read its platdata
+ * device_next_child_ofdata_err() - Find the next child and read its plat
*
* The ofdata_to_platdata() method is called on the child before it is returned,
* but the child is not probed.
* lists_driver_lookup_name() - Return u_boot_driver corresponding to name
*
* This function returns a pointer to a driver given its name. This is used
- * for binding a driver given its name and platdata.
+ * for binding a driver given its name and plat.
*
* @name: Name of driver to look up
* @return pointer to driver, or NULL if not found
*
* This returns an int to avoid a dependency on pci.h
*
- * @reg: reg value from dt-platdata.c array (first member). This is not a
+ * @reg: reg value from dt-plat.c array (first member). This is not a
* pointer type, since the caller may use fdt32_t or fdt64_t depending on
* the address sizes.
* @return device/function for that device (pci_dev_t format)
* available). U-Boot's driver model uses device tree for configuration.
*
* @name: Driver name
- * @platdata: Driver-specific platform data
+ * @plat: Driver-specific platform data
* @platdata_size: Size of platform data structure
* @parent_idx: Index of the parent driver_info structure
*/
struct driver_info {
const char *name;
- const void *platdata;
+ const void *plat;
#if CONFIG_IS_ENABLED(OF_PLATDATA)
unsigned short platdata_size;
short parent_idx;
* available). U-Boot's driver model uses device tree for configuration.
*
* When of-platdata is in use, U_BOOT_DEVICE() cannot be used outside of the
- * dt-platdata.c file created by dtoc
+ * dt-plat.c file created by dtoc
*/
#if CONFIG_IS_ENABLED(OF_PLATDATA) && !defined(DT_PLATDATA_C)
#define U_BOOT_DEVICE(__name) _Static_assert(false, \
/**
* dm_scan_platdata() - Scan all platform data and bind drivers
*
- * This scans all available platdata and creates drivers for each
+ * This scans all available plat and creates drivers for each
*
* @pre_reloc_only: If true, bind only drivers with the DM_FLAG_PRE_RELOC
* flag. If false bind all drivers.
* @per_device_auto: Each device can hold private data owned
* by the uclass. If required this will be automatically allocated if this
* value is non-zero.
- * @per_device_platdata_auto: Each device can hold platform data
- * owned by the uclass as 'dev->uclass_platdata'. If the value is non-zero,
+ * @per_device_plat_auto: Each device can hold platform data
+ * owned by the uclass as 'dev->uclass_plat'. If the value is non-zero,
* then this will be automatically allocated.
* @per_child_auto: Each child device (of a parent in this
* uclass) can hold parent data for the device/uclass. This value is only
* used as a fallback if this member is 0 in the driver.
- * @per_child_platdata_auto: A bus likes to store information about
+ * @per_child_plat_auto: A bus likes to store information about
* its children. If non-zero this is the size of this data, to be allocated
- * in the child device's parent_platdata pointer. This value is only used as
+ * in the child device's parent_plat pointer. This value is only used as
* a fallback if this member is 0 in the driver.
* @ops: Uclass operations, providing the consistent interface to devices
* within the uclass.
int (*destroy)(struct uclass *class);
int priv_auto;
int per_device_auto;
- int per_device_platdata_auto;
+ int per_device_plat_auto;
int per_child_auto;
- int per_child_platdata_auto;
+ int per_child_plat_auto;
const void *ops;
uint32_t flags;
};
* ...
*
* Inside U_BOOT_DRIVER():
- * .platdata_auto = sizeof(struct rockchip_mmc_plat),
+ * .plat_auto = sizeof(struct rockchip_mmc_plat),
*
* To access platform data:
* struct rockchip_mmc_plat *plat = dev_get_platdata(dev);
* An I2C chip is a device on the I2C bus. It sits at a particular address
* and normally supports 7-bit or 10-bit addressing.
*
- * To obtain this structure, use dev_get_parent_platdata(dev) where dev is
+ * To obtain this structure, use dev_get_parent_plat(dev) where dev is
* the chip to examine.
*
* @chip_addr: Chip address on bus
* @enetaddr: The Ethernet MAC address that is loaded from EEPROM or env
* @phy_interface: PHY interface to use - see PHY_INTERFACE_MODE_...
* @max_speed: Maximum speed of Ethernet connection supported by MAC
- * @priv_pdata: device specific platdata
+ * @priv_pdata: device specific plat
*/
struct eth_pdata {
phys_addr_t iobase;
*
* Every device on a PCI bus has this per-child data.
*
- * It can be accessed using dev_get_parent_platdata(dev) if dev->parent is a
+ * It can be accessed using dev_get_parent_plat(dev) if dev->parent is a
* PCI bus (i.e. UCLASS_PCI)
*
* @devfn: Encoded device and function index - see PCI_DEVFN()
* 'UCLASS_REGULATOR' and the regulator driver API.
*
* The regulator uclass - is based on uclass platform data which is allocated,
- * automatically for each regulator device on bind and 'dev->uclass_platdata'
- * points to it. The data type is: 'struct dm_regulator_uclass_platdata'.
+ * automatically for each regulator device on bind and 'dev->uclass_plat'
+ * points to it. The data type is: 'struct dm_regulator_uclass_plat'.
* The uclass file: 'drivers/power/regulator/regulator-uclass.c'
*
* The regulator device - is based on driver's model 'struct udevice'.
* The API can use regulator name in two meanings:
* - devname - the regulator device's name: 'dev->name'
- * - platname - the device's platdata's name. So in the code it looks like:
- * 'uc_pdata = dev->uclass_platdata'; 'name = uc_pdata->name'.
+ * - platname - the device's plat's name. So in the code it looks like:
+ * 'uc_pdata = dev->uclass_plat'; 'name = uc_pdata->name'.
*
* The regulator device driver - provide an implementation of uclass operations
* pointed by 'dev->driver->ops' as a struct of type 'struct dm_regulator_ops'.
};
/**
- * struct dm_regulator_uclass_platdata - pointed by dev->uclass_platdata, and
+ * struct dm_regulator_uclass_plat - pointed by dev->uclass_plat, and
* allocated on each regulator bind. This structure holds an information
* about each regulator's constraints and supported operation modes.
* There is no "step" voltage value - so driver should take care of this.
* The constraints: type, mode, mode_count, can be set by device driver, e.g.
* by the driver '.probe' method.
*/
-struct dm_regulator_uclass_platdata {
+struct dm_regulator_uclass_plat {
enum regulator_type type;
struct dm_regulator_mode *mode;
int mode_count;
* regulator_autoset: setup the voltage/current on a regulator
*
* The setup depends on constraints found in device's uclass's platform data
- * (struct dm_regulator_uclass_platdata):
+ * (struct dm_regulator_uclass_plat):
*
* - Enable - will set - if any of: 'always_on' or 'boot_on' is set to true,
* or if both are unset, then the function returns
*
* The function returns on the first-encountered error.
*
- * @platname - expected string for dm_regulator_uclass_platdata .name field
+ * @platname - expected string for dm_regulator_uclass_plat .name field
* @devp - returned pointer to the regulator device - if non-NULL passed
* @return: 0 on success or negative value of errno.
*/
/**
* regulator_autoset_by_name: setup the regulator given by its uclass's
* platform data name field. The setup depends on constraints found in device's
- * uclass's platform data (struct dm_regulator_uclass_platdata):
+ * uclass's platform data (struct dm_regulator_uclass_plat):
* - Enable - will set - if any of: 'always_on' or 'boot_on' is set to true,
* or if both are unset, then the function returns
* - Voltage value - will set - if '.min_uV' and '.max_uV' values are equal
*
* The function returns on first encountered error.
*
- * @platname - expected string for dm_regulator_uclass_platdata .name field
+ * @platname - expected string for dm_regulator_uclass_plat .name field
* @devp - returned pointer to the regulator device - if non-NULL passed
* @return: 0 on success or negative value of errno.
*
* regulator_autoset_by_name() for each name from the list.
*
* @list_platname - an array of expected strings for .name field of each
- * regulator's uclass platdata
+ * regulator's uclass plat
* @list_devp - an array of returned pointers to the successfully setup
* regulator devices if non-NULL passed
* @verbose - (true/false) print each regulator setup info, or be quiet
/**
* regulator_get_by_platname: returns the pointer to the pmic regulator device.
- * Search by name, found in regulator uclass platdata.
+ * Search by name, found in regulator uclass plat.
*
- * @platname - expected string for uc_pdata->name of regulator uclass platdata
+ * @platname - expected string for uc_pdata->name of regulator uclass plat
* @devp - returns pointer to the regulator device or NULL on error
* @return 0 on success or negative value of errno.
*
* @mem_type: one of 'enum rproc_mem_type'
* @driver_plat_data: driver specific platform data that may be needed.
*
- * This can be accessed with dev_get_uclass_platdata() for any UCLASS_REMOTEPROC
+ * This can be accessed with dev_get_uclass_plat() for any UCLASS_REMOTEPROC
* device.
*
*/
* ...
*
* Inside U_BOOT_DRIVER():
- * .platdata_auto = sizeof(struct msm_sdhc_plat),
+ * .plat_auto = sizeof(struct msm_sdhc_plat),
*
* To access platform data:
* struct msm_sdhc_plat *plat = dev_get_platdata(dev);
* struct dm_spi_platdata - platform data for all SPI slaves
*
* This describes a SPI slave, a child device of the SPI bus. To obtain this
- * struct from a spi_slave, use dev_get_parent_platdata(dev) or
- * dev_get_parent_platdata(slave->dev).
+ * struct from a spi_slave, use dev_get_parent_plat(dev) or
+ * dev_get_parent_plat(slave->dev).
*
* This data is immuatable. Each time the device is probed, @max_hz and @mode
* will be copied to struct spi_slave.
* is automatically bound on this chip select with requested speed and mode.
*
* Ths new slave device is probed ready for use with the speed and mode
- * from platdata when available or the requested values.
+ * from plat when available or the requested values.
*
* @busnum: SPI bus number
* @cs: Chip select to look for
- * @speed: SPI speed to use for this slave when not available in platdata
- * @mode: SPI mode to use for this slave when not available in platdata
+ * @speed: SPI speed to use for this slave when not available in plat
+ * @mode: SPI mode to use for this slave when not available in plat
* @drv_name: Name of driver to attach to this chip select
* @dev_name: Name of the new device thus created
* @busp: Returns bus device
/**
* struct usb_dev_platdata - Platform data about a USB device
*
- * Given a USB device dev this structure is dev_get_parent_platdata(dev).
+ * Given a USB device dev this structure is dev_get_parent_plat(dev).
* This is used by sandbox to provide emulation data also.
*
* @id: ID used to match this device
* struct usb_emul_platdata - platform data about the USB emulator
*
* Given a USB emulator (UCLASS_USB_EMUL) 'dev', this is
- * dev_get_uclass_platdata(dev).
+ * dev_get_uclass_plat(dev).
*
* @port1: USB emulator device port number on the parent hub
*/
* struct video_uc_platdata - uclass platform data for a video device
*
* This holds information that the uclass needs to know about each device. It
- * is accessed using dev_get_uclass_platdata(dev). See 'Theory of operation' at
+ * is accessed using dev_get_uclass_plat(dev). See 'Theory of operation' at
* the top of video-uclass.c for details on how this information is set.
*
* @align: Frame-buffer alignment, indicating the memory boundary the frame
*
* Note: This function is for internal use.
*
- * This uses the uclass platdata's @size and @align members to figure out
+ * This uses the uclass plat's @size and @align members to figure out
* a size and position for each frame buffer as part of the pre-relocation
* process of determining the post-relocation memory layout.
*
static int acpi_device_set_i2c(const struct udevice *dev, struct acpi_i2c *i2c,
const char *scope)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
struct udevice *bus = dev_get_parent(dev);
memset(i2c, '\0', sizeof(*i2c));
struct dm_spi_slave_platdata *plat;
struct spi_slave *slave = dev_get_parent_priv(dev);
- plat = dev_get_parent_platdata(slave->dev);
+ plat = dev_get_parent_plat(slave->dev);
memset(spi, '\0', sizeof(*spi));
spi->device_select = plat->cs;
spi->device_select_polarity = SPI_POLARITY_LOW;
static ulong efi_bl_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
void *buffer)
{
- struct efi_blk_platdata *platdata = dev_get_platdata(dev);
- struct efi_block_io *io = platdata->io;
+ struct efi_blk_platdata *plat = dev_get_platdata(dev);
+ struct efi_block_io *io = plat->io;
efi_status_t ret;
EFI_PRINT("%s: read '%s', from block " LBAFU ", " LBAFU " blocks\n",
static ulong efi_bl_write(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
const void *buffer)
{
- struct efi_blk_platdata *platdata = dev_get_platdata(dev);
- struct efi_block_io *io = platdata->io;
+ struct efi_blk_platdata *plat = dev_get_platdata(dev);
+ struct efi_block_io *io = plat->io;
efi_status_t ret;
EFI_PRINT("%s: write '%s', from block " LBAFU ", " LBAFU " blocks\n",
struct blk_desc *desc;
const char *if_typename;
- desc = dev_get_uclass_platdata(dev);
+ desc = dev_get_uclass_plat(dev);
if_typename = blk_get_if_type_name(desc->if_type);
return efi_disk_create_partitions(handle, desc, if_typename,
struct efi_object *obj = efi_search_obj(handle);
struct efi_block_io *io = interface;
int disks;
- struct efi_blk_platdata *platdata;
+ struct efi_blk_platdata *plat;
EFI_PRINT("%s: handle %p, interface %p\n", __func__, handle, io);
/* Set the DM_FLAG_NAME_ALLOCED flag to avoid a memory leak */
device_set_name_alloced(bdev);
- platdata = dev_get_platdata(bdev);
- platdata->handle = handle;
- platdata->io = interface;
+ plat = dev_get_platdata(bdev);
+ plat->handle = handle;
+ plat->io = interface;
ret = device_probe(bdev);
if (ret)
.name = "efi_blk",
.id = UCLASS_BLK,
.ops = &efi_blk_ops,
- .platdata_auto = sizeof(struct efi_blk_platdata),
+ .plat_auto = sizeof(struct efi_blk_platdata),
};
/* EFI driver operators */
case UCLASS_ETH: {
struct efi_device_path_mac_addr *dp =
dp_fill(buf, dev->parent);
- struct eth_pdata *pdata = dev->platdata;
+ struct eth_pdata *pdata = dev->plat;
dp->dp.type = DEVICE_PATH_TYPE_MESSAGING_DEVICE;
dp->dp.sub_type = DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR;
case UCLASS_ROOT: {
/* stop traversing parents at this point: */
struct efi_device_path_vendor *dp;
- struct blk_desc *desc = dev_get_uclass_platdata(dev);
+ struct blk_desc *desc = dev_get_uclass_plat(dev);
dp_fill(buf, dev->parent);
dp = buf;
#ifdef CONFIG_VIRTIO_BLK
case UCLASS_VIRTIO: {
struct efi_device_path_vendor *dp;
- struct blk_desc *desc = dev_get_uclass_platdata(dev);
+ struct blk_desc *desc = dev_get_uclass_plat(dev);
dp_fill(buf, dev->parent);
dp = buf;
case UCLASS_IDE: {
struct efi_device_path_atapi *dp =
dp_fill(buf, dev->parent);
- struct blk_desc *desc = dev_get_uclass_platdata(dev);
+ struct blk_desc *desc = dev_get_uclass_plat(dev);
dp->dp.type = DEVICE_PATH_TYPE_MESSAGING_DEVICE;
dp->dp.sub_type = DEVICE_PATH_SUB_TYPE_MSG_ATAPI;
case UCLASS_SCSI: {
struct efi_device_path_scsi *dp =
dp_fill(buf, dev->parent);
- struct blk_desc *desc = dev_get_uclass_platdata(dev);
+ struct blk_desc *desc = dev_get_uclass_plat(dev);
dp->dp.type = DEVICE_PATH_TYPE_MESSAGING_DEVICE;
dp->dp.sub_type = DEVICE_PATH_SUB_TYPE_MSG_SCSI;
case UCLASS_MMC: {
struct efi_device_path_sd_mmc_path *sddp =
dp_fill(buf, dev->parent);
- struct blk_desc *desc = dev_get_uclass_platdata(dev);
+ struct blk_desc *desc = dev_get_uclass_plat(dev);
sddp->dp.type = DEVICE_PATH_TYPE_MESSAGING_DEVICE;
sddp->dp.sub_type = is_sd(desc) ?
case UCLASS_AHCI: {
struct efi_device_path_sata *dp =
dp_fill(buf, dev->parent);
- struct blk_desc *desc = dev_get_uclass_platdata(dev);
+ struct blk_desc *desc = dev_get_uclass_plat(dev);
dp->dp.type = DEVICE_PATH_TYPE_MESSAGING_DEVICE;
dp->dp.sub_type = DEVICE_PATH_SUB_TYPE_MSG_SATA;
for (uclass_first_device_check(UCLASS_BLK, &dev); dev;
uclass_next_device_check(&dev)) {
- struct blk_desc *desc = dev_get_uclass_platdata(dev);
+ struct blk_desc *desc = dev_get_uclass_plat(dev);
const char *if_typename = blk_get_if_type_name(desc->if_type);
/* Add block device for the full device */
uclass_find_first_device(UCLASS_CPU, &cpu);
if (cpu) {
- struct cpu_platdata *plat = dev_get_parent_platdata(cpu);
+ struct cpu_platdata *plat = dev_get_parent_plat(cpu);
if (plat->family)
processor_family = plat->family;
struct eth_pdata *pdata;
if (eth_get_dev()) {
- pdata = eth_get_dev()->platdata;
+ pdata = eth_get_dev()->plat;
return pdata->enetaddr;
}
/* seq is valid since the device is active */
if (eth_get_ops(dev)->write_hwaddr && !eth_mac_skip(dev->seq)) {
- pdata = dev->platdata;
+ pdata = dev->plat;
if (!is_valid_ethaddr(pdata->enetaddr)) {
printf("\nError: %s address %pM illegal value\n",
dev->name, pdata->enetaddr);
retval = uclass_find_device_by_seq(UCLASS_ETH, index, false, &dev);
if (!retval) {
- struct eth_pdata *pdata = dev->platdata;
+ struct eth_pdata *pdata = dev->plat;
switch (op) {
case env_op_create:
case env_op_overwrite:
static int eth_post_probe(struct udevice *dev)
{
struct eth_device_priv *priv = dev->uclass_priv;
- struct eth_pdata *pdata = dev->platdata;
+ struct eth_pdata *pdata = dev->plat;
unsigned char env_enetaddr[ARP_HLEN];
char *source = "DT";
static int eth_pre_remove(struct udevice *dev)
{
- struct eth_pdata *pdata = dev->platdata;
+ struct eth_pdata *pdata = dev->plat;
eth_get_ops(dev)->stop(dev);
struct udevice *mux = ch->parent;
struct mdio_mux_perdev_priv *priv = dev_get_uclass_priv(mux);
struct mdio_mux_ops *ops = mdio_mux_get_ops(mux);
- struct mdio_mux_ch_data *ch_data = dev_get_parent_platdata(ch);
+ struct mdio_mux_ch_data *ch_data = dev_get_parent_plat(ch);
int err = 0;
if (sel) {
/* Picks up the mux selection value for each child */
static int dm_mdio_mux_child_post_bind(struct udevice *ch)
{
- struct mdio_mux_ch_data *ch_data = dev_get_parent_platdata(ch);
+ struct mdio_mux_ch_data *ch_data = dev_get_parent_plat(ch);
ch_data->sel = dev_read_u32_default(ch, "reg", MDIO_MUX_SELECT_NONE);
.post_bind = dm_mdio_mux_post_bind,
.post_probe = dm_mdio_mux_post_probe,
.per_device_auto = sizeof(struct mdio_mux_perdev_priv),
- .per_child_platdata_auto = sizeof(struct mdio_mux_ch_data),
+ .per_child_plat_auto = sizeof(struct mdio_mux_ch_data),
};
.of_match = testacpi_ids,
.id = UCLASS_TEST_ACPI,
.bind = dm_scan_fdt_dev,
- .platdata_auto = sizeof(struct testacpi_platdata),
+ .plat_auto = sizeof(struct testacpi_platdata),
ACPI_OPS_PTR(&testacpi_ops)
};
ut_assertok(regulator_set_value(supply, SANDBOX_BUCK2_SET_UV));
ut_asserteq(SANDBOX_BUCK2_SET_UV, regulator_get_value(supply));
- /* Update ADC platdata and get new Vdd value */
+ /* Update ADC plat and get new Vdd value */
ut_assertok(adc_vdd_value(dev, &uV));
ut_asserteq(SANDBOX_BUCK2_SET_UV, uV);
* Check that the block device devnum matches its parent's
* sequence number
*/
- desc = dev_get_uclass_platdata(dev);
+ desc = dev_get_uclass_plat(dev);
ut_asserteq(desc->devnum, i);
}
DECLARE_GLOBAL_DATA_PTR;
-struct dm_test_parent_platdata {
+struct dm_test_parent_plat {
int count;
int bind_flag;
int uclass_bind_flag;
static int testbus_child_post_bind(struct udevice *dev)
{
- struct dm_test_parent_platdata *plat;
+ struct dm_test_parent_plat *plat;
- plat = dev_get_parent_platdata(dev);
+ plat = dev_get_parent_plat(dev);
plat->bind_flag = 1;
plat->uclass_bind_flag = 2;
.probe = testbus_drv_probe,
.child_post_bind = testbus_child_post_bind,
.priv_auto = sizeof(struct dm_test_priv),
- .platdata_auto = sizeof(struct dm_test_pdata),
+ .plat_auto = sizeof(struct dm_test_pdata),
.per_child_auto = sizeof(struct dm_test_parent_data),
- .per_child_platdata_auto =
- sizeof(struct dm_test_parent_platdata),
+ .per_child_plat_auto =
+ sizeof(struct dm_test_parent_plat),
.child_pre_probe = testbus_child_pre_probe,
.child_post_remove = testbus_child_post_remove,
};
}
DM_TEST(dm_test_bus_parent_ops, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
-static int test_bus_parent_platdata(struct unit_test_state *uts)
+static int test_bus_parent_plat(struct unit_test_state *uts)
{
- struct dm_test_parent_platdata *plat;
+ struct dm_test_parent_plat *plat;
struct udevice *bus, *dev;
/* Check that the bus has no children */
dev;
device_find_next_child(&dev)) {
/* Check that platform data is allocated */
- plat = dev_get_parent_platdata(dev);
+ plat = dev_get_parent_plat(dev);
ut_assert(plat != NULL);
/*
device_probe(dev);
device_remove(dev, DM_REMOVE_NORMAL);
- ut_asserteq_ptr(plat, dev_get_parent_platdata(dev));
+ ut_asserteq_ptr(plat, dev_get_parent_plat(dev));
ut_asserteq(1, plat->count);
ut_assertok(device_probe(dev));
}
dev;
device_find_next_child(&dev)) {
/* Check that platform data is allocated */
- plat = dev_get_parent_platdata(dev);
+ plat = dev_get_parent_plat(dev);
ut_assert(plat != NULL);
ut_asserteq(1, plat->count);
}
device_unbind(dev);
} while (dev);
- /* Now the child platdata should be removed and re-added */
+ /* Now the child plat should be removed and re-added */
device_probe(bus);
for (device_find_first_child(bus, &dev);
dev;
device_find_next_child(&dev)) {
/* Check that platform data is allocated */
- plat = dev_get_parent_platdata(dev);
+ plat = dev_get_parent_plat(dev);
ut_assert(plat != NULL);
ut_asserteq(0, plat->count);
}
}
/* Test that the bus can store platform data about each child */
-static int dm_test_bus_parent_platdata(struct unit_test_state *uts)
+static int dm_test_bus_parent_plat(struct unit_test_state *uts)
{
- return test_bus_parent_platdata(uts);
+ return test_bus_parent_plat(uts);
}
-DM_TEST(dm_test_bus_parent_platdata, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
+DM_TEST(dm_test_bus_parent_plat, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
/* As above but the size is controlled by the uclass */
-static int dm_test_bus_parent_platdata_uclass(struct unit_test_state *uts)
+static int dm_test_bus_parent_plat_uclass(struct unit_test_state *uts)
{
struct udevice *bus;
struct driver *drv;
/* Set the driver size to 0 so that the uclass size is used */
ut_assertok(uclass_find_device(UCLASS_TEST_BUS, 0, &bus));
drv = (struct driver *)bus->driver;
- size = drv->per_child_platdata_auto;
+ size = drv->per_child_plat_auto;
#ifdef CONFIG_SANDBOX
os_mprotect_allow(bus->uclass->uc_drv, sizeof(*bus->uclass->uc_drv));
os_mprotect_allow(drv, sizeof(*drv));
#endif
- bus->uclass->uc_drv->per_child_platdata_auto = size;
- drv->per_child_platdata_auto = 0;
- ret = test_bus_parent_platdata(uts);
+ bus->uclass->uc_drv->per_child_plat_auto = size;
+ drv->per_child_plat_auto = 0;
+ ret = test_bus_parent_plat(uts);
if (ret)
return ret;
- bus->uclass->uc_drv->per_child_platdata_auto = 0;
- drv->per_child_platdata_auto = size;
+ bus->uclass->uc_drv->per_child_plat_auto = 0;
+ drv->per_child_plat_auto = size;
return 0;
}
-DM_TEST(dm_test_bus_parent_platdata_uclass,
+DM_TEST(dm_test_bus_parent_plat_uclass,
UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
/* Test that the child post_bind method is called */
static int dm_test_bus_child_post_bind(struct unit_test_state *uts)
{
- struct dm_test_parent_platdata *plat;
+ struct dm_test_parent_plat *plat;
struct udevice *bus, *dev;
ut_assertok(uclass_get_device(UCLASS_TEST_BUS, 0, &bus));
dev;
device_find_next_child(&dev)) {
/* Check that platform data is allocated */
- plat = dev_get_parent_platdata(dev);
+ plat = dev_get_parent_plat(dev);
ut_assert(plat != NULL);
ut_asserteq(1, plat->bind_flag);
}
/* Test that the child post_bind method is called */
static int dm_test_bus_child_post_bind_uclass(struct unit_test_state *uts)
{
- struct dm_test_parent_platdata *plat;
+ struct dm_test_parent_plat *plat;
struct udevice *bus, *dev;
ut_assertok(uclass_get_device(UCLASS_TEST_BUS, 0, &bus));
dev;
device_find_next_child(&dev)) {
/* Check that platform data is allocated */
- plat = dev_get_parent_platdata(dev);
+ plat = dev_get_parent_plat(dev);
ut_assert(plat != NULL);
ut_asserteq(2, plat->uclass_bind_flag);
}
U_BOOT_DEVICE(dm_test_info1) = {
.name = "test_drv",
- .platdata = &test_pdata[0],
+ .plat = &test_pdata[0],
};
U_BOOT_DEVICE(dm_test_info2) = {
.name = "test_drv",
- .platdata = &test_pdata[1],
+ .plat = &test_pdata[1],
};
U_BOOT_DEVICE(dm_test_info3) = {
.name = "test_drv",
- .platdata = &test_pdata[2],
+ .plat = &test_pdata[2],
};
static struct driver_info driver_info_manual = {
.name = "test_manual_drv",
- .platdata = &test_pdata_manual,
+ .plat = &test_pdata_manual,
};
static struct driver_info driver_info_pre_reloc = {
.name = "test_pre_reloc_drv",
- .platdata = &test_pdata_pre_reloc,
+ .plat = &test_pdata_pre_reloc,
};
static struct driver_info driver_info_act_dma = {
return 0;
}
-/* Test that binding with platdata occurs correctly */
+/* Test that binding with plat occurs correctly */
static int dm_test_autobind(struct unit_test_state *uts)
{
struct dm_test_state *dms = uts->priv;
}
DM_TEST(dm_test_autobind, 0);
-/* Test that binding with uclass platdata allocation occurs correctly */
+/* Test that binding with uclass plat allocation occurs correctly */
static int dm_test_autobind_uclass_pdata_alloc(struct unit_test_state *uts)
{
struct dm_test_perdev_uc_pdata *uc_pdata;
/**
* Test if test uclass driver requires allocation for the uclass
- * platform data and then check the dev->uclass_platdata pointer.
+ * platform data and then check the dev->uclass_plat pointer.
*/
- ut_assert(uc->uc_drv->per_device_platdata_auto);
+ ut_assert(uc->uc_drv->per_device_plat_auto);
for (uclass_find_first_device(UCLASS_TEST, &dev);
dev;
uclass_find_next_device(&dev)) {
ut_assertnonnull(dev);
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ut_assert(uc_pdata);
}
}
DM_TEST(dm_test_autobind_uclass_pdata_alloc, UT_TESTF_SCAN_PDATA);
-/* Test that binding with uclass platdata setting occurs correctly */
+/* Test that binding with uclass plat setting occurs correctly */
static int dm_test_autobind_uclass_pdata_valid(struct unit_test_state *uts)
{
struct dm_test_perdev_uc_pdata *uc_pdata;
uclass_find_next_device(&dev)) {
ut_assertnonnull(dev);
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ut_assert(uc_pdata);
ut_assert(uc_pdata->intval1 == TEST_UC_PDATA_INTVAL1);
ut_assert(uc_pdata->intval2 == TEST_UC_PDATA_INTVAL2);
ut_assert(priv);
ut_asserteq(expected_base_add, priv->base_add);
- pdata = dev->platdata;
+ pdata = dev->plat;
expected_base_add += pdata->ping_add;
}
}
DM_TEST(dm_test_autoprobe, UT_TESTF_SCAN_PDATA);
-/* Check that we see the correct platdata in each device */
+/* Check that we see the correct plat in each device */
static int dm_test_platdata(struct unit_test_state *uts)
{
const struct dm_test_pdata *pdata;
for (i = 0; i < 3; i++) {
ut_assertok(uclass_find_device(UCLASS_TEST, i, &dev));
ut_assert(dev);
- pdata = dev->platdata;
+ pdata = dev->plat;
ut_assert(pdata->ping_add == test_pdata[i].ping_add);
}
int expected;
int pingret;
- /* Getting the child device should allocate platdata / priv */
+ /* Getting the child device should allocate plat / priv */
ut_assertok(testfdt_ping(dev, 10, &pingret));
ut_assert(dev->priv);
- ut_assert(dev->platdata);
+ ut_assert(dev->plat);
expected = 10 + base;
ut_asserteq(expected, pingret);
/*
* Get the 'reg' property, which tells us what the ping add
- * should be. We don't use the platdata because we want
+ * should be. We don't use the plat because we want
* to test the code that sets that up (testfdt_drv_probe()).
*/
base = test_pdata[i].ping_add;
&driver_info_manual, &dev));
pdata = calloc(1, sizeof(*pdata));
pdata->ping_add = key + i;
- dev->platdata = pdata;
+ dev->plat = pdata;
if (child)
child[i] = dev;
}
ut_asserteq(1, stats.allocs);
ut_asserteq(TEST_DEVRES_SIZE, stats.total_size);
- /* Getting platdata should add one allocation */
+ /* Getting plat should add one allocation */
ut_assertok(device_ofdata_to_platdata(dev));
devres_get_stats(dev, &stats);
ut_asserteq(2, stats.allocs);
/*
* We expect to get 4 banks. One is anonymous (just numbered) and
- * comes from platdata. The other are named a (20 gpios),
+ * comes from plat. The other are named a (20 gpios),
* b (10 gpios) and c (10 gpios) and come from the device tree. See
* test/dm/test.dts.
*/
ut_asserteq(4, len);
break;
case 3:
- /* only for platdata */
+ /* only for plat */
ut_asserteq_str("name", propname);
ut_asserteq(6, len);
ut_asserteq_str("flash", value);
/* Test regulator get method */
static int dm_test_power_regulator_get(struct unit_test_state *uts)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
struct udevice *dev_by_devname;
struct udevice *dev_by_platname;
const char *devname;
* a device with the name equal to the requested one.
*/
ut_assertok(regulator_get_by_platname(platname, &dev_by_platname));
- uc_pdata = dev_get_uclass_platdata(dev_by_platname);
+ uc_pdata = dev_get_uclass_plat(dev_by_platname);
ut_assert(uc_pdata);
ut_asserteq_str(platname, uc_pdata->name);
/* Test regulator set and get Voltage method */
static int dm_test_power_regulator_set_get_voltage(struct unit_test_state *uts)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
struct udevice *dev;
const char *platname;
int val_set, val_get;
platname = regulator_names[BUCK1][PLATNAME];
ut_assertok(regulator_get_by_platname(platname, &dev));
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ut_assert(uc_pdata);
val_set = uc_pdata->min_uV;
/* Test regulator set and get Current method */
static int dm_test_power_regulator_set_get_current(struct unit_test_state *uts)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
struct udevice *dev;
const char *platname;
int val_set, val_get;
platname = regulator_names[LDO1][PLATNAME];
ut_assertok(regulator_get_by_platname(platname, &dev));
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ut_assert(uc_pdata);
val_set = uc_pdata->min_uA;
platname = regulator_names[LDO2][PLATNAME];
ut_assertok(regulator_get_by_platname(platname, &dev));
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ut_assert(uc_pdata);
ut_asserteq(-ENODATA, uc_pdata->min_uA);
ut_asserteq(-ENODATA, uc_pdata->max_uA);
/* Test regulator set and get suspend Voltage method */
static int dm_test_power_regulator_set_get_suspend_voltage(struct unit_test_state *uts)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
const struct dm_regulator_ops *ops;
struct udevice *dev;
const char *platname;
platname = regulator_names[BUCK1][PLATNAME];
ut_assertok(regulator_get_by_platname(platname, &dev));
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ut_assert(uc_pdata);
ops = dev_get_driver_ops(dev);
static int testfdt_drv_ping(struct udevice *dev, int pingval, int *pingret)
{
- const struct dm_test_pdata *pdata = dev->platdata;
+ const struct dm_test_pdata *pdata = dev->plat;
struct dm_test_priv *priv = dev_get_priv(dev);
*pingret = pingval + pdata->ping_add;
.probe = testfdt_drv_probe,
.ops = &test_ops,
.priv_auto = sizeof(struct dm_test_priv),
- .platdata_auto = sizeof(struct dm_test_pdata),
+ .plat_auto = sizeof(struct dm_test_pdata),
};
static const struct udevice_id testfdt1_ids[] = {
.probe = testfdt_drv_probe,
.ops = &test_ops,
.priv_auto = sizeof(struct dm_test_priv),
- .platdata_auto = sizeof(struct dm_test_pdata),
+ .plat_auto = sizeof(struct dm_test_pdata),
.flags = DM_FLAG_PRE_RELOC,
};
.of_match = testprobe_ids,
.id = UCLASS_TEST_PROBE,
.probe = testprobe_drv_probe,
- .platdata_auto = sizeof(struct dm_testprobe_pdata),
+ .plat_auto = sizeof(struct dm_testprobe_pdata),
};
UCLASS_DRIVER(testprobe) = {
.bind = testdevres_drv_bind,
.ofdata_to_platdata = testdevres_drv_ofdata_to_platdata,
.probe = testdevres_drv_probe,
- .platdata_auto = sizeof(struct dm_testdevres_pdata),
+ .plat_auto = sizeof(struct dm_testdevres_pdata),
.priv_auto = sizeof(struct dm_testdevres_priv),
};
/*
* Get the 'ping-expect' property, which tells us what the
- * ping add should be. We don't use the platdata because we
+ * ping add should be. We don't use the plat because we
* want to test the code that sets that up
* (testfdt_drv_probe()).
*/
ret = uclass_find_device(UCLASS_TEST_FDT, i, &dev);
ut_assert(!ret);
ut_assert(!dev_get_priv(dev));
- ut_assert(dev->platdata);
+ ut_assert(dev->plat);
}
ut_assertok(dm_check_devices(uts, num_devices));
dm_testdrv_op_count[DM_TEST_OP_POST_BIND]++;
ut_assert(!device_active(dev));
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ut_assert(uc_pdata);
uc_pdata->intval1 = TEST_UC_PDATA_INTVAL1;
if (&prev->uclass_node != &uc->dev_head) {
struct dm_test_uclass_perdev_priv *prev_uc_priv
= dev_get_uclass_priv(prev);
- struct dm_test_pdata *pdata = prev->platdata;
+ struct dm_test_pdata *pdata = prev->plat;
ut_assert(pdata);
ut_assert(prev_uc_priv);
.destroy = test_destroy,
.priv_auto = sizeof(struct dm_test_uclass_priv),
.per_device_auto = sizeof(struct dm_test_uclass_perdev_priv),
- .per_device_platdata_auto =
+ .per_device_plat_auto =
sizeof(struct dm_test_perdev_uc_pdata),
};
# Add a device declaration
self.buf('U_BOOT_DEVICE(%s) = {\n' % var_name)
self.buf('\t.name\t\t= "%s",\n' % struct_name)
- self.buf('\t.platdata\t= &%s%s,\n' % (VAL_PREFIX, var_name))
+ self.buf('\t.plat\t= &%s%s,\n' % (VAL_PREFIX, var_name))
self.buf('\t.platdata_size\t= sizeof(%s%s),\n' % (VAL_PREFIX, var_name))
idx = -1
if node.parent and node.parent in self._valid_nodes:
};
U_BOOT_DEVICE(i2c_at_0) = {
\t.name\t\t= "sandbox_i2c_test",
-\t.platdata\t= &dtv_i2c_at_0,
+\t.plat\t= &dtv_i2c_at_0,
\t.platdata_size\t= sizeof(dtv_i2c_at_0),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(pmic_at_9) = {
\t.name\t\t= "sandbox_pmic_test",
-\t.platdata\t= &dtv_pmic_at_9,
+\t.plat\t= &dtv_pmic_at_9,
\t.platdata_size\t= sizeof(dtv_pmic_at_9),
\t.parent_idx\t= 0,
};
};
U_BOOT_DEVICE(spl_test) = {
\t.name\t\t= "sandbox_spl_test",
-\t.platdata\t= &dtv_spl_test,
+\t.plat\t= &dtv_spl_test,
\t.platdata_size\t= sizeof(dtv_spl_test),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(spl_test2) = {
\t.name\t\t= "sandbox_spl_test",
-\t.platdata\t= &dtv_spl_test2,
+\t.plat\t= &dtv_spl_test2,
\t.platdata_size\t= sizeof(dtv_spl_test2),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(spl_test3) = {
\t.name\t\t= "sandbox_spl_test",
-\t.platdata\t= &dtv_spl_test3,
+\t.plat\t= &dtv_spl_test3,
\t.platdata_size\t= sizeof(dtv_spl_test3),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(spl_test4) = {
\t.name\t\t= "sandbox_spl_test_2",
-\t.platdata\t= &dtv_spl_test4,
+\t.plat\t= &dtv_spl_test4,
\t.platdata_size\t= sizeof(dtv_spl_test4),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(gpios_at_0) = {
\t.name\t\t= "sandbox_gpio",
-\t.platdata\t= &dtv_gpios_at_0,
+\t.plat\t= &dtv_gpios_at_0,
\t.platdata_size\t= sizeof(dtv_gpios_at_0),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(spl_test) = {
\t.name\t\t= "invalid",
-\t.platdata\t= &dtv_spl_test,
+\t.plat\t= &dtv_spl_test,
\t.platdata_size\t= sizeof(dtv_spl_test),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(phandle2_target) = {
\t.name\t\t= "target",
-\t.platdata\t= &dtv_phandle2_target,
+\t.plat\t= &dtv_phandle2_target,
\t.platdata_size\t= sizeof(dtv_phandle2_target),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(phandle3_target) = {
\t.name\t\t= "target",
-\t.platdata\t= &dtv_phandle3_target,
+\t.plat\t= &dtv_phandle3_target,
\t.platdata_size\t= sizeof(dtv_phandle3_target),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(phandle_target) = {
\t.name\t\t= "target",
-\t.platdata\t= &dtv_phandle_target,
+\t.plat\t= &dtv_phandle_target,
\t.platdata_size\t= sizeof(dtv_phandle_target),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(phandle_source) = {
\t.name\t\t= "source",
-\t.platdata\t= &dtv_phandle_source,
+\t.plat\t= &dtv_phandle_source,
\t.platdata_size\t= sizeof(dtv_phandle_source),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(phandle_source2) = {
\t.name\t\t= "source",
-\t.platdata\t= &dtv_phandle_source2,
+\t.plat\t= &dtv_phandle_source2,
\t.platdata_size\t= sizeof(dtv_phandle_source2),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(phandle_target) = {
\t.name\t\t= "target",
-\t.platdata\t= &dtv_phandle_target,
+\t.plat\t= &dtv_phandle_target,
\t.platdata_size\t= sizeof(dtv_phandle_target),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(phandle_source2) = {
\t.name\t\t= "source",
-\t.platdata\t= &dtv_phandle_source2,
+\t.plat\t= &dtv_phandle_source2,
\t.platdata_size\t= sizeof(dtv_phandle_source2),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(phandle2_target) = {
\t.name\t\t= "target",
-\t.platdata\t= &dtv_phandle2_target,
+\t.plat\t= &dtv_phandle2_target,
\t.platdata_size\t= sizeof(dtv_phandle2_target),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(phandle3_target) = {
\t.name\t\t= "target",
-\t.platdata\t= &dtv_phandle3_target,
+\t.plat\t= &dtv_phandle3_target,
\t.platdata_size\t= sizeof(dtv_phandle3_target),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(phandle_target) = {
\t.name\t\t= "target",
-\t.platdata\t= &dtv_phandle_target,
+\t.plat\t= &dtv_phandle_target,
\t.platdata_size\t= sizeof(dtv_phandle_target),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(phandle_source) = {
\t.name\t\t= "source",
-\t.platdata\t= &dtv_phandle_source,
+\t.plat\t= &dtv_phandle_source,
\t.platdata_size\t= sizeof(dtv_phandle_source),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(phandle_source2) = {
\t.name\t\t= "source",
-\t.platdata\t= &dtv_phandle_source2,
+\t.plat\t= &dtv_phandle_source2,
\t.platdata_size\t= sizeof(dtv_phandle_source2),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(test1) = {
\t.name\t\t= "test1",
-\t.platdata\t= &dtv_test1,
+\t.plat\t= &dtv_test1,
\t.platdata_size\t= sizeof(dtv_test1),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(test2) = {
\t.name\t\t= "test2",
-\t.platdata\t= &dtv_test2,
+\t.plat\t= &dtv_test2,
\t.platdata_size\t= sizeof(dtv_test2),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(test3) = {
\t.name\t\t= "test3",
-\t.platdata\t= &dtv_test3,
+\t.plat\t= &dtv_test3,
\t.platdata_size\t= sizeof(dtv_test3),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(test1) = {
\t.name\t\t= "test1",
-\t.platdata\t= &dtv_test1,
+\t.plat\t= &dtv_test1,
\t.platdata_size\t= sizeof(dtv_test1),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(test2) = {
\t.name\t\t= "test2",
-\t.platdata\t= &dtv_test2,
+\t.plat\t= &dtv_test2,
\t.platdata_size\t= sizeof(dtv_test2),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(test1) = {
\t.name\t\t= "test1",
-\t.platdata\t= &dtv_test1,
+\t.plat\t= &dtv_test1,
\t.platdata_size\t= sizeof(dtv_test1),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(test2) = {
\t.name\t\t= "test2",
-\t.platdata\t= &dtv_test2,
+\t.plat\t= &dtv_test2,
\t.platdata_size\t= sizeof(dtv_test2),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(test3) = {
\t.name\t\t= "test3",
-\t.platdata\t= &dtv_test3,
+\t.plat\t= &dtv_test3,
\t.platdata_size\t= sizeof(dtv_test3),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(test1) = {
\t.name\t\t= "test1",
-\t.platdata\t= &dtv_test1,
+\t.plat\t= &dtv_test1,
\t.platdata_size\t= sizeof(dtv_test1),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(test2) = {
\t.name\t\t= "test2",
-\t.platdata\t= &dtv_test2,
+\t.plat\t= &dtv_test2,
\t.platdata_size\t= sizeof(dtv_test2),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(test3) = {
\t.name\t\t= "test3",
-\t.platdata\t= &dtv_test3,
+\t.plat\t= &dtv_test3,
\t.platdata_size\t= sizeof(dtv_test3),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(spl_test) = {
\t.name\t\t= "sandbox_spl_test",
-\t.platdata\t= &dtv_spl_test,
+\t.plat\t= &dtv_spl_test,
\t.platdata_size\t= sizeof(dtv_spl_test),
\t.parent_idx\t= -1,
};
};
U_BOOT_DEVICE(spl_test2) = {
\t.name\t\t= "sandbox_spl_test",
-\t.platdata\t= &dtv_spl_test2,
+\t.plat\t= &dtv_spl_test2,
\t.platdata_size\t= sizeof(dtv_spl_test2),
\t.parent_idx\t= -1,
};