aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Holland2022-03-17 23:52:35 -0500
committerAndre Przywara2022-04-04 23:24:17 +0100
commitc9dd3caae3119c9f77081b5c1ef42553b44ddf20 (patch)
tree8e5b29feb7c2061b67ee4b2ba7681a74361ea41b
parent07c411346cb2493e4f59a8affbd35f5efc2ec736 (diff)
i2c: sun8i_rsb: Initialize chips in .child_pre_probe
Chips attached to the RSB bus require an initialization command before they can be used. (Specifically, this command programs the chip's runtime address.) The driver does this in its .probe_chip hook, under the assumption that .probe_chip is called during child probe. This is not the case; .probe_chip is only called by dm_i2c_probe, which is intended for use by board-level code, not for chips with OF nodes. Since this initialization command must be run before a child chip can be used, do it before probing each child. Signed-off-by: Samuel Holland <samuel@sholland.org> Acked-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
-rw-r--r--drivers/i2c/sun8i_rsb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/i2c/sun8i_rsb.c b/drivers/i2c/sun8i_rsb.c
index 0dea8f7a923..38d6e87577d 100644
--- a/drivers/i2c/sun8i_rsb.c
+++ b/drivers/i2c/sun8i_rsb.c
@@ -244,11 +244,12 @@ static int sun8i_rsb_probe(struct udevice *bus)
static int sun8i_rsb_child_pre_probe(struct udevice *child)
{
struct dm_i2c_chip *chip = dev_get_parent_plat(child);
+ struct udevice *bus = child->parent;
/* Ensure each transfer is for a single register. */
chip->flags |= DM_I2C_CHIP_RD_ADDRESS | DM_I2C_CHIP_WR_ADDRESS;
- return 0;
+ return sun8i_rsb_probe_chip(bus, chip->chip_addr, 0);
}
static const struct dm_i2c_ops sun8i_rsb_ops = {