Commit a9456ccc authored by Jarkko Nikula's avatar Jarkko Nikula Committed by Tony Lindgren

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: default avatarJarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 1f257594
......@@ -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
......
......@@ -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 */
......
......@@ -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);
......
......@@ -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 */
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment