All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rtc: m41t62: fix wrong register use for set/reset ST bit
@ 2021-05-10  5:23 MAX.YANG 楊勝鴻
  2021-07-16 15:51 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: MAX.YANG 楊勝鴻 @ 2021-05-10  5:23 UTC (permalink / raw)
  To: u-boot

Fix wrong register use when set/reset ST bit.
ST bit is in register M41T62_REG_SEC not in M41T62_REG_ALARM_HOUR.

I have not actually tested this. But this seemed buggy from inspection.

Fixes: 9bbe210512c4539 ("rtc: m41t62: add oscillator fail bit reset support")
Signed-off-by: Max Yang <max.yang@deltaww.com>
---

drivers/rtc/m41t62.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/m41t62.c b/drivers/rtc/m41t62.c
index 0a4e12d698..8be532c3e3 100644
--- a/drivers/rtc/m41t62.c
+++ b/drivers/rtc/m41t62.c
@@ -213,13 +213,13 @@ static int m41t62_rtc_restart_osc(struct udevice *dev)

        /* 1. Set stop bit */
        val |= M41T62_SEC_ST;
-       ret = dm_i2c_write(dev, M41T62_REG_ALARM_HOUR, &val, sizeof(val));
+       ret = dm_i2c_write(dev, M41T62_REG_SEC, &val, sizeof(val));
        if (ret)
                return ret;

        /* 2. Clear stop bit */
        val &= ~M41T62_SEC_ST;
-       ret = dm_i2c_write(dev, M41T62_REG_ALARM_HOUR, &val, sizeof(val));
+       ret = dm_i2c_write(dev, M41T62_REG_SEC, &val, sizeof(val));
        if (ret)
                return ret;

*************************************************************************
This email message, including any attachments, is for the sole
use of the intended recipient(s) and may contain confidential and
privileged information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of the original
message. [Delta Electronics, INC. Taiwan]
*************************************************************************

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] rtc: m41t62: fix wrong register use for set/reset ST bit
  2021-05-10  5:23 [PATCH] rtc: m41t62: fix wrong register use for set/reset ST bit MAX.YANG 楊勝鴻
@ 2021-07-16 15:51 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2021-07-16 15:51 UTC (permalink / raw)
  To: Max Yang; +Cc: u-boot

[-- Attachment #1: Type: text/plain, Size: 443 bytes --]

On Mon, May 10, 2021 at 05:23:37AM +0000, Max Yang wrote:

> Fix wrong register use when set/reset ST bit.
> ST bit is in register M41T62_REG_SEC not in M41T62_REG_ALARM_HOUR.
> 
> I have not actually tested this. But this seemed buggy from inspection.
> 
> Fixes: 9bbe210512c4539 ("rtc: m41t62: add oscillator fail bit reset support")
> Signed-off-by: Max Yang <max.yang@deltaww.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-16 15:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-10  5:23 [PATCH] rtc: m41t62: fix wrong register use for set/reset ST bit MAX.YANG 楊勝鴻
2021-07-16 15:51 ` Tom Rini

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.