powerpc/qe: Implement QE Pin Multiplexing API
commit1b9e89046c31fd39d08742915b6bd72f6c239608
authorAnton Vorontsov <avorontsov@ru.mvista.com>
Wed, 3 Dec 2008 19:27:38 +0000 (3 22:27 +0300)
committerKumar Gala <galak@kernel.crashing.org>
Tue, 30 Dec 2008 17:13:43 +0000 (30 11:13 -0600)
tree0fbb35ccfd0c0645db7b304277d48aa95b2375b5
parent78c7705037ed9f107660178e17aa73f8bc4127e8
powerpc/qe: Implement QE Pin Multiplexing API

With this API we're able to set a QE pin to the GPIO mode or a dedicated
peripheral function.

The API relies on the fact that QE gpio controllers are registered. If
they aren't, the API won't work (gracefully though).

There is one caveat though: if anybody occupied the node->data before us,
or overwrote it, then bad things will happen. Luckily this is all in the
platform code that we fully control, so this should never happen.

I could implement more checks (for example we could create a list of
successfully registered QE controllers, and compare the node->data in the
qe_pin_request()), but this is unneeded if nobody is going to do silly
things behind our back.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/powerpc/include/asm/qe.h
arch/powerpc/sysdev/qe_lib/gpio.c