Build the ds1672 driver as a module. Add a detach() to unregister the rtc.
This commit is contained in:
parent
18029749f4
commit
b138780b0c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=330529
@ -117,6 +117,14 @@ ds1672_init(device_t dev)
|
|||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
ds1672_detach(device_t dev)
|
||||||
|
{
|
||||||
|
|
||||||
|
clock_unregister(dev);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ds1672_attach(device_t dev)
|
ds1672_attach(device_t dev)
|
||||||
{
|
{
|
||||||
@ -166,6 +174,7 @@ ds1672_settime(device_t dev, struct timespec *ts)
|
|||||||
static device_method_t ds1672_methods[] = {
|
static device_method_t ds1672_methods[] = {
|
||||||
DEVMETHOD(device_probe, ds1672_probe),
|
DEVMETHOD(device_probe, ds1672_probe),
|
||||||
DEVMETHOD(device_attach, ds1672_attach),
|
DEVMETHOD(device_attach, ds1672_attach),
|
||||||
|
DEVMETHOD(device_detach, ds1672_detach),
|
||||||
|
|
||||||
DEVMETHOD(clock_gettime, ds1672_gettime),
|
DEVMETHOD(clock_gettime, ds1672_gettime),
|
||||||
DEVMETHOD(clock_settime, ds1672_settime),
|
DEVMETHOD(clock_settime, ds1672_settime),
|
||||||
|
@ -5,6 +5,7 @@ SUBDIR = \
|
|||||||
cyapa \
|
cyapa \
|
||||||
ds1307 \
|
ds1307 \
|
||||||
ds13rtc \
|
ds13rtc \
|
||||||
|
ds1672 \
|
||||||
ds3231 \
|
ds3231 \
|
||||||
icee \
|
icee \
|
||||||
if_ic \
|
if_ic \
|
||||||
|
19
sys/modules/i2c/ds1672/Makefile
Normal file
19
sys/modules/i2c/ds1672/Makefile
Normal 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>
|
Loading…
Reference in New Issue
Block a user