Using GPIO... and including kernel headers

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Hello all,
this is a question about GPIO, but I believe it is also more general.

I'm using an embedded Xilinx card (PPC processor), which I cross compile for
from a Linux PC.

I would like to make use of the GPIO lines in a usermode program (or is that
wrong and I need to use a kernel module ?!?)

$ grep GPIO .config
CONFIG_XILINX_GPIO=y

$ cat include/linux/gpio.h
#ifdef CONFIG_GENERIC_GPIO
#include <asm/gpio.h>
#else
... empty statements ...
#endif

So I guess it means I must use what's in:
$ ls drivers/char/xilinx_gpio/
adapter.c  adapter.o  built-in.o  Makefile  modules.order  xgpio.c  xgpio.h
xgpio_ioctl.h  xgpio_l.h  xgpio.o  xilinx_gpio.o

Now I'm no kernel expert and I'm not sure what's the correct way to include
and link against this xgpio.h/o ? Do I need to explicitely give gcc
the -Ifullpath or is there some compilation trick I don't know about ?
--
Guillaume Dargaud
http://www.gdargaud.net /



Site Timeline