summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/i2c/pcf8563.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/sys/dev/i2c/pcf8563.c b/sys/dev/i2c/pcf8563.c
index e4624a08684..ee44d74ce40 100644
--- a/sys/dev/i2c/pcf8563.c
+++ b/sys/dev/i2c/pcf8563.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pcf8563.c,v 1.7 2015/04/11 20:05:44 joerg Exp $ */
+/* $NetBSD: pcf8563.c,v 1.8 2017/10/07 20:18:16 jmcneill Exp $ */
/*
* Copyright (c) 2011 Jonathan A. Kollasch
@@ -26,8 +26,13 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/* XXX */
+#if defined(__arm__) || defined(__aarch64__)
+#include "opt_fdt.h"
+#endif
+
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pcf8563.c,v 1.7 2015/04/11 20:05:44 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcf8563.c,v 1.8 2017/10/07 20:18:16 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -39,6 +44,16 @@ __KERNEL_RCSID(0, "$NetBSD: pcf8563.c,v 1.7 2015/04/11 20:05:44 joerg Exp $");
#include <dev/i2c/i2cvar.h>
#include <dev/i2c/pcf8563reg.h>
+#ifdef FDT
+#include <dev/fdt/fdtvar.h>
+#endif
+
+static const char *compatible[] = {
+ "nxp,pcf8563",
+ "pcf8563rtc",
+ NULL
+};
+
struct pcf8563rtc_softc {
device_t sc_dev;
i2c_tag_t sc_tag;
@@ -64,8 +79,7 @@ pcf8563rtc_match(device_t parent, cfdata_t cf, void *aux)
if (ia->ia_name) {
/* direct config - check name */
- if (strcmp(ia->ia_name, "pcf8563rtc") == 0)
- return 1;
+ return iic_compat_match(ia, compatible);
} else {
/* indirect config - check typical address */
if (ia->ia_addr == PCF8563_ADDR)
@@ -98,7 +112,11 @@ pcf8563rtc_attach(device_t parent, device_t self, void *aux)
I2C_F_POLL);
iic_release_bus(sc->sc_tag, I2C_F_POLL);
+#ifdef FDT
+ fdtbus_todr_attach(self, ia->ia_cookie, &sc->sc_todr);
+#else
todr_attach(&sc->sc_todr);
+#endif
}
static int
nux32/common/linux32_exec.c?h=lockdoc-10.99.5&id=c74f0279eabe6bad52196bc4803dfd729849bf16'>more caddr_t lossage.christos 2007-02-15Fix COMPAT_LINUX32.ad 2007-02-09Merge newlock2 to head.ad 2006-08-231) Complete Linux exit_group() emulationmanu 2006-06-25- Complete exit_group() implementation. We now maintain a list of Linuxmanu 2006-02-09Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough somanu