public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC 0/21 Continue phasing out legacy GPIO calls
@ 2008-10-29 11:36 Jarkko Nikula
  2008-10-29 11:36 ` [RFC 01/21] ARM: OMAP: Clean-up OMAP GPIO request/free functions Jarkko Nikula
                   ` (21 more replies)
  0 siblings, 22 replies; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap

This set continues OMAP gpio call clean-up started by David Brownell and
is generated on top of his rebased set.

First patch is the important one here and remaining set gradually
convert omap_request_gpio and omap_free_gpio calls to use gpiolib
gpio_request and gpio_free calls with hopefully sensible name label.

Probably bit overkill size set but wanted to separate them some sort of
logical way for easier mainline merge. I can combine them if needed.

Build and boot tested only on N810. Will do test builds later on as well but
wanted to get some early comments as early as possible :-)


-- 
Jarkko

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [RFC 01/21] ARM: OMAP: Clean-up OMAP GPIO request/free functions
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
@ 2008-10-29 11:36 ` Jarkko Nikula
  2008-10-29 17:49   ` David Brownell
  2008-10-29 11:36 ` [RFC 02/21] OneNAND OMAP2: Complete gpiolib conversion Jarkko Nikula
                   ` (20 subsequent siblings)
  21 siblings, 1 reply; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

- Rename and declare static OMAP specific GPIO request/free functions
- Register them into gpiolib as chip-specific hooks
- Add omap_request_gpio/omap_free_gpio wrappers for existing code not
  converted yet to use gpiolib

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 arch/arm/plat-omap/gpio.c              |   41 +++++++++++---------------------
 arch/arm/plat-omap/include/mach/gpio.h |   12 +++++++-
 2 files changed, 24 insertions(+), 29 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index e9954a4..1e2204e 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -885,26 +885,21 @@ static int gpio_wake_enable(unsigned int irq, unsigned int enable)
 	return retval;
 }
 
-int omap_request_gpio(int gpio)
+static int omap_gpio_request(struct gpio_chip *chip, unsigned offset)
 {
 	struct gpio_bank *bank;
 	unsigned long flags;
-	int status;
 
-	if (check_gpio(gpio) < 0)
+	bank = container_of(chip, struct gpio_bank, chip);
+	if (check_gpio(bank->chip.base + offset) < 0)
 		return -EINVAL;
 
-	status = gpio_request(gpio, NULL);
-	if (status < 0)
-		return status;
-
-	bank = get_gpio_bank(gpio);
 	spin_lock_irqsave(&bank->lock, flags);
 
 	/* Set trigger to none. You need to enable the desired trigger with
 	 * request_irq() or set_irq_type().
 	 */
-	_set_gpio_triggering(bank, get_gpio_index(gpio), IRQ_TYPE_NONE);
+	_set_gpio_triggering(bank, offset, IRQ_TYPE_NONE);
 
 #ifdef CONFIG_ARCH_OMAP15XX
 	if (bank->method == METHOD_GPIO_1510) {
@@ -912,7 +907,7 @@ int omap_request_gpio(int gpio)
 
 		/* Claim the pin for MPU */
 		reg = bank->base + OMAP1510_GPIO_PIN_CONTROL;
-		__raw_writel(__raw_readl(reg) | (1 << get_gpio_index(gpio)), reg);
+		__raw_writel(__raw_readl(reg) | (1 << offset), reg);
 	}
 #endif
 	spin_unlock_irqrestore(&bank->lock, flags);
@@ -920,39 +915,32 @@ int omap_request_gpio(int gpio)
 	return 0;
 }
 
-void omap_free_gpio(int gpio)
+static void omap_gpio_free(struct gpio_chip *chip, unsigned offset)
 {
 	struct gpio_bank *bank;
 	unsigned long flags;
 
-	if (check_gpio(gpio) < 0)
+	bank = container_of(chip, struct gpio_bank, chip);
+	if (check_gpio(bank->chip.base + offset) < 0)
 		return;
-	bank = get_gpio_bank(gpio);
+
 	spin_lock_irqsave(&bank->lock, flags);
-	if (unlikely(!gpiochip_is_requested(&bank->chip,
-				get_gpio_index(gpio)))) {
-		spin_unlock_irqrestore(&bank->lock, flags);
-		printk(KERN_ERR "omap-gpio: GPIO %d wasn't reserved!\n", gpio);
-		dump_stack();
-		return;
-	}
 #ifdef CONFIG_ARCH_OMAP16XX
 	if (bank->method == METHOD_GPIO_1610) {
 		/* Disable wake-up during idle for dynamic tick */
 		void __iomem *reg = bank->base + OMAP1610_GPIO_CLEAR_WAKEUPENA;
-		__raw_writel(1 << get_gpio_index(gpio), reg);
+		__raw_writel(1 << offset, reg);
 	}
 #endif
 #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
 	if (bank->method == METHOD_GPIO_24XX) {
 		/* Disable wake-up during idle for dynamic tick */
 		void __iomem *reg = bank->base + OMAP24XX_GPIO_CLEARWKUENA;
-		__raw_writel(1 << get_gpio_index(gpio), reg);
+		__raw_writel(1 << offset, reg);
 	}
 #endif
-	_reset_gpio(bank, gpio);
+	_reset_gpio(bank, bank->chip.base + offset);
 	spin_unlock_irqrestore(&bank->lock, flags);
-	gpio_free(gpio);
 }
 
 /*
@@ -1457,6 +1445,8 @@ static int __init _omap_gpio_init(void)
 		/* REVISIT eventually switch from OMAP-specific gpio structs
 		 * over to the generic ones
 		 */
+		bank->chip.request = omap_gpio_request;
+		bank->chip.free = omap_gpio_free;
 		bank->chip.direction_input = gpio_input;
 		bank->chip.get = gpio_get;
 		bank->chip.direction_output = gpio_output;
@@ -1725,9 +1715,6 @@ static int __init omap_gpio_sysinit(void)
 	return ret;
 }
 
-EXPORT_SYMBOL(omap_request_gpio);
-EXPORT_SYMBOL(omap_free_gpio);
-
 arch_initcall(omap_gpio_sysinit);
 
 
diff --git a/arch/arm/plat-omap/include/mach/gpio.h b/arch/arm/plat-omap/include/mach/gpio.h
index 552ad0c..04e68e8 100644
--- a/arch/arm/plat-omap/include/mach/gpio.h
+++ b/arch/arm/plat-omap/include/mach/gpio.h
@@ -71,8 +71,6 @@
 				 IH_GPIO_BASE + (nr))
 
 extern int omap_gpio_init(void);	/* Call from board init only */
-extern int omap_request_gpio(int gpio);
-extern void omap_free_gpio(int gpio);
 extern void omap2_gpio_prepare_for_retention(void);
 extern void omap2_gpio_resume_after_retention(void);
 extern void omap_set_gpio_debounce(int gpio, int enable);
@@ -89,6 +87,16 @@ 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);
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC 02/21] OneNAND OMAP2: Complete gpiolib conversion
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
  2008-10-29 11:36 ` [RFC 01/21] ARM: OMAP: Clean-up OMAP GPIO request/free functions Jarkko Nikula
@ 2008-10-29 11:36 ` Jarkko Nikula
  2008-10-29 11:36 ` [RFC 03/21] SPI: TSC2301: " Jarkko Nikula
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 drivers/mtd/onenand/omap2.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
index 1298563..87b5120 100644
--- a/drivers/mtd/onenand/omap2.c
+++ b/drivers/mtd/onenand/omap2.c
@@ -32,12 +32,12 @@
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
+#include <linux/gpio.h>
 
 #include <asm/io.h>
 #include <asm/mach/flash.h>
 #include <mach/gpmc.h>
 #include <mach/onenand.h>
-#include <mach/gpio.h>
 #include <mach/pm.h>
 
 #include <linux/dma-mapping.h>
@@ -630,7 +630,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;
@@ -727,7 +727,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:
@@ -762,7 +762,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);
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC 03/21] SPI: TSC2301: Complete gpiolib conversion
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
  2008-10-29 11:36 ` [RFC 01/21] ARM: OMAP: Clean-up OMAP GPIO request/free functions Jarkko Nikula
  2008-10-29 11:36 ` [RFC 02/21] OneNAND OMAP2: Complete gpiolib conversion Jarkko Nikula
@ 2008-10-29 11:36 ` Jarkko Nikula
  2008-10-29 11:36 ` [RFC 04/21] ARM: OMAP: Complete LCD panel " Jarkko Nikula
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 drivers/spi/tsc2301-core.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/spi/tsc2301-core.c b/drivers/spi/tsc2301-core.c
index 715e400..4b565b7 100644
--- a/drivers/spi/tsc2301-core.c
+++ b/drivers/spi/tsc2301-core.c
@@ -22,13 +22,10 @@
 #include <linux/module.h>
 #include <linux/device.h>
 #include <linux/delay.h>
+#include <linux/gpio.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/tsc2301.h>
 
-#ifdef CONFIG_ARCH_OMAP
-#include <mach/gpio.h>
-#endif
-
 u16 tsc2301_read_reg(struct tsc2301 *tsc, int reg)
 {
 	struct spi_transfer t[2];
@@ -157,14 +154,12 @@ static int __devinit tsc2301_probe(struct spi_device *spi)
 
 	if (pdata->reset_gpio >= 0) {
 		tsc->reset_gpio = pdata->reset_gpio;
-#ifdef CONFIG_ARCH_OMAP
-		r = omap_request_gpio(tsc->reset_gpio);
+		r = gpio_request(tsc->reset_gpio, "TSC2301 reset");
 		if (r < 0)
 			goto err1;
 		gpio_direction_output(tsc->reset_gpio, 1);
 		mdelay(1);
 		gpio_set_value(tsc->reset_gpio, 0);
-#endif
 	} else
 		tsc->reset_gpio = -1;
 
@@ -229,8 +224,10 @@ static int __devexit tsc2301_remove(struct spi_device *spi)
 	struct tsc2301 *tsc = dev_get_drvdata(&spi->dev);
 
 	tsc2301_mixer_exit(tsc);
-        tsc2301_ts_exit(tsc);
-        tsc2301_kp_exit(tsc);
+	tsc2301_ts_exit(tsc);
+	tsc2301_kp_exit(tsc);
+	if (tsc->reset_gpio >= 0)
+		gpio_free(tsc->reset_gpio);
 	kfree(tsc);
 
 	return 0;
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC 04/21] ARM: OMAP: Complete LCD panel gpiolib conversion
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
                   ` (2 preceding siblings ...)
  2008-10-29 11:36 ` [RFC 03/21] SPI: TSC2301: " Jarkko Nikula
@ 2008-10-29 11:36 ` Jarkko Nikula
  2008-10-29 11:36 ` [RFC 05/21] Complete brf6150 and hci_h4p " Jarkko Nikula
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 drivers/video/omap/lcd_2430sdp.c     |    6 +++---
 drivers/video/omap/lcd_omap2evm.c    |   14 +++++++-------
 drivers/video/omap/lcd_omap3beagle.c |    4 ++--
 drivers/video/omap/lcd_omap3evm.c    |   12 ++++++------
 4 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/video/omap/lcd_2430sdp.c b/drivers/video/omap/lcd_2430sdp.c
index d60e846..2763117 100644
--- a/drivers/video/omap/lcd_2430sdp.c
+++ b/drivers/video/omap/lcd_2430sdp.c
@@ -24,9 +24,9 @@
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/delay.h>
+#include <linux/gpio.h>
 #include <linux/i2c/twl4030.h>
 
-#include <mach/gpio.h>
 #include <mach/mux.h>
 #include <mach/omapfb.h>
 #include <asm/mach-types.h>
@@ -65,8 +65,8 @@ static int sdp2430_panel_init(struct lcd_panel *panel,
 		backlight_gpio = SDP2430_LCD_PANEL_BACKLIGHT_GPIO;
 	}
 
-	omap_request_gpio(enable_gpio);			/* LCD panel */
-	omap_request_gpio(backlight_gpio);		/* LCD backlight */
+	gpio_request(enable_gpio, "LCD enable");	/* LCD panel */
+	gpio_request(backlight_gpio, "LCD bl");		/* LCD backlight */
 	gpio_direction_output(enable_gpio, 0);
 	gpio_direction_output(backlight_gpio, 0);
 
diff --git a/drivers/video/omap/lcd_omap2evm.c b/drivers/video/omap/lcd_omap2evm.c
index 424fbae..2fc46c2 100644
--- a/drivers/video/omap/lcd_omap2evm.c
+++ b/drivers/video/omap/lcd_omap2evm.c
@@ -23,9 +23,9 @@
 
 #include <linux/module.h>
 #include <linux/platform_device.h>
+#include <linux/gpio.h>
 #include <linux/i2c/twl4030.h>
 
-#include <mach/gpio.h>
 #include <mach/mux.h>
 #include <mach/omapfb.h>
 #include <asm/mach-types.h>
@@ -50,12 +50,12 @@ static unsigned int bklight_level;
 static int omap2evm_panel_init(struct lcd_panel *panel,
 				struct omapfb_device *fbdev)
 {
-	omap_request_gpio(LCD_PANEL_ENABLE_GPIO);
-	omap_request_gpio(LCD_PANEL_LR);
-	omap_request_gpio(LCD_PANEL_UD);
-	omap_request_gpio(LCD_PANEL_INI);
-	omap_request_gpio(LCD_PANEL_QVGA);
-	omap_request_gpio(LCD_PANEL_RESB);
+	gpio_request(LCD_PANEL_ENABLE_GPIO, "LCD enable");
+	gpio_request(LCD_PANEL_LR, "LCD lr");
+	gpio_request(LCD_PANEL_UD, "LCD ud");
+	gpio_request(LCD_PANEL_INI, "LCD ini");
+	gpio_request(LCD_PANEL_QVGA, "LCD qvga");
+	gpio_request(LCD_PANEL_RESB, "LCD resb");
 
 	gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 1);
 	gpio_direction_output(LCD_PANEL_RESB, 1);
diff --git a/drivers/video/omap/lcd_omap3beagle.c b/drivers/video/omap/lcd_omap3beagle.c
index 0c779e4..eae43e4 100644
--- a/drivers/video/omap/lcd_omap3beagle.c
+++ b/drivers/video/omap/lcd_omap3beagle.c
@@ -22,9 +22,9 @@
 
 #include <linux/module.h>
 #include <linux/platform_device.h>
+#include <linux/gpio.h>
 #include <linux/i2c/twl4030.h>
 
-#include <mach/gpio.h>
 #include <mach/mux.h>
 #include <mach/omapfb.h>
 #include <asm/mach-types.h>
@@ -38,7 +38,7 @@
 static int omap3beagle_panel_init(struct lcd_panel *panel,
 				struct omapfb_device *fbdev)
 {
-	omap_request_gpio(LCD_PANEL_ENABLE_GPIO);
+	gpio_request(LCD_PANEL_ENABLE_GPIO, "LCD enable");
 	return 0;
 }
 
diff --git a/drivers/video/omap/lcd_omap3evm.c b/drivers/video/omap/lcd_omap3evm.c
index 90aa015..1c3d814 100644
--- a/drivers/video/omap/lcd_omap3evm.c
+++ b/drivers/video/omap/lcd_omap3evm.c
@@ -22,9 +22,9 @@
 
 #include <linux/module.h>
 #include <linux/platform_device.h>
+#include <linux/gpio.h>
 #include <linux/i2c/twl4030.h>
 
-#include <mach/gpio.h>
 #include <mach/mux.h>
 #include <mach/omapfb.h>
 #include <asm/mach-types.h>
@@ -54,11 +54,11 @@ static unsigned int bklight_level;
 static int omap3evm_panel_init(struct lcd_panel *panel,
 				struct omapfb_device *fbdev)
 {
-	omap_request_gpio(LCD_PANEL_LR);
-	omap_request_gpio(LCD_PANEL_UD);
-	omap_request_gpio(LCD_PANEL_INI);
-	omap_request_gpio(LCD_PANEL_RESB);
-	omap_request_gpio(LCD_PANEL_QVGA);
+	gpio_request(LCD_PANEL_LR, "LCD lr");
+	gpio_request(LCD_PANEL_UD, "LCD ud");
+	gpio_request(LCD_PANEL_INI, "LCD ini");
+	gpio_request(LCD_PANEL_RESB, "LCD resb");
+	gpio_request(LCD_PANEL_QVGA, "LCD qvga");
 
 	gpio_direction_output(LCD_PANEL_RESB, 1);
 	gpio_direction_output(LCD_PANEL_INI, 1);
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC 05/21] Complete brf6150 and hci_h4p gpiolib conversion
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
                   ` (3 preceding siblings ...)
  2008-10-29 11:36 ` [RFC 04/21] ARM: OMAP: Complete LCD panel " Jarkko Nikula
@ 2008-10-29 11:36 ` Jarkko Nikula
  2008-10-29 11:36 ` [RFC 06/21] CBUS: Complete " Jarkko Nikula
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 drivers/bluetooth/brf6150.c      |   26 +++++++++++++-------------
 drivers/bluetooth/hci_h4p/core.c |   26 +++++++++++++-------------
 2 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/drivers/bluetooth/brf6150.c b/drivers/bluetooth/brf6150.c
index 256ecde..2d22aec 100644
--- a/drivers/bluetooth/brf6150.c
+++ b/drivers/bluetooth/brf6150.c
@@ -33,9 +33,9 @@
 #include <linux/timer.h>
 #include <linux/clk.h>
 #include <linux/platform_device.h>
+#include <linux/gpio.h>
 
 #include <mach/hardware.h>
-#include <mach/gpio.h>
 #include <mach/board.h>
 #include <mach/irqs.h>
 
@@ -913,7 +913,7 @@ static int __init brf6150_init(void)
 	NBT_DBG("Uart: %d\n", info->btinfo->bt_uart);
 	NBT_DBG("sysclk: %d\n", info->btinfo->bt_sysclk);
 
-	err = omap_request_gpio(info->btinfo->reset_gpio);
+	err = gpio_request(info->btinfo->reset_gpio, "BT reset");
 	if (err < 0)
 	{
 		printk(KERN_WARNING "Cannot get GPIO line %d", 
@@ -922,23 +922,23 @@ static int __init brf6150_init(void)
 		return err;
 	}
 
-	err = omap_request_gpio(info->btinfo->bt_wakeup_gpio);
+	err = gpio_request(info->btinfo->bt_wakeup_gpio, "BT wakeup");
 	if (err < 0)
 	{
 		printk(KERN_WARNING "Cannot get GPIO line 0x%d",
 		       info->btinfo->bt_wakeup_gpio);
-		omap_free_gpio(info->btinfo->reset_gpio);
+		gpio_free(info->btinfo->reset_gpio);
 		kfree(info);
 		return err;
 	}
 
-	err = omap_request_gpio(info->btinfo->host_wakeup_gpio);
+	err = gpio_request(info->btinfo->host_wakeup_gpio, "BT host wakeup");
 	if (err < 0)
 	{
 		printk(KERN_WARNING "Cannot get GPIO line %d",
 		       info->btinfo->host_wakeup_gpio);
-		omap_free_gpio(info->btinfo->reset_gpio);
-		omap_free_gpio(info->btinfo->bt_wakeup_gpio);
+		gpio_free(info->btinfo->reset_gpio);
+		gpio_free(info->btinfo->bt_wakeup_gpio);
 		kfree(info);
 		return err;
 	}
@@ -1022,9 +1022,9 @@ cleanup_irq:
 	free_irq(irq, (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);
-	omap_free_gpio(info->btinfo->host_wakeup_gpio);
+	gpio_free(info->btinfo->reset_gpio);
+	gpio_free(info->btinfo->bt_wakeup_gpio);
+	gpio_free(info->btinfo->host_wakeup_gpio);
 	kfree(info);
 
 	return err;
@@ -1034,9 +1034,9 @@ static void __exit brf6150_exit(void)
 {
 	brf6150_hci_close(exit_info->hdev);
 	hci_free_dev(exit_info->hdev);
-	omap_free_gpio(exit_info->btinfo->reset_gpio);
-	omap_free_gpio(exit_info->btinfo->bt_wakeup_gpio);
-	omap_free_gpio(exit_info->btinfo->host_wakeup_gpio);
+	gpio_free(exit_info->btinfo->reset_gpio);
+	gpio_free(exit_info->btinfo->bt_wakeup_gpio);
+	gpio_free(exit_info->btinfo->host_wakeup_gpio);
 	free_irq(exit_info->irq, (void *)exit_info);
 	free_irq(gpio_to_irq(exit_info->btinfo->host_wakeup_gpio), (void *)exit_info);
 	kfree(exit_info);
diff --git a/drivers/bluetooth/hci_h4p/core.c b/drivers/bluetooth/hci_h4p/core.c
index 9964a0c..a5b76ad 100644
--- a/drivers/bluetooth/hci_h4p/core.c
+++ b/drivers/bluetooth/hci_h4p/core.c
@@ -34,9 +34,9 @@
 #include <linux/device.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
+#include <linux/gpio.h>
 
 #include <mach/hardware.h>
-#include <mach/gpio.h>
 #include <mach/board.h>
 #include <mach/irqs.h>
 #include <mach/pm.h>
@@ -823,7 +823,7 @@ static int hci_h4p_probe(struct platform_device *pdev)
 	NBT_DBG("Uart: %d\n", bt_config->bt_uart);
 	NBT_DBG("sysclk: %d\n", info->bt_sysclk);
 
-	err = omap_request_gpio(info->reset_gpio);
+	err = gpio_request(info->reset_gpio, "BT reset");
 	if (err < 0) {
 		dev_err(&pdev->dev, "Cannot get GPIO line %d\n",
 			info->reset_gpio);
@@ -831,23 +831,23 @@ static int hci_h4p_probe(struct platform_device *pdev)
 		goto cleanup;
 	}
 
-	err = omap_request_gpio(info->bt_wakeup_gpio);
+	err = gpio_request(info->bt_wakeup_gpio, "BT wakeup");
 	if (err < 0)
 	{
 		dev_err(info->dev, "Cannot get GPIO line 0x%d",
 			info->bt_wakeup_gpio);
-		omap_free_gpio(info->reset_gpio);
+		gpio_free(info->reset_gpio);
 		kfree(info);
 		goto cleanup;
 	}
 
-	err = omap_request_gpio(info->host_wakeup_gpio);
+	err = gpio_request(info->host_wakeup_gpio, "BT host wakeup");
 	if (err < 0)
 	{
 		dev_err(info->dev, "Cannot get GPIO line %d",
 		       info->host_wakeup_gpio);
-		omap_free_gpio(info->reset_gpio);
-		omap_free_gpio(info->bt_wakeup_gpio);
+		gpio_free(info->reset_gpio);
+		gpio_free(info->bt_wakeup_gpio);
 		kfree(info);
 		goto cleanup;
 	}
@@ -953,9 +953,9 @@ cleanup_irq:
 	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);
-	omap_free_gpio(info->bt_wakeup_gpio);
-	omap_free_gpio(info->host_wakeup_gpio);
+	gpio_free(info->reset_gpio);
+	gpio_free(info->bt_wakeup_gpio);
+	gpio_free(info->host_wakeup_gpio);
 	kfree(info);
 
 	return err;
@@ -971,9 +971,9 @@ static int hci_h4p_remove(struct platform_device *dev)
 	hci_h4p_hci_close(info->hdev);
 	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);
-	omap_free_gpio(info->host_wakeup_gpio);
+	gpio_free(info->reset_gpio);
+	gpio_free(info->bt_wakeup_gpio);
+	gpio_free(info->host_wakeup_gpio);
 	free_irq(info->irq, (void *) info);
 	kfree(info);
 
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC 06/21] CBUS: Complete gpiolib conversion
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
                   ` (4 preceding siblings ...)
  2008-10-29 11:36 ` [RFC 05/21] Complete brf6150 and hci_h4p " Jarkko Nikula
@ 2008-10-29 11:36 ` Jarkko Nikula
  2008-10-29 11:36 ` [RFC 07/21] INPUT: TSC2005: " Jarkko Nikula
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 drivers/cbus/cbus.c  |   12 ++++++------
 drivers/cbus/retu.c  |   10 +++++-----
 drivers/cbus/tahvo.c |   10 +++++-----
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/cbus/cbus.c b/drivers/cbus/cbus.c
index 1a184b0..020afad 100644
--- a/drivers/cbus/cbus.c
+++ b/drivers/cbus/cbus.c
@@ -28,8 +28,8 @@
 #include <linux/kernel.h>
 #include <linux/delay.h>
 #include <linux/spinlock.h>
+#include <linux/gpio.h>
 
-#include <mach/gpio.h>
 #include <mach/board.h>
 
 #include <asm/io.h>
@@ -253,13 +253,13 @@ int __init cbus_bus_init(void)
 	}
 #endif
 
-	if ((ret = omap_request_gpio(chost->clk_gpio)) < 0)
+	if ((ret = gpio_request(chost->clk_gpio, "CBUS clk")) < 0)
 		goto exit1;
 
-	if ((ret = omap_request_gpio(chost->dat_gpio)) < 0)
+	if ((ret = gpio_request(chost->dat_gpio, "CBUS data")) < 0)
 		goto exit2;
 
-	if ((ret = omap_request_gpio(chost->sel_gpio)) < 0)
+	if ((ret = gpio_request(chost->sel_gpio, "CBUS sel")) < 0)
 		goto exit3;
 
 	gpio_direction_output(chost->clk_gpio, 0);
@@ -273,9 +273,9 @@ int __init cbus_bus_init(void)
 
 	return 0;
 exit3:
-	omap_free_gpio(chost->dat_gpio);
+	gpio_free(chost->dat_gpio);
 exit2:
-	omap_free_gpio(chost->clk_gpio);
+	gpio_free(chost->clk_gpio);
 exit1:
 	kfree(chost);
 	return ret;
diff --git a/drivers/cbus/retu.c b/drivers/cbus/retu.c
index 5f9a20a..35ea149 100644
--- a/drivers/cbus/retu.c
+++ b/drivers/cbus/retu.c
@@ -35,11 +35,11 @@
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
+#include <linux/gpio.h>
 
 #include <asm/uaccess.h>
 
 #include <mach/mux.h>
-#include <mach/gpio.h>
 #include <mach/board.h>
 
 #include "cbus.h"
@@ -335,7 +335,7 @@ static int __devinit retu_probe(struct device *dev)
 
 	retu_irq_pin = em_asic_config->retu_irq_gpio;
 
-	if ((ret = omap_request_gpio(retu_irq_pin)) < 0) {
+	if ((ret = gpio_request(retu_irq_pin, "RETU irq")) < 0) {
 		printk(KERN_ERR PFX "Unable to reserve IRQ GPIO\n");
 		return ret;
 	}
@@ -362,7 +362,7 @@ static int __devinit retu_probe(struct device *dev)
 			  "retu", 0);
 	if (ret < 0) {
 		printk(KERN_ERR PFX "Unable to register IRQ handler\n");
-		omap_free_gpio(retu_irq_pin);
+		gpio_free(retu_irq_pin);
 		return ret;
 	}
 	set_irq_wake(gpio_to_irq(retu_irq_pin), 1);
@@ -375,7 +375,7 @@ static int __devinit retu_probe(struct device *dev)
 	if (retu_user_init() < 0) {
 		printk(KERN_ERR "Unable to initialize driver\n");
 		free_irq(gpio_to_irq(retu_irq_pin), 0);
-		omap_free_gpio(retu_irq_pin);
+		gpio_free(retu_irq_pin);
 		return ret;
 	}
 #endif
@@ -391,7 +391,7 @@ static int retu_remove(struct device *dev)
 	/* Mask all RETU interrupts */
 	retu_write_reg(RETU_REG_IMR, 0xffff);
 	free_irq(gpio_to_irq(retu_irq_pin), 0);
-	omap_free_gpio(retu_irq_pin);
+	gpio_free(retu_irq_pin);
 	tasklet_kill(&retu_tasklet);
 
 	return 0;
diff --git a/drivers/cbus/tahvo.c b/drivers/cbus/tahvo.c
index fe665d4..eab593f 100644
--- a/drivers/cbus/tahvo.c
+++ b/drivers/cbus/tahvo.c
@@ -35,11 +35,11 @@
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
+#include <linux/gpio.h>
 
 #include <asm/uaccess.h>
 
 #include <mach/mux.h>
-#include <mach/gpio.h>
 #include <mach/board.h>
 
 #include "cbus.h"
@@ -322,7 +322,7 @@ static int __devinit tahvo_probe(struct device *dev)
 
 	tahvo_irq_pin = em_asic_config->tahvo_irq_gpio;
 
-	if ((ret = omap_request_gpio(tahvo_irq_pin)) < 0) {
+	if ((ret = gpio_request(tahvo_irq_pin, "TAHVO irq")) < 0) {
 		printk(KERN_ERR PFX "Unable to reserve IRQ GPIO\n");
 		return ret;
 	}
@@ -340,7 +340,7 @@ static int __devinit tahvo_probe(struct device *dev)
 			  "tahvo", 0);
 	if (ret < 0) {
 		printk(KERN_ERR PFX "Unable to register IRQ handler\n");
-		omap_free_gpio(tahvo_irq_pin);
+		gpio_free(tahvo_irq_pin);
 		return ret;
 	}
 #ifdef CONFIG_CBUS_TAHVO_USER
@@ -348,7 +348,7 @@ static int __devinit tahvo_probe(struct device *dev)
 	if (tahvo_user_init() < 0) {
 		printk(KERN_ERR "Unable to initialize driver\n");
 		free_irq(gpio_to_irq(tahvo_irq_pin), 0);
-		omap_free_gpio(tahvo_irq_pin);
+		gpio_free(tahvo_irq_pin);
 		return ret;
 	}
 #endif
@@ -363,7 +363,7 @@ static int tahvo_remove(struct device *dev)
 	/* Mask all TAHVO interrupts */
 	tahvo_write_reg(TAHVO_REG_IMR, 0xffff);
 	free_irq(gpio_to_irq(tahvo_irq_pin), 0);
-	omap_free_gpio(tahvo_irq_pin);
+	gpio_free(tahvo_irq_pin);
 	tasklet_kill(&tahvo_tasklet);
 
 	return 0;
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC 07/21] INPUT: TSC2005: Complete gpiolib conversion
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
                   ` (5 preceding siblings ...)
  2008-10-29 11:36 ` [RFC 06/21] CBUS: Complete " Jarkko Nikula
@ 2008-10-29 11:36 ` Jarkko Nikula
  2008-10-29 11:36 ` [RFC 08/21] INPUT: TS_Hx: " Jarkko Nikula
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 drivers/input/touchscreen/tsc2005.c |   18 +++++-------------
 1 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c
index 38ac537..03c3a10 100644
--- a/drivers/input/touchscreen/tsc2005.c
+++ b/drivers/input/touchscreen/tsc2005.c
@@ -27,12 +27,9 @@
 #include <linux/input.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
+#include <linux/gpio.h>
 #include <linux/spi/spi.h>
 
-#ifdef CONFIG_ARCH_OMAP
-#include <mach/gpio.h>
-#endif
-
 #include <linux/spi/tsc2005.h>
 
 /**
@@ -534,8 +531,7 @@ static int __devinit tsc2005_ts_init(struct tsc2005 *ts,
 	ts->dav_gpio = dav_gpio;
 	dev_dbg(&ts->spi->dev, "TSC2005: DAV GPIO = %d\n", dav_gpio);
 
-#ifdef CONFIG_ARCH_OMAP
-	r = omap_request_gpio(dav_gpio);
+	r = gpio_request(dav_gpio, "TSC2005 dav");
 	if (r < 0) {
 		dev_err(&ts->spi->dev, "unable to get DAV GPIO");
 		goto err1;
@@ -543,7 +539,7 @@ static int __devinit tsc2005_ts_init(struct tsc2005 *ts,
 	gpio_direction_input(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);
 	setup_timer(&ts->penup_timer, tsc2005_ts_penup_timer_handler,
 			(unsigned long)ts);
@@ -612,9 +608,7 @@ err3:
 	tsc2005_stop_scan(ts);
 	input_free_device(idev);
 err2:
-#ifdef CONFIG_ARCH_OMAP
-	omap_free_gpio(dav_gpio);
-#endif
+	gpio_free(dav_gpio);
 err1:
 	return r;
 }
@@ -672,9 +666,7 @@ static int __devexit tsc2005_remove(struct spi_device *spi)
 	free_irq(ts->irq, ts);
 	input_unregister_device(ts->idev);
 
-#ifdef CONFIG_ARCH_OMAP
-	omap_free_gpio(ts->dav_gpio);
-#endif
+	gpio_free(ts->dav_gpio);
 	kfree(ts);
 
 	return 0;
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC 08/21] INPUT: TS_Hx: Complete gpiolib conversion
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
                   ` (6 preceding siblings ...)
  2008-10-29 11:36 ` [RFC 07/21] INPUT: TSC2005: " Jarkko Nikula
@ 2008-10-29 11:36 ` Jarkko Nikula
  2008-10-29 11:36 ` [RFC 09/21] OMAP: USB: " Jarkko Nikula
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 drivers/input/touchscreen/omap/ts_hx.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/omap/ts_hx.c b/drivers/input/touchscreen/omap/ts_hx.c
index 0ef7f6c..9d3ec97 100644
--- a/drivers/input/touchscreen/omap/ts_hx.c
+++ b/drivers/input/touchscreen/omap/ts_hx.c
@@ -28,8 +28,8 @@
 
 #include <linux/input.h>
 #include <linux/device.h>
+#include <linux/gpio.h>
 #include <asm/mach-types.h>
-#include <asm/arch/gpio.h>
 #include <asm/arch/mux.h>
 #include <asm/arch/hardware.h>
 #include <asm/hardware/tsc2101.h>
@@ -92,7 +92,7 @@ static int __init hx_ts_probe(struct omap_ts_t *ts)
 		return -ENODEV;
 
 	ts->irq = gpio_to_irq(gpio);
-	if (omap_request_gpio(gpio) != 0) {
+	if (gpio_request(gpio, "TS irq") != 0) {
 		printk(KERN_ERR "hX_ts_init.c: Could not reserve GPIO!\n");
 		return -EINVAL;
 	};
@@ -177,8 +177,8 @@ static void hx_ts_disable(void)
 static void __exit hx_ts_remove(void)
 {
 	if (machine_is_omap_h2())
-		omap_free_gpio(H2_GPIO_NUM);
+		gpio_free(H2_GPIO_NUM);
 	else if (machine_is_omap_h3())
-		omap_free_gpio(H3_GPIO_NUM);
+		gpio_free(H3_GPIO_NUM);
 }
 #endif
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC 09/21] OMAP: USB: Complete gpiolib conversion
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
                   ` (7 preceding siblings ...)
  2008-10-29 11:36 ` [RFC 08/21] INPUT: TS_Hx: " Jarkko Nikula
@ 2008-10-29 11:36 ` Jarkko Nikula
  2008-10-29 11:36 ` [RFC 10/21] LEDS: Complete leds-omap gpiolib conversion and do some fixes Jarkko Nikula
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 drivers/usb/host/ehci-omap.c |    8 ++++----
 drivers/usb/host/ohci-omap.c |    6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index 4dffba6..1b3266c 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -225,9 +225,9 @@ static int omap_start_ehc(struct platform_device *dev, struct usb_hcd *hcd)
 
 #ifdef EXTERNAL_PHY_RESET
 	/* Refer: ISSUE1 */
-	omap_request_gpio(EXT_PHY_RESET_GPIO_PORT1);
+	gpio_request(EXT_PHY_RESET_GPIO_PORT1, "USB1 PHY reset");
 	gpio_direction_output(EXT_PHY_RESET_GPIO_PORT1, 0);
-	omap_request_gpio(EXT_PHY_RESET_GPIO_PORT2);
+	gpio_request(EXT_PHY_RESET_GPIO_PORT2, "USB2 PHY reset");
 	gpio_direction_output(EXT_PHY_RESET_GPIO_PORT2, 0);
 	/* Hold the PHY in RESET for enough time till DIR is high */
 	udelay(EXT_PHY_RESET_DELAY);
@@ -393,8 +393,8 @@ static void omap_stop_ehc(struct platform_device *dev, struct usb_hcd *hcd)
 
 
 #ifdef EXTERNAL_PHY_RESET
-	omap_free_gpio(EXT_PHY_RESET_GPIO_PORT1);
-	omap_free_gpio(EXT_PHY_RESET_GPIO_PORT2);
+	gpio_free(EXT_PHY_RESET_GPIO_PORT1);
+	gpio_free(EXT_PHY_RESET_GPIO_PORT2);
 #endif
 
 	dev_dbg(hcd->self.controller,
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index 22f6d19..267b212 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -18,6 +18,7 @@
 #include <linux/jiffies.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
+#include <linux/gpio.h>
 
 #include <mach/hardware.h>
 #include <asm/io.h>
@@ -25,7 +26,6 @@
 
 #include <mach/mux.h>
 #include <mach/irqs.h>
-#include <mach/gpio.h>
 #include <mach/fpga.h>
 #include <mach/usb.h>
 
@@ -254,7 +254,7 @@ static int ohci_omap_init(struct usb_hcd *hcd)
 
 			/* gpio9 for overcurrent detction */
 			omap_cfg_reg(W8_1610_GPIO9);
-			omap_request_gpio(9);
+			gpio_request(9, "USB over current");
 			gpio_direction_input(9);
 
 			/* for paranoia's sake:  disable USB.PUEN */
@@ -407,7 +407,7 @@ usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev)
 		put_device(ohci->transceiver->dev);
 	}
 	if (machine_is_omap_osk())
-		omap_free_gpio(9);
+		gpio_free(9);
 	iounmap(hcd->regs);
 	release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
 	usb_put_hcd(hcd);
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC 10/21] LEDS: Complete leds-omap gpiolib conversion and do some fixes
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
                   ` (8 preceding siblings ...)
  2008-10-29 11:36 ` [RFC 09/21] OMAP: USB: " Jarkko Nikula
@ 2008-10-29 11:36 ` Jarkko Nikula
  2008-10-29 17:15   ` David Brownell
  2008-10-29 11:36 ` [RFC 11/21] ARM: OMAP: Complete N8x0 board file gpiolib conversion Jarkko Nikula
                   ` (11 subsequent siblings)
  21 siblings, 1 reply; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 drivers/leds/leds-omap.c |   24 +++++++++++-------------
 1 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/drivers/leds/leds-omap.c b/drivers/leds/leds-omap.c
index 46b4232..cb89e17 100644
--- a/drivers/leds/leds-omap.c
+++ b/drivers/leds/leds-omap.c
@@ -14,8 +14,8 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/leds.h>
+#include <linux/gpio.h>
 
-#include <mach/gpio.h>
 #include <mach/hardware.h>
 #include <mach/led.h>
 
@@ -34,15 +34,6 @@ static void omap_set_led_gpio(struct led_classdev *led_cdev,
 		gpio_set_value(led_dev->gpio, 0);
 }
 
-static void omap_configure_led_gpio(int gpio)
-{
-	if (omap_request_gpio(gpio) < 0) {
-		printk(KERN_ERR "Failed to request GPIO%d for LEDs\n", gpio);
-		return;
-	}
-	gpio_direction_output(gpio, 0);
-}
-
 static int omap_led_probe(struct platform_device *dev)
 {
 	struct omap_led_platform_data *pdata = dev->dev.platform_data;
@@ -50,7 +41,10 @@ static int omap_led_probe(struct platform_device *dev)
 	int i, ret = 0;
 
 	for (i = 0; ret >= 0 && i < pdata->nr_leds; i++) {
-		omap_configure_led_gpio(leds[i].gpio);
+		ret = gpio_request(leds[i].gpio, leds[i].cdev.name);
+		if (ret < 0)
+			break;
+		gpio_direction_output(leds[i].gpio, 0);
 		if (!leds[i].cdev.brightness_set)
 			leds[i].cdev.brightness_set = omap_set_led_gpio;
 
@@ -58,8 +52,10 @@ static int omap_led_probe(struct platform_device *dev)
 	}
 
 	if (ret < 0 && i > 1) {
-		for (i = i - 2; i >= 0; i--)
+		for (i = i - 2; i >= 0; i--) {
 			led_classdev_unregister(&leds[i].cdev);
+			gpio_free(leds[i].gpio);
+		}
 	}
 
 	return ret;
@@ -71,8 +67,10 @@ static int omap_led_remove(struct platform_device *dev)
 	struct omap_led_config *leds = pdata->leds;
 	int i;
 
-	for (i = 0; i < pdata->nr_leds; i++)
+	for (i = 0; i < pdata->nr_leds; i++) {
 		led_classdev_unregister(&leds[i].cdev);
+		gpio_free(leds[i].gpio);
+	}
 
 	return 0;
 }
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC 11/21] ARM: OMAP: Complete N8x0 board file gpiolib conversion
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
                   ` (9 preceding siblings ...)
  2008-10-29 11:36 ` [RFC 10/21] LEDS: Complete leds-omap gpiolib conversion and do some fixes Jarkko Nikula
@ 2008-10-29 11:36 ` Jarkko Nikula
  2008-10-29 11:36 ` [RFC 12/21] ARM: OMAP: Complete TUSB-OMAP interface " Jarkko Nikula
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 arch/arm/mach-omap2/board-n800-camera.c |    4 ++--
 arch/arm/mach-omap2/board-n800-mmc.c    |   14 +++++++-------
 arch/arm/mach-omap2/board-n800-usb.c    |    6 +++---
 arch/arm/mach-omap2/board-n800.c        |    6 +++---
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-omap2/board-n800-camera.c b/arch/arm/mach-omap2/board-n800-camera.c
index 1f3b1e9..3959128 100644
--- a/arch/arm/mach-omap2/board-n800-camera.c
+++ b/arch/arm/mach-omap2/board-n800-camera.c
@@ -25,13 +25,13 @@
 #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__);
diff --git a/arch/arm/mach-omap2/board-n800-mmc.c b/arch/arm/mach-omap2/board-n800-mmc.c
index 469572e..178f895 100644
--- a/arch/arm/mach-omap2/board-n800-mmc.c
+++ b/arch/arm/mach-omap2/board-n800-mmc.c
@@ -11,12 +11,12 @@
 
 #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)
 
@@ -287,11 +287,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);
 	}
 }
 
@@ -347,16 +347,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);
 	}
diff --git a/arch/arm/mach-omap2/board-n800-usb.c b/arch/arm/mach-omap2/board-n800-usb.c
index 5ab453d..e182a93 100644
--- a/arch/arm/mach-omap2/board-n800-usb.c
+++ b/arch/arm/mach-omap2/board-n800-usb.c
@@ -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);
 }
diff --git a/arch/arm/mach-omap2/board-n800.c b/arch/arm/mach-omap2/board-n800.c
index 66c7d18..b38b295 100644
--- a/arch/arm/mach-omap2/board-n800.c
+++ b/arch/arm/mach-omap2/board-n800.c
@@ -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;
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC 12/21] ARM: OMAP: Complete TUSB-OMAP interface gpiolib conversion
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
                   ` (10 preceding siblings ...)
  2008-10-29 11:36 ` [RFC 11/21] ARM: OMAP: Complete N8x0 board file gpiolib conversion Jarkko Nikula
@ 2008-10-29 11:36 ` Jarkko Nikula
  2008-10-29 11:36 ` [RFC 13/21] ARM: OMAP: Complete OMAP1 board files " Jarkko Nikula
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 arch/arm/mach-omap2/usb-tusb6010.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-tusb6010.c b/arch/arm/mach-omap2/usb-tusb6010.c
index d59855c..32b7c85 100644
--- a/arch/arm/mach-omap2/usb-tusb6010.c
+++ b/arch/arm/mach-omap2/usb-tusb6010.c
@@ -12,11 +12,11 @@
 #include <linux/errno.h>
 #include <linux/delay.h>
 #include <linux/platform_device.h>
+#include <linux/gpio.h>
 
 #include <linux/usb/musb.h>
 
 #include <mach/gpmc.h>
-#include <mach/gpio.h>
 #include <mach/mux.h>
 
 
@@ -290,7 +290,7 @@ tusb6010_setup_interface(struct musb_hdrc_platform_data *data,
 			);
 
 	/* IRQ */
-	status = omap_request_gpio(irq);
+	status = gpio_request(irq, "TUSB6010 irq");
 	if (status < 0) {
 		printk(error, 3, status);
 		return status;
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC 13/21] ARM: OMAP: Complete OMAP1 board files gpiolib conversion
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
                   ` (11 preceding siblings ...)
  2008-10-29 11:36 ` [RFC 12/21] ARM: OMAP: Complete TUSB-OMAP interface " Jarkko Nikula
@ 2008-10-29 11:36 ` Jarkko Nikula
  2008-10-29 11:36 ` [RFC 14/21] ARM: OMAP: Complete 3430sdp board file " Jarkko Nikula
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 arch/arm/mach-omap1/board-fsample.c   |    5 +++--
 arch/arm/mach-omap1/board-h2.c        |   15 ++++++++-------
 arch/arm/mach-omap1/board-h3.c        |    7 ++++---
 arch/arm/mach-omap1/board-innovator.c |    2 +-
 arch/arm/mach-omap1/board-nokia770.c  |    2 +-
 arch/arm/mach-omap1/board-palmte.c    |    4 ++--
 arch/arm/mach-omap1/board-palmz71.c   |    4 ++--
 arch/arm/mach-omap1/board-perseus2.c  |    5 +++--
 arch/arm/mach-omap1/board-sx1.c       |    6 +++---
 arch/arm/mach-omap1/board-voiceblue.c |   16 ++++++++--------
 10 files changed, 35 insertions(+), 31 deletions(-)

diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index 68da313..3030829 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -223,8 +223,9 @@ static struct omap_board_config_kernel fsample_config[] = {
 
 static void __init omap_fsample_init(void)
 {
-	if (!(omap_request_gpio(P2_NAND_RB_GPIO_PIN)))
-		nand_data.dev_ready = nand_dev_ready;
+	if (gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0)
+		BUG();
+	nand_data.dev_ready = nand_dev_ready;
 
 	omap_cfg_reg(L3_1610_FLASH_CS2B_OE);
 	omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index a621440..7cbed54 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -431,7 +431,7 @@ static struct platform_device *h2_devices[] __initdata = {
 
 static void __init h2_init_smc91x(void)
 {
-	if ((omap_request_gpio(0)) < 0) {
+	if (gpio_request(0, "SMC91x irq") < 0) {
 		printk("Error requesting gpio 0 for smc91x irq\n");
 		return;
 	}
@@ -522,8 +522,9 @@ static void __init h2_init(void)
 
 	h2_nand_resource.end = h2_nand_resource.start = OMAP_CS2B_PHYS;
 	h2_nand_resource.end += SZ_4K - 1;
-	if (!(omap_request_gpio(H2_NAND_RB_GPIO_PIN)))
-		h2_nand_data.dev_ready = h2_nand_dev_ready;
+	if (gpio_request(H2_NAND_RB_GPIO_PIN, "NAND ready") < 0)
+		BUG();
+	gpio_direction_input(H2_NAND_RB_GPIO_PIN);
 
 	omap_cfg_reg(L3_1610_FLASH_CS2B_OE);
 	omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
@@ -535,10 +536,10 @@ 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))) {
-		gpio_direction_output(H2_IRDA_FIRSEL_GPIO_PIN, 0);
-		h2_irda_data.transceiver_mode = h2_transceiver_mode;
-	}
+	if (gpio_request(H2_IRDA_FIRSEL_GPIO_PIN, "IRDA mode") < 0)
+		BUG();
+	gpio_direction_output(H2_IRDA_FIRSEL_GPIO_PIN, 0);
+	h2_irda_data.transceiver_mode = h2_transceiver_mode;
 #endif
 
 	platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices));
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index fe9eebf..da29f4c 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -608,8 +608,9 @@ static void __init h3_init(void)
 
 	nand_resource.end = nand_resource.start = OMAP_CS2B_PHYS;
 	nand_resource.end += SZ_4K - 1;
-	if (!(omap_request_gpio(H3_NAND_RB_GPIO_PIN)))
-		nand_data.dev_ready = nand_dev_ready;
+	if (gpio_request(H3_NAND_RB_GPIO_PIN, "NAND ready") < 0)
+		BUG();
+	nand_data.dev_ready = nand_dev_ready;
 
 	/* GPIO10 Func_MUX_CTRL reg bit 29:27, Configure V2 to mode1 as GPIO */
 	/* GPIO10 pullup/down register, Enable pullup on GPIO10 */
@@ -635,7 +636,7 @@ static void __init h3_init(void)
 static void __init h3_init_smc91x(void)
 {
 	omap_cfg_reg(W15_1710_GPIO40);
-	if (omap_request_gpio(40) < 0) {
+	if (gpio_request(40, "SMC91x irq") < 0) {
 		printk("Error requesting gpio 40 for smc91x irq\n");
 		return;
 	}
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index 7a97f6b..eee0657 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -302,7 +302,7 @@ static void __init innovator_init_smc91x(void)
 			   OMAP1510_FPGA_RST);
 		udelay(750);
 	} else {
-		if ((omap_request_gpio(0)) < 0) {
+		if (gpio_request(0, "SMC91x irq") < 0)
 			printk("Error requesting gpio 0 for smc91x irq\n");
 			return;
 		}
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 3e4625e..7f50fad 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -126,7 +126,7 @@ static void mipid_dev_init(void)
 
 static void ads7846_dev_init(void)
 {
-	if (omap_request_gpio(ADS7846_PENDOWN_GPIO) < 0)
+	if (gpio_request(ADS7846_PENDOWN_GPIO, "ADS7846 pendown") < 0)
 		printk(KERN_ERR "can't get ads7846 pen down GPIO\n");
 }
 
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index 3548bc2..cc99031 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -369,14 +369,14 @@ static struct omap_gpio_switch palmte_switches[] __initdata = {
 static void __init palmte_misc_gpio_setup(void)
 {
 	/* Set TSC2102 PINTDAV pin as input (used by TSC2102 driver) */
-	if (omap_request_gpio(PALMTE_PINTDAV_GPIO)) {
+	if (gpio_request(PALMTE_PINTDAV_GPIO, "TSC2102 PINTDAV") < 0) {
 		printk(KERN_ERR "Could not reserve PINTDAV GPIO!\n");
 		return;
 	}
 	gpio_direction_input(PALMTE_PINTDAV_GPIO);
 
 	/* Set USB-or-DC-IN pin as input (unused) */
-	if (omap_request_gpio(PALMTE_USB_OR_DC_GPIO)) {
+	if (gpio_request(PALMTE_USB_OR_DC_GPIO, "USB/DC-IN") < 0) {
 		printk(KERN_ERR "Could not reserve cable signal GPIO!\n");
 		return;
 	}
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index b44fde6..cc05257 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -315,14 +315,14 @@ palmz71_gpio_setup(int early)
 		gpio_direction_output(1, 1);
 	} else {
 		/* Set MMC/SD host WP pin as input */
-		if (omap_request_gpio(PALMZ71_MMC_WP_GPIO)) {
+		if (gpio_request(PALMZ71_MMC_WP_GPIO, "MMC WP") < 0) {
 			printk(KERN_ERR "Could not reserve WP GPIO!\n");
 			return;
 		}
 		gpio_direction_input(PALMZ71_MMC_WP_GPIO);
 
 		/* Monitor the Power-cable-connected signal */
-		if (omap_request_gpio(PALMZ71_USBDETECT_GPIO)) {
+		if (gpio_request(PALMZ71_USBDETECT_GPIO, "USB detect") < 0) {
 			printk(KERN_ERR
 				"Could not reserve cable signal GPIO!\n");
 			return;
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index b8f0077..3b9f907 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -223,8 +223,9 @@ static struct omap_board_config_kernel perseus2_config[] __initdata = {
 
 static void __init omap_perseus2_init(void)
 {
-	if (!(omap_request_gpio(P2_NAND_RB_GPIO_PIN)))
-		nand_data.dev_ready = nand_dev_ready;
+	if (gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0)
+		BUG();
+	nand_data.dev_ready = nand_dev_ready;
 
 	omap_cfg_reg(L3_1610_FLASH_CS2B_OE);
 	omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index 786c6a0..bfafba2 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -424,9 +424,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-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index abf6cb4..c224f3c 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -160,23 +160,23 @@ static void __init voiceblue_init_irq(void)
 static void __init voiceblue_init(void)
 {
 	/* Watchdog */
-	omap_request_gpio(0);
+	gpio_request(0, "Watchdog");
 	/* smc91x reset */
-	omap_request_gpio(7);
+	gpio_request(7, "SMC91x reset");
 	gpio_direction_output(7, 1);
 	udelay(2);	/* wait at least 100ns */
 	gpio_set_value(7, 0);
 	mdelay(50);	/* 50ms until PHY ready */
 	/* smc91x interrupt pin */
-	omap_request_gpio(8);
+	gpio_request(8, "SMC91x irq");
 	/* 16C554 reset*/
-	omap_request_gpio(6);
+	gpio_request(6, "16C554 reset");
 	gpio_direction_output(6, 0);
 	/* 16C554 interrupt pins */
-	omap_request_gpio(12);
-	omap_request_gpio(13);
-	omap_request_gpio(14);
-	omap_request_gpio(15);
+	gpio_request(12, "16C554 irq");
+	gpio_request(13, "16C554 irq");
+	gpio_request(14, "16C554 irq");
+	gpio_request(15, "16C554 irq");
 	set_irq_type(gpio_to_irq(12), IRQ_TYPE_EDGE_RISING);
 	set_irq_type(gpio_to_irq(13), IRQ_TYPE_EDGE_RISING);
 	set_irq_type(gpio_to_irq(14), IRQ_TYPE_EDGE_RISING);
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC 14/21] ARM: OMAP: Complete 3430sdp board file gpiolib conversion
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
                   ` (12 preceding siblings ...)
  2008-10-29 11:36 ` [RFC 13/21] ARM: OMAP: Complete OMAP1 board files " Jarkko Nikula
@ 2008-10-29 11:36 ` Jarkko Nikula
  2008-10-29 11:36 ` [RFC 15/21] ARM: OMAP: Complete omap3evm " Jarkko Nikula
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 arch/arm/mach-omap2/board-3430sdp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 1feeff6..0155920 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -165,7 +165,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;
 	}
@@ -273,7 +273,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;
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC 15/21] ARM: OMAP: Complete omap3evm board file gpiolib conversion
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
                   ` (13 preceding siblings ...)
  2008-10-29 11:36 ` [RFC 14/21] ARM: OMAP: Complete 3430sdp board file " Jarkko Nikula
@ 2008-10-29 11:36 ` Jarkko Nikula
  2008-10-29 11:36 ` [RFC 16/21] ARM: OMAP2: Complete gpiolib conversion in upstream merged board files Jarkko Nikula
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 arch/arm/mach-omap2/board-omap3evm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 8a8b2fa..7644cf6 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -75,7 +75,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;
@@ -171,7 +171,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);
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC 16/21] ARM: OMAP2: Complete gpiolib conversion in upstream merged board files
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
                   ` (14 preceding siblings ...)
  2008-10-29 11:36 ` [RFC 15/21] ARM: OMAP: Complete omap3evm " Jarkko Nikula
@ 2008-10-29 11:36 ` Jarkko Nikula
  2008-10-29 11:36 ` [RFC 17/21] ARM: OMAP: Complete gpio-switch gpiolib conversion Jarkko Nikula
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 arch/arm/mach-omap2/board-2430sdp.c |    4 ++--
 arch/arm/mach-omap2/board-apollon.c |    6 +++---
 arch/arm/mach-omap2/board-ldp.c     |    2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 42e51d8..e6acac8 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -213,7 +213,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 pendown") < 0)
 		printk(KERN_ERR "can't get ads746 pen down GPIO\n");
 
 	gpio_direction_input(TS_GPIO);
@@ -307,7 +307,7 @@ static inline void __init sdp2430_init_smc91x(void)
 	sdp2430_smc91x_resources[0].end = cs_mem_base + 0x30f;
 	udelay(100);
 
-	if (omap_request_gpio(OMAP24XX_ETHR_GPIO_IRQ) < 0) {
+	if (gpio_request(OMAP24XX_ETHR_GPIO_IRQ, "SMC91x irq") < 0) {
 		printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
 			OMAP24XX_ETHR_GPIO_IRQ);
 		gpmc_cs_free(eth_cs);
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index fcf2ab0..c68bf06 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -308,7 +308,7 @@ static inline void __init apollon_init_smc91x(void)
 	udelay(100);
 
 	omap_cfg_reg(W4__24XX_GPIO74);
-	if (omap_request_gpio(APOLLON_ETHR_GPIO_IRQ) < 0) {
+	if (gpio_request(APOLLON_ETHR_GPIO_IRQ, "SMC91x irq") < 0) {
 		printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
 			APOLLON_ETHR_GPIO_IRQ);
 		gpmc_cs_free(eth_cs);
@@ -391,7 +391,7 @@ static void __init apollon_usb_init(void)
 	/* USB device */
 	/* DEVICE_SUSPEND */
 	omap_cfg_reg(P21_242X_GPIO12);
-	omap_request_gpio(12);
+	gpio_request(12, "USB suspend");
 	gpio_direction_output(12, 0);
 }
 
@@ -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 dc1c3c1..5401fb7 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -94,7 +94,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;
 	}
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC 17/21] ARM: OMAP: Complete gpio-switch gpiolib conversion
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
                   ` (15 preceding siblings ...)
  2008-10-29 11:36 ` [RFC 16/21] ARM: OMAP2: Complete gpiolib conversion in upstream merged board files Jarkko Nikula
@ 2008-10-29 11:36 ` Jarkko Nikula
  2008-10-29 11:36 ` [RFC 18/21] ARM: OMAP: Complete OMAP1 serial.c " Jarkko Nikula
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 arch/arm/plat-omap/gpio-switch.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-omap/gpio-switch.c b/arch/arm/plat-omap/gpio-switch.c
index f18f6df..2b5665d 100644
--- a/arch/arm/plat-omap/gpio-switch.c
+++ b/arch/arm/plat-omap/gpio-switch.c
@@ -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);
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC 18/21] ARM: OMAP: Complete OMAP1 serial.c gpiolib conversion
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
                   ` (16 preceding siblings ...)
  2008-10-29 11:36 ` [RFC 17/21] ARM: OMAP: Complete gpio-switch gpiolib conversion Jarkko Nikula
@ 2008-10-29 11:36 ` Jarkko Nikula
  2008-10-29 11:36 ` [RFC 19/21] ARM: OMAP: LEDS: Complete " Jarkko Nikula
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 arch/arm/mach-omap1/serial.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index b63da3f..0002084 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -244,7 +244,7 @@ static void __init omap_serial_set_port_wakeup(int gpio_nr)
 {
 	int ret;
 
-	ret = omap_request_gpio(gpio_nr);
+	ret = gpio_request(gpio_nr, "UART wake");
 	if (ret < 0) {
 		printk(KERN_ERR "Could not request UART wake GPIO: %i\n",
 		       gpio_nr);
@@ -254,7 +254,7 @@ static void __init omap_serial_set_port_wakeup(int gpio_nr)
 	ret = request_irq(gpio_to_irq(gpio_nr), &omap_serial_wake_interrupt,
 			  IRQF_TRIGGER_RISING, "serial wakeup", NULL);
 	if (ret) {
-		omap_free_gpio(gpio_nr);
+		gpio_free(gpio_nr);
 		printk(KERN_ERR "No interrupt for UART wake GPIO: %i\n",
 		       gpio_nr);
 		return;
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC 19/21] ARM: OMAP: LEDS: Complete gpiolib conversion
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
                   ` (17 preceding siblings ...)
  2008-10-29 11:36 ` [RFC 18/21] ARM: OMAP: Complete OMAP1 serial.c " Jarkko Nikula
@ 2008-10-29 11:36 ` Jarkko Nikula
  2008-10-29 17:46   ` David Brownell
  2008-10-29 11:36 ` [RFC 20/21] ARM: OMAP: Complete Innovator FPGA " Jarkko Nikula
                   ` (2 subsequent siblings)
  21 siblings, 1 reply; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 arch/arm/mach-omap1/leds.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap1/leds.c b/arch/arm/mach-omap1/leds.c
index 540434e..8cbf256 100644
--- a/arch/arm/mach-omap1/leds.c
+++ b/arch/arm/mach-omap1/leds.c
@@ -47,13 +47,13 @@ omap_leds_init(void)
 		 * that's a different kind of LED (just one color at a time).
 		 */
 		omap_cfg_reg(P18_1610_GPIO3);
-		if (omap_request_gpio(3) == 0)
+		if (gpio_request(3, "LED red") == 0)
 			gpio_direction_output(3, 1);
 		else
 			printk(KERN_WARNING "LED: can't get GPIO3/red?\n");
 
 		omap_cfg_reg(MPUIO4);
-		if (omap_request_gpio(OMAP_MPUIO(4)) == 0)
+		if (gpio_request(OMAP_MPUIO(4), "LED green") == 0)
 			gpio_direction_output(OMAP_MPUIO(4), 1);
 		else
 			printk(KERN_WARNING "LED: can't get MPUIO4/green?\n");
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC 20/21] ARM: OMAP: Complete Innovator FPGA gpiolib conversion
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
                   ` (18 preceding siblings ...)
  2008-10-29 11:36 ` [RFC 19/21] ARM: OMAP: LEDS: Complete " Jarkko Nikula
@ 2008-10-29 11:36 ` Jarkko Nikula
  2008-10-29 11:36 ` [RFC 21/21] ARM: OMAP: Complete debug board " Jarkko Nikula
  2008-10-29 16:00 ` [RFC 0/21 Continue phasing out legacy GPIO calls Tony Lindgren
  21 siblings, 0 replies; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 arch/arm/mach-omap1/fpga.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap1/fpga.c b/arch/arm/mach-omap1/fpga.c
index 55748ec..4f2b8a7 100644
--- a/arch/arm/mach-omap1/fpga.c
+++ b/arch/arm/mach-omap1/fpga.c
@@ -177,7 +177,7 @@ void omap1510_fpga_init_irq(void)
 	 * NOTE: For general GPIO/MPUIO access and interrupts, please see
 	 * gpio.[ch]
 	 */
-	omap_request_gpio(13);
+	gpio_request(13, "FPGA irq");
 	gpio_direction_input(13);
 	set_irq_type(gpio_to_irq(13), IRQ_TYPE_EDGE_RISING);
 	set_irq_chained_handler(OMAP1510_INT_FPGA, innovator_fpga_IRQ_demux);
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC 21/21] ARM: OMAP: Complete debug board gpiolib conversion
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
                   ` (19 preceding siblings ...)
  2008-10-29 11:36 ` [RFC 20/21] ARM: OMAP: Complete Innovator FPGA " Jarkko Nikula
@ 2008-10-29 11:36 ` Jarkko Nikula
  2008-10-29 17:19   ` David Brownell
  2008-10-29 16:00 ` [RFC 0/21 Continue phasing out legacy GPIO calls Tony Lindgren
  21 siblings, 1 reply; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-29 11:36 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 arch/arm/plat-omap/debug-devices.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/debug-devices.c b/arch/arm/plat-omap/debug-devices.c
index 7d9c87c..f668483 100644
--- a/arch/arm/plat-omap/debug-devices.c
+++ b/arch/arm/plat-omap/debug-devices.c
@@ -72,7 +72,7 @@ int __init debug_card_init(u32 addr, unsigned gpio)
 	smc91x_resources[1].start = gpio_to_irq(gpio);
 	smc91x_resources[1].end   = gpio_to_irq(gpio);
 
-	status = omap_request_gpio(gpio);
+	status = gpio_request(gpio, "SMC91x irq");
 	if (status < 0) {
 		printk(KERN_ERR "GPIO%d unavailable for smc91x IRQ\n", gpio);
 		return status;
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [RFC 0/21 Continue phasing out legacy GPIO calls
  2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
                   ` (20 preceding siblings ...)
  2008-10-29 11:36 ` [RFC 21/21] ARM: OMAP: Complete debug board " Jarkko Nikula
@ 2008-10-29 16:00 ` Tony Lindgren
  2008-10-29 23:49   ` David Brownell
                     ` (2 more replies)
  21 siblings, 3 replies; 38+ messages in thread
From: Tony Lindgren @ 2008-10-29 16:00 UTC (permalink / raw)
  To: Jarkko Nikula; +Cc: linux-omap

Hi,

* Jarkko Nikula <jarkko.nikula@nokia.com> [081029 04:37]:
> This set continues OMAP gpio call clean-up started by David Brownell and
> is generated on top of his rebased set.
> 
> First patch is the important one here and remaining set gradually
> convert omap_request_gpio and omap_free_gpio calls to use gpiolib
> gpio_request and gpio_free calls with hopefully sensible name label.
> 
> Probably bit overkill size set but wanted to separate them some sort of
> logical way for easier mainline merge. I can combine them if needed.
> 
> Build and boot tested only on N810. Will do test builds later on as well but
> wanted to get some early comments as early as possible :-)

Great. One request though:

Let's do the clean-up patches in two phases, one series that
applies against the mainline kernel, then additional patches for
linux-omap. Otherwise we'll never get out of this merge hell.

BTW, we should try to do the same for anything that we can already
patch in the mainline kernel.

Regards,

Tony

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [RFC 10/21] LEDS: Complete leds-omap gpiolib conversion and do some fixes
  2008-10-29 11:36 ` [RFC 10/21] LEDS: Complete leds-omap gpiolib conversion and do some fixes Jarkko Nikula
@ 2008-10-29 17:15   ` David Brownell
  0 siblings, 0 replies; 38+ messages in thread
From: David Brownell @ 2008-10-29 17:15 UTC (permalink / raw)
  To: Jarkko Nikula; +Cc: linux-omap

On Wednesday 29 October 2008, Jarkko Nikula wrote:
>  drivers/leds/leds-omap.c |   24 +++++++++++-------------

I'd have expected this driver to vanish completely ...
is there something this driver does that leds-gpio.c can't?

- Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [RFC 21/21] ARM: OMAP: Complete debug board gpiolib conversion
  2008-10-29 11:36 ` [RFC 21/21] ARM: OMAP: Complete debug board " Jarkko Nikula
@ 2008-10-29 17:19   ` David Brownell
  0 siblings, 0 replies; 38+ messages in thread
From: David Brownell @ 2008-10-29 17:19 UTC (permalink / raw)
  To: Jarkko Nikula; +Cc: linux-omap

On Wednesday 29 October 2008, Jarkko Nikula wrote:
> -       status = omap_request_gpio(gpio);
> +       status = gpio_request(gpio, "SMC91x irq");

OK, that IRQ is actually shared among all the IRQ sources on
the debug board ... notably, its four serial ports share it.
So I'd use a different label.  :)

I'm working on a slightly different patch, to make all the
FPGA GPIOs plug in to the GPIO framework, but that can
easily go on top of this.

- Dave

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [RFC 19/21] ARM: OMAP: LEDS: Complete gpiolib conversion
  2008-10-29 11:36 ` [RFC 19/21] ARM: OMAP: LEDS: Complete " Jarkko Nikula
@ 2008-10-29 17:46   ` David Brownell
  2008-10-30 13:01     ` Jarkko Nikula
  0 siblings, 1 reply; 38+ messages in thread
From: David Brownell @ 2008-10-29 17:46 UTC (permalink / raw)
  To: Jarkko Nikula; +Cc: linux-omap

On Wednesday 29 October 2008, Jarkko Nikula wrote:
>  arch/arm/mach-omap1/leds.c |    4 ++--

A file which *certainly* should vanish,
along with the leds-{h2p2,inn,osk}*.c
files it supports.

This is all for the legacy ARM LED stuff,
which hasn't worked well at all since we
converted to the generic time framework
with its NO_HZ instead of the ARM-only
version Tony did.

Just make it all use leds-gpio.  :)

- Dave


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [RFC 01/21] ARM: OMAP: Clean-up OMAP GPIO request/free functions
  2008-10-29 11:36 ` [RFC 01/21] ARM: OMAP: Clean-up OMAP GPIO request/free functions Jarkko Nikula
@ 2008-10-29 17:49   ` David Brownell
  2008-10-30 12:58     ` Jarkko Nikula
  0 siblings, 1 reply; 38+ messages in thread
From: David Brownell @ 2008-10-29 17:49 UTC (permalink / raw)
  To: Jarkko Nikula; +Cc: linux-omap

Looks OK to me, but I think there's a missing patch:

On Wednesday 29 October 2008, Jarkko Nikula wrote:
> +static inline int omap_request_gpio(int gpio)
> +{
> +       return gpio_request(gpio, "FIXME");
> +}
> +
> +static inline void omap_free_gpio(int gpio)
> +{
> +       gpio_free(gpio);
> +}
> +

At the end of this patch series, delete these.  :)

- Dave

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [RFC 0/21 Continue phasing out legacy GPIO calls
  2008-10-29 16:00 ` [RFC 0/21 Continue phasing out legacy GPIO calls Tony Lindgren
@ 2008-10-29 23:49   ` David Brownell
  2008-10-30 17:26     ` Tony Lindgren
  2008-10-30  7:43   ` David Brownell
  2008-10-30 13:11   ` Jarkko Nikula
  2 siblings, 1 reply; 38+ messages in thread
From: David Brownell @ 2008-10-29 23:49 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Jarkko Nikula, linux-omap

On Wednesday 29 October 2008, Tony Lindgren wrote:
> Let's do the clean-up patches in two phases, one series that
> applies against the mainline kernel, then additional patches for
> linux-omap. Otherwise we'll never get out of this merge hell.

I'll refresh my patches that way then.  Most of the stuff
remaining sits inside arch/arm anyway.


> BTW, we should try to do the same for anything that we can already
> patch in the mainline kernel.

Right.  We'll count on you to help us do that right.  Part
of the problem will be coping with the ARM tree merge rules,
especially for changes that touch mainline drivers too...

- Dave
 



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [RFC 0/21 Continue phasing out legacy GPIO calls
  2008-10-29 16:00 ` [RFC 0/21 Continue phasing out legacy GPIO calls Tony Lindgren
  2008-10-29 23:49   ` David Brownell
@ 2008-10-30  7:43   ` David Brownell
  2008-10-30 17:32     ` Tony Lindgren
  2008-10-30 13:11   ` Jarkko Nikula
  2 siblings, 1 reply; 38+ messages in thread
From: David Brownell @ 2008-10-30  7:43 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Jarkko Nikula, linux-omap

On Wednesday 29 October 2008, Tony Lindgren wrote:
> Let's do the clean-up patches in two phases, one series that
> applies against the mainline kernel, then additional patches for
> linux-omap. Otherwise we'll never get out of this merge hell.

Note that the patches I sent were in two phases ... but the
other way around.  The OMAP-only patches can go in immediately,
and won't change anything of node.

But since the ones that "also" apply against mainline remove
the legacy calls, they need to go later.  If it were realistic
to merge them for 2.6.28, they could safely be pulled down IFF
the OMAP-only patches were already in the OMAP tree.

- Dave


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [RFC 01/21] ARM: OMAP: Clean-up OMAP GPIO request/free functions
  2008-10-29 17:49   ` David Brownell
@ 2008-10-30 12:58     ` Jarkko Nikula
  2008-10-30 16:55       ` David Brownell
  0 siblings, 1 reply; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-30 12:58 UTC (permalink / raw)
  To: ext David Brownell; +Cc: linux-omap

On Wed, 29 Oct 2008 10:49:49 -0700
"ext David Brownell" <david-b@pacbell.net> wrote:

> Looks OK to me, but I think there's a missing patch:
> 
> On Wednesday 29 October 2008, Jarkko Nikula wrote:
> > +static inline int omap_request_gpio(int gpio)
> > +{
> > +       return gpio_request(gpio, "FIXME");
> > +}
> > +
> > +static inline void omap_free_gpio(int gpio)
> > +{
> > +       gpio_free(gpio);
> > +}
> > +
> 
> At the end of this patch series, delete these.  :)
> 
Probably these should exist over one release cycle so that out-kernel
tree projects have time to convert their drivers? No big deal to me,
but wanted to be kind :-)


Jarkko
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [RFC 19/21] ARM: OMAP: LEDS: Complete gpiolib conversion
  2008-10-29 17:46   ` David Brownell
@ 2008-10-30 13:01     ` Jarkko Nikula
  0 siblings, 0 replies; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-30 13:01 UTC (permalink / raw)
  To: ext David Brownell; +Cc: linux-omap

On Wed, 29 Oct 2008 10:46:03 -0700
"ext David Brownell" <david-b@pacbell.net> wrote:

> On Wednesday 29 October 2008, Jarkko Nikula wrote:
> >  arch/arm/mach-omap1/leds.c |    4 ++--
> 
> A file which *certainly* should vanish,
> along with the leds-{h2p2,inn,osk}*.c
> files it supports.
> 
> This is all for the legacy ARM LED stuff,
> which hasn't worked well at all since we
> converted to the generic time framework
> with its NO_HZ instead of the ARM-only
> version Tony did.
> 
> Just make it all use leds-gpio.  :)
> 
Ah, good to know. I then leave this out from my set as well as the
drivers/leds/leds-omap.c.


Jarkko
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [RFC 0/21 Continue phasing out legacy GPIO calls
  2008-10-29 16:00 ` [RFC 0/21 Continue phasing out legacy GPIO calls Tony Lindgren
  2008-10-29 23:49   ` David Brownell
  2008-10-30  7:43   ` David Brownell
@ 2008-10-30 13:11   ` Jarkko Nikula
  2008-10-30 17:34     ` Tony Lindgren
  2 siblings, 1 reply; 38+ messages in thread
From: Jarkko Nikula @ 2008-10-30 13:11 UTC (permalink / raw)
  To: ext Tony Lindgren; +Cc: linux-omap

On Wed, 29 Oct 2008 09:00:56 -0700
"ext Tony Lindgren" <tony@atomide.com> wrote:

> Great. One request though:
> 
> Let's do the clean-up patches in two phases, one series that
> applies against the mainline kernel, then additional patches for
> linux-omap. Otherwise we'll never get out of this merge hell.
> 
> BTW, we should try to do the same for anything that we can already
> patch in the mainline kernel.
> 
Is it most easiest to you if I leave the set aside for a while and base
only first patch against mainline or David's recent set?

Probably first conversion set is then for those board files which are
in mainline and second set to non-mainline merged board files. Drivers
probably can be converted gradually as they are going via their mailing
lists?

At least with my first patch it's easy to detect from debugfs what is
needed to convert :-)

+static inline int omap_request_gpio(int gpio)
+{
+	return gpio_request(gpio, "FIXME");
+}


Jarkko

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [RFC 01/21] ARM: OMAP: Clean-up OMAP GPIO request/free functions
  2008-10-30 12:58     ` Jarkko Nikula
@ 2008-10-30 16:55       ` David Brownell
  0 siblings, 0 replies; 38+ messages in thread
From: David Brownell @ 2008-10-30 16:55 UTC (permalink / raw)
  To: Jarkko Nikula; +Cc: linux-omap

On Thursday 30 October 2008, Jarkko Nikula wrote:
> 
> > At the end of this patch series, delete these.  :)
> > 
> Probably these should exist over one release cycle so that out-kernel
> tree projects have time to convert their drivers? No big deal to me,
> but wanted to be kind :-)

The other GPIO changes don't keep such wrappers ... so it
wouldn't help that much.

There's a general policy for kernel API changes, and it's
to update mainline and let other code fend for itself.
It's a mild incentive for drivers to get into mainline.

- Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [RFC 0/21 Continue phasing out legacy GPIO calls
  2008-10-29 23:49   ` David Brownell
@ 2008-10-30 17:26     ` Tony Lindgren
  0 siblings, 0 replies; 38+ messages in thread
From: Tony Lindgren @ 2008-10-30 17:26 UTC (permalink / raw)
  To: David Brownell; +Cc: Jarkko Nikula, linux-omap

* David Brownell <david-b@pacbell.net> [081029 16:49]:
> On Wednesday 29 October 2008, Tony Lindgren wrote:
> > Let's do the clean-up patches in two phases, one series that
> > applies against the mainline kernel, then additional patches for
> > linux-omap. Otherwise we'll never get out of this merge hell.
> 
> I'll refresh my patches that way then.  Most of the stuff
> remaining sits inside arch/arm anyway.

Thanks, that's a bit extra work, but unless we do that in a distributed
way, I'll end up having to spend tons of time reworking the patches.

> > BTW, we should try to do the same for anything that we can already
> > patch in the mainline kernel.
> 
> Right.  We'll count on you to help us do that right.  Part
> of the problem will be coping with the ARM tree merge rules,
> especially for changes that touch mainline drivers too...

Yeah, I'll queue up what we can for Russell in smaller patch
sets. All the new code will then get queued up in Russell's omap-all
branch for mainline, and it will sit there potentially quite
a long time, but gets to mainline every merge window.

Tony

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [RFC 0/21 Continue phasing out legacy GPIO calls
  2008-10-30  7:43   ` David Brownell
@ 2008-10-30 17:32     ` Tony Lindgren
  2008-10-30 18:16       ` David Brownell
  0 siblings, 1 reply; 38+ messages in thread
From: Tony Lindgren @ 2008-10-30 17:32 UTC (permalink / raw)
  To: David Brownell; +Cc: Jarkko Nikula, linux-omap

* David Brownell <david-b@pacbell.net> [081030 00:43]:
> On Wednesday 29 October 2008, Tony Lindgren wrote:
> > Let's do the clean-up patches in two phases, one series that
> > applies against the mainline kernel, then additional patches for
> > linux-omap. Otherwise we'll never get out of this merge hell.
> 
> Note that the patches I sent were in two phases ... but the
> other way around.  The OMAP-only patches can go in immediately,
> and won't change anything of node.

OK, thanks.

> But since the ones that "also" apply against mainline remove
> the legacy calls, they need to go later.  If it were realistic
> to merge them for 2.6.28, they could safely be pulled down IFF
> the OMAP-only patches were already in the OMAP tree.

Great, to me those look safe to merge. Can you Cc Russell on the
arch/arm/*omap* patches if you merge them via gpiolib patches?

Basically anything that will cause merge conflicts for omap-all
should go via Russell so we don't frustrate him further, but
I don't think these will cause an issue for him.

Tony

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [RFC 0/21 Continue phasing out legacy GPIO calls
  2008-10-30 13:11   ` Jarkko Nikula
@ 2008-10-30 17:34     ` Tony Lindgren
  0 siblings, 0 replies; 38+ messages in thread
From: Tony Lindgren @ 2008-10-30 17:34 UTC (permalink / raw)
  To: Jarkko Nikula; +Cc: linux-omap

* Jarkko Nikula <jarkko.nikula@nokia.com> [081030 06:12]:
> On Wed, 29 Oct 2008 09:00:56 -0700
> "ext Tony Lindgren" <tony@atomide.com> wrote:
> 
> > Great. One request though:
> > 
> > Let's do the clean-up patches in two phases, one series that
> > applies against the mainline kernel, then additional patches for
> > linux-omap. Otherwise we'll never get out of this merge hell.
> > 
> > BTW, we should try to do the same for anything that we can already
> > patch in the mainline kernel.
> > 
> Is it most easiest to you if I leave the set aside for a while and base
> only first patch against mainline or David's recent set?

Well if possible we should queue them up for mainline via Dave's
gpiolib patches.

> Probably first conversion set is then for those board files which are
> in mainline and second set to non-mainline merged board files. Drivers
> probably can be converted gradually as they are going via their mailing
> lists?

I'd just send them all at once via Dave's gpiolib patches.

> At least with my first patch it's easy to detect from debugfs what is
> needed to convert :-)
> 
> +static inline int omap_request_gpio(int gpio)
> +{
> +	return gpio_request(gpio, "FIXME");
> +}

Yes, these are pretty straightforward patches :)

Tony

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [RFC 0/21 Continue phasing out legacy GPIO calls
  2008-10-30 17:32     ` Tony Lindgren
@ 2008-10-30 18:16       ` David Brownell
  2008-10-30 18:21         ` Tony Lindgren
  0 siblings, 1 reply; 38+ messages in thread
From: David Brownell @ 2008-10-30 18:16 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Jarkko Nikula, linux-omap

On Thursday 30 October 2008, Tony Lindgren wrote:
> 
> Great, to me those look safe to merge. Can you Cc Russell on the
> arch/arm/*omap* patches if you merge them via gpiolib patches?
> 
> Basically anything that will cause merge conflicts for omap-all
> should go via Russell so we don't frustrate him further, but
> I don't think these will cause an issue for him.

Unless you think they should go into 2.6.28, I'll just let
you merge them via Russell for 2.6.29 ... they're almost all
arch/arm/* changes, aren't bugfixes, and don't affect non-OMAP
code, so they don't fit into one of the usual categories of
stuff Russell avoids (cross-platform or drivers/* code).

- Dave

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [RFC 0/21 Continue phasing out legacy GPIO calls
  2008-10-30 18:16       ` David Brownell
@ 2008-10-30 18:21         ` Tony Lindgren
  0 siblings, 0 replies; 38+ messages in thread
From: Tony Lindgren @ 2008-10-30 18:21 UTC (permalink / raw)
  To: David Brownell; +Cc: Jarkko Nikula, linux-omap

* David Brownell <david-b@pacbell.net> [081030 11:16]:
> On Thursday 30 October 2008, Tony Lindgren wrote:
> > 
> > Great, to me those look safe to merge. Can you Cc Russell on the
> > arch/arm/*omap* patches if you merge them via gpiolib patches?
> > 
> > Basically anything that will cause merge conflicts for omap-all
> > should go via Russell so we don't frustrate him further, but
> > I don't think these will cause an issue for him.
> 
> Unless you think they should go into 2.6.28, I'll just let
> you merge them via Russell for 2.6.29 ... they're almost all
> arch/arm/* changes, aren't bugfixes, and don't affect non-OMAP
> code, so they don't fit into one of the usual categories of
> stuff Russell avoids (cross-platform or drivers/* code).

OK, will queue them up for 2.6.29 then.

Tony

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2008-10-30 18:21 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-29 11:36 [RFC 0/21 Continue phasing out legacy GPIO calls Jarkko Nikula
2008-10-29 11:36 ` [RFC 01/21] ARM: OMAP: Clean-up OMAP GPIO request/free functions Jarkko Nikula
2008-10-29 17:49   ` David Brownell
2008-10-30 12:58     ` Jarkko Nikula
2008-10-30 16:55       ` David Brownell
2008-10-29 11:36 ` [RFC 02/21] OneNAND OMAP2: Complete gpiolib conversion Jarkko Nikula
2008-10-29 11:36 ` [RFC 03/21] SPI: TSC2301: " Jarkko Nikula
2008-10-29 11:36 ` [RFC 04/21] ARM: OMAP: Complete LCD panel " Jarkko Nikula
2008-10-29 11:36 ` [RFC 05/21] Complete brf6150 and hci_h4p " Jarkko Nikula
2008-10-29 11:36 ` [RFC 06/21] CBUS: Complete " Jarkko Nikula
2008-10-29 11:36 ` [RFC 07/21] INPUT: TSC2005: " Jarkko Nikula
2008-10-29 11:36 ` [RFC 08/21] INPUT: TS_Hx: " Jarkko Nikula
2008-10-29 11:36 ` [RFC 09/21] OMAP: USB: " Jarkko Nikula
2008-10-29 11:36 ` [RFC 10/21] LEDS: Complete leds-omap gpiolib conversion and do some fixes Jarkko Nikula
2008-10-29 17:15   ` David Brownell
2008-10-29 11:36 ` [RFC 11/21] ARM: OMAP: Complete N8x0 board file gpiolib conversion Jarkko Nikula
2008-10-29 11:36 ` [RFC 12/21] ARM: OMAP: Complete TUSB-OMAP interface " Jarkko Nikula
2008-10-29 11:36 ` [RFC 13/21] ARM: OMAP: Complete OMAP1 board files " Jarkko Nikula
2008-10-29 11:36 ` [RFC 14/21] ARM: OMAP: Complete 3430sdp board file " Jarkko Nikula
2008-10-29 11:36 ` [RFC 15/21] ARM: OMAP: Complete omap3evm " Jarkko Nikula
2008-10-29 11:36 ` [RFC 16/21] ARM: OMAP2: Complete gpiolib conversion in upstream merged board files Jarkko Nikula
2008-10-29 11:36 ` [RFC 17/21] ARM: OMAP: Complete gpio-switch gpiolib conversion Jarkko Nikula
2008-10-29 11:36 ` [RFC 18/21] ARM: OMAP: Complete OMAP1 serial.c " Jarkko Nikula
2008-10-29 11:36 ` [RFC 19/21] ARM: OMAP: LEDS: Complete " Jarkko Nikula
2008-10-29 17:46   ` David Brownell
2008-10-30 13:01     ` Jarkko Nikula
2008-10-29 11:36 ` [RFC 20/21] ARM: OMAP: Complete Innovator FPGA " Jarkko Nikula
2008-10-29 11:36 ` [RFC 21/21] ARM: OMAP: Complete debug board " Jarkko Nikula
2008-10-29 17:19   ` David Brownell
2008-10-29 16:00 ` [RFC 0/21 Continue phasing out legacy GPIO calls Tony Lindgren
2008-10-29 23:49   ` David Brownell
2008-10-30 17:26     ` Tony Lindgren
2008-10-30  7:43   ` David Brownell
2008-10-30 17:32     ` Tony Lindgren
2008-10-30 18:16       ` David Brownell
2008-10-30 18:21         ` Tony Lindgren
2008-10-30 13:11   ` Jarkko Nikula
2008-10-30 17:34     ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox