summaryrefslogtreecommitdiff
path: root/sys/dev/i2c
diff options
context:
space:
mode:
authorkiyohara <kiyohara@NetBSD.org>2016-10-04 15:06:59 +0000
committerkiyohara <kiyohara@NetBSD.org>2016-10-04 15:06:59 +0000
commit2a2c8a37504084a3bf7a3e8b7a8c95c3ea49ebe0 (patch)
tree9b02d88fdb5d60e7a355ab1339e92eea0ec99eed /sys/dev/i2c
parentc589f39547356e13c51df819b3df5c7ecd9bc5b4 (diff)
Add DS1340.
Diffstat (limited to 'sys/dev/i2c')
-rw-r--r--sys/dev/i2c/ds1307.c11
-rw-r--r--sys/dev/i2c/ds1307reg.h6
2 files changed, 14 insertions, 3 deletions
diff --git a/sys/dev/i2c/ds1307.c b/sys/dev/i2c/ds1307.c
index 0515fc0829a..f47cc078a6b 100644
--- a/sys/dev/i2c/ds1307.c
+++ b/sys/dev/i2c/ds1307.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ds1307.c,v 1.22 2016/04/05 10:53:16 bouyer Exp $ */
+/* $NetBSD: ds1307.c,v 1.23 2016/10/04 15:06:59 kiyohara Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ds1307.c,v 1.22 2016/04/05 10:53:16 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ds1307.c,v 1.23 2016/10/04 15:06:59 kiyohara Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -83,6 +83,13 @@ static const struct dsrtc_model dsrtc_models[] = {
.dm_rtc_size = DS1339_RTC_SIZE,
.dm_flags = DSRTC_FLAG_BCD,
}, {
+ .dm_model = 1340,
+ .dm_ch_reg = DSXXXX_SECONDS,
+ .dm_ch_value = DS1340_SECONDS_EOSC,
+ .dm_rtc_start = DS1340_RTC_START,
+ .dm_rtc_size = DS1340_RTC_SIZE,
+ .dm_flags = DSRTC_FLAG_BCD,
+ }, {
.dm_model = 1672,
.dm_rtc_start = DS1672_RTC_START,
.dm_rtc_size = DS1672_RTC_SIZE,
diff --git a/sys/dev/i2c/ds1307reg.h b/sys/dev/i2c/ds1307reg.h
index 452688a712d..114a7b7bf5d 100644
--- a/sys/dev/i2c/ds1307reg.h
+++ b/sys/dev/i2c/ds1307reg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ds1307reg.h,v 1.6 2016/04/05 10:53:16 bouyer Exp $ */
+/* $NetBSD: ds1307reg.h,v 1.7 2016/10/04 15:06:59 kiyohara Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -65,6 +65,10 @@
#define DS1339_NVRAM_START 0
#define DS1339_NVRAM_SIZE 0
+#define DS1340_RTC_START 0
+#define DS1340_RTC_SIZE DSXXXX_RTC_SIZE
+#define DS1340_SECONDS_EOSC (1 << 7) /* Clock Hold */
+
#define DS1672_CNTR1 0x00
#define DS1672_CNTR2 0x01
#define DS1672_CNTR3 0x02