This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

trying to use Linux gpio_xxxx functions



Hi

I'm trying to use the gpio functions referenced here:

http://processors.wiki.ti.com/index.php/GPIO_Driver_Guide

under Linux on a DM8148.

However, the compiler can't seem to find <linux/gpio.h>.  Does this functionality exist on the DM8148?.

-steve

  • Are you building a kernel module, kernel code or a user application?

    Those functions are meant to be called from a kernel module. Building an "out-of-tree" kernel module automatically implies that a path to the current kernel include files. You shouldn't get a header not found error.

    Sometimes, user applications need system headers. For example, ioctl() calls need command numbers and structures. From what I've seen, most cross-compilers are built with a hard-coded path to particular version of the system headers. If system headers are deleted or moved, the compiler cannot find them. In some cases, it is not desirable to use the compiler's system headers, eg. you have a newer or different version of the kernel. In those cases in compiling a user application, you need to manually path the kernel headers with -I or with the newer cross compilers -isystem.

    If you are writing a user application, the sysfs interface is accessed from code by using the standard IO, ie, open, read, close, etc. You emulate in code what you would do at the command line shell.

  • Hi Stephen Turner,

    You can refer the same document for sysfs entries.

    Regards

    AnilKumar

    Please mark this Forum post as answered via the Verify Answer button below if it helps answer your question.  Thanks!

  • This is a user mode app, so it looks like I need to use the sysfs method.  I will pursue that.

    thanks

    steve