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 options STRTC_NO_USERRAM and STRTC_NO_WATCHD...



details:   https://anonhg.NetBSD.org/src/rev/9a99cfd20643
branches:  trunk
changeset: 757978:9a99cfd20643
user:      kiyohara <kiyohara%NetBSD.org@localhost>
date:      Sun Oct 10 05:17:44 2010 +0000

description:
Add options STRTC_NO_USERRAM and STRTC_NO_WATCHDOG for m41t80.

diffstat:

 sys/dev/i2c/files.i2c |   4 +++-
 sys/dev/i2c/m41st84.c |  13 +++++++++++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diffs (84 lines):

diff -r d37e377d7dad -r 9a99cfd20643 sys/dev/i2c/files.i2c
--- a/sys/dev/i2c/files.i2c     Sun Oct 10 04:49:48 2010 +0000
+++ b/sys/dev/i2c/files.i2c     Sun Oct 10 05:17:44 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.i2c,v 1.28 2010/10/02 06:07:37 kiyohara Exp $
+#      $NetBSD: files.i2c,v 1.29 2010/10/10 05:17:44 kiyohara Exp $
 
 defflag        opt_i2cbus.h                            I2C_SCAN
 define i2cbus { }
@@ -26,6 +26,8 @@
 device strtc
 attach strtc at iic
 file   dev/i2c/m41st84.c                       strtc
+defflag        opt_strtc.h                             STRTC_NO_USERRAM
+                                               STRTC_NO_WATCHDOG
 
 # MAX6900 Real Time Clock
 device maxrtc
diff -r d37e377d7dad -r 9a99cfd20643 sys/dev/i2c/m41st84.c
--- a/sys/dev/i2c/m41st84.c     Sun Oct 10 04:49:48 2010 +0000
+++ b/sys/dev/i2c/m41st84.c     Sun Oct 10 05:17:44 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: m41st84.c,v 1.15 2009/12/12 14:44:10 tsutsui Exp $     */
+/*     $NetBSD: m41st84.c,v 1.16 2010/10/10 05:17:44 kiyohara Exp $    */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,9 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: m41st84.c,v 1.15 2009/12/12 14:44:10 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: m41st84.c,v 1.16 2010/10/10 05:17:44 kiyohara Exp $");
+
+#include "opt_strtc.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -66,6 +68,8 @@
 
 CFATTACH_DECL_NEW(strtc, sizeof(struct strtc_softc),
     strtc_match, strtc_attach, NULL, NULL);
+
+#ifndef STRTC_NO_USERRAM
 extern struct cfdriver strtc_cd;
 
 dev_type_open(strtc_open);
@@ -77,6 +81,7 @@
        strtc_open, strtc_close, strtc_read, strtc_write, noioctl,
        nostop, notty, nopoll, nommap, nokqfilter, D_OTHER
 };
+#endif
 
 static int strtc_clock_read(struct strtc_softc *, struct clock_ymdhms *);
 static int strtc_clock_write(struct strtc_softc *, struct clock_ymdhms *);
@@ -115,6 +120,7 @@
        todr_attach(&sc->sc_todr);
 }
 
+#ifndef STRTC_NO_USERRAM
 /*ARGSUSED*/
 int
 strtc_open(dev_t dev, int flag, int fmt, struct lwp *l)
@@ -221,6 +227,7 @@
 
        return (error);
 }
+#endif /* STRTC_NO_USERRAM */
 
 static int
 strtc_gettime(struct todr_chip_handle *ch, struct timeval *tv)
@@ -416,6 +423,7 @@
        return (1);
 }
 
+#ifndef STRTC_NO_WATCHDOG
 void
 strtc_wdog_config(void *arg, uint8_t wd)
 {
@@ -440,3 +448,4 @@
 
        iic_release_bus(sc->sc_tag, I2C_F_POLL);
 }
+#endif /* STRTC_NO_WATCHDOG */



Home | Main Index | Thread Index | Old Index