From: Juha Yrjola Date: Thu, 9 Feb 2006 08:33:47 +0000 (+0200) Subject: ARM: OMAP: Have the gpio-switch driver use SA_TRIGGER_ flags X-Git-Tag: v2.6.16-omap1~86 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=e21ff9273fd61caeac19e4d73c2e68d631dda932;p=linux-2.6-omap-h63xx.git ARM: OMAP: Have the gpio-switch driver use SA_TRIGGER_ flags --- diff --git a/arch/arm/plat-omap/gpio-switch.c b/arch/arm/plat-omap/gpio-switch.c index cbb1efb409e..b5d0543d5e1 100644 --- a/arch/arm/plat-omap/gpio-switch.c +++ b/arch/arm/plat-omap/gpio-switch.c @@ -142,7 +142,7 @@ static void gpio_sw_handler(void *data) static int __init new_switch(struct gpio_switch *sw) { - int r, direction; + int r, direction, trigger; sw->pdev.name = sw->name; sw->pdev.id = -1; @@ -166,11 +166,6 @@ static int __init new_switch(struct gpio_switch *sw) direction = !(sw->flags & OMAP_GPIO_SWITCH_FLAG_OUTPUT); omap_set_gpio_direction(sw->gpio, direction); - if (omap_get_gpio_datain(sw->gpio)) - set_irq_type(OMAP_GPIO_IRQ(sw->gpio), IRQT_FALLING); - else - set_irq_type(OMAP_GPIO_IRQ(sw->gpio), IRQT_RISING); - switch (sw->type) { case OMAP_GPIO_SWITCH_TYPE_COVER: device_create_file(&sw->pdev.dev, &dev_attr_cover_switch); @@ -185,8 +180,12 @@ static int __init new_switch(struct gpio_switch *sw) if (!direction) return 0; - r = request_irq(OMAP_GPIO_IRQ(sw->gpio), gpio_sw_irq_handler, SA_SHIRQ, - sw->name, sw); + if (omap_get_gpio_datain(sw->gpio)) + trigger = SA_TRIGGER_FALLING; + else + trigger = SA_TRIGGER_RISING; + r = request_irq(OMAP_GPIO_IRQ(sw->gpio), gpio_sw_irq_handler, + SA_SHIRQ | trigger, sw->name, sw); if (r < 0) { printk(KERN_ERR "gpio-switch: request_irq() failed " "for GPIO %d\n", sw->gpio);