summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-12-04 02:55:18 +0300
committerSimon Glass <sjg@chromium.org>2020-12-14 02:51:08 +0300
commitcaa4daa2ae3dc0a3e516addea5772c9af76abcb0 (patch)
tree0abbc5b538894532f4db28d56e4645d3be230d27 /drivers/i2c
parent41575d8e4c334df148c4cdd7c40cc825dc0fcaa1 (diff)
downloadu-boot-caa4daa2ae3dc0a3e516addea5772c9af76abcb0.tar.xz
dm: treewide: Rename 'platdata' variables to just 'plat'
We use 'priv' for private data but often use 'platdata' for platform data. We can't really use 'pdata' since that is ambiguous (it could mean private or platform data). Rename some of the latter variables to end with 'plat' for consistency. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/Kconfig2
-rw-r--r--drivers/i2c/acpi_i2c.c2
-rw-r--r--drivers/i2c/i2c-emul-uclass.c14
-rw-r--r--drivers/i2c/i2c-uclass.c28
-rw-r--r--drivers/i2c/muxes/i2c-mux-uclass.c8
-rw-r--r--drivers/i2c/omap24xx_i2c.c2
-rw-r--r--drivers/i2c/sandbox_i2c.c2
7 files changed, 29 insertions, 29 deletions
diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
index 37958083af..403602fddf 100644
--- a/drivers/i2c/Kconfig
+++ b/drivers/i2c/Kconfig
@@ -11,7 +11,7 @@ config DM_I2C
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
diff --git a/drivers/i2c/acpi_i2c.c b/drivers/i2c/acpi_i2c.c
index 57d29683cb..ef12789e7f 100644
--- a/drivers/i2c/acpi_i2c.c
+++ b/drivers/i2c/acpi_i2c.c
@@ -210,7 +210,7 @@ int acpi_i2c_ofdata_to_platdata(struct udevice *dev)
/* 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,
diff --git a/drivers/i2c/i2c-emul-uclass.c b/drivers/i2c/i2c-emul-uclass.c
index 956ebeefb6..83f0f90831 100644
--- a/drivers/i2c/i2c-emul-uclass.c
+++ b/drivers/i2c/i2c-emul-uclass.c
@@ -14,7 +14,7 @@
* 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().
@@ -27,7 +27,7 @@
* 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
*/
@@ -37,7 +37,7 @@ struct i2c_emul_uc_platdata {
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;
}
@@ -54,7 +54,7 @@ int i2c_emul_find(struct udevice *dev, struct udevice **emulp)
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;
@@ -64,14 +64,14 @@ int i2c_emul_find(struct udevice *dev, struct udevice **emulp)
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,
diff --git a/drivers/i2c/i2c-uclass.c b/drivers/i2c/i2c-uclass.c
index 2feb5882e6..e81420558d 100644
--- a/drivers/i2c/i2c-uclass.c
+++ b/drivers/i2c/i2c-uclass.c
@@ -79,7 +79,7 @@ static int i2c_setup_offset(struct dm_i2c_chip *chip, uint offset,
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;
@@ -108,7 +108,7 @@ static int i2c_read_bytewise(struct udevice *dev, uint offset,
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];
@@ -131,7 +131,7 @@ static int i2c_write_bytewise(struct udevice *dev, uint offset,
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;
@@ -162,7 +162,7 @@ int dm_i2c_read(struct udevice *dev, uint offset, uint8_t *buffer, int len)
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];
@@ -297,7 +297,7 @@ static int i2c_bind_driver(struct udevice *bus, uint chip_addr, uint offset_len,
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);
@@ -328,7 +328,7 @@ int i2c_get_chip(struct udevice *bus, uint chip_addr, uint offset_len,
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 &
@@ -433,7 +433,7 @@ int dm_i2c_get_bus_speed(struct udevice *bus)
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;
@@ -449,7 +449,7 @@ int i2c_set_chip_flags(struct udevice *dev, uint flags)
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;
@@ -458,7 +458,7 @@ int i2c_get_chip_flags(struct udevice *dev, uint *flagsp)
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);
@@ -469,14 +469,14 @@ int i2c_set_chip_offset_len(struct udevice *dev, uint offset_len)
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;
@@ -485,7 +485,7 @@ int i2c_set_chip_addr_offset_mask(struct udevice *dev, uint 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;
}
@@ -676,7 +676,7 @@ static int i2c_post_probe(struct udevice *dev)
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;
@@ -743,7 +743,7 @@ UCLASS_DRIVER(i2c) = {
.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,
};
diff --git a/drivers/i2c/muxes/i2c-mux-uclass.c b/drivers/i2c/muxes/i2c-mux-uclass.c
index cefd9dbfff..d69c12001c 100644
--- a/drivers/i2c/muxes/i2c-mux-uclass.c
+++ b/drivers/i2c/muxes/i2c-mux-uclass.c
@@ -36,7 +36,7 @@ struct i2c_mux_bus {
/* 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);
@@ -126,7 +126,7 @@ static int i2c_mux_post_probe(struct udevice *mux)
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);
@@ -138,7 +138,7 @@ int i2c_mux_select(struct udevice *dev)
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);
@@ -221,6 +221,6 @@ UCLASS_DRIVER(i2c_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,
};
diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c
index bdb4f079e9..ea9e93327d 100644
--- a/drivers/i2c/omap24xx_i2c.c
+++ b/drivers/i2c/omap24xx_i2c.c
@@ -1094,7 +1094,7 @@ U_BOOT_DRIVER(i2c_omap) = {
#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),
diff --git a/drivers/i2c/sandbox_i2c.c b/drivers/i2c/sandbox_i2c.c
index 3abd05324a..a61dfc096b 100644
--- a/drivers/i2c/sandbox_i2c.c
+++ b/drivers/i2c/sandbox_i2c.c
@@ -27,7 +27,7 @@ static int get_emul(struct udevice *dev, struct udevice **devp,
*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)