All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bryan Brattlof <bb@ti.com>
To: Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Linux RTC <linux-rtc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Nishanth Menon <nm@ti.com>, Bryan Brattlof <bb@ti.com>
Subject: [PATCH 1/2] rtc: k3: wait until the unlock field is not zero
Date: Tue, 16 Aug 2022 12:33:11 -0500	[thread overview]
Message-ID: <20220816173312.23243-1-bb@ti.com> (raw)

After writing the magic words to the KICK0 and KICK1 registers, we must
wait for a 1 in the unlock field of the general control register to
signify when the rtc device is in an unlocked state.

Signed-off-by: Bryan Brattlof <bb@ti.com>
---
 drivers/rtc/rtc-ti-k3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-ti-k3.c b/drivers/rtc/rtc-ti-k3.c
index 7a0f181d3fefe..fd26be7868d25 100644
--- a/drivers/rtc/rtc-ti-k3.c
+++ b/drivers/rtc/rtc-ti-k3.c
@@ -190,7 +190,7 @@ static int k3rtc_unlock_rtc(struct ti_k3_rtc *priv)
 
 	/* Skip fence since we are going to check the unlock bit as fence */
 	ret = regmap_field_read_poll_timeout(priv->r_fields[K3RTC_UNLOCK], ret,
-					     !ret, 2, priv->sync_timeout_us);
+					     ret, 2, priv->sync_timeout_us);
 
 	return ret;
 }
-- 
2.17.1


             reply	other threads:[~2022-08-16 17:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16 17:33 Bryan Brattlof [this message]
2022-08-16 17:33 ` [PATCH 2/2] rtc: k3: detect SoC to determine erratum fix Bryan Brattlof
2022-08-23 20:26 ` [PATCH 1/2] rtc: k3: wait until the unlock field is not zero Alexandre Belloni

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=20220816173312.23243-1-bb@ti.com \
    --to=bb@ti.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=nm@ti.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.