]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Switch to gpio_request/free calls (part 2)
authorJarkko Nikula <jarkko.nikula@nokia.com>
Fri, 31 Oct 2008 12:18:50 +0000 (14:18 +0200)
committerTony Lindgren <tony@atomide.com>
Fri, 21 Nov 2008 23:37:16 +0000 (15:37 -0800)
This converts new files which are not yet merged upstream including
gpio-switch and board files for 3430sdp, Nokia N800 and omap3evm.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/board-3430sdp.c
arch/arm/mach-omap2/board-n800-camera.c
arch/arm/mach-omap2/board-n800-mmc.c
arch/arm/mach-omap2/board-n800-usb.c
arch/arm/mach-omap2/board-n800.c
arch/arm/mach-omap2/board-omap3evm.c
arch/arm/plat-omap/gpio-switch.c

index b7d2e92d8e68bf9d4da6df2811fb36fab7f85917..81a4711ce56cd0f8bb5e40cf57d1197b0e1786db 100644 (file)
@@ -166,7 +166,7 @@ out:
  */
 static void ads7846_dev_init(void)
 {
-       if (omap_request_gpio(ts_gpio) < 0) {
+       if (gpio_request(ts_gpio, "ADS7846 pendown") < 0) {
                printk(KERN_ERR "can't get ads746 pen down GPIO\n");
                return;
        }
@@ -274,7 +274,7 @@ static inline void __init sdp3430_init_smc91x(void)
 
        sdp3430_smc91x_resources[1].start = gpio_to_irq(eth_gpio);
 
-       if (omap_request_gpio(eth_gpio) < 0) {
+       if (gpio_request(eth_gpio, "SMC91x irq") < 0) {
                printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
                        eth_gpio);
                return;
index 1f3b1e9f2b60f8ea012c0e73c1cd8fab726943c1..395912818ae31bda75bf7fa5589fd6c80865f613 100644 (file)
 #include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/videodev2.h>
+#include <linux/gpio.h>
 #include <linux/i2c/menelaus.h>
 
 #include <media/v4l2-int-device.h>
 
 #include <asm/mach-types.h>
 
-#include <mach/gpio.h>
 #include <mach/board.h>
 
 #include <../drivers/cbus/retu.h>
@@ -356,7 +356,7 @@ void __init n800_cam_init(void)
 {
        int r;
 
-       r = omap_request_gpio(N800_CAM_SENSOR_RESET_GPIO);
+       r = gpio_request(N800_CAM_SENSOR_RESET_GPIO, "TCM825x reset");
        if (r < 0) {
                printk(KERN_WARNING "%s: failed to request gpio\n",
                        __func__);
index d4df2b77bfe86000d962572ad2842a235b59d882..b2376a96fbfcfde5f0b144940fac2d817b304aad 100644 (file)
 
 #include <linux/delay.h>
 #include <linux/platform_device.h>
+#include <linux/gpio.h>
 #include <linux/i2c/menelaus.h>
 
 #include <asm/mach-types.h>
 
 #include <mach/mmc.h>
-#include <mach/gpio.h>
 
 #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
 
@@ -284,11 +284,11 @@ static void n800_mmc_cleanup(struct device *dev)
 {
        menelaus_unregister_mmc_callback();
 
-       omap_free_gpio(slot_switch_gpio);
+       gpio_free(slot_switch_gpio);
 
        if (machine_is_nokia_n810()) {
-               omap_free_gpio(n810_slot2_pw_vddf);
-               omap_free_gpio(n810_slot2_pw_vdd);
+               gpio_free(n810_slot2_pw_vddf);
+               gpio_free(n810_slot2_pw_vdd);
        }
 }
 
@@ -344,16 +344,16 @@ void __init n800_mmc_init(void)
                mmc1_data.slots[1].ban_openended = 1;
        }
 
-       if (omap_request_gpio(slot_switch_gpio) < 0)
+       if (gpio_request(slot_switch_gpio, "MMC slot switch") < 0)
                BUG();
        gpio_direction_output(slot_switch_gpio, 0);
 
        if (machine_is_nokia_n810()) {
-               if (omap_request_gpio(n810_slot2_pw_vddf) < 0)
+               if (gpio_request(n810_slot2_pw_vddf, "MMC slot 2 Vddf") < 0)
                        BUG();
                gpio_direction_output(n810_slot2_pw_vddf, 0);
 
-               if (omap_request_gpio(n810_slot2_pw_vdd) < 0)
+               if (gpio_request(n810_slot2_pw_vdd, "MMC slot 2 Vdd") < 0)
                        BUG();
                gpio_direction_output(n810_slot2_pw_vdd, 0);
        }
index 5ab453dba25335d58074a1775ed9331eee7ffbbb..e182a93ad191e1601b0c494fc3ad71b4020dec18 100644 (file)
@@ -14,9 +14,9 @@
 #include <linux/platform_device.h>
 #include <linux/clk.h>
 #include <linux/err.h>
+#include <linux/gpio.h>
 #include <linux/usb/musb.h>
 #include <mach/gpmc.h>
-#include <mach/gpio.h>
 #include <mach/pm.h>
 
 #define TUSB_ASYNC_CS          1
@@ -150,7 +150,7 @@ void __init n800_usb_init(void)
        static char     announce[] __initdata = KERN_INFO "TUSB 6010\n";
 
        /* PM companion chip power control pin */
-       ret = omap_request_gpio(GPIO_TUSB_ENABLE);
+       ret = gpio_request(GPIO_TUSB_ENABLE, "TUSB6010 enable");
        if (ret != 0) {
                printk(KERN_ERR "Could not get TUSB power GPIO%i\n",
                       GPIO_TUSB_ENABLE);
@@ -171,5 +171,5 @@ void __init n800_usb_init(void)
        return;
 
 err:
-       omap_free_gpio(GPIO_TUSB_ENABLE);
+       gpio_free(GPIO_TUSB_ENABLE);
 }
index 66c7d18317ffdc22434a1a7947ec8cbdb9340078..b38b295cc35c0eb7194f9368d36366500b22e410 100644 (file)
@@ -127,7 +127,7 @@ void __init nokia_n800_init_irq(void)
        omap_gpio_init();
 
 #ifdef CONFIG_OMAP_STI
-       if (omap_request_gpio(N800_STI_GPIO) < 0) {
+       if (gpio_request(N800_STI_GPIO, "STI") < 0) {
                printk(KERN_ERR "Failed to request GPIO %d for STI\n",
                       N800_STI_GPIO);
                return;
@@ -254,7 +254,7 @@ static void __init blizzard_dev_init(void)
 {
        int r;
 
-       r = omap_request_gpio(N800_BLIZZARD_POWERDOWN_GPIO);
+       r = gpio_request(N800_BLIZZARD_POWERDOWN_GPIO, "Blizzard pd");
        if (r < 0)
                return;
        gpio_direction_output(N800_BLIZZARD_POWERDOWN_GPIO, 1);
@@ -331,7 +331,7 @@ static int __init tea5761_dev_init(void)
                pr_debug("Enabling tea5761 at GPIO %d\n",
                         enable_gpio);
 
-               if (omap_request_gpio(enable_gpio) < 0) {
+               if (gpio_request(enable_gpio, "TEA5761 enable") < 0) {
                        printk(KERN_ERR "Can't request GPIO %d\n",
                               enable_gpio);
                        return -ENODEV;
index bc44cb5a4e63a3581cbea2ef497980efd14c27d4..9e6a33e7e0a46557c44c05c7c797a66917dbab7d 100644 (file)
@@ -77,7 +77,7 @@ static inline void __init omap3evm_init_smc911x(void)
        else
                rate = clk_get_rate(l3ck);
 
-       if (omap_request_gpio(OMAP3EVM_ETHR_GPIO_IRQ) < 0) {
+       if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMC911x irq") < 0) {
                printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n",
                        OMAP3EVM_ETHR_GPIO_IRQ);
                return;
@@ -173,7 +173,7 @@ static struct omap_lcd_config omap3_evm_lcd_config __initdata = {
 
 static void ads7846_dev_init(void)
 {
-       if (omap_request_gpio(OMAP3_EVM_TS_GPIO) < 0)
+       if (gpio_request(OMAP3_EVM_TS_GPIO, "ADS7846 pendown") < 0)
                printk(KERN_ERR "can't get ads7846 pen down GPIO\n");
 
        gpio_direction_input(OMAP3_EVM_TS_GPIO);
index f18f6df6212c77baf5c4b1135af716fb262aa0a6..2b5665dcb68bde3a51256a185433ce9c0b956faa 100644 (file)
@@ -19,8 +19,8 @@
 #include <linux/platform_device.h>
 #include <linux/timer.h>
 #include <linux/err.h>
+#include <linux/gpio.h>
 #include <mach/hardware.h>
-#include <mach/gpio.h>
 #include <mach/irqs.h>
 #include <mach/mux.h>
 #include <mach/board.h>
@@ -278,7 +278,7 @@ static int __init new_switch(struct gpio_switch *sw)
        }
        dev_set_drvdata(&sw->pdev.dev, sw);
 
-       r = omap_request_gpio(sw->gpio);
+       r = gpio_request(sw->gpio, sw->name);
        if (r < 0) {
                platform_device_unregister(&sw->pdev);
                return r;
@@ -319,7 +319,7 @@ static int __init new_switch(struct gpio_switch *sw)
                printk(KERN_ERR "gpio-switch: request_irq() failed "
                       "for GPIO %d\n", sw->gpio);
                platform_device_unregister(&sw->pdev);
-               omap_free_gpio(sw->gpio);
+               gpio_free(sw->gpio);
                return r;
        }
 
@@ -455,7 +455,7 @@ static void gpio_sw_cleanup(void)
                device_remove_file(&sw->pdev.dev, &dev_attr_direction);
 
                platform_device_unregister(&sw->pdev);
-               omap_free_gpio(sw->gpio);
+               gpio_free(sw->gpio);
                old = sw;
        }
        kfree(old);