]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
use gpio_to_irq (OMAP tree only)
authorDavid Brownell <dbrownell@users.sourceforge.net>
Thu, 30 Oct 2008 07:34:45 +0000 (00:34 -0700)
committerTony Lindgren <tony@atomide.com>
Thu, 13 Nov 2008 21:29:57 +0000 (13:29 -0800)
Have most uses of OMAP_GPIO_IRQ() use gpio_to_irq() instead.
Calls used for table initialization are left alone, at least
this time around.

(This patches code that's in the OMAP tree but not yet mainline.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/board-3430sdp.c
arch/arm/mach-omap2/board-ldp.c
arch/arm/mach-omap2/board-n800.c
arch/arm/plat-omap/gpio-switch.c
drivers/bluetooth/brf6150.c
drivers/bluetooth/hci_h4p/core.c
drivers/cbus/retu.c
drivers/cbus/tahvo.c
drivers/input/touchscreen/omap/ts_hx.c
drivers/input/touchscreen/tsc2005.c

index 2ef8754d4771527eedc01177a0f451d3a7b5fa9b..b7d2e92d8e68bf9d4da6df2811fb36fab7f85917 100644 (file)
@@ -272,7 +272,7 @@ static inline void __init sdp3430_init_smc91x(void)
        else
                eth_gpio = OMAP34XX_ETHR_GPIO_IRQ_SDPV1;
 
-       sdp3430_smc91x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio);
+       sdp3430_smc91x_resources[1].start = gpio_to_irq(eth_gpio);
 
        if (omap_request_gpio(eth_gpio) < 0) {
                printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
@@ -473,7 +473,7 @@ static void __init omap_3430sdp_init(void)
                ts_gpio = OMAP34XX_TS_GPIO_IRQ_SDPV2;
        else
                ts_gpio = OMAP34XX_TS_GPIO_IRQ_SDPV1;
-       sdp3430_spi_board_info[0].irq = OMAP_GPIO_IRQ(ts_gpio);
+       sdp3430_spi_board_info[0].irq = gpio_to_irq(ts_gpio);
        spi_register_board_info(sdp3430_spi_board_info,
                                ARRAY_SIZE(sdp3430_spi_board_info));
        ads7846_dev_init();
index 42d57fa9a43c62320afdfa7fa74125ce70f3ac75..3ad5dba8519be661d2eb9583921ce435292dece5 100644 (file)
@@ -358,7 +358,7 @@ static void __init omap_ldp_init(void)
        omap_board_config = ldp_config;
        omap_board_config_size = ARRAY_SIZE(ldp_config);
        ts_gpio = 54;
-       ldp_spi_board_info[0].irq = OMAP_GPIO_IRQ(ts_gpio);
+       ldp_spi_board_info[0].irq = gpio_to_irq(ts_gpio);
        spi_register_board_info(ldp_spi_board_info,
                                ARRAY_SIZE(ldp_spi_board_info));
        msecure_init();
index 280806c3ccf5858fd4a67662c0f644d1d3289409..66c7d18317ffdc22434a1a7947ec8cbdb9340078 100644 (file)
@@ -303,7 +303,7 @@ static void tsc2301_dev_init(void)
        r = gpio_request(gpio, "tsc2301 KBD IRQ");
        if (r >= 0) {
                gpio_direction_input(gpio);
-               tsc2301_config.keyb_int = OMAP_GPIO_IRQ(gpio);
+               tsc2301_config.keyb_int = gpio_to_irq(gpio);
        } else {
                printk(KERN_ERR "unable to get KBD GPIO");
        }
@@ -312,7 +312,7 @@ static void tsc2301_dev_init(void)
        r = gpio_request(gpio, "tsc2301 DAV IRQ");
        if (r >= 0) {
                gpio_direction_input(gpio);
-               tsc2301_config.dav_int = OMAP_GPIO_IRQ(gpio);
+               tsc2301_config.dav_int = gpio_to_irq(gpio);
        } else {
                printk(KERN_ERR "unable to get DAV GPIO");
        }
index 89812ea3adfa1a68cc57a503dbb7de0d30d87a14..f18f6df6212c77baf5c4b1135af716fb262aa0a6 100644 (file)
@@ -191,9 +191,9 @@ static irqreturn_t gpio_sw_irq_handler(int irq, void *arg)
 
        if (!sw->both_edges) {
                if (gpio_get_value(sw->gpio))
-                       set_irq_type(OMAP_GPIO_IRQ(sw->gpio), IRQ_TYPE_EDGE_FALLING);
+                       set_irq_type(gpio_to_irq(sw->gpio), IRQ_TYPE_EDGE_FALLING);
                else
-                       set_irq_type(OMAP_GPIO_IRQ(sw->gpio), IRQ_TYPE_EDGE_RISING);
+                       set_irq_type(gpio_to_irq(sw->gpio), IRQ_TYPE_EDGE_RISING);
        }
 
        state = gpio_sw_get_state(sw);
@@ -313,7 +313,7 @@ static int __init new_switch(struct gpio_switch *sw)
                else
                        trigger = IRQF_TRIGGER_RISING;
        }
-       r = request_irq(OMAP_GPIO_IRQ(sw->gpio), gpio_sw_irq_handler,
+       r = request_irq(gpio_to_irq(sw->gpio), gpio_sw_irq_handler,
                        IRQF_SHARED | trigger, sw->name, sw);
        if (r < 0) {
                printk(KERN_ERR "gpio-switch: request_irq() failed "
@@ -448,7 +448,7 @@ static void gpio_sw_cleanup(void)
                flush_scheduled_work();
                del_timer_sync(&sw->timer);
 
-               free_irq(OMAP_GPIO_IRQ(sw->gpio), sw);
+               free_irq(gpio_to_irq(sw->gpio), sw);
 
                device_remove_file(&sw->pdev.dev, &dev_attr_state);
                device_remove_file(&sw->pdev.dev, &dev_attr_type);
index adb947ac2919e7ae36c06613cf216e747803b21b..256ecdec5058a75f1ea2587437886a25d55a6bdc 100644 (file)
@@ -742,7 +742,7 @@ static int brf6150_hci_open(struct hci_dev *hdev)
        info->garbage_bytes = 0;
        info->rx_skb = NULL;
        info->pm_enabled = 0;
-       set_irq_type(OMAP_GPIO_IRQ(info->btinfo->host_wakeup_gpio), IRQ_TYPE_NONE);
+       set_irq_type(gpio_to_irq(info->btinfo->host_wakeup_gpio), IRQ_TYPE_NONE);
        init_completion(&info->fw_completion);
 
        clk_enable(info->uart_ck);
@@ -771,7 +771,7 @@ static int brf6150_hci_open(struct hci_dev *hdev)
        if (err < 0)
                printk(KERN_ERR "brf6150: Sending firmware failed. Bluetooth won't work properly\n");
 
-       set_irq_type(OMAP_GPIO_IRQ(info->btinfo->host_wakeup_gpio), IRQ_TYPE_EDGE_BOTH);
+       set_irq_type(gpio_to_irq(info->btinfo->host_wakeup_gpio), IRQ_TYPE_EDGE_BOTH);
        info->pm_enabled = 1;
        set_bit(HCI_RUNNING, &hdev->flags);
        return 0;
@@ -787,7 +787,7 @@ static int brf6150_hci_close(struct hci_dev *hdev)
        clk_disable(info->uart_ck);
        del_timer_sync(&info->pm_timer);
        gpio_set_value(info->btinfo->bt_wakeup_gpio, 0);
-       set_irq_type(OMAP_GPIO_IRQ(info->btinfo->host_wakeup_gpio), IRQ_TYPE_NONE);
+       set_irq_type(gpio_to_irq(info->btinfo->host_wakeup_gpio), IRQ_TYPE_NONE);
 
        return 0;
 }
@@ -946,7 +946,7 @@ static int __init brf6150_init(void)
        gpio_direction_output(info->btinfo->reset_gpio, 0);
        gpio_direction_output(info->btinfo->bt_wakeup_gpio, 0);
        gpio_direction_input(info->btinfo->host_wakeup_gpio);
-       set_irq_type(OMAP_GPIO_IRQ(info->btinfo->host_wakeup_gpio), IRQ_TYPE_NONE);
+       set_irq_type(gpio_to_irq(info->btinfo->host_wakeup_gpio), IRQ_TYPE_NONE);
 
        switch (info->btinfo->bt_uart) {
        case 1:
@@ -985,11 +985,11 @@ static int __init brf6150_init(void)
                goto cleanup;
        }
 
-       err = request_irq(OMAP_GPIO_IRQ(info->btinfo->host_wakeup_gpio),
+       err = request_irq(gpio_to_irq(info->btinfo->host_wakeup_gpio),
                        brf6150_wakeup_interrupt, 0, "brf6150_wkup", (void *)info);
        if (err < 0) {
                printk(KERN_ERR "brf6150: unable to get wakeup IRQ %d\n",
-                               OMAP_GPIO_IRQ(info->btinfo->host_wakeup_gpio));
+                               gpio_to_irq(info->btinfo->host_wakeup_gpio));
                free_irq(irq, (void *)info);
                goto cleanup;
        }
@@ -1020,7 +1020,7 @@ static int __init brf6150_init(void)
 
 cleanup_irq:
        free_irq(irq, (void *)info);
-       free_irq(OMAP_GPIO_IRQ(info->btinfo->host_wakeup_gpio), (void *)info);
+       free_irq(gpio_to_irq(info->btinfo->host_wakeup_gpio), (void *)info);
 cleanup:
        omap_free_gpio(info->btinfo->reset_gpio);
        omap_free_gpio(info->btinfo->bt_wakeup_gpio);
@@ -1038,7 +1038,7 @@ static void __exit brf6150_exit(void)
        omap_free_gpio(exit_info->btinfo->bt_wakeup_gpio);
        omap_free_gpio(exit_info->btinfo->host_wakeup_gpio);
        free_irq(exit_info->irq, (void *)exit_info);
-       free_irq(OMAP_GPIO_IRQ(exit_info->btinfo->host_wakeup_gpio), (void *)exit_info);
+       free_irq(gpio_to_irq(exit_info->btinfo->host_wakeup_gpio), (void *)exit_info);
        kfree(exit_info);
 }
 
index 3bf7c211d37d577a5c403936624aa22d3b14a604..9964a0c24a2e51e9df55447054a755268b6d0ba0 100644 (file)
@@ -911,13 +911,13 @@ static int hci_h4p_probe(struct platform_device *pdev)
                goto cleanup;
        }
 
-       err = request_irq(OMAP_GPIO_IRQ(info->host_wakeup_gpio),
+       err = request_irq(gpio_to_irq(info->host_wakeup_gpio),
                          hci_h4p_wakeup_interrupt,
                                IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
                          "hci_h4p_wkup", (void *)info);
        if (err < 0) {
                dev_err(info->dev, "hci_h4p: unable to get wakeup IRQ %d\n",
-                         OMAP_GPIO_IRQ(info->host_wakeup_gpio));
+                         gpio_to_irq(info->host_wakeup_gpio));
                free_irq(irq, (void *)info);
                goto cleanup;
        }
@@ -950,7 +950,7 @@ static int hci_h4p_probe(struct platform_device *pdev)
 
 cleanup_irq:
        free_irq(irq, (void *)info);
-       free_irq(OMAP_GPIO_IRQ(info->host_wakeup_gpio), (void *)info);
+       free_irq(gpio_to_irq(info->host_wakeup_gpio), (void *)info);
 cleanup:
        gpio_set_value(info->reset_gpio, 0);
        omap_free_gpio(info->reset_gpio);
@@ -969,7 +969,7 @@ static int hci_h4p_remove(struct platform_device *dev)
        info = platform_get_drvdata(dev);
 
        hci_h4p_hci_close(info->hdev);
-       free_irq(OMAP_GPIO_IRQ(info->host_wakeup_gpio), (void *) info);
+       free_irq(gpio_to_irq(info->host_wakeup_gpio), (void *) info);
        hci_free_dev(info->hdev);
        omap_free_gpio(info->reset_gpio);
        omap_free_gpio(info->bt_wakeup_gpio);
index 981bbe1700303f4729536c000422f6fcb38e880a..5f9a20acfa23f22a3db86fbbfc536d77535c53a4 100644 (file)
@@ -344,7 +344,7 @@ static int __devinit retu_probe(struct device *dev)
        gpio_direction_input(retu_irq_pin);
 
        /* Rising edge triggers the IRQ */
-       set_irq_type(OMAP_GPIO_IRQ(retu_irq_pin), IRQ_TYPE_EDGE_RISING);
+       set_irq_type(gpio_to_irq(retu_irq_pin), IRQ_TYPE_EDGE_RISING);
 
        retu_initialized = 1;
 
@@ -358,14 +358,14 @@ static int __devinit retu_probe(struct device *dev)
        /* Mask all RETU interrupts */
        retu_write_reg(RETU_REG_IMR, 0xffff);
 
-       ret = request_irq(OMAP_GPIO_IRQ(retu_irq_pin), retu_irq_handler, 0,
+       ret = request_irq(gpio_to_irq(retu_irq_pin), retu_irq_handler, 0,
                          "retu", 0);
        if (ret < 0) {
                printk(KERN_ERR PFX "Unable to register IRQ handler\n");
                omap_free_gpio(retu_irq_pin);
                return ret;
        }
-       set_irq_wake(OMAP_GPIO_IRQ(retu_irq_pin), 1);
+       set_irq_wake(gpio_to_irq(retu_irq_pin), 1);
 
        /* Register power off function */
        pm_power_off = retu_power_off;
@@ -374,7 +374,7 @@ static int __devinit retu_probe(struct device *dev)
        /* Initialize user-space interface */
        if (retu_user_init() < 0) {
                printk(KERN_ERR "Unable to initialize driver\n");
-               free_irq(OMAP_GPIO_IRQ(retu_irq_pin), 0);
+               free_irq(gpio_to_irq(retu_irq_pin), 0);
                omap_free_gpio(retu_irq_pin);
                return ret;
        }
@@ -390,7 +390,7 @@ static int retu_remove(struct device *dev)
 #endif
        /* Mask all RETU interrupts */
        retu_write_reg(RETU_REG_IMR, 0xffff);
-       free_irq(OMAP_GPIO_IRQ(retu_irq_pin), 0);
+       free_irq(gpio_to_irq(retu_irq_pin), 0);
        omap_free_gpio(retu_irq_pin);
        tasklet_kill(&retu_tasklet);
 
index 68236d1d04dea569f80aacde04b20badfb686882..fe665d489169b05bb79a7c052150c571fff35566 100644 (file)
@@ -331,12 +331,12 @@ static int __devinit tahvo_probe(struct device *dev)
        gpio_direction_input(tahvo_irq_pin);
 
        /* Rising edge triggers the IRQ */
-       set_irq_type(OMAP_GPIO_IRQ(tahvo_irq_pin), IRQ_TYPE_EDGE_RISING);
+       set_irq_type(gpio_to_irq(tahvo_irq_pin), IRQ_TYPE_EDGE_RISING);
 
        /* Mask all TAHVO interrupts */
        tahvo_write_reg(TAHVO_REG_IMR, 0xffff);
 
-       ret = request_irq(OMAP_GPIO_IRQ(tahvo_irq_pin), tahvo_irq_handler, 0,
+       ret = request_irq(gpio_to_irq(tahvo_irq_pin), tahvo_irq_handler, 0,
                          "tahvo", 0);
        if (ret < 0) {
                printk(KERN_ERR PFX "Unable to register IRQ handler\n");
@@ -347,7 +347,7 @@ static int __devinit tahvo_probe(struct device *dev)
        /* Initialize user-space interface */
        if (tahvo_user_init() < 0) {
                printk(KERN_ERR "Unable to initialize driver\n");
-               free_irq(OMAP_GPIO_IRQ(tahvo_irq_pin), 0);
+               free_irq(gpio_to_irq(tahvo_irq_pin), 0);
                omap_free_gpio(tahvo_irq_pin);
                return ret;
        }
@@ -362,7 +362,7 @@ static int tahvo_remove(struct device *dev)
 #endif
        /* Mask all TAHVO interrupts */
        tahvo_write_reg(TAHVO_REG_IMR, 0xffff);
-       free_irq(OMAP_GPIO_IRQ(tahvo_irq_pin), 0);
+       free_irq(gpio_to_irq(tahvo_irq_pin), 0);
        omap_free_gpio(tahvo_irq_pin);
        tasklet_kill(&tahvo_tasklet);
 
index a536e306efd2444c89fba1924602613e4601c403..0ef7f6c8d78b5eba819baeb70b196189da7f5646 100644 (file)
@@ -91,7 +91,7 @@ static int __init hx_ts_probe(struct omap_ts_t *ts)
        } else
                return -ENODEV;
 
-       ts->irq = OMAP_GPIO_IRQ(gpio);
+       ts->irq = gpio_to_irq(gpio);
        if (omap_request_gpio(gpio) != 0) {
                printk(KERN_ERR "hX_ts_init.c: Could not reserve GPIO!\n");
                return -EINVAL;
index 69213a47188da981055fda97476c402068d76047..38ac5377badb42ffa037b8f89d5ad0198e4d2880 100644 (file)
@@ -541,7 +541,7 @@ static int __devinit tsc2005_ts_init(struct tsc2005 *ts,
                goto err1;
        }
        gpio_direction_input(dav_gpio);
-       ts->irq = OMAP_GPIO_IRQ(dav_gpio);
+       ts->irq = gpio_to_irq(dav_gpio);
        dev_dbg(&ts->spi->dev, "TSC2005: DAV IRQ = %d\n", ts->irq);
 #endif
        init_timer(&ts->penup_timer);