On Mon, Jun 17, 2013 at 11:16:12AM -0600, 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 }
I don't think this is correct, you are effecticely reserving the GPIO pins inside their own definition so nothing else can ever use them. I think these resources should only be the Memory32Fixed section. The driver then creates the GPIOs. There is then a function in acpi to map ACPI gpio -> linux gpio when other drivers need to make use of them.
Thanks
Graeme
}) 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.
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.
-- ciao, al
Al Stone Software Engineer Linaro Enterprise Group al.stone@linaro.org
Linaro-acpi mailing list Linaro-acpi@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-acpi