Thanks for all the information and links. I had a look at the linux driver apple-gmux.c, and tried to write a simple DragonFly kernel module that switches off the gmux. However, I'm stuck with the attachment of the gmux device: probing via acpi works fine, but I'm not able to allocate IO ports. The gmux controller is at the LPC bus:
--- LPC --- pciconf -lv: isab0@pci0:0:31:0: . . . vendor = 'Intel Corporation' device = 'HM55 Chipset LPC Interface Controller' class = bridge subclass = PCI-ISA --- ---- GMUX ---- devinfo -rv | grep GMUX: unknown pnpinfo _HID=APP000B _UID=0 at handle=\_SB_.PCI0.LPCB.GMUX --- It seems devices attached to LPC bus can be treated as isa devices: https://lists.freebsd.org/pipermail/freebsd-hackers/2004-October/008733.html I tried to follow the logic of similar drivers, e.g. acpi_ec, which seems to sit at the same bus (if I understand it correctly that the handle says it's located at the LPC bus?): acpi_ec0 pnpinfo . . . handle=\_SB_.PCI0.LPCB.EC__ The acpi_ec probe part is done with roughly: --- sys/dev/acpica/acpi_ec.c: --- acpi_ec_probe(. . .) { . . . ACPI_ID_PROBE(device_get_parent(dev), dev, ec_ids) . . . } --- and that works fine for gmux too. Then attach() calls bus_alloc_resource(): --- sys/dev/acpica/acpi_ec.c: --- acpi_ec_attach(. . .) { . . . res = bus_alloc_resource_any(sc->ec_dev, SYS_RES_IOPORT, &sc->ec_data_rid, RF_ACTIVE); . . . } --- But that same call returns a NULL pointer for gmux. Where have I gone wrong? Cheers Peeter -- On Thu, Aug 4, 2016 at 5:28 PM, Pedro Andrés Aranda Gutiérrez < [email protected]> wrote: > BTW, there was some code around in the switcher and in mackintosh lists on > this. File was something like gmux.c > > > > On 28 Jul 2016, at 11:45, Francois Tigeot <[email protected]> wrote: > > > On Thu, Jul 28, 2016 at 10:49:26AM +0200, Pedro Andres Aranda Gutierrez > wrote: > >> Similar problem here with an ASUS with nVidia Optimus... So it's not Mac > >> specific... > > > > Well, in a way it is. > > > > If I'm not mistaken, most Optimus devices have their video outputs > directly > > connected to the Intel GPU so it's just a matter of disabling the NVidia > one. > > > > On at least some Macbook models, the video output are connected to a > third > > chip, and this chip must also be told to talk exclusively to the Intel > GPU at > > boot time first. > > > > -- > > Francois Tigeot > >
