public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Samuel Holland <samuel@sholland.org>
Cc: Heiko Schocher <hs@denx.de>,
	u-boot@lists.denx.de, Jagan Teki <jagan@amarulasolutions.com>
Subject: Re: [PATCH 3/4] i2c: sun8i_rsb: Initialize chips in .child_pre_probe
Date: Mon, 4 Apr 2022 18:30:45 +0100	[thread overview]
Message-ID: <20220404183045.26dd5195@donnerap.cambridge.arm.com> (raw)
In-Reply-To: <20220318045237.56237-4-samuel@sholland.org>

On Thu, 17 Mar 2022 23:52:35 -0500
Samuel Holland <samuel@sholland.org> wrote:

Hi,

> 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>

Same as for patch 1/4:
currently that code path is not called by any sunxi code, so without
looking too deep or having the ability to test this, it looks alright to
me:

Acked-by: Andre Przywara <andre.przywara@arm.com>

Cheers,
Andre

> ---
> 
>  drivers/i2c/sun8i_rsb.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/sun8i_rsb.c b/drivers/i2c/sun8i_rsb.c
> index 716b245a00..0681e398f7 100644
> --- a/drivers/i2c/sun8i_rsb.c
> +++ b/drivers/i2c/sun8i_rsb.c
> @@ -252,11 +252,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 = {


  reply	other threads:[~2022-04-04 17:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-18  4:52 [PATCH 0/4] sunxi: Fixes for DM I2C drivers Samuel Holland
2022-03-18  4:52 ` [PATCH 1/4] i2c: sun6i_p2wi: Initialize chips in .child_pre_probe Samuel Holland
2022-04-04 14:25   ` Andre Przywara
2022-03-18  4:52 ` [PATCH 2/4] i2c: sun6i_p2wi: Add support for DM clocks and resets Samuel Holland
2022-04-04 14:24   ` Andre Przywara
2022-03-18  4:52 ` [PATCH 3/4] i2c: sun8i_rsb: Initialize chips in .child_pre_probe Samuel Holland
2022-04-04 17:30   ` Andre Przywara [this message]
2022-03-18  4:52 ` [PATCH 4/4] i2c: sun8i_rsb: Add support for DM clocks and resets Samuel Holland
2022-04-04 17:30   ` Andre Przywara
2022-04-05  2:16     ` Samuel Holland
2022-04-05 22:57 ` [PATCH 0/4] sunxi: Fixes for DM I2C drivers Andre Przywara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220404183045.26dd5195@donnerap.cambridge.arm.com \
    --to=andre.przywara@arm.com \
    --cc=hs@denx.de \
    --cc=jagan@amarulasolutions.com \
    --cc=samuel@sholland.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox