Source-Changes-HG archive

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

[src/thorpej-i2c-spi-conf]: src/sys/dev/i2c - Don't use acpi_enter_i2c_devs()...



details:   https://anonhg.NetBSD.org/src/rev/63e45c960420
branches:  thorpej-i2c-spi-conf
changeset: 1020779:63e45c960420
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Apr 25 22:02:59 2021 +0000

description:
- Don't use acpi_enter_i2c_devs() -- it no longer exists.
- Pass along our devhandle to the i2c bus instance.

diffstat:

 sys/arch/arm/broadcom/bcm2835_bsc_acpi.c |   9 +++++----
 sys/arch/x86/pci/dwiic_pci.c             |  23 +++++------------------
 sys/dev/acpi/dwiic_acpi.c                |  10 +++++-----
 sys/dev/acpi/nxpiic_acpi.c               |   5 ++---
 sys/dev/i2c/motoi2c.c                    |   6 +++---
 sys/dev/i2c/motoi2cvar.h                 |   3 +--
 6 files changed, 21 insertions(+), 35 deletions(-)

diffs (200 lines):

diff -r 26f88d71f7de -r 63e45c960420 sys/arch/arm/broadcom/bcm2835_bsc_acpi.c
--- a/sys/arch/arm/broadcom/bcm2835_bsc_acpi.c  Sun Apr 25 21:52:28 2021 +0000
+++ b/sys/arch/arm/broadcom/bcm2835_bsc_acpi.c  Sun Apr 25 22:02:59 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bcm2835_bsc_acpi.c,v 1.3.2.1 2021/04/25 21:52:28 thorpej Exp $ */
+/* $NetBSD: bcm2835_bsc_acpi.c,v 1.3.2.2 2021/04/25 22:02:59 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2020 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc_acpi.c,v 1.3.2.1 2021/04/25 21:52:28 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc_acpi.c,v 1.3.2.2 2021/04/25 22:02:59 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -159,8 +159,9 @@
 
        memset(&iba, 0, sizeof(iba));
        iba.iba_tag = &sc->sc_i2c;
-       iba.iba_child_devices = acpi_enter_i2c_devs(self, aa->aa_node);
-       config_found(self, &iba, iicbus_print, CFARG_EOL);
+       config_found(self, &iba, iicbus_print,
+           CFARG_DEVHANDLE, device_handle(self),
+           CFARG_EOL);
 
 done:
        acpi_resource_cleanup(&res);
diff -r 26f88d71f7de -r 63e45c960420 sys/arch/x86/pci/dwiic_pci.c
--- a/sys/arch/x86/pci/dwiic_pci.c      Sun Apr 25 21:52:28 2021 +0000
+++ b/sys/arch/x86/pci/dwiic_pci.c      Sun Apr 25 22:02:59 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dwiic_pci.c,v 1.4.2.1 2021/04/25 21:52:28 thorpej Exp $ */
+/* $NetBSD: dwiic_pci.c,v 1.4.2.2 2021/04/25 22:02:59 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwiic_pci.c,v 1.4.2.1 2021/04/25 21:52:28 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwiic_pci.c,v 1.4.2.2 2021/04/25 22:02:59 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -42,10 +42,6 @@
 #include <dev/pci/pcivar.h>
 #include <dev/pci/pcidevs.h>
 
-#include <dev/acpi/acpivar.h>
-#include <dev/acpi/acpi_pci.h>
-#include <dev/acpi/acpi_util.h>
-
 #include <dev/ic/dwiic_var.h>
 #include <arch/x86/pci/lpssreg.h>
 
@@ -61,7 +57,6 @@
        struct dwiic_softc      sc_dwiic;
        pci_chipset_tag_t       sc_pc;
        pcitag_t                sc_ptag;
-       struct acpi_devnode     *sc_acpinode;
 };
 
 static uint32_t
@@ -164,19 +159,11 @@
        lpss_write(sc, LPSS_REMAP_HI,
            pci_conf_read(sc->sc_pc, sc->sc_ptag, PCI_BAR0 + 0x4));
 
-       sc->sc_acpinode = acpi_pcidev_find(0 /*XXX segment*/,
-           pa->pa_bus, pa->pa_device, pa->pa_function);
-
-       if (sc->sc_acpinode) {
-               sc->sc_dwiic.sc_iba.iba_child_devices = 
-                   acpi_enter_i2c_devs(NULL, sc->sc_acpinode);
-       } else {
-               aprint_verbose_dev(self, "no matching ACPI node\n");
-       }
-
        dwiic_attach(&sc->sc_dwiic);
 
-       config_found(self, &sc->sc_dwiic.sc_iba, iicbus_print, CFARG_EOL);
+       config_found(self, &sc->sc_dwiic.sc_iba, iicbus_print,
+           CFARG_DEVHANDLE, device_handle(self),
+           CFARG_EOL);
 
        pmf_device_register(self, dwiic_suspend, dwiic_resume);
 
diff -r 26f88d71f7de -r 63e45c960420 sys/dev/acpi/dwiic_acpi.c
--- a/sys/dev/acpi/dwiic_acpi.c Sun Apr 25 21:52:28 2021 +0000
+++ b/sys/dev/acpi/dwiic_acpi.c Sun Apr 25 22:02:59 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dwiic_acpi.c,v 1.8.2.1 2021/04/25 21:52:28 thorpej Exp $ */
+/* $NetBSD: dwiic_acpi.c,v 1.8.2.2 2021/04/25 22:02:59 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwiic_acpi.c,v 1.8.2.1 2021/04/25 21:52:28 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwiic_acpi.c,v 1.8.2.2 2021/04/25 22:02:59 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -124,11 +124,11 @@
 
        dwiic_acpi_configure(sc, aa->aa_node->ad_handle);
 
-       sc->sc_iba.iba_child_devices = acpi_enter_i2c_devs(self, aa->aa_node);
-
        dwiic_attach(sc);
 
-       config_found(self, &sc->sc_iba, iicbus_print, CFARG_EOL);
+       config_found(self, &sc->sc_iba, iicbus_print,
+           CFARG_DEVHANDLE, device_handle(self),
+           CFARG_EOL);
 
        pmf_device_register(self, dwiic_suspend, dwiic_resume);
 
diff -r 26f88d71f7de -r 63e45c960420 sys/dev/acpi/nxpiic_acpi.c
--- a/sys/dev/acpi/nxpiic_acpi.c        Sun Apr 25 21:52:28 2021 +0000
+++ b/sys/dev/acpi/nxpiic_acpi.c        Sun Apr 25 22:02:59 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nxpiic_acpi.c,v 1.4.6.1 2021/04/25 21:52:28 thorpej Exp $ */
+/* $NetBSD: nxpiic_acpi.c,v 1.4.6.2 2021/04/25 22:02:59 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nxpiic_acpi.c,v 1.4.6.1 2021/04/25 21:52:28 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nxpiic_acpi.c,v 1.4.6.2 2021/04/25 22:02:59 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -147,7 +147,6 @@
        msc->sc_flags |= MOTOI2C_F_ENABLE_INV | MOTOI2C_F_STATUS_W1C;
        msc->sc_iord = nxpiic_acpi_iord;
        msc->sc_iowr = nxpiic_acpi_iowr;
-       msc->sc_child_devices = acpi_enter_i2c_devs(self, aa->aa_node);
 
        motoi2c_attach_common(self, msc, &settings);
 
diff -r 26f88d71f7de -r 63e45c960420 sys/dev/i2c/motoi2c.c
--- a/sys/dev/i2c/motoi2c.c     Sun Apr 25 21:52:28 2021 +0000
+++ b/sys/dev/i2c/motoi2c.c     Sun Apr 25 22:02:59 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: motoi2c.c,v 1.11 2021/04/24 23:36:54 thorpej Exp $ */
+/* $NetBSD: motoi2c.c,v 1.11.2.1 2021/04/25 22:02:59 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2007, 2010 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: motoi2c.c,v 1.11 2021/04/24 23:36:54 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: motoi2c.c,v 1.11.2.1 2021/04/25 22:02:59 thorpej Exp $");
 
 #if defined(__arm__) || defined(__aarch64__)
 #include "opt_fdt.h"
@@ -107,7 +107,6 @@
                sc->sc_iowr = motoi2c_iowr1;
        memset(&iba, 0, sizeof(iba));
        iba.iba_tag = &sc->sc_i2c;
-       iba.iba_child_devices = sc->sc_child_devices;
 
        if ((sc->sc_flags & MOTOI2C_F_ENABLE_INV) != 0) {
                sc->sc_enable_mask = 0;
@@ -136,6 +135,7 @@
 #endif
        config_found(self, &iba, iicbus_print,
            CFARG_IATTR, "i2cbus",
+           CFARG_DEVHANDLE, device_handle(self),
            CFARG_EOL);
 }
 
diff -r 26f88d71f7de -r 63e45c960420 sys/dev/i2c/motoi2cvar.h
--- a/sys/dev/i2c/motoi2cvar.h  Sun Apr 25 21:52:28 2021 +0000
+++ b/sys/dev/i2c/motoi2cvar.h  Sun Apr 25 22:02:59 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: motoi2cvar.h,v 1.8 2021/01/25 12:08:47 jmcneill Exp $ */
+/* $NetBSD: motoi2cvar.h,v 1.8.4.1 2021/04/25 22:02:59 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2007, 2010 The NetBSD Foundation, Inc.
@@ -51,7 +51,6 @@
        motoi2c_iord_t          sc_iord;
        motoi2c_iowr_t          sc_iowr;
        int                     sc_phandle;
-       prop_array_t            sc_child_devices;
        int                     sc_flags;
 #define        MOTOI2C_F_ENABLE_INV    __BIT(0)
 #define        MOTOI2C_F_STATUS_W1C    __BIT(1)



Home | Main Index | Thread Index | Old Index