Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: GPIO driver for AT91SAM9G45-EKES
PostPosted: Mon Feb 07, 2011 6:54 am 
Offline

Joined: Thu Dec 30, 2010 6:49 pm
Posts: 38
Hi,

Where can i get GPIO driver for AT91SAM9G45-EKES kit? is it part of the Kernel source?
When i checks out Kernel source, they have Sysfs implementation but i need a char driver (normal way). Can anyone please help me on this?

Thanks
Prashanth


Top
 Profile  
 
 Post subject: Re: GPIO driver for AT91SAM9G45-EKES
PostPosted: Mon Feb 07, 2011 10:16 am 
Offline
User avatar

Joined: Wed May 12, 2004 6:59 pm
Posts: 161
Location: Bergamo, Italia
[quote="pkumarn"]Hi,

Where can i get GPIO driver for AT91SAM9G45-EKES kit? is it part of the Kernel source?
When i checks out Kernel source, they have Sysfs implementation but i need a char driver (normal way). Can anyone please help me on this?
[/quote]

Sysfs implementation of GPIO is an excellent way, however you could be interested to discover how to manage GPIO access from user space.
In this case I suggest you to read the devmem2 source code, maybe using it as skeleton for your custom GPIO management.
ftp://ftp.koansoftware.com/public/linux ... /devmem2.c

HTH

_________________
Marco Cavallini
Koan s.a.s. - Bergamo - ITALIA
Embedded and Real-Time Software Engineering
- Atmel Third Party Consultant
Tel. +39-(0)35-255.235 - Fax +39-178-223.9748
http://www.KoanSoftware.com | http://www.KaeilOS.com


Top
 Profile  
 
 Post subject: Re: GPIO driver for AT91SAM9G45-EKES
PostPosted: Mon Feb 07, 2011 10:27 am 
Offline

Joined: Thu Dec 30, 2010 6:49 pm
Posts: 38
Thanks for the reply. I am not much aware of Sysfs and i feel if you want to manager more GPIO's then it would be cumbersome (correct me if i am wrong). As i am comfortable in legacy way so was seeing if we have handy GPIO driver. When i talked to Atmel folks, they did provide me a GPIO driver but somehow it is not working. i am attaching the GPIO driver code and the application i have written to access the same. Can you please review and let me know what is wrong?

Thanks
Prashanth


Attachments:
SAM9G45.zip [4.83 KiB]
Downloaded 68 times
Top
 Profile  
 
 Post subject: Re: GPIO driver for AT91SAM9G45-EKES
PostPosted: Mon Feb 07, 2011 10:33 am 
Offline
User avatar

Joined: Wed May 12, 2004 6:59 pm
Posts: 161
Location: Bergamo, Italia
[quote="pkumarn"]Thanks for the reply. I am not much aware of Sysfs and i feel if you want to manager more GPIO's then it would be cumbersome (correct me if i am wrong). As i am comfortable in legacy way so was seeing if we have handy GPIO driver. When i talked to Atmel folks, they did provide me a GPIO driver but somehow it is not working. i am attaching the GPIO driver code and the application i have written to access the same. Can you please review and let me know what is wrong?
[/quote]

What is not working?
Did you build sources?
Did you insmod the driver?
Did you launch the gpioutil 'tester'?
Please post your output and more info.

_________________
Marco Cavallini
Koan s.a.s. - Bergamo - ITALIA
Embedded and Real-Time Software Engineering
- Atmel Third Party Consultant
Tel. +39-(0)35-255.235 - Fax +39-178-223.9748
http://www.KoanSoftware.com | http://www.KaeilOS.com


Top
 Profile  
 
 Post subject: Re: GPIO driver for AT91SAM9G45-EKES
PostPosted: Mon Feb 07, 2011 12:59 pm 
Offline

Joined: Thu Dec 30, 2010 6:49 pm
Posts: 38
Here is what I did…
Compiled the module separately and flashed into the board
Then did insmod cdrv.ko – This operation was successful and was able to see the device “key” in /proc/devices
Then created new device at /dev using mknod /dev/key c 252 0 – Even this was successful
Then I ran “gpioutil” and this was able to open the device file successfully.
Once I do a “ioctl” call to Turn OFF or Turn ON a LED, I don’t see anything happening on the screen.
To make sure low level calls provide by Atmel are working, I put the following call in module initialization
at91_led_on() , even this failed.
I also put printk() in “ioctl” as the first statement, even this failed…
I am not sure what is wrong now ….

-Prashanth


Top
 Profile  
 
 Post subject: Re: GPIO driver for AT91SAM9G45-EKES
PostPosted: Fri Feb 25, 2011 5:05 pm 
Offline

Joined: Wed Dec 15, 2010 10:40 am
Posts: 9
Hi, for inputs, we have done something which consists on monitoring GPIO event on a specific file "/dev/gpio-event" on G45-EKES. A module is launch with IO to monitor and when a IO is modified we have an information .

Take a look here : http://wiki.gumstix.org/index.php?title=GPIO

For ouput, you only need to write to /sys/class/gpio/xxx, which is really easy.


If you have trouble , tell me, I'll try to help you more .
Regards
Seb


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: