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

This commit is contained in:
Ian Lepore 2018-03-06 02:30:34 +00:00
parent 18029749f4
commit b138780b0c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=330529
3 changed files with 29 additions and 0 deletions

View File

@ -117,6 +117,14 @@ ds1672_init(device_t dev)
return (error);
}
static int
ds1672_detach(device_t dev)
{
clock_unregister(dev);
return (0);
}
static int
ds1672_attach(device_t 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),

View File

@ -5,6 +5,7 @@ SUBDIR = \
cyapa \
ds1307 \
ds13rtc \
ds1672 \
ds3231 \
icee \
if_ic \

View File

@ -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>