2009-03-24 05:40:55     simple GPIO Driver in uCLinux2008R1

Document created by Aaronwu Employee on Aug 14, 2013
Version 1Show Document
  • View in full screen mode

2009-03-24 05:40:55     simple GPIO Driver in uCLinux2008R1

Patrick Hotz (GERMANY)

Message: 71436   

 

Hi guys,

 

 

 

i want to backport the Simple gpio driver from uClinux-dist2008R1.5 into uClinux-dist2008R1.

 

I have moved "simple-gpio.c" in drivers/char, added it into Kconfig and Makefile and added the struct into my board-config-file...

It semms to be OK, in bootup the driver shows "simple-gpio: now handling 48 GPIOs: 0 - 47"

 

The problem is that i can´t see any gpios in /dev....

 

Is there any special trick to get it running?

 

 

 

Best regards,

Patrick

TranslateQuoteReplyEditDelete

 

 

2009-03-24 05:57:35     Re: simple GPIO Driver in uCLinux2008R1

Mike Frysinger (UNITED STATES)

Message: 71439   

 

try this:

http://docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:dev-management#troubleshooting

 

otherwise some people have talked about backporting it in the forums before ...

QuoteReplyEditDelete

 

 

2009-03-24 16:26:26     Re: simple GPIO Driver in uCLinux2008R1

Patrick Hotz (GERMANY)

Message: 71466   

 

Hi,

 

i have tried the suggestions on the troubleshooting-page but the /dev folder is always the same... no gpio device.

 

The board config file is correct and the simple-gpio.c file is compiled,

on bootup the simple gpio message shows gpio 0 - 47,

in /proc/devices the entry gpio is ok.

 

any ideas what´s the problem?

TranslateQuoteReplyEditDelete

 

 

2009-03-24 18:06:55     Re: simple GPIO Driver in uCLinux2008R1

Mike Frysinger (UNITED STATES)

Message: 71469   

 

try running mdev manually and make sure /dev is writable

QuoteReplyEditDelete

 

 

2009-03-25 03:30:21     Re: simple GPIO Driver in uCLinux2008R1

Patrick Hotz (GERMANY)

Message: 71486   

 

Hi,

 

mdev does not work.... no gpio devices in /dev...

 

This is what i have done:

moved "simple-gpio.c" in "drivers/char",

added to Kconfig:

           config SIMPLE_GPIO

           tristate "Simple GPIO char interface"

           depends on GENERIC_GPIO

           default n

           help

            If you say Y here, you will get support for a character device

           interface to the GPIO pins which will allow you to read and

            write GPIO values from userspace.

 

            To compile this driver as a module, choose M here: the module

            will be called simple-gpio.

 

            If unsure, it is safe to say Y.

 

added to Makefile:

          obj-$(CONFIG_SIMPLE_GPIO)  += sinple-gpio.o

 

added to board config-file:

static struct resource bfin_gpios_resources = {

       start = 0,

       end = MAX_BLACKFIN_GPIOS - 1,

       flags = IORESOURCE_IRQ,

};

 

static struct platform_device bfin_gpios_device = {

     name = "simple-gpio",

     id = -1,

     num_resources = 1,

     resource = &bfin_gpios_resources,

}

 

and in "static struct platform_device *cm_bf537_devices[] __initdata = {

    &bfin_gpios_device,

 

 

 

I think this is all what i have to do....

In bootup there is "simple-gpio: now handling 48 GPIOs: 0 - 47"

 

I do not know what is wrong....

 

 

 

Patrick

Attachments

    Outcomes