From a9456ccc5d6eae2804a0f181fcd42051e2c8b826 Mon Sep 17 00:00:00 2001 From: Jarkko Nikula Date: Wed, 7 Jan 2009 12:54:34 +0200 Subject: [PATCH] ARM: OMAP: Fix gpio by switching to generic gpio calls Fix compile by removing remaining omap specific gpio calls. Based on earlier patches by Jarkko Nikula. Signed-off-by: Jarkko Nikula Signed-off-by: Tony Lindgren --- arch/arm/mach-omap1/board-h2.c | 4 ++-- arch/arm/mach-omap1/board-sx1.c | 6 +++--- arch/arm/mach-omap2/board-2430sdp.c | 2 +- arch/arm/mach-omap2/board-apollon.c | 6 +++--- arch/arm/mach-omap2/board-ldp.c | 4 ++-- arch/arm/plat-omap/include/mach/gpio.h | 10 ---------- drivers/mtd/onenand/omap2.c | 6 +++--- drivers/video/omap/lcd_ldp.c | 14 +++++++------- 8 files changed, 21 insertions(+), 31 deletions(-) diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c index 6f29f935bc6..359f6e4e530 100644 --- a/arch/arm/mach-omap1/board-h2.c +++ b/arch/arm/mach-omap1/board-h2.c @@ -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 diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c index 5b1e61840d6..c602729f622 100644 --- a/arch/arm/mach-omap1/board-sx1.c +++ b/arch/arm/mach-omap1/board-sx1.c @@ -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 */ diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index 669cd15d2cc..5d2933d7a75 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c @@ -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); diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index 755f93b0a56..c2ef58ae832 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c @@ -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 */ diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index eff413a5e72..6592d581312 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c @@ -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; diff --git a/arch/arm/plat-omap/include/mach/gpio.h b/arch/arm/plat-omap/include/mach/gpio.h index 04e68e88f13..8d9dfe31438 100644 --- a/arch/arm/plat-omap/include/mach/gpio.h +++ b/arch/arm/plat-omap/include/mach/gpio.h @@ -87,16 +87,6 @@ extern void omap_set_gpio_debounce_time(int gpio, int enable); #include #include -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); diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c index d1e0b8e7224..c260e2d6363 100644 --- a/drivers/mtd/onenand/omap2.c +++ b/drivers/mtd/onenand/omap2.c @@ -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); diff --git a/drivers/video/omap/lcd_ldp.c b/drivers/video/omap/lcd_ldp.c index 69af1253676..89252301271 100644 --- a/drivers/video/omap/lcd_ldp.c +++ b/drivers/video/omap/lcd_ldp.c @@ -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); } -- 2.41.0