[Soekris] pc87360 linux driver question (GPIO, pc8736x_gpio)
Jim Cromie
jim.cromie at gmail.com
Thu Jun 14 04:47:31 UTC 2007
Joe O'Donnell wrote:
> Dear Jim Cromie,
> Thank you for creating the Linux pc8736 driver. I am attempting to use
> the driver to allow reading of the gpio pins on my Soekris 4081 board.
> May I ask for some more information on how to get the driver working?
>
> I googled for and found 1 page with advice on how to use the driver:
>
> http://lists.soekris.com/pipermail/soekris-tech/2006-November/011203.html
Curious link you found -
I dont need any of those workarounds either,
and I had difficulty relating it to your problems.
you might try gmane.org, theyve mirrored the soekris-tech ML, and its
searchable !
http://search.gmane.org/?query=gpio&author=&group=gmane.comp.hardware.soekris.technical&sort=relevance&DEFAULTOP=and&%3E=Next&TOPDOC=20&xP=gpio&xFILTERS=Gcomp.hardware.soekris.technical---A
that said, I couldnt find some posts that I was sure I sent (once upon a
time!)
>
> I tried the instructions from the above, but the modprobe.d referenced
> shell scipt produced errors.
referenced shell script ??
> The device creation script did create the devices. I tried insmod
> pc87360x_gpio.ko which apparently did load the driver. However cat
> /dev/gpio-0 prodcued "cat: /dev/gpio-0: No such device" The pyramid
> linux distribution I am using uses the udev system. In your response
> to the above post you mentioned:
>
> ***********
> >/ install pc8736x_gpio /sbin/modprobe --ignore-install pc8736x_gpio &&
> />/ /usr/local/sbin/gpio-dev create
> />/
> />/
>
> /
> I don't have to do that workaround, but I wasnt using udev then either.
> You could just make the nodes unconditionally, say in rc.local.
> This simplifies a tiny bit, and if the module isnt there, the user App
> still gets an error that is readily identifiable:
>
> soekris:/dev# cat gpio-00
> cat: gpio-00: No such device or address
>
You seem to be missing the device-special files,
your comment to the contrary notwithstnding.
Can you double-check that these (or similar) are present ?
soekris:~# ls -l /dev/gpio-*
crw-r--r-- 1 root root 240, 12 Jun 13 21:52 /dev/gpio-12
crw-r--r-- 1 root root 240, 13 Jun 13 21:52 /dev/gpio-13
crw-r--r-- 1 root root 240, 20 Jun 13 21:52 /dev/gpio-20
crw-r--r-- 1 root root 240, 21 Jun 13 21:52 /dev/gpio-21
crw-r--r-- 1 root root 240, 22 Jun 13 21:52 /dev/gpio-22
crw-r--r-- 1 root root 240, 23 Jun 13 21:52 /dev/gpio-23
crw-r--r-- 1 root root 240, 24 Jun 13 21:52 /dev/gpio-24
crw-r--r-- 1 root root 240, 25 Jun 13 21:52 /dev/gpio-25
crw-r--r-- 1 root root 240, 26 Jun 13 21:52 /dev/gpio-26
crw-r--r-- 1 root root 240, 27 Jun 13 21:52 /dev/gpio-27
crw-r--r-- 1 root root 240, 4 Jun 13 21:52 /dev/gpio-4
crw-r--r-- 1 root root 240, 5 Jun 13 21:52 /dev/gpio-5
you make them like so :
mknod /dev/gpio-20 c $major 20;
mknod /dev/gpio-21 c $major 21;
mknod /dev/gpio-22 c $major 22;
your $major must match with what the driver is expecting,
whether default, or as given in
more /etc/modprobe.d/gpio
# assign last 2 dynamic devnums to gpio (255..240)
options scx200_gpio major=240
options pc8736x_gpio major=241
> However lsmod does list the module as being there, but the above
> mentioned error is still happening. May I ask your advice on which
> Linux areas I should research more about in order to figure out how to
> solve the problem?
if the info above doesnt help, post to list, with:
- ls -l /dev/gpio*
- lsmod
generally, you should :
- subscribe to soekris-tech ML.
- continue this thread there - so that others, archives can pick it up.
- consider building your own kernel, enabling these drivers:
scx200_gpio 4892 0
pc8736x_gpio 5852 0
pc87360 19572 0
ohci_hcd 17180 0
hwmon_vid 2704 1 pc87360
scx200_hrt 2520 0 [permanent]
ledtrig_heartbeat 2832 0
usbcore 117712 3 ndiswrapper,ohci_hcd
led_class 5116 0
scx200 4704 2 scx200_gpio,scx200_hrt
nsc_gpio 3216 2 scx200_gpio,pc8736x_gpio
Once youve built your own, you can add "#define DEBUG 1"
to the top of *_gpio, to turn on debug-prints.
to see those debug-prints on console :
soekris:~# sysctl -w kernel.printk=8
>
> Thank you,
> Joe O'Donnnell
>
hth
-jimc
More information about the Soekris-tech
mailing list