[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cpu on post feb. 2005 Powerbook: patch does not work



> > No, the 2 things above are GPIOs (general purpose IO pins), that
> > apparently are used as interrupts. 
> 
> Can you point me to any documentation on these GPIOs? I must admit that
> I've never heard of the term.

There isn't really any documentation. GPIO is a generic term for general
purpose IO pins that can be used for all sort of things, like
controlling a reset line, getting an interrupt from some device, etc...
All the stuffs under the "mac-io/gpio" node in the device-tree is GPIO
lines going out of Apple ASIC.

There is code using them in things like the cpufreq driver or the sound
driver. The via-pmu driver also gets the incoming message interrupt from
a GPIO (which isn't always in the device-tree btw, I had to hard code
some of them...)

Also note that Apple doesn't always put very consistent infos about the
various GPIOs in the device-tree. For example, depending on the model
the GPIO "reg" property (unit address) contains either an offset from
the KeyLargo ASIC MMIO base address, or from the GPIO block of it which
is at 0x50... so you sometimes have to add 0x50 to the value you get
from there... (see today's patch I posted about cpufreq and sleep
problem).

In our case, though, those GPIOs seem to be interrupts, so you probably
just have to get their irq line and request it, though if those are
level interrupts (I haven't checked), then you probably need a mecanism
for "ack'ing" them or you'll deadlock the first time you get one (but I
suspect they are edge).

> > I suspect the accelerometer can be
> > configure to send an interrupt when a certain threshold is attained, and
> > those interrupts are sent via those 2 GPIO pins.
> 
> That would make sense since it is supposed to be used to save the hd.
> 
> johannes
-- 
Benjamin Herrenschmidt <benh@kernel.crashing.org>



Reply to: