linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Issues with GPIO and wake from sleep
@ 2014-01-17 12:24 Marc Murphy
  2014-01-17 17:39 ` Tony Lindgren
  0 siblings, 1 reply; 6+ messages in thread
From: Marc Murphy @ 2014-01-17 12:24 UTC (permalink / raw)
  To: linux-omap@vger.kernel.org

I have resisted contacting the list with regards to an issue I am having trying to get what should be a simple part of my system working but I cannot find any documentation or other posts to help.
 
I am using 3.6 kernel but have tried 3.12 to see if the issue has been addressed in that but its exactly the same.
 
I am attempting to get a GPIO to wake my AM3517 system up from a suspend to memory.  I have tried with a few different options for GPIO’s
I have available GPIO-10, GPIO-28 and GPIO-30.
 
I started by using GPIO-28 and that would configure nicely and I set up the interrupt handler and could see my debug when triggering the input (brilliant) but for some reason I cannot use it  to wake the system as it is not in the correct group for wakeup.  There is a note in the Tech Ref Man -

Only gpio_1, gpio_9, gpio_10, gpio_11, gpio_30, and gpio_31 can be used to generate a direct wake-up event.

So have to use a different one. GPIO-30 cannot be used as that holds the system in reset, so all that is left is GPIO-10.
All seems to be good for initialisation;
 
In the omap_board_mux I define
 
    OMAP3_MUX(SYS_CLKOUT1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
              OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW |
              OMAP_PIN_OFF_WAKEUPENABLE),
 
Then the init function and interrupt handler;
 
/****************************************************************************
*
* Board wakeup interrupt
*
****************************************************************************/
#define IGNITION_GPIO 10
 
static irqreturn_t detect_irq(int irq, void *_data)
{
    printk("%s: irq\n", __func__);
 
    return IRQ_HANDLED;
}
 
static void enable_board_wakeup_source(void)
{
    int irq;
    int ret;
    /* GPIO_10 interrupt line */
 
    gpio_request(IGNITION_GPIO, "gpio_10");
    gpio_direction_input(IGNITION_GPIO);
    omap_mux_init_gpio(IGNITION_GPIO, OMAP_PIN_INPUT_PULLUP |
                       OMAP_PIN_OFF_WAKEUPENABLE);
 
       irq = gpio_to_irq(IGNITION_GPIO);
    if (request_irq(irq, detect_irq, IRQF_TRIGGER_RISING, "ignition",
                    NULL)) {
            pr_err("********* %s: request_irq() failed\n", __func__);
            return;
    }
 
    if (enable_irq_wake(irq)) {
            pr_err("********* %s: irq_set_irq_wake() failed\n", __func__);
            return;
    }
 
    pr_err("************** %s: set irq %u\n", __func__, irq);
}
 
But when I try and trigger the input there is no IRQ handled and I also cannot export the gpio in sys/class/
 
If I have a look at the mux it seems to be OK
# cd /debug/omap_mux/
# cat sys_clkout1
name: sys_clkout1.gpio_10 (0x48002a1a/0x9ea = 0x411c), b ag25, t NA
mode: OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE | OMAP_MUX_MODE4
signals: sys_clkout1 | NA | NA | NA | gpio_10 | NA | NA | safe_mode
 
There is definitely a problem as when I look at the state it says its high, when the input is definitely 0V
# cat /debug/gpio
GPIOs 0-31, gpio:
gpio-0   (mpu6050-irq         ) in  lo
gpio-10  (gpio_10             ) in  hi
gpio-25  (USB1 PHY reset      ) out hi
 
I think there is something else taking over the pin, maybe the clock setup for sys_clkout1.
 
Is there any way to make it just work for my config or make GPIO-28 work to wake the system ?
 
Hope you have seen this before.
 
Kind Regards
Marc--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-02-13 22:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-17 12:24 Issues with GPIO and wake from sleep Marc Murphy
2014-01-17 17:39 ` Tony Lindgren
2014-01-23  9:45   ` Marc Murphy
2014-02-04 22:47     ` Marc Murphy
2014-02-05 23:17       ` Marc Murphy
2014-02-13 22:40         ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).