Subject: kern/24229: x1226 (RTC) flag miss?
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <kiyohara@kk.iij4u.or.jp>
List: netbsd-bugs
Date: 01/25/2004 06:21:26
>Number: 24229
>Category: kern
>Synopsis: x1226 (RTC) flag miss?
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: kern-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sun Jan 25 06:22:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: KIYOHARA Takashi
>Release: NetBSD 1.6ZG
>Organization:
>Environment:
NetBSD evbppc.fool 1.6ZG NetBSD 1.6ZG (OPENBLOCKS266) #0: Sun Dec 21 12:58:20 JST 2003 lance@evbppc.fool:/sys/arch/evbppc/compile/OPENBLOCKS266 evbppc
>Description:
This is wrong although I looked at and checked the datasheet. First of all, the processings which write it as read differ.
>How-To-Repeat:
>Fix:
Index: x1226.c
===================================================================
RCS file: /cvsroot/src/sys/dev/i2c/x1226.c,v
retrieving revision 1.1
diff -c -r1.1 x1226.c
*** x1226.c 2003/10/06 18:02:02 1.1
--- x1226.c 2004/01/15 15:16:42
***************
*** 324,330 ****
& X1226_REG_SC_MASK);
dt->dt_min = FROMBCD(bcd[X1226_REG_MN - X1226_REG_RTC_BASE]
& X1226_REG_MN_MASK);
! if (bcd[X1226_REG_HR - X1226_REG_RTC_BASE] & X1226_FLAG_HR_24H) {
dt->dt_hour = FROMBCD(bcd[X1226_REG_HR - X1226_REG_RTC_BASE]
& X1226_REG_HR12_MASK);
if (bcd[X1226_REG_HR - X1226_REG_RTC_BASE] & X1226_FLAG_HR_12HPM
) {
--- 324,330 ----
& X1226_REG_SC_MASK);
dt->dt_min = FROMBCD(bcd[X1226_REG_MN - X1226_REG_RTC_BASE]
& X1226_REG_MN_MASK);
! if (!(bcd[X1226_REG_HR - X1226_REG_RTC_BASE] & X1226_FLAG_HR_24H)) {
dt->dt_hour = FROMBCD(bcd[X1226_REG_HR - X1226_REG_RTC_BASE]
& X1226_REG_HR12_MASK);
if (bcd[X1226_REG_HR - X1226_REG_RTC_BASE] & X1226_FLAG_HR_12HPM) {
>Release-Note:
>Audit-Trail:
>Unformatted: