Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/i2c Add DS1340.
details: https://anonhg.NetBSD.org/src/rev/53244afe1338
branches: trunk
changeset: 348101:53244afe1338
user: kiyohara <kiyohara%NetBSD.org@localhost>
date: Tue Oct 04 15:06:59 2016 +0000
description:
Add DS1340.
diffstat:
sys/dev/i2c/ds1307.c | 11 +++++++++--
sys/dev/i2c/ds1307reg.h | 6 +++++-
2 files changed, 14 insertions(+), 3 deletions(-)
diffs (52 lines):
diff -r c864fbf43acf -r 53244afe1338 sys/dev/i2c/ds1307.c
--- a/sys/dev/i2c/ds1307.c Tue Oct 04 15:06:31 2016 +0000
+++ b/sys/dev/i2c/ds1307.c Tue Oct 04 15:06:59 2016 +0000
@@ -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 @@
.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 -r c864fbf43acf -r 53244afe1338 sys/dev/i2c/ds1307reg.h
--- a/sys/dev/i2c/ds1307reg.h Tue Oct 04 15:06:31 2016 +0000
+++ b/sys/dev/i2c/ds1307reg.h Tue Oct 04 15:06:59 2016 +0000
@@ -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
Home |
Main Index |
Thread Index |
Old Index