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.

OMAP37xx McSPI2 Issue

Other Parts Discussed in Thread: TSC2046, ADS7846

We build a LVDS exp board for OMAP37xx EVM. In this, touchscreen is connected thru the SPI2. I did the following to enable the SPI2

1. In omap_board_mux omap36x_board_mux[] __initdata:

/* McSPI 2 */
        OMAP3_MUX(MCSPI2_CLK,  OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
        OMAP3_MUX(MCSPI2_SIMO, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
        OMAP3_MUX(MCSPI2_SOMI, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
        OMAP3_MUX(MCSPI2_CS1,  OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
                                OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW |
                                OMAP_PIN_OFF_WAKEUPENABLE),

2. GPIO 182 is used as the Pen Down Interrupt (#define OMAP3_EVM_TS_GPIO 182)

The issue is, still SPI2 is not working.

1. Is there any other mux is needed?

2. I read that, GPMC_NBE1/HSUSB is muxed with GPIO 182. So to access the 182, do I need to sacrifices the USB OTG Port? or any other work-around?

3. How to make the GPIO 182 is available for the Pen Down interrupt?

  • Some pointers -

    1) What is your MCSPI2_CS0 mux configuration?

    2) Can you make sure from kernel prompt that the MCSPI2_CS1/GPIO182 is configured into GPIO mode? You can use devmem tool here to dump the register form Linux prompt.

    3) Have you probed the SPI pins and verified that it is toggling?

    Thanks,

    Vaibhav

  • Thanks Vaibhav. I have not touched the MCSPI2_CS0 mux setting. When I probed, there is no activity on the SPI. But I  am able to see activity on Touchscreen pins. I thought, it may be due to the GPMC_NBE1. I will dump and share the register values.

    My major worry is, to use the SPI2, do I need to give-up EHCI USB Port??

  • I dropped the SPI2 and moved to SPI3. It is working partially. Whenever I touch the LCD, I getting continious output in getevent command.

    1. The interrupt line status is always at 0(low). Rarely comes back to 1(high).

    2. When I touch, interrupt goes to high and goes back to low with-in a very short duration.

    3. No increment of interrupt count in /proc/interrupts

    4. We are using extr tsc2046 controller and drivers, which comes with kernel.

    5. Touchscreen is 10.1"

    I feel, the GPIO interrupt not getting cleared and driver is continiously reading SPI3. Any other tips?

  • With SPI3.0 + IRQ GPIO 134:

    ads7846 spi3.0: touchscreen, irq 294
    input: ADS7846 Touchscreen as /devices/platform/omap2_mcspi.3/spi3.0/input/input1

    In GetEvent: When I touch the screen, I am getting the the following sequence of events continously, till I remove the finger from the screen:

    add device 1: /dev/input/event1
      name:     "ADS7846 Touchscreen"
    add device 2: /dev/input/event0
      name:     "TWL4030 Keypad"

    /dev/input/event1: 0003 0000 0000051f
    /dev/input/event1: 0003 0001 00000b47
    /dev/input/event1: 0003 0018 00000090
    /dev/input/event1: 0000 0000 00000000
    /dev/input/event1: 0001 014a 00000000
    /dev/input/event1: 0003 0018 00000000
    /dev/input/event1: 0000 0000 00000000
    ...

    Interrupts are also getting incremented from every pen down and up event. I hope it is working

  • The touchscreen is working for a while, then it is stopped and interrupt count increment is also stopped. In this state, I am able to see the event in GetEvent output. Later I found that, PEN UP status is not getting detected. After gone thru the code, we understood that, PEN UP is not detected using the GPIO Interrupt. It is thru Timer interrupt. Is it right?

    Our board uses, TSC2046. Any suggestions?

  • After increasing the TS_POLL_PERIOD from 5 to 10, seems to be little stable. Most of the time, GPIO(134)  PENIRQ for PEN UP is not generated and PENIRQ is configured for both FALL and RISING edge of the interrupt.