Hi John,

Try using channel 1. It may be set up where the first channel is 1 and not 0.

Not sure what you mean...

I'm actually not clear how many devices I should have:

$ grep "GPIO.*BASEADDR" arch/ppc/platforms/4xx/xparameters/xparameters_ml405.h
#define XPAR_GPIO_0_BASEADDR XPAR_LEDS_4BIT_BASEADDR
#define XPAR_GPIO_1_BASEADDR XPAR_LEDS_POSITIONS_BASEADDR
#define XPAR_GPIO_2_BASEADDR XPAR_PUSH_BUTTONS_POSITION_BASEADDR

But depending on the examples I look at, they define either:

crw-rw-rw-    1 root     root      10, 185 May 26 13:49 xgpio
or:
crw-rw-rw-    1 root     root      10, 185 May 26 13:18 xgpio0
crw-rw-rw-    1 root     root      10, 186 May 26 13:18 xgpio1
crw-rw-rw-    1 root     root      10, 187 May 26 13:18 xgpio2

If that is the former, I see the code uses:
gpio_ioctl.chan=0;
And I guess that's what you are refering to, right ?

Putting 1 gives me a working program, but no LED lights up and the buttons are always shown at 0.
Putting 0 gives a nice core dump as in my previous msg.
Putting 2 locks up the system.

And... I don't see how the code manages to read/wite all 3 GPIOs with only two IOCTL calls. Shouldn't they be 3 different calls using different addresses ?!? Argh, this complete lack of documentation in maddening. Not everything can be understood from reading the source.

Thanks.
--
Guillaume Dargaud
http://www.gdargaud.net/


_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to