@@ -24,6 +24,8 @@
#include <linux/regulator/machine.h>
#include <linux/io.h>
#include <linux/gpio.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>
@@ -140,6 +142,11 @@ static struct twl4030_keypad_data sdp3430_kp_data = {
static int ts_gpio; /* Needed for ads7846_get_pendown_state */
+static irqreturn_t dummy_interrupt_handler (int irq, void *dev_id)
+{
+ return IRQ_HANDLED;
+}
+
/**
* @brief ads7846_dev_init : Requests & sets GPIO line for pen-irq
*
@@ -147,6 +154,8 @@ static int ts_gpio; /* Needed for ads7846_get_pendown_state */
*/
static void ads7846_dev_init(void)
{
+ int ret;
+
if (gpio_request(ts_gpio, "ADS7846 pendown") < 0) {
printk(KERN_ERR "can't get ads746 pen down GPIO\n");
return;
@@ -156,6 +165,12 @@ static void ads7846_dev_init(void)
omap_set_gpio_debounce(ts_gpio, 1);
omap_set_gpio_debounce_time(ts_gpio, 0xa);
+
+ ret = request_irq(gpio_to_irq(ts_gpio),
+ (irq_handler_t)dummy_interrupt_handler,
+ IRQF_TRIGGER_FALLING,
+ "ads7846-dummy", NULL);
+ enable_irq_wake(gpio_to_irq(ts_gpio));
}
static int ads7846_get_pendown_state(void)
@@ -574,8 +574,15 @@ static int __init omap3_evm_i2c_init(void)
return 0;
}
+static irqreturn_t dummy_interrupt_handler (int irq, void *dev_id)
+{
+ return IRQ_HANDLED;
+}
+
static void ads7846_dev_init(void)
{
+ int ret;
+
if (gpio_request(OMAP3_EVM_TS_GPIO, "ADS7846 pendown") < 0)
printk(KERN_ERR "can't get ads7846 pen down GPIO\n");
@@ -583,6 +590,12 @@ static void ads7846_dev_init(void)
omap_set_gpio_debounce(OMAP3_EVM_TS_GPIO, 1);
omap_set_gpio_debounce_time(OMAP3_EVM_TS_GPIO, 0xa);
+
+ ret = request_irq(gpio_to_irq(OMAP3_EVM_TS_GPIO),
+ (irq_handler_t)dummy_interrupt_handler,
+ IRQF_TRIGGER_FALLING,
+ "ads7846-dummy", NULL);
+ enable_irq_wake(gpio_to_irq(OMAP3_EVM_TS_GPIO));
}
static int ads7846_get_pendown_state(void)