Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 853C5C433F5 for ; Fri, 17 Sep 2021 06:47:12 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id AB94160E08 for ; Fri, 17 Sep 2021 06:47:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AB94160E08 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=traverse.com.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7950A83213; Fri, 17 Sep 2021 08:46:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=traverse.com.au Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=traverse.com.au header.i=@traverse.com.au header.b="pfxsJQ9i"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="lj0teugd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9FD06831EE; Fri, 17 Sep 2021 08:46:33 +0200 (CEST) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (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 A771F831DB for ; Fri, 17 Sep 2021 08:46:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=traverse.com.au Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=matt@traverse.com.au Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id D38C65C0107; Fri, 17 Sep 2021 02:46:24 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 17 Sep 2021 02:46:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=traverse.com.au; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=UAEbbsKet/6CY BIq5uiss9Eit2a/lURi01Xr9XCB06A=; b=pfxsJQ9iBQLB3PZMM0v06DO0s9Vqu wtmRLawFyp26gpgVnpWY96/pWAUqlxvpSIkW0WEO+vOwq05hWIbN0g7oExWGCwtJ bKJnlSR4VoxhIs3f43xEGHfkcQun/dQ+L33yOrGz9IIm//kEoDTXI4f9SB3O/Gan Bv3CxIkmGdUK+11qjGOx5r9KY4yaHocojUrQR2XEiHWO9wzYYrJ4/76cgfvJu39K v/B8FZvK/uejEpp+6MySLXwx7nBgyufzMiVurHM0wGtTiZX2IcYk5OKoL5tfDjJq ihiHAQBB5i3NfwS4IxBAZuo7qJ1xn0q57i/PknBsruaGZSQapoZmY6itw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=UAEbbsKet/6CYBIq5uiss9Eit2a/lURi01Xr9XCB06A=; b=lj0teugd hQIBUT1mlmS57e7n1qPlMc+I97wG+Mz5dtZ6MCcqENxLO+Nf7uNu5jXwwvkYPD1S grwZr38eRYnG6y+8W+ES56YqEOXx+Rn5fgLyRxgrfWNuKwaYVbSdAzzoucaWXwXN mMbt04UCdFQq6bVbUINIpcfVglOTB5VGJg0M3ksMiQhgLlOpHZeI0QwZgFF6hxQ4 UNZ/ndl0VNrJHy3JsK+zztlGrLUjcvNcwfRSkr5il9PAjEps3LyqWaPzw8pGJT23 X1z4hmVDEHAFNmmFBLIuIjzXqq5AS1XvFvX9GA/7KjigFYTtQVDorsPoIqWGzm2b IcCo13mx5tz2eg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudehhedguddutdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpeforghthhgvficuofgtuehrihguvgcuoehmrghtthesthhr rghvvghrshgvrdgtohhmrdgruheqnecuggftrfgrthhtvghrnhepkeelveetledvudehte fgvdefleeukeffgeegteehtdetleejieevvdfgheejjeehnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrthhtsehtrhgrvhgvrhhsvgdrtg homhdrrghu X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 17 Sep 2021 02:46:23 -0400 (EDT) From: Mathew McBride To: u-boot@lists.denx.de Cc: Mathew McBride Subject: [PATCH 4/4] rtc: rx8025: revise single register write to use offset Date: Fri, 17 Sep 2021 06:46:04 +0000 Message-Id: <20210917064604.3912-5-matt@traverse.com.au> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210917064604.3912-1-matt@traverse.com.au> References: <20210917064604.3912-1-matt@traverse.com.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean Writing of individual registers was not functioning correctly as a 0 'offset' byte under DM-managed I2C was being appended in front of register we wanted to access. Signed-off-by: Mathew McBride --- drivers/rtc/rx8025.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/rtc/rx8025.c b/drivers/rtc/rx8025.c index 9423a1bb82..1394c2306a 100644 --- a/drivers/rtc/rx8025.c +++ b/drivers/rtc/rx8025.c @@ -214,11 +214,14 @@ static int rx8025_rtc_reset(struct udevice *dev) */ static int rtc_write(struct udevice *dev, uchar reg, uchar val) { - uchar buf[2]; - buf[0] = reg << 4; - buf[1] = val; + /* The RX8025/RX8035 uses the top 4 bits of the + * 'offset' byte as the start register address, + * and the bottom 4 bits as a 'transfer' mode setting + * (only applicable for reads) + */ + u8 offset = (reg << 4); - if (dm_i2c_write(dev, 0, buf, 2)) { + if (dm_i2c_reg_write(dev, offset, val)) { printf("Error writing to RTC\n"); return -EIO; } -- 2.30.1