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 not working.

One of the GPIO pins on my dm355 board is connected to a reset pin on my CMOS sensor. I tried the following two commands to deassert a reset signal. I tried those commands in arch/arm-mach-davinci/board-dm355-evm.c. The output stayed low. I also tried them in the mt9t031.c and had the same result.

    gpio_request(80, "MT9T_RESET");
    gpio_direction_output(80, 1); // reset high (deasserted)

What is the proper way to control the GPIOs?

  • Any ideas or comments? Thanks.

     

  • Got it working. Just like several posts on this forum mentioned, the PINMUX configuration was not set properly.

    Here is the code.

       void __iomem *pinmux;

        pinmux = (void __iomem *) IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE + 0x4);
            __raw_writel( __raw_readl(pinmux) & 0xFFFFFFFC, pinmux);

    To set the correct pin as GPIO make sure to change the offset (0x4 for MINMUX1; in the second line) to refer to correct value and change the mask (0xFFFFFFFC for GIO81; in the third line) to clear the proper bits.

    For some reason gpio_request and gpio_direction_output do not change PINMUX registers. What is the point in having gpio_request functions if you can still have to do manual PINMUX configuration?