-/* $OpenBSD: abx80x.c,v 1.7 2022/04/06 18:59:28 naddy Exp $ */
+/* $OpenBSD: abx80x.c,v 1.8 2022/10/15 18:22:53 kettenis Exp $ */
/*
* Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org>
* Copyright (c) 2018 Patrick Wildt <patrick@blueri.se>
#include <dev/ofw/openfirm.h>
#endif
-extern todr_chip_handle_t todr_handle;
-
#define ABX8XX_HTH 0x00
#define ABX8XX_SC 0x01
#define ABX8XX_MN 0x02
sc->sc_todr.cookie = sc;
sc->sc_todr.todr_gettime = abcrtc_gettime;
sc->sc_todr.todr_settime = abcrtc_settime;
- todr_handle = &sc->sc_todr;
+ sc->sc_todr.todr_quality = 1000;
+ todr_attach(&sc->sc_todr);
printf("\n");
}
-/* $OpenBSD: ds1307.c,v 1.5 2022/04/06 18:59:28 naddy Exp $ */
+/* $OpenBSD: ds1307.c,v 1.6 2022/10/15 18:22:53 kettenis Exp $ */
/*
* Copyright (c) 2016 Marcus Glocker <mglocker@openbsd.org>
NULL, "maxrtc", DV_DULL
};
-extern todr_chip_handle_t todr_handle;
-
/*
* Functions.
*/
sc->sc_tag = ia->ia_tag;
sc->sc_addr = ia->ia_addr;
- sc->sc_todr.cookie = sc;
- sc->sc_todr.todr_gettime = maxrtc_gettime;
- sc->sc_todr.todr_settime = maxrtc_settime;
- sc->sc_todr.todr_setwen = NULL;
if (maxrtc_enable_osc(sc) == -1)
return;
if (maxrtc_set_24h_mode(sc) == -1)
return;
- todr_handle = &sc->sc_todr;
+ sc->sc_todr.cookie = sc;
+ sc->sc_todr.todr_gettime = maxrtc_gettime;
+ sc->sc_todr.todr_settime = maxrtc_settime;
+ sc->sc_todr.todr_quality = 1000;
+ todr_attach(&sc->sc_todr);
}
int
-/* $OpenBSD: ds3231.c,v 1.2 2022/04/06 18:59:28 naddy Exp $ */
+/* $OpenBSD: ds3231.c,v 1.3 2022/10/15 18:22:53 kettenis Exp $ */
/*
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
*
#include <dev/clock_subr.h>
-extern todr_chip_handle_t todr_handle;
-
#define DS3231_SC 0x00
#define DS3231_MN 0x01
#define DS3231_HR 0x02
sc->sc_todr.cookie = sc;
sc->sc_todr.todr_gettime = dsxrtc_gettime;
sc->sc_todr.todr_settime = dsxrtc_settime;
- todr_handle = &sc->sc_todr;
+ sc->sc_todr.todr_quality = 1000;
+ todr_attach(&sc->sc_todr);
printf("\n");
}
-/* $OpenBSD: isl1208.c,v 1.4 2022/04/06 18:59:28 naddy Exp $ */
+/* $OpenBSD: isl1208.c,v 1.5 2022/10/15 18:22:53 kettenis Exp $ */
/*
* Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org>
*
#include <dev/clock_subr.h>
-extern todr_chip_handle_t todr_handle;
-
#define ISL1208_SC 0x00
#define ISL1208_MN 0x01
#define ISL1208_HR 0x02
sc->sc_todr.cookie = sc;
sc->sc_todr.todr_gettime = islrtc_gettime;
sc->sc_todr.todr_settime = islrtc_settime;
- todr_handle = &sc->sc_todr;
+ sc->sc_todr.todr_quality = 1000;
+ todr_attach(&sc->sc_todr);
printf("\n");
}
-/* $OpenBSD: mcp794xx.c,v 1.2 2022/04/06 18:59:28 naddy Exp $ */
+/* $OpenBSD: mcp794xx.c,v 1.3 2022/10/15 18:22:53 kettenis Exp $ */
/*
* Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org>
* Copyright (c) 2018 Patrick Wildt <patrick@blueri.se>
#include <dev/clock_subr.h>
-extern todr_chip_handle_t todr_handle;
-
#define MCP794XX_SC 0x00
#define MCP794XX_SC_ST (1 << 7)
#define MCP794XX_MN 0x01
sc->sc_todr.cookie = sc;
sc->sc_todr.todr_gettime = mcprtc_gettime;
sc->sc_todr.todr_settime = mcprtc_settime;
+ sc->sc_todr.todr_quality = 1000;
+ todr_attach(&sc->sc_todr);
printf("\n");
- todr_handle = &sc->sc_todr;
}
int