Module Name:    src
Committed By:   bouyer
Date:           Tue Apr  5 10:53:16 UTC 2016

Modified Files:
        src/sys/dev/i2c: ds1307.c ds1307reg.h

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/i2c/ds1307.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/i2c/ds1307reg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/i2c/ds1307.c
diff -u src/sys/dev/i2c/ds1307.c:1.21 src/sys/dev/i2c/ds1307.c:1.22
--- src/sys/dev/i2c/ds1307.c:1.21	Thu Nov 20 16:34:26 2014
+++ src/sys/dev/i2c/ds1307.c	Tue Apr  5 10:53:16 2016
@@ -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 @@ static const struct dsrtc_model dsrtc_mo
 		.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,

Index: src/sys/dev/i2c/ds1307reg.h
diff -u src/sys/dev/i2c/ds1307reg.h:1.5 src/sys/dev/i2c/ds1307reg.h:1.6
--- src/sys/dev/i2c/ds1307reg.h:1.5	Sun Oct 12 01:23:23 2014
+++ src/sys/dev/i2c/ds1307reg.h	Tue Apr  5 10:53:16 2016
@@ -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

Reply via email to