On Sun, May 20, 2018 at 08:51:03PM +0200, Mark Kettenis wrote: > > Date: Sat, 19 May 2018 18:48:15 -0700 > > From: Mike Larkin <mlar...@azathoth.net> > > > > On Sat, May 19, 2018 at 09:44:22PM +0200, Mark Kettenis wrote: > > > I'm working on some i2c drivers that are closely tied to acpi. These > > > drivers need to call into acpi and need to know their acpi node. The > > > diff below makes dwiic(4) pass the acpi node as the cookie to its > > > children. This matches what we do in ofw/fdt land where we pass the > > > device tree node. > > > > > > ok? > > > > > > > Sure, ok mlarkin > > Turns out I need interrupts as well. > > ok? > > Index: dwiic_acpi.c > =================================================================== > RCS file: /cvs/src/sys/dev/acpi/dwiic_acpi.c,v > retrieving revision 1.6 > diff -u -p -r1.6 dwiic_acpi.c > --- dwiic_acpi.c 20 May 2018 09:30:00 -0000 1.6 > +++ dwiic_acpi.c 20 May 2018 18:49:22 -0000 > @@ -395,6 +395,9 @@ dwiic_acpi_found_hid(struct aml_node *no > ia.ia_addr = crs.i2c_addr; > ia.ia_cookie = node->parent; > > + if (crs.irq_int != 0 || crs.gpio_int_node != NULL) > + ia.ia_intr = &crs; > + > config_found(sc->sc_iic, &ia, dwiic_i2c_print); > node->parent->attached = 1; > >
sure