Skip to contentSkip to conversation

user space program for omap gpio

DISCUSSION mohammed shareef 3 participants 6 messages Jun 2, 2008 – Jun 3, 2008

lore
Share & tools
lore
#0 lore raw

Hi,

i want to access the omap5912 GPIO pins from user space... like reading the pin or writing to it from a user space program. is it possible?

thanx and regards,
Shareef

#1 lore raw
Quoted 5 lines · mohammed shareef

Hi,

i want to access the omap5912 GPIO pins from user space... like reading the pin or writing to it from a user space program. is it possible?

Maybe you can use gpio-switch for reading. But for writing, then you would have to write your own module with, maybe, ioctl for writing to gpios.

I don't know of any already implemented way for completely handling gpios via userland.

Signature · 5 lines
Best Regards,

Felipe Balbi
[email protected]
http://blog.felipebalbi.com
#2 lore raw

Hi Felipe,

could you give me some useful pointers on how to use the gpio-switch and ioctl to read and write gpio?

thanx and regards,
Shareef

Quoted 21 lines · Felipe Balbi
Quoted 5 lines · mohammed shareef

Hi,

i want to access the omap5912 GPIO pins from user space... like reading the pin or writing to it from a user space program. is it possible?

Maybe you can use gpio-switch for reading. But for writing, then you would have to write your own module with, maybe, ioctl for writing to gpios.

I don't know of any already implemented way for completely handling gpios via userland.

--
Best Regards,

Felipe Balbi
[email protected]
http://blog.felipebalbi.com

#3 lore raw
Quoted 4 lines · mohammed shareef

Hi Felipe,

could you give me some useful pointers on how to use the gpio-switch and ioctl to read and write gpio?

gpio-switch you can check in arch/arm/mach-omap2/board-n800.c

about using ioctls for controlling the gpio, you'll have to write a module from scratch. afaict, there's no way of controlling gpio from userland. Besides gpiofs that a friend was writing and never finished :-p

I'll try to reach him and ask him to send as RFC cuz it was a good work anyway :-)

Signature · 5 lines
Best Regards,

Felipe Balbi
http://felipebalbi.com
[email protected]
#4 lore raw

Hi Felipe,

Actually, David Brownell is working on something very similar. sysfs for gpio lib.

http://kerneltrap.org/mailarchive/linux-kernel/2008/4/28/1640134

That'd be really useful indeed.

But I believe it is not merged yet.

My 2 cents.

Cheers,

Quoted 31 lines · Felipe Balbi
Quoted 4 lines · mohammed shareef

Hi Felipe,

could you give me some useful pointers on how to use the gpio-switch and ioctl to read and write gpio?

gpio-switch you can check in arch/arm/mach-omap2/board-n800.c

about using ioctls for controlling the gpio, you'll have to write a module from scratch. afaict, there's no way of controlling gpio from userland. Besides gpiofs that a friend was writing and never finished :-p

I'll try to reach him and ask him to send as RFC cuz it was a good work anyway :-)

--
Best Regards,

Felipe Balbi
http://felipebalbi.com
[email protected]

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 1 line
Eduardo Bezerra Valentin