I thought about this some more. I went through the device tree and wanted to see if I could access the sound-related GPIOs directly through reads and writes to their physical addresses in Open Firmware. It looks like the answer is yes. See the attached screenshot -- this is reading the headphone detect GPIO directly, with the plug removed/inserted/removed. It looks like bit 1 represents the GPIO detected state, which correlates with the Linux aoa sound driver I linked earlier in the thread.
I'm thinking of writing my own sound component to handle the GPIOs at first, and the I2S DAC eventually.
A few questions for folks who know more about this stuff on classic Mac OS than I do:
* If I write a sound component, are all the physical addresses for the available hardware identity-mapped within the component? For instance, if I go read 0x80000067 like I did here, will it work? Or do I need to do something like ioremap() on Linux?
* How do I register an interrupt handler for the GPIO interrupt here? It's off of the mac-io (Keylargo), which is a PCI-connected device.
I'm thinking of writing my own sound component to handle the GPIOs at first, and the I2S DAC eventually.
A few questions for folks who know more about this stuff on classic Mac OS than I do:
* If I write a sound component, are all the physical addresses for the available hardware identity-mapped within the component? For instance, if I go read 0x80000067 like I did here, will it work? Or do I need to do something like ioremap() on Linux?
* How do I register an interrupt handler for the GPIO interrupt here? It's off of the mac-io (Keylargo), which is a PCI-connected device.