Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D9B09C433EF for ; Mon, 4 Apr 2022 17:32:09 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 15C8583988; Mon, 4 Apr 2022 19:31:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 3B05183928; Mon, 4 Apr 2022 19:31:32 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 8014383966 for ; Mon, 4 Apr 2022 19:31:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CE1E61480; Mon, 4 Apr 2022 10:31:26 -0700 (PDT) Received: from donnerap.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 247CC3F718; Mon, 4 Apr 2022 10:31:26 -0700 (PDT) Date: Mon, 4 Apr 2022 18:30:45 +0100 From: Andre Przywara To: Samuel Holland Cc: Heiko Schocher , u-boot@lists.denx.de, Jagan Teki Subject: Re: [PATCH 3/4] i2c: sun8i_rsb: Initialize chips in .child_pre_probe Message-ID: <20220404183045.26dd5195@donnerap.cambridge.arm.com> In-Reply-To: <20220318045237.56237-4-samuel@sholland.org> References: <20220318045237.56237-1-samuel@sholland.org> <20220318045237.56237-4-samuel@sholland.org> Organization: ARM X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; aarch64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean On Thu, 17 Mar 2022 23:52:35 -0500 Samuel Holland 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 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 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 = {