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 27C19C433EF for ; Fri, 18 Mar 2022 04:53:21 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DA34783D1E; Fri, 18 Mar 2022 05:52:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.b="UOvJ4/V6"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="FreoceLZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CECAC83D57; Fri, 18 Mar 2022 05:52:53 +0100 (CET) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2B67C83D06 for ; Fri, 18 Mar 2022 05:52:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 4DF573200A1E; Fri, 18 Mar 2022 00:52:47 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 18 Mar 2022 00:52:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; bh=tRJbCkA/iIArBozp9Y4qzNJAXYWkst jaoNS0CHrB2YM=; b=UOvJ4/V6VrWYD8xXZSTkw0XsDe8pAB8i+ZWJEpNRvJ2fVO nXkiDtATlwAsvnpt+ER5cEMU6/09mBVDgPAcSjUkAv6SgTJ3dAuqxOJAT+bcIsAK gIqri8WnckZx3ajLnbY4nNEQp30VqaC0y0IBB9nQwDWPJlAr1l75boGb/GoKvm+6 Bm1gZMJWv4IWp57tGAhd1p+mPmtV0IkUtGTT2N/AqGrnxTSyy9HELyLKQ0zCuej1 riyP6Ic6w83sCZdUsfG+Ld5kjD46kJqM43QNwx/M40nHU5bJ5z//TwjFdg6eccPY yAg/TrqE/rAGAHzlt1KJypBklisE9yACdHxvMNNQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=tRJbCk A/iIArBozp9Y4qzNJAXYWkstjaoNS0CHrB2YM=; b=FreoceLZDhZHnN4p3q6o6f TtEXpIcctIuilM2z2PjH6hk91qwB90To4BV4QxgnkrMsop1j4qYC11nVof04VwKg 0oS0b3s2Yi46Yn/0MTu8mkDd09/uDJsC5ld1Uck1IDXbn+JyB86s4an3XDDgHdc4 SIrlpevf7Sv8qQ4H0v7TUFAxVkeemY9WBYTyG7YQIYt8+r03xNFkHGYKlh1ytvhw f9WDyBT5jotdZWoKS85g4VXnU0JrTOunOmJN6FfSaHRWwNpCFSMP0JUjK0hZr8Rs U5e3Xu1PqT/Sw2V1QSnbGRjv/xMJk3BHyvqKsEdAE4ZcKmwMEjsn6wLX3qdo0JQg == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudefhedgjeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv gfejheeuieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 18 Mar 2022 00:52:46 -0400 (EDT) From: Samuel Holland To: Heiko Schocher , u-boot@lists.denx.de, Jagan Teki , Andre Przywara Cc: Samuel Holland Subject: [PATCH 3/4] i2c: sun8i_rsb: Initialize chips in .child_pre_probe Date: Thu, 17 Mar 2022 23:52:35 -0500 Message-Id: <20220318045237.56237-4-samuel@sholland.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220318045237.56237-1-samuel@sholland.org> References: <20220318045237.56237-1-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 --- 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 = { -- 2.33.1