Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/i2c Add standard compat strings from the Device Tree...



details:   https://anonhg.NetBSD.org/src/rev/54f35eebc4f6
branches:  trunk
changeset: 1018307:54f35eebc4f6
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Jan 30 17:38:27 2021 +0000

description:
Add standard compat strings from the Device Tree bindings.

diffstat:

 sys/dev/i2c/rs5c372.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (39 lines):

diff -r bdf030e592ef -r 54f35eebc4f6 sys/dev/i2c/rs5c372.c
--- a/sys/dev/i2c/rs5c372.c     Sat Jan 30 17:37:25 2021 +0000
+++ b/sys/dev/i2c/rs5c372.c     Sat Jan 30 17:38:27 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rs5c372.c,v 1.16 2020/01/02 17:17:36 thorpej Exp $     */
+/*     $NetBSD: rs5c372.c,v 1.17 2021/01/30 17:38:27 thorpej Exp $     */
 
 /*-
  * Copyright (C) 2005 NONAKA Kimihiro <nonaka%netbsd.org@localhost>
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rs5c372.c,v 1.16 2020/01/02 17:17:36 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rs5c372.c,v 1.17 2021/01/30 17:38:27 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -61,13 +61,19 @@
 static int rs5c372rtc_gettime_ymdhms(todr_chip_handle_t, struct clock_ymdhms *);
 static int rs5c372rtc_settime_ymdhms(todr_chip_handle_t, struct clock_ymdhms *);
 
+static const struct device_compatible_entry compat_data[] = {
+       { .compat = "ricoh,rs5c372a" },
+       { .compat = "ricoh,rs5c372b" },
+       DEVICE_COMPAT_EOL
+};
+
 static int
 rs5c372rtc_match(device_t parent, cfdata_t cf, void *arg)
 {
        struct i2c_attach_args *ia = arg;
        int match_result;
 
-       if (iic_use_direct_match(ia, cf, NULL, &match_result))
+       if (iic_use_direct_match(ia, cf, compat_data, &match_result))
                return match_result;
 
        /* indirect config - check typical address */



Home | Main Index | Thread Index | Old Index