On 2013-6-18 1:16, Al Stone wrote:
Sorry I did not send this out sooner -- I rewrote it a several different times over the last week to play with some ideas...
Nonetheless, here's the simple bit of ASL I'm using for GPIO right now:
Scope (_SB) {
// Base Address: 0x11400000 Device (GPA0) // GPIO controller GPA0 { Name (_HID, "LINA0002") Name (_UID, 0x00) Method (_CRS, 0x0, Serialized) { Name(RBUF, ResourceTemplate () { Memory32Fixed (ReadWrite, 0x11400000, 0x18) GpioIo (Exclusive, PullDefault, , // debounce timeout , // drive strength , // IO restriction "GPA0") { // pin numbers 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 } }) Return(RBUF) } }
}
This is still not quite working in the Samsung gpiolib code just yet. They never really used FDT before (or at least, not in a way I would consider proper) so I'm having to unwind some partial movement to FDT and their specific data structures.
GPIO interrupts are not going to be much different but I don't have a good example to send out just yet.
Hi Al,
Have you considered about GPIO-signaled ACPI Events in GPIO ASL?
Thanks Hanjun
You should be able to figure out the address from the current FDT. The pin numbers are much better hidden in mach-exynos/include/mach/gpio.h. Sometimes it's easier just to read them from /sys :).
I put this in an SSDT just for grins, but it can also go in the DSDT.