Author: ian
Date: Tue Mar  6 02:30:34 2018
New Revision: 330529
URL: https://svnweb.freebsd.org/changeset/base/330529

Log:
  Build the ds1672 driver as a module.  Add a detach() to unregister the rtc.

Added:
  head/sys/modules/i2c/ds1672/
  head/sys/modules/i2c/ds1672/Makefile   (contents, props changed)
Modified:
  head/sys/dev/iicbus/ds1672.c
  head/sys/modules/i2c/Makefile

Modified: head/sys/dev/iicbus/ds1672.c
==============================================================================
--- head/sys/dev/iicbus/ds1672.c        Tue Mar  6 02:21:41 2018        
(r330528)
+++ head/sys/dev/iicbus/ds1672.c        Tue Mar  6 02:30:34 2018        
(r330529)
@@ -118,6 +118,14 @@ ds1672_init(device_t dev)
 }
 
 static int
+ds1672_detach(device_t dev)
+{
+
+    clock_unregister(dev);
+    return (0);
+}
+
+static int
 ds1672_attach(device_t dev)
 {
        struct ds1672_softc *sc = device_get_softc(dev);
@@ -166,6 +174,7 @@ ds1672_settime(device_t dev, struct timespec *ts)
 static device_method_t ds1672_methods[] = {
        DEVMETHOD(device_probe,         ds1672_probe),
        DEVMETHOD(device_attach,        ds1672_attach),
+       DEVMETHOD(device_detach,        ds1672_detach),
 
        DEVMETHOD(clock_gettime,        ds1672_gettime),
        DEVMETHOD(clock_settime,        ds1672_settime),

Modified: head/sys/modules/i2c/Makefile
==============================================================================
--- head/sys/modules/i2c/Makefile       Tue Mar  6 02:21:41 2018        
(r330528)
+++ head/sys/modules/i2c/Makefile       Tue Mar  6 02:30:34 2018        
(r330529)
@@ -5,6 +5,7 @@ SUBDIR = \
        cyapa \
        ds1307 \
        ds13rtc \
+       ds1672 \
        ds3231 \
        icee \
        if_ic \

Added: head/sys/modules/i2c/ds1672/Makefile
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/i2c/ds1672/Makefile        Tue Mar  6 02:30:34 2018        
(r330529)
@@ -0,0 +1,19 @@
+# $FreeBSD$
+
+.PATH: ${SRCTOP}/sys/dev/iicbus
+KMOD   = ds1672
+SRCS   = ds1672.c 
+
+# Generated files...
+SRCS+= \
+       bus_if.h \
+       clock_if.h \
+       device_if.h \
+       iicbus_if.h \
+       opt_platform.h \
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_bus_if.h
+.endif
+
+.include <bsd.kmod.mk>
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to