Building a software serial driver

Torrie Fischer tdfischer at hackerbots.net
Mon Jun 23 14:15:01 EDT 2014


Greetings fellow newbies.

I'm toying around with a Raspberry PI and trying to create a driver that takes 
a single GPIO pin and turns it into a read-only TTY device because using the 
userspace GPIO sysfs API is too slow for me.

Here's my current code:

https://github.com/tdfischer/gpio_serial

It is based off of the tiny_serial example driver in the LDD3 repo:

https://github.com/martinezjavier/ldd3/blob/master/tty/tiny_serial.c

It builds and loads just fine, and even creates a /dev/ttyGPIO0 device. 
However, reading from it returns -EIO. Running strace on cat shows that it 
opens up the device successfully, but fails on the first call to read().

Any idea what I'm missing here? I'm fairly certain it is something obvious.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140623/f42481d0/attachment.bin 


More information about the Kernelnewbies mailing list