Index: arch/macppc/dev/deq.c =================================================================== RCS file: /cvsroot/src/sys/arch/macppc/dev/deq.c,v retrieving revision 1.20 retrieving revision 1.20.14.1 diff -u -p -r1.20 -r1.20.14.1 --- arch/macppc/dev/deq.c 27 Jan 2021 02:17:27 -0000 1.20 +++ arch/macppc/dev/deq.c 9 Aug 2021 00:30:08 -0000 1.20.14.1 @@ -1,4 +1,4 @@ -/* $NetBSD: deq.c,v 1.20 2021/01/27 02:17:27 thorpej Exp $ */ +/* $NetBSD: deq.c,v 1.20.14.1 2021/08/09 00:30:08 thorpej Exp $ */ /*- * Copyright (C) 2005 Michael Lorenz @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: deq.c,v 1.20 2021/01/27 02:17:27 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: deq.c,v 1.20.14.1 2021/08/09 00:30:08 thorpej Exp $"); #include #include @@ -83,7 +83,7 @@ deq_attach(device_t parent, device_t sel char name[256]; sc->sc_dev = self; - sc->sc_node = ia->ia_cookie; + sc->sc_node = devhandle_to_of(device_handle(self)); sc->sc_parent = parent; sc->sc_address = ia->ia_addr; sc->sc_i2c = ia->ia_tag; Index: arch/macppc/dev/fcu.c =================================================================== RCS file: /cvsroot/src/sys/arch/macppc/dev/fcu.c,v retrieving revision 1.4 retrieving revision 1.4.8.1 diff -u -p -r1.4 -r1.4.8.1 --- arch/macppc/dev/fcu.c 30 Jul 2021 22:07:14 -0000 1.4 +++ arch/macppc/dev/fcu.c 9 Aug 2021 01:16:01 -0000 1.4.8.1 @@ -1,4 +1,4 @@ -/* $NetBSD: fcu.c,v 1.4 2021/07/30 22:07:14 macallan Exp $ */ +/* $NetBSD: fcu.c,v 1.4.8.1 2021/08/09 01:16:01 thorpej Exp $ */ /*- * Copyright (c) 2018 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fcu.c,v 1.4 2021/07/30 22:07:14 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fcu.c,v 1.4.8.1 2021/08/09 01:16:01 thorpej Exp $"); #include #include @@ -198,8 +198,10 @@ fcu_attach(device_t parent, device_t sel /* round up sensors */ int ch; + int const phandle = devhandle_to_of(device_handle(self)); + sc->sc_nsensors = 0; - ch = OF_child(ia->ia_cookie); + ch = OF_child(phandle); while (ch != 0) { char type[32], descr[32]; uint32_t reg; Index: arch/macppc/dev/lmu.c =================================================================== RCS file: /cvsroot/src/sys/arch/macppc/dev/lmu.c,v retrieving revision 1.9 retrieving revision 1.9.6.1 diff -u -p -r1.9 -r1.9.6.1 --- arch/macppc/dev/lmu.c 18 Jun 2021 22:52:04 -0000 1.9 +++ arch/macppc/dev/lmu.c 9 Aug 2021 00:30:08 -0000 1.9.6.1 @@ -1,4 +1,4 @@ -/* $NetBSD: lmu.c,v 1.9 2021/06/18 22:52:04 macallan Exp $ */ +/* $NetBSD: lmu.c,v 1.9.6.1 2021/08/09 00:30:08 thorpej Exp $ */ /*- * Copyright (c) 2020 Michael Lorenz @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: lmu.c,v 1.9 2021/06/18 22:52:04 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lmu.c,v 1.9.6.1 2021/08/09 00:30:08 thorpej Exp $"); #include #include @@ -57,7 +57,6 @@ struct lmu_softc { device_t sc_dev; i2c_tag_t sc_i2c; i2c_addr_t sc_addr; - int sc_node; struct sysmon_envsys *sc_sme; envsys_data_t sc_sensors[2]; @@ -167,7 +166,6 @@ lmu_attach(device_t parent, device_t sel sc->sc_dev = self; sc->sc_i2c = ia->ia_tag; sc->sc_addr = ia->ia_addr; - sc->sc_node = ia->ia_cookie; sc->sc_last = 0; aprint_naive("\n"); Index: arch/macppc/dev/psoc.c =================================================================== RCS file: /cvsroot/src/sys/arch/macppc/dev/psoc.c,v retrieving revision 1.8 retrieving revision 1.8.6.1 diff -u -p -r1.8 -r1.8.6.1 --- arch/macppc/dev/psoc.c 18 Jun 2021 23:00:47 -0000 1.8 +++ arch/macppc/dev/psoc.c 9 Aug 2021 00:30:08 -0000 1.8.6.1 @@ -1,4 +1,4 @@ - /* $NetBSD: psoc.c,v 1.8 2021/06/18 23:00:47 macallan Exp $ */ + /* $NetBSD: psoc.c,v 1.8.6.1 2021/08/09 00:30:08 thorpej Exp $ */ /*- * Copyright (c) 2019 Michael Lorenz @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: psoc.c,v 1.8 2021/06/18 23:00:47 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: psoc.c,v 1.8.6.1 2021/08/09 00:30:08 thorpej Exp $"); #include #include @@ -116,7 +116,7 @@ psoc_attach(device_t parent, device_t se sc->sc_dev = self; sc->sc_i2c = ia->ia_tag; sc->sc_addr = ia->ia_addr; - sc->sc_node = ia->ia_cookie; + sc->sc_node = devhandle_to_of(device_handle(self)); sc->sc_last = 0; aprint_naive("\n"); Index: arch/macppc/dev/smusat.c =================================================================== RCS file: /cvsroot/src/sys/arch/macppc/dev/smusat.c,v retrieving revision 1.9 retrieving revision 1.9.14.1 diff -u -p -r1.9 -r1.9.14.1 --- arch/macppc/dev/smusat.c 27 Jan 2021 02:17:28 -0000 1.9 +++ arch/macppc/dev/smusat.c 9 Aug 2021 00:30:08 -0000 1.9.14.1 @@ -41,8 +41,6 @@ #include #include -#include - #include "opt_smusat.h" extern int smu_get_datablock(int, uint8_t *, size_t); @@ -137,7 +135,7 @@ smusat_attach(device_t parent, device_t int node, i, j; sc->sc_dev = self; - sc->sc_node = ia->ia_cookie; + sc->sc_node = devhandle_to_of(device_handle(self)); sc->sc_addr = ia->ia_addr; sc->sc_i2c = ia->ia_tag; Index: arch/macppc/dev/videopll.c =================================================================== RCS file: /cvsroot/src/sys/arch/macppc/dev/videopll.c,v retrieving revision 1.3 retrieving revision 1.3.28.2 diff -u -p -r1.3 -r1.3.28.2 --- arch/macppc/dev/videopll.c 16 Jun 2018 21:22:13 -0000 1.3 +++ arch/macppc/dev/videopll.c 11 Sep 2021 15:22:57 -0000 1.3.28.2 @@ -1,4 +1,4 @@ -/* $NetBSD: videopll.c,v 1.3 2018/06/16 21:22:13 thorpej Exp $ */ +/* $NetBSD: videopll.c,v 1.3.28.2 2021/09/11 15:22:57 thorpej Exp $ */ /* * Copyright (c) 2012 Michael Lorenz @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: videopll.c,v 1.3 2018/06/16 21:22:13 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: videopll.c,v 1.3.28.2 2021/09/11 15:22:57 thorpej Exp $"); #include #include @@ -66,13 +66,18 @@ CFATTACH_DECL_NEW(videopll, sizeof(struc static void *glob = NULL; +static const struct device_compatible_entry compat_data[] = { + { .compat = "aapl,valkyrie-videopll" }, + DEVICE_COMPAT_EOL +}; + static int videopll_match(device_t parent, cfdata_t cfdata, void *aux) { struct i2c_attach_args *ia = aux; int match_result; - if (iic_use_direct_match(ia, cfdata, NULL, &match_result)) + if (iic_use_direct_match(ia, cfdata, compat_data, &match_result)) return match_result; /* This driver is direct-config only. */ Index: arch/sparc64/dev/pcf8591_envctrl.c =================================================================== RCS file: /cvsroot/src/sys/arch/sparc64/dev/pcf8591_envctrl.c,v retrieving revision 1.19 retrieving revision 1.19.14.1 diff -u -p -r1.19 -r1.19.14.1 --- arch/sparc64/dev/pcf8591_envctrl.c 27 Jan 2021 02:20:03 -0000 1.19 +++ arch/sparc64/dev/pcf8591_envctrl.c 9 Aug 2021 00:30:08 -0000 1.19.14.1 @@ -1,4 +1,4 @@ -/* $NetBSD: pcf8591_envctrl.c,v 1.19 2021/01/27 02:20:03 thorpej Exp $ */ +/* $NetBSD: pcf8591_envctrl.c,v 1.19.14.1 2021/08/09 00:30:08 thorpej Exp $ */ /* $OpenBSD: pcf8591_envctrl.c,v 1.6 2007/10/25 21:17:20 kettenis Exp $ */ /* @@ -19,7 +19,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pcf8591_envctrl.c,v 1.19 2021/01/27 02:20:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pcf8591_envctrl.c,v 1.19.14.1 2021/08/09 00:30:08 thorpej Exp $"); #include #include @@ -125,9 +125,11 @@ ecadc_attach(device_t parent, device_t s int64_t minv, warnv, crit, num, den; u_int8_t junk[PCF8591_CHANNELS + 1]; envsys_data_t *sensor; - int len, error, addr, chan, node = (int)ia->ia_cookie; + int len, error, addr, chan, node; u_int i; + node = devhandle_to_of(device_handle(self)); + sc->sc_dev = self; sc->sc_nchan = 0; sc->sc_hastimer = 0; Index: dev/i2c/ac100.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/ac100.c,v retrieving revision 1.7 retrieving revision 1.7.14.1 diff -u -p -r1.7 -r1.7.14.1 --- dev/i2c/ac100.c 27 Jan 2021 02:29:48 -0000 1.7 +++ dev/i2c/ac100.c 9 Aug 2021 00:30:09 -0000 1.7.14.1 @@ -1,4 +1,4 @@ -/* $NetBSD: ac100.c,v 1.7 2021/01/27 02:29:48 thorpej Exp $ */ +/* $NetBSD: ac100.c,v 1.7.14.1 2021/08/09 00:30:09 thorpej Exp $ */ /*- * Copyright (c) 2014 Jared D. McNeill @@ -29,7 +29,7 @@ #include "opt_fdt.h" #include -__KERNEL_RCSID(0, "$NetBSD: ac100.c,v 1.7 2021/01/27 02:29:48 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ac100.c,v 1.7.14.1 2021/08/09 00:30:09 thorpej Exp $"); #include #include @@ -153,7 +153,7 @@ ac100_attach(device_t parent, device_t s sc->sc_todr.cookie = sc; #ifdef FDT - const int phandle = ia->ia_cookie; + const int phandle = devhandle_to_of(device_handle(self)); const int rtc_phandle = of_find_firstchild_byname(phandle, "rtc"); if (rtc_phandle > 0) fdtbus_todr_attach(self, rtc_phandle, &sc->sc_todr); Index: dev/i2c/adadc.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/adadc.c,v retrieving revision 1.10 retrieving revision 1.10.14.1 diff -u -p -r1.10 -r1.10.14.1 --- dev/i2c/adadc.c 27 Jan 2021 02:29:48 -0000 1.10 +++ dev/i2c/adadc.c 9 Aug 2021 00:30:09 -0000 1.10.14.1 @@ -1,4 +1,4 @@ -/* $NetBSD: adadc.c,v 1.10 2021/01/27 02:29:48 thorpej Exp $ */ +/* $NetBSD: adadc.c,v 1.10.14.1 2021/08/09 00:30:09 thorpej Exp $ */ /*- * Copyright (c) 2018 Michael Lorenz @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: adadc.c,v 1.10 2021/01/27 02:29:48 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: adadc.c,v 1.10.14.1 2021/08/09 00:30:09 thorpej Exp $"); #include #include @@ -128,6 +128,7 @@ adadc_attach(device_t parent, device_t s struct i2c_attach_args *ia = aux; envsys_data_t *s; int error, ch; + int phandle; uint32_t eeprom[40]; char loc[256]; int which_cpu; @@ -151,8 +152,8 @@ adadc_attach(device_t parent, device_t s * should probably just expose the temperature and four ENVSYS_INTEGERs */ which_cpu = 0; - ch = OF_child(ia->ia_cookie); - while (ch != 0) { + phandle = devhandle_to_of(device_handle(self)); + for (ch = OF_child(phandle); ch != 0; ch = OF_peer(ch)) { if (OF_getprop(ch, "location", loc, 32) > 0) { int reg = 0; OF_getprop(ch, "reg", ®, sizeof(reg)); @@ -185,7 +186,6 @@ adadc_attach(device_t parent, device_t s sysmon_envsys_sensor_attach(sc->sc_sme, s); sc->sc_nsensors++; } - ch = OF_peer(ch); } aprint_debug_dev(self, "monitoring CPU %d\n", which_cpu); error = get_cpuid(which_cpu, (uint8_t *)eeprom); Index: dev/i2c/adm1021.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/adm1021.c,v retrieving revision 1.29 retrieving revision 1.29.6.1 diff -u -p -r1.29 -r1.29.6.1 --- dev/i2c/adm1021.c 21 Jun 2021 03:12:54 -0000 1.29 +++ dev/i2c/adm1021.c 10 Sep 2021 15:45:28 -0000 1.29.6.1 @@ -1,4 +1,4 @@ -/* $NetBSD: adm1021.c,v 1.29 2021/06/21 03:12:54 christos Exp $ */ +/* $NetBSD: adm1021.c,v 1.29.6.1 2021/09/10 15:45:28 thorpej Exp $ */ /* $OpenBSD: adm1021.c,v 1.27 2007/06/24 05:34:35 dlg Exp $ */ /* @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: adm1021.c,v 1.29 2021/06/21 03:12:54 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: adm1021.c,v 1.29.6.1 2021/09/10 15:45:28 thorpej Exp $"); #include #include @@ -341,8 +341,11 @@ admtemp_attach(device_t parent, device_t sc->sc_tag = ia->ia_tag; sc->sc_addr = ia->ia_addr; - sc->sc_prop = ia->ia_prop; - prop_object_retain(sc->sc_prop); + + /* XXX XXX XXX */ + if ((sc->sc_prop = ia->ia_prop) != NULL) { + prop_object_retain(sc->sc_prop); + } if (iic_acquire_bus(sc->sc_tag, 0)) { aprint_error_dev(self, "cannot acquire iic bus\n"); Index: dev/i2c/anxedp.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/anxedp.c,v retrieving revision 1.6 retrieving revision 1.6.14.1 diff -u -p -r1.6 -r1.6.14.1 --- dev/i2c/anxedp.c 27 Jan 2021 02:29:48 -0000 1.6 +++ dev/i2c/anxedp.c 9 Aug 2021 00:30:09 -0000 1.6.14.1 @@ -1,4 +1,4 @@ -/* $NetBSD: anxedp.c,v 1.6 2021/01/27 02:29:48 thorpej Exp $ */ +/* $NetBSD: anxedp.c,v 1.6.14.1 2021/08/09 00:30:09 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: anxedp.c,v 1.6 2021/01/27 02:29:48 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: anxedp.c,v 1.6.14.1 2021/08/09 00:30:09 thorpej Exp $"); #include #include @@ -434,7 +434,7 @@ anxedp_attach(device_t parent, device_t sc->sc_dev = self; sc->sc_i2c = ia->ia_tag; sc->sc_addr = ia->ia_addr; - sc->sc_phandle = ia->ia_cookie; + sc->sc_phandle = devhandle_to_of(device_handle(self)); aprint_naive("\n"); aprint_normal(": eDP TX\n"); Index: dev/i2c/as3722.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/as3722.c,v retrieving revision 1.24 retrieving revision 1.24.2.1 diff -u -p -r1.24 -r1.24.2.1 --- dev/i2c/as3722.c 7 Aug 2021 16:19:11 -0000 1.24 +++ dev/i2c/as3722.c 9 Aug 2021 00:30:09 -0000 1.24.2.1 @@ -1,4 +1,4 @@ -/* $NetBSD: as3722.c,v 1.24 2021/08/07 16:19:11 thorpej Exp $ */ +/* $NetBSD: as3722.c,v 1.24.2.1 2021/08/09 00:30:09 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -29,7 +29,7 @@ #include "opt_fdt.h" #include -__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.24 2021/08/07 16:19:11 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.24.2.1 2021/08/09 00:30:09 thorpej Exp $"); #include #include @@ -261,7 +261,7 @@ as3722_attach(device_t parent, device_t sc->sc_dev = self; sc->sc_i2c = ia->ia_tag; sc->sc_addr = ia->ia_addr; - sc->sc_phandle = ia->ia_cookie; + sc->sc_phandle = devhandle_to_of(device_handle(self)); aprint_naive("\n"); aprint_normal(": AMS AS3722\n"); Index: dev/i2c/axp20x.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/axp20x.c,v retrieving revision 1.21 retrieving revision 1.21.2.1 diff -u -p -r1.21 -r1.21.2.1 --- dev/i2c/axp20x.c 7 Aug 2021 16:19:11 -0000 1.21 +++ dev/i2c/axp20x.c 9 Aug 2021 00:30:09 -0000 1.21.2.1 @@ -1,4 +1,4 @@ -/* $NetBSD: axp20x.c,v 1.21 2021/08/07 16:19:11 thorpej Exp $ */ +/* $NetBSD: axp20x.c,v 1.21.2.1 2021/08/09 00:30:09 thorpej Exp $ */ /*- * Copyright (c) 2014-2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: axp20x.c,v 1.21 2021/08/07 16:19:11 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: axp20x.c,v 1.21.2.1 2021/08/09 00:30:09 thorpej Exp $"); #include #include @@ -241,7 +241,7 @@ axp20x_attach(device_t parent, device_t sc->sc_dev = self; sc->sc_i2c = ia->ia_tag; sc->sc_addr = ia->ia_addr; - sc->sc_phandle = ia->ia_cookie; + sc->sc_phandle = devhandle_to_of(device_handle(self)); error = axp20x_read(sc, AXP_INPUT_STATUS, &sc->sc_inputstatus, 1); Index: dev/i2c/axppmic.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/axppmic.c,v retrieving revision 1.36 retrieving revision 1.36.2.1 diff -u -p -r1.36 -r1.36.2.1 --- dev/i2c/axppmic.c 7 Aug 2021 16:19:11 -0000 1.36 +++ dev/i2c/axppmic.c 9 Aug 2021 00:30:09 -0000 1.36.2.1 @@ -1,4 +1,4 @@ -/* $NetBSD: axppmic.c,v 1.36 2021/08/07 16:19:11 thorpej Exp $ */ +/* $NetBSD: axppmic.c,v 1.36.2.1 2021/08/09 00:30:09 thorpej Exp $ */ /*- * Copyright (c) 2014-2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: axppmic.c,v 1.36 2021/08/07 16:19:11 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: axppmic.c,v 1.36.2.1 2021/08/09 00:30:09 thorpej Exp $"); #include #include @@ -955,7 +955,7 @@ axppmic_attach(device_t parent, device_t sc->sc_dev = self; sc->sc_i2c = ia->ia_tag; sc->sc_addr = ia->ia_addr; - sc->sc_phandle = ia->ia_cookie; + sc->sc_phandle = devhandle_to_of(device_handle(self)); sc->sc_conf = c; aprint_naive("\n"); Index: dev/i2c/cwfg.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/cwfg.c,v retrieving revision 1.4 retrieving revision 1.4.14.1 diff -u -p -r1.4 -r1.4.14.1 --- dev/i2c/cwfg.c 27 Jan 2021 02:29:48 -0000 1.4 +++ dev/i2c/cwfg.c 9 Aug 2021 00:30:09 -0000 1.4.14.1 @@ -1,4 +1,4 @@ -/* $NetBSD: cwfg.c,v 1.4 2021/01/27 02:29:48 thorpej Exp $ */ +/* $NetBSD: cwfg.c,v 1.4.14.1 2021/08/09 00:30:09 thorpej Exp $ */ /*- * Copyright (c) 2020 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cwfg.c,v 1.4 2021/01/27 02:29:48 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cwfg.c,v 1.4.14.1 2021/08/09 00:30:09 thorpej Exp $"); #include #include @@ -418,7 +418,7 @@ cwfg_attach(device_t parent, device_t se sc->sc_dev = self; sc->sc_i2c = ia->ia_tag; sc->sc_addr = ia->ia_addr; - sc->sc_phandle = ia->ia_cookie; + sc->sc_phandle = devhandle_to_of(device_handle(self)); cwfg_lock(sc); error = cwfg_read(sc, VERSION_REG, &ver); Index: dev/i2c/dbcool.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/dbcool.c,v retrieving revision 1.62 retrieving revision 1.62.6.1 diff -u -p -r1.62 -r1.62.6.1 --- dev/i2c/dbcool.c 21 Jun 2021 03:12:54 -0000 1.62 +++ dev/i2c/dbcool.c 10 Sep 2021 15:45:28 -0000 1.62.6.1 @@ -1,4 +1,4 @@ -/* $NetBSD: dbcool.c,v 1.62 2021/06/21 03:12:54 christos Exp $ */ +/* $NetBSD: dbcool.c,v 1.62.6.1 2021/09/10 15:45:28 thorpej Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -50,7 +50,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.62 2021/06/21 03:12:54 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.62.6.1 2021/09/10 15:45:28 thorpej Exp $"); #include #include @@ -775,8 +775,11 @@ dbcool_attach(device_t parent, device_t sc->sc_dc.dc_readreg = dbcool_readreg; sc->sc_dc.dc_writereg = dbcool_writereg; sc->sc_dev = self; - sc->sc_prop = args->ia_prop; - prop_object_retain(sc->sc_prop); + + /* XXX XXX XXX */ + if ((sc->sc_prop = args->ia_prop) != NULL) { + prop_object_retain(sc->sc_prop); + } if (dbcool_chip_ident(&sc->sc_dc) < 0 || sc->sc_dc.dc_chip == NULL) panic("could not identify chip at addr %d", args->ia_addr); Index: dev/i2c/dstemp.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/dstemp.c,v retrieving revision 1.14 retrieving revision 1.14.6.1 diff -u -p -r1.14 -r1.14.6.1 --- dev/i2c/dstemp.c 21 Jun 2021 03:12:54 -0000 1.14 +++ dev/i2c/dstemp.c 10 Sep 2021 15:45:28 -0000 1.14.6.1 @@ -1,4 +1,4 @@ -/* $NetBSD: dstemp.c,v 1.14 2021/06/21 03:12:54 christos Exp $ */ +/* $NetBSD: dstemp.c,v 1.14.6.1 2021/09/10 15:45:28 thorpej Exp $ */ /*- * Copyright (c) 2018 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dstemp.c,v 1.14 2021/06/21 03:12:54 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dstemp.c,v 1.14.6.1 2021/09/10 15:45:28 thorpej Exp $"); #include #include @@ -109,8 +109,11 @@ dstemp_attach(device_t parent, device_t sc->sc_dev = self; sc->sc_i2c = ia->ia_tag; sc->sc_addr = ia->ia_addr; - sc->sc_prop = ia->ia_prop; - prop_object_retain(sc->sc_prop); + + /* XXX XXX XXX */ + if ((sc->sc_prop = ia->ia_prop) != NULL) { + prop_object_retain(sc->sc_prop); + } aprint_naive("\n"); aprint_normal(": DS1361\n"); Index: dev/i2c/es8316ac.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/es8316ac.c,v retrieving revision 1.5 retrieving revision 1.5.14.1 diff -u -p -r1.5 -r1.5.14.1 --- dev/i2c/es8316ac.c 27 Jan 2021 02:29:48 -0000 1.5 +++ dev/i2c/es8316ac.c 9 Aug 2021 00:30:09 -0000 1.5.14.1 @@ -1,4 +1,4 @@ -/* $NetBSD: es8316ac.c,v 1.5 2021/01/27 02:29:48 thorpej Exp $ */ +/* $NetBSD: es8316ac.c,v 1.5.14.1 2021/08/09 00:30:09 thorpej Exp $ */ /*- * Copyright (c) 2020 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: es8316ac.c,v 1.5 2021/01/27 02:29:48 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: es8316ac.c,v 1.5.14.1 2021/08/09 00:30:09 thorpej Exp $"); #include #include @@ -690,12 +690,12 @@ escodec_attach(device_t parent, device_t { struct escodec_softc * const sc = device_private(self); struct i2c_attach_args * const ia = aux; - const int phandle = ia->ia_cookie; + const int phandle = devhandle_to_of(device_handle(self)); sc->sc_dev = self; sc->sc_i2c = ia->ia_tag; sc->sc_addr = ia->ia_addr; - sc->sc_phandle = ia->ia_cookie; + sc->sc_phandle = devhandle_to_of(device_handle(self)); sc->sc_swvol = 0xff; sc->sc_clk = fdtbus_clock_get(phandle, "mclk"); Index: dev/i2c/fan53555.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/fan53555.c,v retrieving revision 1.9 retrieving revision 1.9.14.1 diff -u -p -r1.9 -r1.9.14.1 --- dev/i2c/fan53555.c 27 Jan 2021 02:29:48 -0000 1.9 +++ dev/i2c/fan53555.c 9 Aug 2021 00:30:09 -0000 1.9.14.1 @@ -1,4 +1,4 @@ -/* $NetBSD: fan53555.c,v 1.9 2021/01/27 02:29:48 thorpej Exp $ */ +/* $NetBSD: fan53555.c,v 1.9.14.1 2021/08/09 00:30:09 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fan53555.c,v 1.9 2021/01/27 02:29:48 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fan53555.c,v 1.9.14.1 2021/08/09 00:30:09 thorpej Exp $"); #include #include @@ -307,7 +307,7 @@ fan53555_attach(device_t parent, device_ sc->sc_dev = self; sc->sc_i2c = ia->ia_tag; sc->sc_addr = ia->ia_addr; - sc->sc_phandle = ia->ia_cookie; + sc->sc_phandle = devhandle_to_of(device_handle(self)); compat = iic_compatible_lookup(ia, compat_data); KASSERT(compat != NULL); Index: dev/i2c/files.i2c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/files.i2c,v retrieving revision 1.116 retrieving revision 1.116.6.1 diff -u -p -r1.116 -r1.116.6.1 --- dev/i2c/files.i2c 27 Jul 2021 20:23:41 -0000 1.116 +++ dev/i2c/files.i2c 9 Aug 2021 00:30:09 -0000 1.116.6.1 @@ -1,7 +1,7 @@ -# $NetBSD: files.i2c,v 1.116 2021/07/27 20:23:41 macallan Exp $ +# $NetBSD: files.i2c,v 1.116.6.1 2021/08/09 00:30:09 thorpej Exp $ obsolete defflag opt_i2cbus.h I2C_SCAN -define i2cbus { } +define i2cbus { [bus = -1] } define i2cexec device iic { [addr = -1] } : i2c_bitbang Index: dev/i2c/ihidev.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/ihidev.c,v retrieving revision 1.20 retrieving revision 1.20.2.2 diff -u -p -r1.20 -r1.20.2.2 --- dev/i2c/ihidev.c 7 Aug 2021 16:19:11 -0000 1.20 +++ dev/i2c/ihidev.c 9 Aug 2021 12:36:14 -0000 1.20.2.2 @@ -1,4 +1,4 @@ -/* $NetBSD: ihidev.c,v 1.20 2021/08/07 16:19:11 thorpej Exp $ */ +/* $NetBSD: ihidev.c,v 1.20.2.2 2021/08/09 12:36:14 thorpej Exp $ */ /* $OpenBSD ihidev.c,v 1.13 2017/04/08 02:57:23 deraadt Exp $ */ /*- @@ -54,7 +54,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ihidev.c,v 1.20 2021/08/07 16:19:11 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ihidev.c,v 1.20.2.2 2021/08/09 12:36:14 thorpej Exp $"); #include #include @@ -162,8 +162,7 @@ ihidev_attach(device_t parent, device_t sc->sc_addr = ia->ia_addr; mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_VM); - sc->sc_phandle = ia->ia_cookie; - if (ia->ia_cookietype != I2C_COOKIE_ACPI) { + if (devhandle_type(device_handle(self)) != DEVHANDLE_TYPE_ACPI) { aprint_error(": unsupported device tree type\n"); return; } @@ -649,7 +648,7 @@ static bool ihiddev_intr_init(struct ihidev_softc *sc) { #if NACPICA > 0 - ACPI_HANDLE hdl = (void *)(uintptr_t)sc->sc_phandle; + ACPI_HANDLE hdl = devhandle_to_acpi(device_handle(sc->sc_dev)); struct acpi_resources res; ACPI_STATUS rv; char buf[100]; @@ -673,8 +672,8 @@ ihiddev_intr_init(struct ihidev_softc *s acpi_resource_cleanup(&res); - sc->sc_ih = acpi_intr_establish(sc->sc_dev, sc->sc_phandle, IPL_TTY, - false, ihidev_intr, sc, device_xname(sc->sc_dev)); + sc->sc_ih = acpi_intr_establish(sc->sc_dev, (uint64_t)(uintptr_t)hdl, + IPL_TTY, false, ihidev_intr, sc, device_xname(sc->sc_dev)); if (sc->sc_ih == NULL) { aprint_error_dev(sc->sc_dev, "can't establish interrupt\n"); return false; @@ -975,7 +974,7 @@ ihidev_set_report(struct device *dev, in static bool ihidev_acpi_get_info(struct ihidev_softc *sc) { - ACPI_HANDLE hdl = (void *)(uintptr_t)sc->sc_phandle; + ACPI_HANDLE hdl = devhandle_to_acpi(device_handle(sc->sc_dev)); ACPI_STATUS status; ACPI_INTEGER val; Index: dev/i2c/ihidev.h =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/ihidev.h,v retrieving revision 1.4 retrieving revision 1.4.20.1 diff -u -p -r1.4 -r1.4.20.1 --- dev/i2c/ihidev.h 9 Jan 2020 04:04:01 -0000 1.4 +++ dev/i2c/ihidev.h 9 Aug 2021 00:30:09 -0000 1.4.20.1 @@ -1,4 +1,4 @@ -/* $NetBSD: ihidev.h,v 1.4 2020/01/09 04:04:01 thorpej Exp $ */ +/* $NetBSD: ihidev.h,v 1.4.20.1 2021/08/09 00:30:09 thorpej Exp $ */ /* $OpenBSD ihidev.h,v 1.4 2016/01/31 18:24:35 jcs Exp $ */ /*- @@ -97,7 +97,6 @@ struct ihidev_softc { device_t sc_dev; i2c_tag_t sc_tag; i2c_addr_t sc_addr; - uint64_t sc_phandle; void * sc_ih; void * sc_sih; Index: dev/i2c/lm75.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/lm75.c,v retrieving revision 1.45 retrieving revision 1.45.6.1 diff -u -p -r1.45 -r1.45.6.1 --- dev/i2c/lm75.c 21 Jun 2021 03:12:54 -0000 1.45 +++ dev/i2c/lm75.c 10 Sep 2021 15:45:28 -0000 1.45.6.1 @@ -1,4 +1,4 @@ -/* $NetBSD: lm75.c,v 1.45 2021/06/21 03:12:54 christos Exp $ */ +/* $NetBSD: lm75.c,v 1.45.6.1 2021/09/10 15:45:28 thorpej Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: lm75.c,v 1.45 2021/06/21 03:12:54 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lm75.c,v 1.45.6.1 2021/09/10 15:45:28 thorpej Exp $"); #include #include @@ -214,9 +214,11 @@ lmtemp_attach(device_t parent, device_t sc->sc_tag = ia->ia_tag; sc->sc_address = ia->ia_addr; - sc->sc_prop = ia->ia_prop; - - if (ia->ia_prop != NULL) prop_object_retain(sc->sc_prop); + + /* XXX XXX XXX */ + if ((sc->sc_prop = ia->ia_prop) != NULL) { + prop_object_retain(sc->sc_prop); + } aprint_naive(": Temperature Sensor\n"); if (ia->ia_name) { Index: dev/i2c/max77620.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/max77620.c,v retrieving revision 1.11 retrieving revision 1.11.14.1 diff -u -p -r1.11 -r1.11.14.1 --- dev/i2c/max77620.c 27 Jan 2021 02:29:48 -0000 1.11 +++ dev/i2c/max77620.c 9 Aug 2021 00:30:09 -0000 1.11.14.1 @@ -1,4 +1,4 @@ -/* $NetBSD: max77620.c,v 1.11 2021/01/27 02:29:48 thorpej Exp $ */ +/* $NetBSD: max77620.c,v 1.11.14.1 2021/08/09 00:30:09 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: max77620.c,v 1.11 2021/01/27 02:29:48 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: max77620.c,v 1.11.14.1 2021/08/09 00:30:09 thorpej Exp $"); #include #include @@ -281,7 +281,7 @@ max77620_attach(device_t parent, device_ sc->sc_dev = self; sc->sc_i2c = ia->ia_tag; sc->sc_addr = ia->ia_addr; - sc->sc_phandle = ia->ia_cookie; + sc->sc_phandle = devhandle_to_of(device_handle(self)); aprint_naive("\n"); aprint_normal(": MAX77620 Power Management IC\n"); Index: dev/i2c/pca9685.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/pca9685.c,v retrieving revision 1.6 retrieving revision 1.6.14.1 diff -u -p -r1.6 -r1.6.14.1 --- dev/i2c/pca9685.c 27 Jan 2021 02:29:48 -0000 1.6 +++ dev/i2c/pca9685.c 9 Aug 2021 00:30:09 -0000 1.6.14.1 @@ -1,4 +1,4 @@ -/* $NetBSD: pca9685.c,v 1.6 2021/01/27 02:29:48 thorpej Exp $ */ +/* $NetBSD: pca9685.c,v 1.6.14.1 2021/08/09 00:30:09 thorpej Exp $ */ /*- * Copyright (c) 2018, 2019 Jason R. Thorpe @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pca9685.c,v 1.6 2021/01/27 02:29:48 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pca9685.c,v 1.6.14.1 2021/08/09 00:30:09 thorpej Exp $"); #include #include @@ -526,7 +526,7 @@ pcapwm_attach(device_t parent, device_t struct pcapwm_softc * const sc = device_private(self); struct i2c_attach_args * const ia = aux; struct clk *clk; - const int phandle = (int)ia->ia_cookie; + const int phandle = devhandle_to_of(device_handle(self)); u_int index; int error; Index: dev/i2c/pcf8563.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/pcf8563.c,v retrieving revision 1.15 retrieving revision 1.15.14.1 diff -u -p -r1.15 -r1.15.14.1 --- dev/i2c/pcf8563.c 27 Jan 2021 02:29:48 -0000 1.15 +++ dev/i2c/pcf8563.c 9 Aug 2021 00:30:09 -0000 1.15.14.1 @@ -1,4 +1,4 @@ -/* $NetBSD: pcf8563.c,v 1.15 2021/01/27 02:29:48 thorpej Exp $ */ +/* $NetBSD: pcf8563.c,v 1.15.14.1 2021/08/09 00:30:09 thorpej Exp $ */ /* * Copyright (c) 2011 Jonathan A. Kollasch @@ -32,7 +32,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: pcf8563.c,v 1.15 2021/01/27 02:29:48 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pcf8563.c,v 1.15.14.1 2021/08/09 00:30:09 thorpej Exp $"); #include #include @@ -123,7 +123,8 @@ pcf8563rtc_attach(device_t parent, devic } #ifdef FDT - fdtbus_todr_attach(self, ia->ia_cookie, &sc->sc_todr); + fdtbus_todr_attach(self, devhandle_to_of(device_handle(self)), + &sc->sc_todr); #else todr_attach(&sc->sc_todr); #endif Index: dev/i2c/rkpmic.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/rkpmic.c,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -u -p -r1.14 -r1.14.2.1 --- dev/i2c/rkpmic.c 7 Aug 2021 16:19:11 -0000 1.14 +++ dev/i2c/rkpmic.c 9 Aug 2021 00:30:09 -0000 1.14.2.1 @@ -1,4 +1,4 @@ -/* $NetBSD: rkpmic.c,v 1.14 2021/08/07 16:19:11 thorpej Exp $ */ +/* $NetBSD: rkpmic.c,v 1.14.2.1 2021/08/09 00:30:09 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rkpmic.c,v 1.14 2021/08/07 16:19:11 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rkpmic.c,v 1.14.2.1 2021/08/09 00:30:09 thorpej Exp $"); #include #include @@ -472,7 +472,7 @@ rkpmic_attach(device_t parent, device_t sc->sc_dev = self; sc->sc_i2c = ia->ia_tag; sc->sc_addr = ia->ia_addr; - sc->sc_phandle = ia->ia_cookie; + sc->sc_phandle = devhandle_to_of(device_handle(self)); sc->sc_conf = entry->data; memset(&sc->sc_todr, 0, sizeof(sc->sc_todr)); Index: dev/i2c/spdmem_i2c.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/spdmem_i2c.c,v retrieving revision 1.22 retrieving revision 1.22.6.1 diff -u -p -r1.22 -r1.22.6.1 --- dev/i2c/spdmem_i2c.c 13 Jun 2021 09:48:04 -0000 1.22 +++ dev/i2c/spdmem_i2c.c 9 Aug 2021 00:30:09 -0000 1.22.6.1 @@ -1,4 +1,4 @@ -/* $NetBSD: spdmem_i2c.c,v 1.22 2021/06/13 09:48:04 mlelstv Exp $ */ +/* $NetBSD: spdmem_i2c.c,v 1.22.6.1 2021/08/09 00:30:09 thorpej Exp $ */ /* * Copyright (c) 2007 Nicolas Joly @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: spdmem_i2c.c,v 1.22 2021/06/13 09:48:04 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spdmem_i2c.c,v 1.22.6.1 2021/08/09 00:30:09 thorpej Exp $"); #include #include @@ -180,6 +180,50 @@ static const struct device_compatible_en DEVICE_COMPAT_EOL }; +/* + * Some device trees don't have real "compatible" entries, so we + * end up having to match by name. + */ +static const struct device_compatible_entry name_data[] = { + { .compat = "dimm-spd" }, + { .compat = "dimm" }, + DEVICE_COMPAT_EOL +}; + +#define SPDMEM_HIGH_CONFIDENCE_MATCH (I2C_MATCH_DIRECT_COMPATIBLE + 20) + +static bool +spdmem_i2c_use_name_match(const struct i2c_attach_args *ia, int *match_resultp) +{ + const char *name = ia->ia_name; + + if (name != NULL) { + *match_resultp = device_compatible_match(&name, 1, name_data) + ? SPDMEM_HIGH_CONFIDENCE_MATCH + : 0; + return true; + } + return false; +} + +static bool +spdmem_i2c_use_direct_match(const struct i2c_attach_args *ia, const cfdata_t cf, + const struct device_compatible_entry *cdata, + int *match_resultp) +{ + /* + * Matching by name is not ideal, but some device trees only + * have a name and no "compatible" property. + */ + if (spdmem_i2c_use_name_match(ia, match_resultp)) + return true; + + if (iic_use_direct_match(ia, cf, cdata, match_resultp)) + return true; + + return false; +} + static int spdmem_i2c_match(device_t parent, cfdata_t match, void *aux) { @@ -187,46 +231,32 @@ spdmem_i2c_match(device_t parent, cfdata struct spdmem_i2c_softc sc; int match_result; - if (iic_use_direct_match(ia, match, compat_data, &match_result)) - return match_result; - - /* - * XXXJRT - * Should do this with "compatible" strings. There are also - * other problems with this "match" routine. Specifically, if - * we are doing direct-config, we know the device is already - * there aren't do need to probe. I'll leave the logic for - * now and let someone who knows better clean it later. - */ + if (spdmem_i2c_use_direct_match(ia, match, compat_data, &match_result)) + goto do_probe; - if (ia->ia_name) { - /* add other names as we find more firmware variations */ - if (strcmp(ia->ia_name, "dimm-spd") && - strcmp(ia->ia_name, "dimm")) - return 0; - } - - /* only do this lame test when not using direct config */ - if (ia->ia_name == NULL) { - if ((ia->ia_addr & SPDMEM_I2C_ADDRMASK) != SPDMEM_I2C_ADDR) - return 0; - } + /* Filter out by address when not using direct config. */ + if ((ia->ia_addr & SPDMEM_I2C_ADDRMASK) != SPDMEM_I2C_ADDR) + return 0; sc.sc_tag = ia->ia_tag; sc.sc_addr = ia->ia_addr; sc.sc_page0 = SPDCTL_SPA0; sc.sc_page1 = SPDCTL_SPA1; sc.sc_base.sc_read = spdmem_i2c_read; + match_result = 0; + do_probe: /* Check the bank and reset to the page 0 */ if (spdmem_reset_page(&sc) != 0) return 0; if (spdmem_common_probe(&sc.sc_base)) { - return ia->ia_name ? I2C_MATCH_DIRECT_SPECIFIC - : I2C_MATCH_ADDRESS_AND_PROBE; + if (match_result < SPDMEM_HIGH_CONFIDENCE_MATCH) { + match_result = SPDMEM_HIGH_CONFIDENCE_MATCH; + } } - return 0; + + return match_result; } static void @@ -234,6 +264,7 @@ spdmem_i2c_attach(device_t parent, devic { struct spdmem_i2c_softc *sc = device_private(self); struct i2c_attach_args *ia = aux; + int match_result; sc->sc_tag = ia->ia_tag; sc->sc_addr = ia->ia_addr; @@ -241,10 +272,28 @@ spdmem_i2c_attach(device_t parent, devic sc->sc_page1 = SPDCTL_SPA1; sc->sc_base.sc_read = spdmem_i2c_read; - if (!pmf_device_register(self, NULL, NULL)) - aprint_error_dev(self, "couldn't establish power handler\n"); + /* + * SPD stands for "Serial Presence Detect". If we're using + * direct configuration, the device tree may have given us + * a location where and SPD memory modudle *could* be found, + * not necessarily where it is known to be present. + * + * Accordingly, if we get a direct configuration match based + * on compatible data or device name, we still check to see + * if the device is there. + */ + if (spdmem_i2c_use_direct_match(ia, device_cfdata(self), compat_data, + &match_result)) { + if (! spdmem_common_probe(&sc->sc_base)) { + aprint_normal(": module not present\n"); + return; + } + } spdmem_common_attach(&sc->sc_base, self); + + if (!pmf_device_register(self, NULL, NULL)) + aprint_error_dev(self, "couldn't establish power handler\n"); } static int Index: dev/i2c/sy8106a.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/sy8106a.c,v retrieving revision 1.8 retrieving revision 1.8.14.1 diff -u -p -r1.8 -r1.8.14.1 --- dev/i2c/sy8106a.c 27 Jan 2021 02:29:48 -0000 1.8 +++ dev/i2c/sy8106a.c 9 Aug 2021 00:30:09 -0000 1.8.14.1 @@ -1,4 +1,4 @@ -/* $NetBSD: sy8106a.c,v 1.8 2021/01/27 02:29:48 thorpej Exp $ */ +/* $NetBSD: sy8106a.c,v 1.8.14.1 2021/08/09 00:30:09 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sy8106a.c,v 1.8 2021/01/27 02:29:48 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sy8106a.c,v 1.8.14.1 2021/08/09 00:30:09 thorpej Exp $"); #include #include @@ -202,7 +202,7 @@ sy8106a_attach(device_t parent, device_t sc->sc_dev = self; sc->sc_i2c = ia->ia_tag; sc->sc_addr = ia->ia_addr; - sc->sc_phandle = ia->ia_cookie; + sc->sc_phandle = devhandle_to_of(device_handle(self)); aprint_naive("\n"); aprint_normal(": Silergy SY8106A regulator\n"); Index: dev/i2c/tcagpio.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/tcagpio.c,v retrieving revision 1.8 retrieving revision 1.8.14.1 diff -u -p -r1.8 -r1.8.14.1 --- dev/i2c/tcagpio.c 27 Jan 2021 02:29:48 -0000 1.8 +++ dev/i2c/tcagpio.c 9 Aug 2021 00:30:09 -0000 1.8.14.1 @@ -1,4 +1,4 @@ -/* $NetBSD: tcagpio.c,v 1.8 2021/01/27 02:29:48 thorpej Exp $ */ +/* $NetBSD: tcagpio.c,v 1.8.14.1 2021/08/09 00:30:09 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tcagpio.c,v 1.8 2021/01/27 02:29:48 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcagpio.c,v 1.8.14.1 2021/08/09 00:30:09 thorpej Exp $"); #include #include @@ -263,7 +263,7 @@ tcagpio_attach(device_t parent, device_t sc->sc_dev = self; sc->sc_i2c = ia->ia_tag; sc->sc_addr = ia->ia_addr; - sc->sc_phandle = ia->ia_cookie; + sc->sc_phandle = devhandle_to_of(device_handle(self)); sc->sc_npins = TCA_PIN_COUNT; aprint_naive("\n"); Index: dev/i2c/tcakp.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/tcakp.c,v retrieving revision 1.17 retrieving revision 1.17.2.1 diff -u -p -r1.17 -r1.17.2.1 --- dev/i2c/tcakp.c 7 Aug 2021 16:19:11 -0000 1.17 +++ dev/i2c/tcakp.c 9 Aug 2021 00:30:09 -0000 1.17.2.1 @@ -1,4 +1,4 @@ -/* $NetBSD: tcakp.c,v 1.17 2021/08/07 16:19:11 thorpej Exp $ */ +/* $NetBSD: tcakp.c,v 1.17.2.1 2021/08/09 00:30:09 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -29,7 +29,7 @@ #include "opt_fdt.h" #include -__KERNEL_RCSID(0, "$NetBSD: tcakp.c,v 1.17 2021/08/07 16:19:11 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcakp.c,v 1.17.2.1 2021/08/09 00:30:09 thorpej Exp $"); #include #include @@ -380,7 +380,7 @@ tcakp_attach(device_t parent, device_t s sc->sc_dev = self; sc->sc_i2c = ia->ia_tag; sc->sc_addr = ia->ia_addr; - sc->sc_phandle = ia->ia_cookie; + sc->sc_phandle = devhandle_to_of(device_handle(self)); aprint_naive("\n"); aprint_normal(": TCA8418\n"); Index: dev/i2c/tda19988.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/tda19988.c,v retrieving revision 1.7 retrieving revision 1.7.14.1 diff -u -p -r1.7 -r1.7.14.1 --- dev/i2c/tda19988.c 27 Jan 2021 02:29:48 -0000 1.7 +++ dev/i2c/tda19988.c 9 Aug 2021 00:30:09 -0000 1.7.14.1 @@ -1,4 +1,4 @@ -/* $NetBSD: tda19988.c,v 1.7 2021/01/27 02:29:48 thorpej Exp $ */ +/* $NetBSD: tda19988.c,v 1.7.14.1 2021/08/09 00:30:09 thorpej Exp $ */ /*- * Copyright (c) 2015 Oleksandr Tymoshenko @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tda19988.c,v 1.7 2021/01/27 02:29:48 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tda19988.c,v 1.7.14.1 2021/08/09 00:30:09 thorpej Exp $"); /* * NXP TDA19988 HDMI encoder @@ -904,7 +904,7 @@ tda19988_attach(device_t parent, device_ { struct tda19988_softc *sc = device_private(self); struct i2c_attach_args * const ia = aux; - const int phandle = ia->ia_cookie; + const int phandle = devhandle_to_of(device_handle(self)); sc->sc_dev = self; sc->sc_phandle = phandle; Index: dev/i2c/tps65217pmic.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/tps65217pmic.c,v retrieving revision 1.20 retrieving revision 1.20.2.1 diff -u -p -r1.20 -r1.20.2.1 --- dev/i2c/tps65217pmic.c 7 Aug 2021 16:19:11 -0000 1.20 +++ dev/i2c/tps65217pmic.c 9 Aug 2021 00:30:09 -0000 1.20.2.1 @@ -1,4 +1,4 @@ -/* $NetBSD: tps65217pmic.c,v 1.20 2021/08/07 16:19:11 thorpej Exp $ */ +/* $NetBSD: tps65217pmic.c,v 1.20.2.1 2021/08/09 00:30:09 thorpej Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ #include "opt_fdt.h" #include -__KERNEL_RCSID(0, "$NetBSD: tps65217pmic.c,v 1.20 2021/08/07 16:19:11 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tps65217pmic.c,v 1.20.2.1 2021/08/09 00:30:09 thorpej Exp $"); #include #include @@ -335,7 +335,7 @@ tps65217pmic_attach(device_t parent, dev sc->sc_dev = self; sc->sc_addr = ia->ia_addr; - sc->sc_phandle = ia->ia_cookie; + sc->sc_phandle = devhandle_to_of(device_handle(self)); sc->sc_tag = ia->ia_tag; dict = device_properties(self); Index: dev/i2c/twl4030.c =================================================================== RCS file: /cvsroot/src/sys/dev/i2c/twl4030.c,v retrieving revision 1.6 retrieving revision 1.6.14.1 diff -u -p -r1.6 -r1.6.14.1 --- dev/i2c/twl4030.c 27 Jan 2021 03:10:21 -0000 1.6 +++ dev/i2c/twl4030.c 9 Aug 2021 00:30:09 -0000 1.6.14.1 @@ -1,4 +1,4 @@ -/* $NetBSD: twl4030.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $ */ +/* $NetBSD: twl4030.c,v 1.6.14.1 2021/08/09 00:30:09 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -29,7 +29,7 @@ #include "opt_fdt.h" #include -__KERNEL_RCSID(0, "$NetBSD: twl4030.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: twl4030.c,v 1.6.14.1 2021/08/09 00:30:09 thorpej Exp $"); #include #include @@ -382,7 +382,7 @@ twl_attach(device_t parent, device_t sel sc->sc_dev = self; sc->sc_i2c = ia->ia_tag; sc->sc_addr = ia->ia_addr; - sc->sc_phandle = ia->ia_cookie; + sc->sc_phandle = devhandle_to_of(device_handle(self)); sc->sc_npins = TWL_PIN_COUNT; aprint_naive("\n");