]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: OMAP: omap edge trigger call updates
authorDavid Brownell <dbrownell@users.sourceforge.net>
Wed, 25 May 2005 20:15:43 +0000 (13:15 -0700)
committerTony Lindgren <tony@atomide.com>
Wed, 25 May 2005 20:15:43 +0000 (13:15 -0700)
This switches over to using the standard ARM-Linux set_irq_type() call
instead of its OMAP-specific variant, and removes the OMAP variant.
It also tweaks the SMC driver to include a change requested by the
maintainer of that driver.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
17 files changed:
arch/arm/mach-omap/gpio-switch.c
arch/arm/mach-omap/gpio.c
arch/arm/mach-omap/omap1/board-h2.c
arch/arm/mach-omap/omap1/board-h3.c
arch/arm/mach-omap/omap1/board-innovator.c
arch/arm/mach-omap/omap1/board-netstar.c
arch/arm/mach-omap/omap1/board-osk.c
arch/arm/mach-omap/omap1/board-voiceblue.c
arch/arm/mach-omap/omap1/fpga.c
drivers/i2c/chips/isp1301_omap.c
drivers/i2c/chips/tps65010.c
drivers/input/touchscreen/omap/ts_hx.c
drivers/input/touchscreen/omap/ts_osk.c
drivers/mmc/omap.c
drivers/net/smc91x.c
drivers/net/smc91x.h
include/asm-arm/arch-omap/gpio.h

index ca47111d55e05b27359d42aee503709e510b88ea..1577699f9226687ce8c507b173bba39f4011dcac 100644 (file)
@@ -132,9 +132,9 @@ static void gpio_sw_handler(void *data)
                               &dev_attr_cover_switch.attr);
        sw->state = state;
        if (omap_get_gpio_datain(sw->gpio))
-               omap_set_gpio_edge_ctrl(sw->gpio, OMAP_GPIO_FALLING_EDGE);
+               set_irq_type(OMAP_GPIO_IRQ(sw->gpio), IRQT_FALLING);
        else
-               omap_set_gpio_edge_ctrl(sw->gpio, OMAP_GPIO_RISING_EDGE);
+               set_irq_type(OMAP_GPIO_IRQ(sw->gpio), IRQT_RISING);
        print_sw_state(sw, state);
 }
 
@@ -165,9 +165,9 @@ static int __init new_switch(struct gpio_switch *sw)
        omap_set_gpio_direction(sw->gpio, direction);
 
        if (omap_get_gpio_datain(sw->gpio))
-               omap_set_gpio_edge_ctrl(sw->gpio, OMAP_GPIO_FALLING_EDGE);
+               set_irq_type(OMAP_GPIO_IRQ(sw->gpio), IRQT_FALLING);
        else
-               omap_set_gpio_edge_ctrl(sw->gpio, OMAP_GPIO_RISING_EDGE);
+               set_irq_type(OMAP_GPIO_IRQ(sw->gpio), IRQT_RISING);
 
        switch (sw->type) {
        case OMAP_GPIO_SWITCH_TYPE_COVER:
index e5dcd35f3e842ff388ffed8e5e564e49fa00870e..5436481b676ba3f8860e227016d61dd896717813 100644 (file)
@@ -335,9 +335,9 @@ static int _set_gpio_edge_ctrl(struct gpio_bank *bank, int gpio, int edge)
        case METHOD_MPUIO:
                reg += OMAP_MPUIO_GPIO_INT_EDGE;
                l = __raw_readl((void __iomem *)reg);
-               if (edge == OMAP_GPIO_RISING_EDGE)
+               if (edge == IRQT_RISING)
                        l |= 1 << gpio;
-               else if (edge == OMAP_GPIO_FALLING_EDGE)
+               else if (edge == IRQT_FALLING)
                        l &= ~(1 << gpio);
                else
                        goto bad;
@@ -345,14 +345,15 @@ static int _set_gpio_edge_ctrl(struct gpio_bank *bank, int gpio, int edge)
        case METHOD_GPIO_1510:
                reg += OMAP1510_GPIO_INT_CONTROL;
                l = __raw_readl((void __iomem *)reg);
-               if (edge == OMAP_GPIO_RISING_EDGE)
+               if (edge == IRQT_RISING)
                        l |= 1 << gpio;
-               else if (edge == OMAP_GPIO_FALLING_EDGE)
+               else if (edge == IRQT_FALLING)
                        l &= ~(1 << gpio);
                else
                        goto bad;
                break;
        case METHOD_GPIO_1610:
+               /* NOTE: knows __IRQT_{FAL,RIS}EDGE match OMAP hardware */
                edge &= 0x03;
                if (gpio & 0x08)
                        reg += OMAP1610_GPIO_EDGE_CTRL2;
@@ -366,9 +367,9 @@ static int _set_gpio_edge_ctrl(struct gpio_bank *bank, int gpio, int edge)
        case METHOD_GPIO_730:
                reg += OMAP730_GPIO_INT_CONTROL;
                l = __raw_readl((void __iomem *)reg);
-               if (edge == OMAP_GPIO_RISING_EDGE)
+               if (edge == IRQT_RISING)
                        l |= 1 << gpio;
-               else if (edge == OMAP_GPIO_FALLING_EDGE)
+               else if (edge == IRQT_FALLING)
                        l &= ~(1 << gpio);
                else
                        goto bad;
@@ -397,9 +398,6 @@ static int gpio_irq_type(unsigned irq, unsigned type)
        if (check_gpio(gpio) < 0)
                return -EINVAL;
 
-       /* NOTE:  __IRQT_FALEDGE == OMAP_GPIO_FALLING_EDGE,
-        * and  __IRQT_RISEDGE == OMAP_GPIO_RISING_EDGE
-        */
        if (type & (__IRQT_LOWLVL|__IRQT_HIGHLVL|IRQT_PROBE))
                return -EINVAL;
 
@@ -410,18 +408,6 @@ static int gpio_irq_type(unsigned irq, unsigned type)
        return retval;
 }
 
-void omap_set_gpio_edge_ctrl(int gpio, int edge)
-{
-       struct gpio_bank *bank;
-
-       if (check_gpio(gpio) < 0)
-               return;
-       bank = get_gpio_bank(gpio);
-       spin_lock(&bank->lock);
-       _set_gpio_edge_ctrl(bank, get_gpio_index(gpio), edge);
-       spin_unlock(&bank->lock);
-}
-
 
 static int _get_gpio_edge_ctrl(struct gpio_bank *bank, int gpio)
 {
@@ -431,21 +417,22 @@ static int _get_gpio_edge_ctrl(struct gpio_bank *bank, int gpio)
        case METHOD_MPUIO:
                l = __raw_readl(reg + OMAP_MPUIO_GPIO_INT_EDGE);
                return (l & (1 << gpio)) ?
-                       OMAP_GPIO_RISING_EDGE : OMAP_GPIO_FALLING_EDGE;
+                       IRQT_RISING : IRQT_FALLING;
        case METHOD_GPIO_1510:
                l = __raw_readl(reg + OMAP1510_GPIO_INT_CONTROL);
                return (l & (1 << gpio)) ?
-                       OMAP_GPIO_RISING_EDGE : OMAP_GPIO_FALLING_EDGE;
+                       IRQT_RISING : IRQT_FALLING;
        case METHOD_GPIO_1610:
                if (gpio & 0x08)
                        reg += OMAP1610_GPIO_EDGE_CTRL2;
                else
                        reg += OMAP1610_GPIO_EDGE_CTRL1;
+               /* NOTE: knows __IRQT_{FAL,RIS}EDGE match OMAP hardware */
                return (__raw_readl(reg) >> ((gpio & 0x07) << 1)) & 0x03;
        case METHOD_GPIO_730:
                l = __raw_readl(reg + OMAP730_GPIO_INT_CONTROL);
                return (l & (1 << gpio)) ?
-                       OMAP_GPIO_RISING_EDGE : OMAP_GPIO_FALLING_EDGE;
+                       IRQT_RISING : IRQT_FALLING;
        default:
                BUG();
                return -1;
@@ -714,10 +701,10 @@ static void gpio_unmask_irq(unsigned int irq)
        unsigned int gpio = irq - IH_GPIO_BASE;
        struct gpio_bank *bank = get_gpio_bank(gpio);
 
-       if (_get_gpio_edge_ctrl(bank, get_gpio_index(gpio)) == OMAP_GPIO_NO_EDGE) {
+       if (_get_gpio_edge_ctrl(bank, get_gpio_index(gpio)) == IRQT_NOEDGE) {
                printk(KERN_ERR "OMAP GPIO %d: trying to enable GPIO IRQ while no edge is set\n",
                       gpio);
-               _set_gpio_edge_ctrl(bank, get_gpio_index(gpio), OMAP_GPIO_RISING_EDGE);
+               _set_gpio_edge_ctrl(bank, get_gpio_index(gpio), IRQT_RISING);
        }
        _set_gpio_irqenable(bank, gpio, 1);
 }
@@ -951,6 +938,5 @@ EXPORT_SYMBOL(omap_free_gpio);
 EXPORT_SYMBOL(omap_set_gpio_direction);
 EXPORT_SYMBOL(omap_set_gpio_dataout);
 EXPORT_SYMBOL(omap_get_gpio_datain);
-EXPORT_SYMBOL(omap_set_gpio_edge_ctrl);
 
 arch_initcall(omap_gpio_sysinit);
index a327211dcfc87cfd6d90f771b119c0f9915008c7..c695af8aec05a9d2dc25a70fe835b627d78ab181 100644 (file)
@@ -126,7 +126,6 @@ static void __init h2_init_smc91x(void)
                printk("Error requesting gpio 0 for smc91x irq\n");
                return;
        }
-       omap_set_gpio_edge_ctrl(0, OMAP_GPIO_FALLING_EDGE);
 }
 
 static void __init h2_init_irq(void)
index 1aeee6d10822ca7b5108eca7ba2f5a520f118907..533bb4470d817eb6bbf2b840afc0e47755512859 100644 (file)
@@ -188,7 +188,6 @@ static void __init h3_init_smc91x(void)
                printk("Error requesting gpio 40 for smc91x irq\n");
                return;
        }
-       omap_set_gpio_edge_ctrl(40, OMAP_GPIO_FALLING_EDGE);
 }
 
 void h3_init_irq(void)
index b9ed9b6df7e5f1fd0a0680b20d5c75866ef539fd..a77bcc1c84ed43f6e741e81520ebead349f8464a 100644 (file)
@@ -174,7 +174,6 @@ static void __init innovator_init_smc91x(void)
                        printk("Error requesting gpio 0 for smc91x irq\n");
                        return;
                }
-               omap_set_gpio_edge_ctrl(0, OMAP_GPIO_FALLING_EDGE);
        }
 }
 
index e1048be509e67c6dbd2d4e3da1f1b16490680961..f315ef6ef36cdb2f219a2d36bab66ff74f690176 100644 (file)
@@ -76,16 +76,15 @@ static void __init netstar_init(void)
        mdelay(50);     /* 50ms until PHY ready */
        /* smc91x interrupt pin */
        omap_request_gpio(8);
-       omap_set_gpio_edge_ctrl(8, OMAP_GPIO_RISING_EDGE);
 
        omap_request_gpio(12);
        omap_request_gpio(13);
        omap_request_gpio(14);
        omap_request_gpio(15);
-       omap_set_gpio_edge_ctrl(12, OMAP_GPIO_FALLING_EDGE);
-       omap_set_gpio_edge_ctrl(13, OMAP_GPIO_FALLING_EDGE);
-       omap_set_gpio_edge_ctrl(14, OMAP_GPIO_FALLING_EDGE);
-       omap_set_gpio_edge_ctrl(15, OMAP_GPIO_FALLING_EDGE);
+       set_irq_type(OMAP_GPIO_IRQ(12), IRQT_FALLING);
+       set_irq_type(OMAP_GPIO_IRQ(13), IRQT_FALLING);
+       set_irq_type(OMAP_GPIO_IRQ(14), IRQT_FALLING);
+       set_irq_type(OMAP_GPIO_IRQ(15), IRQT_FALLING);
 
        platform_add_devices(netstar_devices, ARRAY_SIZE(netstar_devices));
 
index ae6dce5cc6c69e3c89ecf05672ebca4227ecffca..7186cb11965eb9064977a6642ddc14f4cb9fc9f8 100644 (file)
@@ -147,7 +147,6 @@ static void __init osk_init_smc91x(void)
                printk("Error requesting gpio 0 for smc91x irq\n");
                return;
        }
-       omap_set_gpio_edge_ctrl(0, OMAP_GPIO_RISING_EDGE);
 
        /* Check EMIFS wait states to fix errors with SMC_GET_PKT_HDR */
        EMIFS_CCS(1) |= 0x2;
@@ -160,8 +159,8 @@ static void __init osk_init_cf(void)
                printk("Error requesting gpio 62 for CF irq\n");
                return;
        }
-       /* it's really active-low */
-       omap_set_gpio_edge_ctrl(62, OMAP_GPIO_FALLING_EDGE);
+       /* the CF I/O IRQ is really active-low */
+       set_irq_type(OMAP_GPIO_IRQ(62), IRQT_FALLING);
 }
 
 static void __init osk_init_irq(void)
index 4759eb9290e1aec3259b15f3986e436ca30215ae..73a0d5db7dedd00cebf2c75d482445cda20709a9 100644 (file)
@@ -178,7 +178,6 @@ static void __init voiceblue_init(void)
        mdelay(50);     /* 50ms until PHY ready */
        /* smc91x interrupt pin */
        omap_request_gpio(8);
-       omap_set_gpio_edge_ctrl(8, OMAP_GPIO_RISING_EDGE);
        /* 16C554 reset*/
        omap_request_gpio(6);
        omap_set_gpio_direction(6, 0);
@@ -188,10 +187,10 @@ static void __init voiceblue_init(void)
        omap_request_gpio(13);
        omap_request_gpio(14);
        omap_request_gpio(15);
-       omap_set_gpio_edge_ctrl(12, OMAP_GPIO_RISING_EDGE);
-       omap_set_gpio_edge_ctrl(13, OMAP_GPIO_RISING_EDGE);
-       omap_set_gpio_edge_ctrl(14, OMAP_GPIO_RISING_EDGE);
-       omap_set_gpio_edge_ctrl(15, OMAP_GPIO_RISING_EDGE);
+       set_irq_type(OMAP_GPIO_IRQ(12), IRQT_RISING);
+       set_irq_type(OMAP_GPIO_IRQ(13), IRQT_RISING);
+       set_irq_type(OMAP_GPIO_IRQ(14), IRQT_RISING);
+       set_irq_type(OMAP_GPIO_IRQ(15), IRQT_RISING);
 
        platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices));
        omap_board_config = voiceblue_config;
index 7c08f6c2e1d0bc38d0864fb724349de0abcc41ec..48d51a58910ad354dfc68450a56966fa4768835a 100644 (file)
@@ -181,7 +181,7 @@ void omap1510_fpga_init_irq(void)
         */
        omap_request_gpio(13);
        omap_set_gpio_direction(13, 1);
-       omap_set_gpio_edge_ctrl(13, OMAP_GPIO_RISING_EDGE);
+       set_irq_type(OMAP_GPIO_IRQ(13), IRQT_RISING);
        set_irq_chained_handler(OMAP1510_INT_FPGA, innovator_fpga_IRQ_demux);
 }
 
index 554701eaf63f1fd7aef93ddbe47b4467db3e8257..683992331358e4eb38bcf0a5a73011a4c0a93218 100644 (file)
@@ -1601,7 +1601,7 @@ fail1:
                isp->irq = OMAP_GPIO_IRQ(2);
                omap_request_gpio(2);
                omap_set_gpio_direction(2, 1);
-               omap_set_gpio_edge_ctrl(2, OMAP_GPIO_FALLING_EDGE);
+               set_irq_type(isp->irq, IRQT_FALLING);
        }
 
        if (machine_is_omap_h3()) {
@@ -1610,7 +1610,7 @@ fail1:
                isp->irq = OMAP_GPIO_IRQ(14);
                omap_request_gpio(14);
                omap_set_gpio_direction(14, 1);
-               omap_set_gpio_edge_ctrl(14, OMAP_GPIO_FALLING_EDGE);
+               set_irq_type(isp->irq, IRQT_FALLING);
        }
 
        status = request_irq(isp->irq, isp1301_irq,
index d2eceaae1eba7d998f6c4a5d0abd881c81312d25..984835a1b7b70139bf408c072150df039e8e0d03 100644 (file)
@@ -535,7 +535,7 @@ fail1:
                tps->irq = OMAP_GPIO_IRQ(58);
                omap_request_gpio(58);
                omap_set_gpio_direction(58, 1);
-               omap_set_gpio_edge_ctrl(58, OMAP_GPIO_FALLING_EDGE);
+               set_irq_type(tps->irq, IRQT_FALLING);
        }
        if (machine_is_omap_osk()) {
                tps->model = TPS65010;
@@ -543,7 +543,7 @@ fail1:
                tps->irq = OMAP_GPIO_IRQ(OMAP_MPUIO(1));
                omap_request_gpio(OMAP_MPUIO(1));
                omap_set_gpio_direction(OMAP_MPUIO(1), 1);
-               omap_set_gpio_edge_ctrl(OMAP_MPUIO(1), OMAP_GPIO_FALLING_EDGE);
+               set_irq_type(tps->irq, IRQT_FALLING);
        }
        if (machine_is_omap_h3()) {
                tps->model = TPS65013;
index 813aef0b521cda5123e9ea9c622ba70995eaa27f..fac78daaa904f47ecbabe42d8128cbc54d563485 100644 (file)
@@ -98,7 +98,7 @@ static int __init hx_ts_probe(struct omap_ts_t *ts)
        };
 
        omap_set_gpio_direction(gpio, 1);
-       omap_set_gpio_edge_ctrl(gpio, OMAP_GPIO_FALLING_EDGE);
+       set_irq_type(ts->irq, IRQT_FALLING);
        return 0;
 }
 
index d05afc6355755dc594722b03a6f67b5cae772188..ab4b1c713683b445fcd8e89db608e4d03b971924 100644 (file)
@@ -90,7 +90,7 @@ static int  __init osk_ts_probe(struct omap_ts_t *ts)
         omap_cfg_reg(P20_1610_GPIO4);
        omap_request_gpio(4);
        omap_set_gpio_direction(4, 1);
-       omap_set_gpio_edge_ctrl(4, OMAP_GPIO_FALLING_EDGE);
+       set_irq_type(OMAP_GPIO_IRQ(4), IRQT_FALLING);
 
        ts->irq = PEN_IRQ;
 
index 5905f2610899fcd6ed841a2420123f09e9dcd98c..6ada6c98bcf6cd87decadc8e72e405db0c2ddc1d 100644 (file)
@@ -973,7 +973,7 @@ static int mmc_omap_probe(struct device *dev)
                }
 
                omap_set_gpio_direction(host->switch_pin, 1);
-               omap_set_gpio_edge_ctrl(host->switch_pin, OMAP_GPIO_RISING_EDGE);
+               set_irq_type(OMAP_GPIO_IRQ(host->switch_pin), IRQT_RISING);
                ret = request_irq(OMAP_GPIO_IRQ(host->switch_pin),
                                  mmc_omap_switch_irq, 0, DRIVER_NAME, host);
                if (ret) {
index a23fdb6bf66bab21b85014f84da92dbaf08460d7..20fb42732476df4ce1608a0b7a34100f9a5b3035 100644 (file)
@@ -1990,7 +1990,7 @@ static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr)
        if (retval)
                goto err_out;
 
-       set_irq_type(dev->irq, IRQ_TRIGGER_TYPE);
+       set_irq_type(dev->irq, SMC_IRQ_TRIGGER_TYPE);
 
 #ifdef SMC_USE_PXA_DMA
        {
index 8f85dd19875e081a8e89879702142ae51b190a47..3a81957a41ba73ee1187e00c4ec64350a9c99de0 100644 (file)
@@ -185,7 +185,7 @@ SMC_outw(u16 val, unsigned long ioaddr, int reg)
 #include <asm/mach-types.h>
 #include <asm/arch/cpu.h>
 
-#define        IRQ_TRIGGER_TYPE (( \
+#define        SMC_IRQ_TRIGGER_TYPE (( \
                   machine_is_omap_h2() \
                || machine_is_omap_h3() \
                || (machine_is_omap_innovator() && !cpu_is_omap1510()) \
@@ -310,8 +310,8 @@ static inline void SMC_outsw (unsigned long a, int r, unsigned char* p, int l)
 
 #endif
 
-#ifndef        IRQ_TRIGGER_TYPE
-#define        IRQ_TRIGGER_TYPE        IRQT_RISING
+#ifndef        SMC_IRQ_TRIGGER_TYPE
+#define        SMC_IRQ_TRIGGER_TYPE    IRQT_RISING
 #endif
 
 #ifdef SMC_USE_PXA_DMA
index e49ff06f60c681feb7a5da07920f971bd6b26635..b017122e97c6e18235c157c5ee59cc895ef35dc3 100644 (file)
                                 IH_MPUIO_BASE + ((nr) & 0x0f) : \
                                 IH_GPIO_BASE + ((nr) & 0x3f))
 
-/* For EDGECTRL */
-#define OMAP_GPIO_NO_EDGE        0x00
-#define OMAP_GPIO_FALLING_EDGE   0x01
-#define OMAP_GPIO_RISING_EDGE    0x02
-#define OMAP_GPIO_BOTH_EDGES     0x03
-
 extern int omap_gpio_init(void);       /* Call from board init only */
 extern int omap_request_gpio(int gpio);
 extern void omap_free_gpio(int gpio);
@@ -65,7 +59,4 @@ extern void omap_set_gpio_direction(int gpio, int is_input);
 extern void omap_set_gpio_dataout(int gpio, int enable);
 extern int omap_get_gpio_datain(int gpio);
 
-/* use ARM-standard set_irq_type() instead */
-extern void __deprecated omap_set_gpio_edge_ctrl(int gpio, int edge);
-
 #endif