]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Fix gpio by switching to generic gpio calls
authorJarkko Nikula <jarkko.nikula@nokia.com>
Wed, 7 Jan 2009 10:54:34 +0000 (12:54 +0200)
committerTony Lindgren <tony@atomide.com>
Wed, 7 Jan 2009 13:46:20 +0000 (15:46 +0200)
Fix compile by removing remaining omap specific gpio
calls. Based on earlier patches by Jarkko Nikula.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap1/board-h2.c
arch/arm/mach-omap1/board-sx1.c
arch/arm/mach-omap2/board-2430sdp.c
arch/arm/mach-omap2/board-apollon.c
arch/arm/mach-omap2/board-ldp.c
arch/arm/plat-omap/include/mach/gpio.h
drivers/mtd/onenand/omap2.c
drivers/video/omap/lcd_ldp.c

index 6f29f935bc6b5ab49c4b54487c6e89fdb10ddf27..359f6e4e530a8085cdb58c50feb1d87d9d25ae73 100644 (file)
@@ -411,8 +411,8 @@ static void __init h2_init(void)
        /* Irda */
 #if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
        omap_writel(omap_readl(FUNC_MUX_CTRL_A) | 7, FUNC_MUX_CTRL_A);
-       if (!(omap_request_gpio(H2_IRDA_FIRSEL_GPIO_PIN))) {
-               omap_set_gpio_direction(H2_IRDA_FIRSEL_GPIO_PIN, 0);
+       if (!(gpio_request(H2_IRDA_FIRSEL_GPIO_PIN, "irda firsel"))) {
+               gpio_direction_output(H2_IRDA_FIRSEL_GPIO_PIN);
                h2_irda_data.transceiver_mode = h2_transceiver_mode;
        }
 #endif
index 5b1e61840d66f672e925ea19d5c28a0e6b558684..c602729f622bd073345862670263a98f7f1dfc5d 100644 (file)
@@ -392,9 +392,9 @@ static void __init omap_sx1_init(void)
 
        /* turn on USB power */
        /* sx1_setusbpower(1); cant do it here because i2c is not ready */
-       omap_request_gpio(1);   /* A_IRDA_OFF */
-       omap_request_gpio(11);  /* A_SWITCH */
-       omap_request_gpio(15);  /* A_USB_ON */
+       gpio_request(1, "A_IRDA_OFF");
+       gpio_request(11, "A_SWITCH");
+       gpio_request(15, "A_USB_ON");
        gpio_direction_output(1, 1);    /*A_IRDA_OFF = 1 */
        gpio_direction_output(11, 0);   /*A_SWITCH = 0 */
        gpio_direction_output(15, 0);   /*A_USB_ON = 0 */
index 669cd15d2cca1cfe5549494408d9d31703f8b1a5..5d2933d7a75dcceeb7d8a8367837d698a196ddd8 100644 (file)
@@ -214,7 +214,7 @@ static struct platform_device *sdp2430_devices[] __initdata = {
 
 static void ads7846_dev_init(void)
 {
-       if (omap_request_gpio(TS_GPIO) < 0)
+       if (gpio_request(TS_GPIO, "ads7846 irq") < 0)
                printk(KERN_ERR "can't get ads746 pen down GPIO\n");
 
        gpio_direction_input(TS_GPIO);
index 755f93b0a56873fac7f7513846eba0748d1d4b2b..c2ef58ae832af4b27e28cf2f6e1d0e530e9fc955 100644 (file)
@@ -195,8 +195,8 @@ static struct resource apollon_smc91x_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = OMAP_GPIO_IRQ(APOLLON_ETHR_GPIO_IRQ),
-               .end    = OMAP_GPIO_IRQ(APOLLON_ETHR_GPIO_IRQ),
+               .start  = gpio_to_irq(APOLLON_ETHR_GPIO_IRQ),
+               .end    = gpio_to_irq(APOLLON_ETHR_GPIO_IRQ),
                .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
        },
 };
@@ -399,7 +399,7 @@ static void __init apollon_tsc_init(void)
 {
        /* TSC2101 */
        omap_cfg_reg(N15_24XX_GPIO85);
-       omap_request_gpio(85);
+       gpio_request(85, "tsc2101 irq");
        gpio_direction_input(85);
 
        omap_cfg_reg(W14_24XX_SYS_CLKOUT);      /* mclk */
index eff413a5e72767847bc0de707a5475730a6532f4..6592d581312413d56a84b91ec8b6e893687e2467 100644 (file)
@@ -228,7 +228,7 @@ out:
  */
 static void ads7846_dev_init(void)
 {
-       if (omap_request_gpio(ts_gpio) < 0) {
+       if (gpio_request(ts_gpio, "ads7846 irq") < 0) {
                printk(KERN_ERR "can't get ads746 pen down GPIO\n");
                return;
        }
@@ -334,7 +334,7 @@ static inline void __init ldp_init_smc911x(void)
 
        ldp_smc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio);
 
-       if (omap_request_gpio(eth_gpio) < 0) {
+       if (gpio_request(eth_gpio, "smc911x irq") < 0) {
                printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n",
                                eth_gpio);
                return;
index 04e68e88f1348a9c2e3d01e74974d7967509ee01..8d9dfe314387b0da08e7d6240724ceae62848afc 100644 (file)
@@ -87,16 +87,6 @@ extern void omap_set_gpio_debounce_time(int gpio, int enable);
 #include <linux/errno.h>
 #include <asm-generic/gpio.h>
 
-static inline int omap_request_gpio(int gpio)
-{
-       return gpio_request(gpio, "FIXME");
-}
-
-static inline void omap_free_gpio(int gpio)
-{
-       gpio_free(gpio);
-}
-
 static inline int gpio_get_value(unsigned gpio)
 {
        return __gpio_get_value(gpio);
index d1e0b8e7224bfa32a87aa8d5dabb37c657b8ae34..c260e2d6363d361c759cd72bb86a7e039444650a 100644 (file)
@@ -629,7 +629,7 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev)
        }
 
        if (c->gpio_irq) {
-               if ((r = omap_request_gpio(c->gpio_irq)) < 0) {
+               if ((r = gpio_request(c->gpio_irq, "OneNAND irq")) < 0) {
                        dev_err(&pdev->dev,  "Failed to request GPIO%d for "
                                "OneNAND\n", c->gpio_irq);
                        goto err_iounmap;
@@ -726,7 +726,7 @@ err_release_dma:
                free_irq(gpio_to_irq(c->gpio_irq), c);
 err_release_gpio:
        if (c->gpio_irq)
-               omap_free_gpio(c->gpio_irq);
+               gpio_free(c->gpio_irq);
 err_iounmap:
        iounmap(c->onenand.base);
 err_release_mem_region:
@@ -761,7 +761,7 @@ static int __devexit omap2_onenand_remove(struct platform_device *pdev)
        platform_set_drvdata(pdev, NULL);
        if (c->gpio_irq) {
                free_irq(gpio_to_irq(c->gpio_irq), c);
-               omap_free_gpio(c->gpio_irq);
+               gpio_free(c->gpio_irq);
        }
        iounmap(c->onenand.base);
        release_mem_region(c->phys_base, ONENAND_IO_SIZE);
index 69af1253676f2897c3564e19ea8138e2edf54de6..892523012717fe1f4e6689f3677cc7558de06f5c 100644 (file)
@@ -64,8 +64,8 @@
 static int ldp_panel_init(struct lcd_panel *panel,
                                struct omapfb_device *fbdev)
 {
-       omap_request_gpio(LCD_PANEL_RESET_GPIO);
-       omap_request_gpio(LCD_PANEL_QVGA_GPIO);
+       gpio_request(LCD_PANEL_RESET_GPIO, "lcd reset");
+       gpio_request(LCD_PANEL_QVGA_GPIO, "lcd qvga");
        gpio_request(LCD_PANEL_ENABLE_GPIO, "lcd panel");
        gpio_request(LCD_PANEL_BACKLIGHT_GPIO, "lcd backlight");
 
@@ -75,19 +75,19 @@ static int ldp_panel_init(struct lcd_panel *panel,
        gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 0);
 
 #ifdef CONFIG_FB_OMAP_LCD_VGA
-       omap_set_gpio_dataout(LCD_PANEL_QVGA_GPIO, 0);
+       gpio_set_value(LCD_PANEL_QVGA_GPIO, 0);
 #else
-       omap_set_gpio_dataout(LCD_PANEL_QVGA_GPIO, 1);
+       gpio_set_value(LCD_PANEL_QVGA_GPIO, 1);
 #endif
-       omap_set_gpio_dataout(LCD_PANEL_RESET_GPIO, 1);
+       gpio_set_value(LCD_PANEL_RESET_GPIO, 1);
 
        return 0;
 }
 
 static void ldp_panel_cleanup(struct lcd_panel *panel)
 {
-       omap_free_gpio(LCD_PANEL_RESET_GPIO);
-       omap_free_gpio(LCD_PANEL_QVGA_GPIO);
+       gpio_free(LCD_PANEL_RESET_GPIO);
+       gpio_free(LCD_PANEL_QVGA_GPIO);
        gpio_free(LCD_PANEL_ENABLE_GPIO);
        gpio_free(LCD_PANEL_BACKLIGHT_GPIO);
 }