From: Tony Lindgren Date: Wed, 30 Aug 2006 11:24:16 +0000 (+0300) Subject: Revert "ARM: OMAP: Add GPIO irq startup and shutdown functions" X-Git-Tag: v2.6.18-omap1~97 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=bb49bddb5e96d395645946c2c63dc6dfe856c5d9;p=linux-2.6-omap-h63xx.git Revert "ARM: OMAP: Add GPIO irq startup and shutdown functions" This reverts commit fb2952b6b89d72d89beaad9e51dc6d3bc12af29e. This will reset trigger type if it's passed from request_irq() as noted by Juha. --- diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index cbd7022a0eb..a555c9d8b2d 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c @@ -662,14 +662,6 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable) } } -void _reset_gpio(struct gpio_bank *bank, int gpio) -{ - _set_gpio_direction(bank, get_gpio_index(gpio), 1); - _set_gpio_irqenable(bank, gpio, 0); - _clear_gpio_irqstatus(bank, gpio); - _set_gpio_triggering(bank, get_gpio_index(gpio), IRQT_NOEDGE); -} - /* Use disable_irq_wake() and enable_irq_wake() functions from drivers */ static int gpio_wake_enable(unsigned int irq, unsigned int enable) { @@ -704,6 +696,9 @@ int omap_request_gpio(int gpio) } bank->reserved_map |= (1 << get_gpio_index(gpio)); + /* Set trigger to none. You need to enable the trigger after request_irq */ + _set_gpio_triggering(bank, get_gpio_index(gpio), IRQT_NOEDGE); + #ifdef CONFIG_ARCH_OMAP15XX if (bank->method == METHOD_GPIO_1510) { void __iomem *reg; @@ -761,7 +756,9 @@ void omap_free_gpio(int gpio) } #endif bank->reserved_map &= ~(1 << get_gpio_index(gpio)); - _reset_gpio(bank, gpio); + _set_gpio_direction(bank, get_gpio_index(gpio), 1); + _set_gpio_irqenable(bank, gpio, 0); + _clear_gpio_irqstatus(bank, gpio); spin_unlock(&bank->lock); } @@ -901,25 +898,6 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc, } -static unsigned int gpio_irq_startup(unsigned int irq) -{ - unsigned int gpio = irq - IH_GPIO_BASE; - struct gpio_bank *bank = get_gpio_bank(gpio); - - _reset_gpio(bank, gpio); - _set_gpio_irqenable(bank, gpio, 1); - - return 0; -} - -static void gpio_irq_shutdown(unsigned int irq) -{ - unsigned int gpio = irq - IH_GPIO_BASE; - struct gpio_bank *bank = get_gpio_bank(gpio); - - _reset_gpio(bank, gpio); -} - static void gpio_ack_irq(unsigned int irq) { unsigned int gpio = irq - IH_GPIO_BASE; @@ -968,8 +946,6 @@ static void mpuio_unmask_irq(unsigned int irq) static struct irq_chip gpio_irq_chip = { .name = "GPIO", - .startup = gpio_irq_startup, - .shutdown = gpio_irq_shutdown, .ack = gpio_ack_irq, .mask = gpio_mask_irq, .unmask = gpio_unmask_irq,