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.

GPIO driver for DM365 Leopard board to write on GPIO 47

#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/kthread.h>
#include <linux/fs.h>
#include <linux/timer.h>
#include <asm/io.h>
#include <asm-arm/arch-davinci/mux.h>
#include <asm/arch/gpio.h>

#define DAVINCI_SYSTEM_MODULE_BASE        0x01c40000
#define DAVINCI_GPIO_BASE                                  0x01C67000

u32 gpio = 47;

static int __init GIO47_init(void)

  {
        davinci_cfg_reg(DM365_GPIO47, PINMUX_FREE);
        davinci_cfg_reg(DM365_GPIO47, PINMUX_RESV);

        /* Configure GPIO20 as an output */
        gpio_direction_output(47, 0);
        gpio_set_value(47, 1);

  //  printk(KERN_INFO "GIO%d: %d\n", gpio, __gpio_get(gpio) );
    printk(KERN_INFO "GIO47 Module Loaded\n");

    return 0;
}

 

static void __exit GIO47_exit(void)
{
    printk(KERN_INFO "GIO%d: %d\n", gpio, gpio_get_value(gpio) );
    printk(KERN_INFO "GIO47 Module exit\n");
}

/* init and exit functions */
module_init(GIO47_init);
module_exit(GIO47_exit);

MODULE_LICENSE("GPL");

 

But Its not working at all.

Could any body suggest me how to make it work?

AS I am struggling a lot.

Thanks in advance.

  • Given that you are not using a TI hardware development board or the software associated with such, you would be better served to ask your question over on the Leopard Imaging support forum.  They should be better equipped to handle your questions.  Thanks.