Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/i2c Fix DS1672 suppport: need to provide dm_ch_reg t...



details:   https://anonhg.NetBSD.org/src/rev/b956a0873375
branches:  trunk
changeset: 344579:b956a0873375
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Tue Apr 05 10:53:16 2016 +0000

description:
Fix DS1672 suppport: need to provide dm_ch_reg to avoid a KASSERT
on write. For consistency set dm_ch_value too, even if it's unused.

diffstat:

 sys/dev/i2c/ds1307.c    |  6 ++++--
 sys/dev/i2c/ds1307reg.h |  3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diffs (44 lines):

diff -r b9331b4cd1bf -r b956a0873375 sys/dev/i2c/ds1307.c
--- a/sys/dev/i2c/ds1307.c      Tue Apr 05 10:03:33 2016 +0000
+++ b/sys/dev/i2c/ds1307.c      Tue Apr 05 10:53:16 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ds1307.c,v 1.21 2014/11/20 16:34:26 christos Exp $     */
+/*     $NetBSD: ds1307.c,v 1.22 2016/04/05 10:53:16 bouyer Exp $       */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ds1307.c,v 1.21 2014/11/20 16:34:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ds1307.c,v 1.22 2016/04/05 10:53:16 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -86,6 +86,8 @@
                .dm_model = 1672,
                .dm_rtc_start = DS1672_RTC_START,
                .dm_rtc_size = DS1672_RTC_SIZE,
+               .dm_ch_reg = DS1672_CONTROL,
+               .dm_ch_value = DS1672_CONTROL_CH,
                .dm_flags = 0,
        }, {
                .dm_model = 3231,
diff -r b9331b4cd1bf -r b956a0873375 sys/dev/i2c/ds1307reg.h
--- a/sys/dev/i2c/ds1307reg.h   Tue Apr 05 10:03:33 2016 +0000
+++ b/sys/dev/i2c/ds1307reg.h   Tue Apr 05 10:53:16 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ds1307reg.h,v 1.5 2014/10/12 01:23:23 macallan Exp $   */
+/*     $NetBSD: ds1307reg.h,v 1.6 2016/04/05 10:53:16 bouyer Exp $     */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -70,6 +70,7 @@
 #define DS1672_CNTR3           0x02
 #define DS1672_CNTR4           0x03
 #define DS1672_CONTROL         0x04
+#define DS1672_CONTROL_CH              (1 << 7) /* clock hold */
 #define DS1672_TRICKLE         0x05
 
 #define DS1672_RTC_START       0



Home | Main Index | Thread Index | Old Index