From patchwork Fri Sep 17 06:46:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathew McBride X-Patchwork-Id: 514168 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp1944151jao; Thu, 16 Sep 2021 23:47:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyG83RbI56/8jD/JkklN/s3lBXlenOm5du5BSrln/XJF7UJceg5TJDCxtaHFu3NL0tr1za X-Received: by 2002:a17:906:3e08:: with SMTP id k8mr10865377eji.361.1631861232710; Thu, 16 Sep 2021 23:47:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631861232; cv=none; d=google.com; s=arc-20160816; b=IGK5vmB2wudLCDpv12LiF6kRXXtm7DelU0J660eUnYU0Iii233FutWmvjGdkkUv05T HNdm1+XtBNE2U8JgZQI6ysQiKhAhgWUhlBgz0hxVAN0D2NcKW2OdAO8dbT9gYJD06Aea dhx+5bGx4/iZgnii7HHAC3/V4EbiebzKy7c8V9fMQm7m8cGF2lBCoK81FYVTBmBivKnA A4xuKfGiHlfsCzOuwt+asOYQubrKy8i3ebIaXAdcC7NyzSstIAxtS0ayPcpuI5ZkB8Ji w2gs9SzMBuCAAD+Xwm1IWCqfr8BJz9NW/wj3mCm00GpRiSTKq2D3vFzQB3RgXdnLGufc N13Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=UAEbbsKet/6CYBIq5uiss9Eit2a/lURi01Xr9XCB06A=; b=VqrsVbQ0WjdFpsU516cqAfwqkOxcqqT3XC7lWd8yUN+0rMkw+IIIr56FQNS+morkEW gELcSRus/BqB2XnOP8WDmif/60Aq9mJJuWwM0CSwbWvIHmZSkzFfet1kN0wjW1gha9Ub EvAANSbXyaRC+8OZnowa0sDJDSJaZZuQGnUbPbAfa4b/bfFtO7znhysAJpSYHp77CtGJ gMjlYwIPEF1CWT9WLj9qqPlko6LfdqK6ddT+eI9RcGpjCXsyGHUbCVeuiNKqeDlatnXb wjjOhuGOnSUr6m87uzsjXCc3g52607/KzZp1c1bAS/slZM+nKsxQ+cr/yl3dxg4oeCGK Yx7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@traverse.com.au header.s=fm1 header.b=pfxsJQ9i; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=lj0teugd; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id z28si3410705edl.12.2021.09.16.23.47.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Sep 2021 23:47:12 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@traverse.com.au header.s=fm1 header.b=pfxsJQ9i; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=lj0teugd; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@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) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 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 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(-) -- 2.30.1 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; }