public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [OMAP and mainline][RFC 2.6.28-rc2-omap 0/3] legacy gpio phaseout (III) ...
@ 2008-10-31 12:17 Jarkko Nikula
  2008-10-31 12:17 ` [OMAP and mainline][RFC 2.6.28-rc2-omap 1/3] ARM: OMAP: Switch to gpio_request/free calls Jarkko Nikula
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Jarkko Nikula @ 2008-10-31 12:17 UTC (permalink / raw)
  To: linux-omap

This is from the "Continue phasing out legacy GPIO calls" set I sent earlier
but includes only files which are in mainline.

This is generated on top of David's recent 4+5 "legacy gpio phaseout.." patches in linux-omap tree.

Note that this still includes arch/arm/mach-omap1/leds.c (should vanish
soon/now) and arch/arm/plat-omap/debug-devices.c untouched.


-- 
Jarkko

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

* [OMAP and mainline][RFC 2.6.28-rc2-omap 1/3] ARM: OMAP: Switch to gpio_request/free calls
  2008-10-31 12:17 [OMAP and mainline][RFC 2.6.28-rc2-omap 0/3] legacy gpio phaseout (III) Jarkko Nikula
@ 2008-10-31 12:17 ` Jarkko Nikula
  2008-10-31 12:17 ` [OMAP and mainline][RFC 2.6.28-rc2-omap 2/3] OneNAND: OMAP2: " Jarkko Nikula
  2008-10-31 12:17 ` [OMAP and mainline][RFC 2.6.28-rc2-omap 3/3] USB: OHCI-OMAP: " Jarkko Nikula
  2 siblings, 0 replies; 15+ messages in thread
From: Jarkko Nikula @ 2008-10-31 12:17 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 ++++++++--------
 arch/arm/mach-omap1/fpga.c            |    2 +-
 arch/arm/mach-omap1/leds.c            |    4 ++--
 arch/arm/mach-omap1/serial.c          |    4 ++--
 arch/arm/mach-omap2/board-2430sdp.c   |    4 ++--
 arch/arm/mach-omap2/board-apollon.c   |    6 +++---
 arch/arm/mach-omap2/board-ldp.c       |    2 +-
 arch/arm/mach-omap2/usb-tusb6010.c    |    4 ++--
 arch/arm/plat-omap/debug-devices.c    |    2 +-
 18 files changed, 49 insertions(+), 45 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 af44566..d53cefd 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -428,7 +428,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;
 	}
@@ -519,8 +519,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);
@@ -532,10 +533,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);
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);
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");
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;
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;
 	}
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;
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] 15+ messages in thread

* [OMAP and mainline][RFC 2.6.28-rc2-omap 2/3] OneNAND: OMAP2: Switch to gpio_request/free calls
  2008-10-31 12:17 [OMAP and mainline][RFC 2.6.28-rc2-omap 0/3] legacy gpio phaseout (III) Jarkko Nikula
  2008-10-31 12:17 ` [OMAP and mainline][RFC 2.6.28-rc2-omap 1/3] ARM: OMAP: Switch to gpio_request/free calls Jarkko Nikula
@ 2008-10-31 12:17 ` Jarkko Nikula
  2008-10-31 12:17 ` [OMAP and mainline][RFC 2.6.28-rc2-omap 3/3] USB: OHCI-OMAP: " Jarkko Nikula
  2 siblings, 0 replies; 15+ messages in thread
From: Jarkko Nikula @ 2008-10-31 12:17 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] 15+ messages in thread

* [OMAP and mainline][RFC 2.6.28-rc2-omap 3/3] USB: OHCI-OMAP: Switch to gpio_request/free calls
  2008-10-31 12:17 [OMAP and mainline][RFC 2.6.28-rc2-omap 0/3] legacy gpio phaseout (III) Jarkko Nikula
  2008-10-31 12:17 ` [OMAP and mainline][RFC 2.6.28-rc2-omap 1/3] ARM: OMAP: Switch to gpio_request/free calls Jarkko Nikula
  2008-10-31 12:17 ` [OMAP and mainline][RFC 2.6.28-rc2-omap 2/3] OneNAND: OMAP2: " Jarkko Nikula
@ 2008-10-31 12:17 ` Jarkko Nikula
  2008-10-31 17:56   ` David Brownell
  2 siblings, 1 reply; 15+ messages in thread
From: Jarkko Nikula @ 2008-10-31 12:17 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

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

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] 15+ messages in thread

* Re: [OMAP and mainline][RFC 2.6.28-rc2-omap 3/3] USB: OHCI-OMAP: Switch to gpio_request/free calls
  2008-10-31 12:17 ` [OMAP and mainline][RFC 2.6.28-rc2-omap 3/3] USB: OHCI-OMAP: " Jarkko Nikula
@ 2008-10-31 17:56   ` David Brownell
  2008-11-03 11:37     ` Jarkko Nikula
  0 siblings, 1 reply; 15+ messages in thread
From: David Brownell @ 2008-10-31 17:56 UTC (permalink / raw)
  To: Jarkko Nikula; +Cc: linux-omap

On Friday 31 October 2008, Jarkko Nikula wrote:
> -                       omap_request_gpio(9);
> +                       gpio_request(9, "USB over current");

Make that "OHCI" not "USB" ... and, general comment, shorter
labels for the GPIOs (12 bytes and less) will preserve column
alignment in /sys/kernel/debug/gpio listings.

- 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] 15+ messages in thread

* Re: [OMAP and mainline][RFC 2.6.28-rc2-omap 3/3] USB: OHCI-OMAP: Switch to gpio_request/free calls
  2008-10-31 17:56   ` David Brownell
@ 2008-11-03 11:37     ` Jarkko Nikula
  2008-11-10 22:23       ` David Brownell
  0 siblings, 1 reply; 15+ messages in thread
From: Jarkko Nikula @ 2008-11-03 11:37 UTC (permalink / raw)
  To: ext David Brownell; +Cc: linux-omap

On Fri, 31 Oct 2008 10:56:55 -0700
"ext David Brownell" <david-b@pacbell.net> wrote:

> On Friday 31 October 2008, Jarkko Nikula wrote:
> > -                       omap_request_gpio(9);
> > +                       gpio_request(9, "USB over current");
> 
> Make that "OHCI" not "USB" ... and, general comment, shorter
> labels for the GPIOs (12 bytes and less) will preserve column
> alignment in /sys/kernel/debug/gpio listings.
> 
Thanks Dave! I clearly forgot to clean this one. "OHCI ovcurr", "OHCI
err", etc?

Yes, I actually noted already before making the first set, that
probably I should sent a patch to wide the label column in debugs
listings :-)

Otherwise we have to invent artificially short labels. See e.g.

"BT host wakeup" -> "BT host wup" (looks stupid)
"ADS7846 pendown" -> "ADS7846 pdown", "ADS7846 pd" (power-down?)

IMO GPIO label will be usually longer than IRQ label since label must
include not only chip/connection info but also function of the GPIO.
E.g. "XXX enable", XXX reset", "XXX irq", "LED green", etc.


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] 15+ messages in thread

* Re: [OMAP and mainline][RFC 2.6.28-rc2-omap 3/3] USB: OHCI-OMAP: Switch to gpio_request/free calls
  2008-11-03 11:37     ` Jarkko Nikula
@ 2008-11-10 22:23       ` David Brownell
  2008-11-11 13:17         ` Jarkko Nikula
  0 siblings, 1 reply; 15+ messages in thread
From: David Brownell @ 2008-11-10 22:23 UTC (permalink / raw)
  To: Jarkko Nikula; +Cc: linux-omap

On Monday 03 November 2008, Jarkko Nikula wrote:
> Yes, I actually noted already before making the first set, that
> probably I should sent a patch to wide the label column in debugs
> listings :-)

Sure, you send me a drivers/gpio/gpiolib.c update and I'll
sign off on it.  20 chars would be better than 12, but
maybe more are needed.


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

* Re: [OMAP and mainline][RFC 2.6.28-rc2-omap 3/3] USB: OHCI-OMAP: Switch to gpio_request/free calls
  2008-11-10 22:23       ` David Brownell
@ 2008-11-11 13:17         ` Jarkko Nikula
  2008-11-12  6:28           ` David Brownell
  0 siblings, 1 reply; 15+ messages in thread
From: Jarkko Nikula @ 2008-11-11 13:17 UTC (permalink / raw)
  To: ext David Brownell; +Cc: linux-omap

On Mon, 10 Nov 2008 14:23:50 -0800
"ext David Brownell" <david-b@pacbell.net> wrote:

> On Monday 03 November 2008, Jarkko Nikula wrote:
> > Yes, I actually noted already before making the first set, that
> > probably I should sent a patch to wide the label column in debugs
> > listings :-)
> 
> Sure, you send me a drivers/gpio/gpiolib.c update and I'll
> sign off on it.  20 chars would be better than 12, but
> maybe more are needed.
> 
I'll try do as soon as possible. Some "work" and other side stuff has
unfortunately delayed this gpio & patchset update recently.

Do you see are there any issue to change label into last column like
in /proc/interrupts so that width doesn't have to be fixed?


Jarkko

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

* Re: [OMAP and mainline][RFC 2.6.28-rc2-omap 3/3] USB: OHCI-OMAP: Switch to gpio_request/free calls
  2008-11-11 13:17         ` Jarkko Nikula
@ 2008-11-12  6:28           ` David Brownell
  2008-11-12  7:53             ` Jarkko Nikula
  0 siblings, 1 reply; 15+ messages in thread
From: David Brownell @ 2008-11-12  6:28 UTC (permalink / raw)
  To: Jarkko Nikula; +Cc: linux-omap

On Tuesday 11 November 2008, Jarkko Nikula wrote:
> 
> > Sure, you send me a drivers/gpio/gpiolib.c update and I'll
> > sign off on it.  20 chars would be better than 12, but
> > maybe more are needed.
> > 
> I'll try do as soon as possible. Some "work" and other side stuff has
> unfortunately delayed this gpio & patchset update recently.
> 
> Do you see are there any issue to change label into last column like
> in /proc/interrupts so that width doesn't have to be fixed?

Only that the amount of data to the right of that label
is variable size too.  I was following a convention that
the standard debug dump code (gpiolib) and the gpio_chip
specific stuff all looked pretty much the same except for
the extras (pullups, pulldowns, drive strength, debounce,
and so on) on the right.

I'd keep it simple and just allow for fatter labels.
Less work all around.

--
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] 15+ messages in thread

* Re: [OMAP and mainline][RFC 2.6.28-rc2-omap 3/3] USB: OHCI-OMAP: Switch to gpio_request/free calls
  2008-11-12  6:28           ` David Brownell
@ 2008-11-12  7:53             ` Jarkko Nikula
  2008-11-21 22:16               ` Tony Lindgren
  0 siblings, 1 reply; 15+ messages in thread
From: Jarkko Nikula @ 2008-11-12  7:53 UTC (permalink / raw)
  To: ext David Brownell; +Cc: linux-omap

On Tue, 11 Nov 2008 22:28:13 -0800
"ext David Brownell" <david-b@pacbell.net> wrote:

> > Do you see are there any issue to change label into last column like
> > in /proc/interrupts so that width doesn't have to be fixed?
> 
> Only that the amount of data to the right of that label
> is variable size too.  I was following a convention that
> the standard debug dump code (gpiolib) and the gpio_chip
> specific stuff all looked pretty much the same except for
> the extras (pullups, pulldowns, drive strength, debounce,
> and so on) on the right.
> 
Yep, again zero thinking from me :-)

> I'd keep it simple and just allow for fatter labels.
> Less work all around.
> 
I just sent a patch extending width to 20 bytes via LKML and you in cc
list. I looked mainline and there were many labels more than 12 but
less 20 bytes. One longer was "board a9m9750dev extirq2" but looks like
it can be squeezed.


Jarkko

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

* Re: [OMAP and mainline][RFC 2.6.28-rc2-omap 3/3] USB: OHCI-OMAP: Switch to gpio_request/free calls
  2008-11-12  7:53             ` Jarkko Nikula
@ 2008-11-21 22:16               ` Tony Lindgren
  2008-11-21 23:37                 ` David Brownell
  0 siblings, 1 reply; 15+ messages in thread
From: Tony Lindgren @ 2008-11-21 22:16 UTC (permalink / raw)
  To: Jarkko Nikula; +Cc: ext David Brownell, linux-omap

* Jarkko Nikula <jarkko.nikula@nokia.com> [081111 23:54]:
> On Tue, 11 Nov 2008 22:28:13 -0800
> "ext David Brownell" <david-b@pacbell.net> wrote:
> 
> > > Do you see are there any issue to change label into last column like
> > > in /proc/interrupts so that width doesn't have to be fixed?
> > 
> > Only that the amount of data to the right of that label
> > is variable size too.  I was following a convention that
> > the standard debug dump code (gpiolib) and the gpio_chip
> > specific stuff all looked pretty much the same except for
> > the extras (pullups, pulldowns, drive strength, debounce,
> > and so on) on the right.
> > 
> Yep, again zero thinking from me :-)
> 
> > I'd keep it simple and just allow for fatter labels.
> > Less work all around.
> > 
> I just sent a patch extending width to 20 bytes via LKML and you in cc
> list. I looked mainline and there were many labels more than 12 but
> less 20 bytes. One longer was "board a9m9750dev extirq2" but looks like
> it can be squeezed.

Jarkko, any news on updating this patch series? It would be nice to
have this queued up for 2.6.29.

Tony

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

* Re: [OMAP and mainline][RFC 2.6.28-rc2-omap 3/3] USB: OHCI-OMAP: Switch to gpio_request/free calls
  2008-11-21 22:16               ` Tony Lindgren
@ 2008-11-21 23:37                 ` David Brownell
  2008-11-21 23:40                   ` Tony Lindgren
  0 siblings, 1 reply; 15+ messages in thread
From: David Brownell @ 2008-11-21 23:37 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Jarkko Nikula, linux-omap

On Friday 21 November 2008, Tony Lindgren wrote:
> > > 
> > I just sent a patch extending width to 20 bytes via LKML and you in cc
> > list. I looked mainline and there were many labels more than 12 but
> > less 20 bytes. One longer was "board a9m9750dev extirq2" but looks like
> > it can be squeezed.
> 
> Jarkko, any news on updating this patch series? It would be nice to
> have this queued up for  2.6.29.

The gpiolib change is in mainline git.


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

* Re: [OMAP and mainline][RFC 2.6.28-rc2-omap 3/3] USB: OHCI-OMAP: Switch to gpio_request/free calls
  2008-11-21 23:37                 ` David Brownell
@ 2008-11-21 23:40                   ` Tony Lindgren
  2008-11-22  0:08                     ` David Brownell
  0 siblings, 1 reply; 15+ messages in thread
From: Tony Lindgren @ 2008-11-21 23:40 UTC (permalink / raw)
  To: David Brownell; +Cc: Jarkko Nikula, linux-omap

* David Brownell <david-b@pacbell.net> [081121 15:37]:
> On Friday 21 November 2008, Tony Lindgren wrote:
> > > > 
> > > I just sent a patch extending width to 20 bytes via LKML and you in cc
> > > list. I looked mainline and there were many labels more than 12 but
> > > less 20 bytes. One longer was "board a9m9750dev extirq2" but looks like
> > > it can be squeezed.
> > 
> > Jarkko, any news on updating this patch series? It would be nice to
> > have this queued up for  2.6.29.
> 
> The gpiolib change is in mainline git.
> 

But I guess Jarkko will still change some names in his patch series?

Tony

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

* Re: [OMAP and mainline][RFC 2.6.28-rc2-omap 3/3] USB: OHCI-OMAP: Switch to gpio_request/free calls
  2008-11-21 23:40                   ` Tony Lindgren
@ 2008-11-22  0:08                     ` David Brownell
  2008-11-24 14:23                       ` Jarkko Nikula
  0 siblings, 1 reply; 15+ messages in thread
From: David Brownell @ 2008-11-22  0:08 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Jarkko Nikula, linux-omap

On Friday 21 November 2008, Tony Lindgren wrote:
> 
> But I guess Jarkko will still change some names in his patch series?
> 

Minor stuff, as I recall.  I'll let him respond...


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

* Re: [OMAP and mainline][RFC 2.6.28-rc2-omap 3/3] USB: OHCI-OMAP: Switch to gpio_request/free calls
  2008-11-22  0:08                     ` David Brownell
@ 2008-11-24 14:23                       ` Jarkko Nikula
  0 siblings, 0 replies; 15+ messages in thread
From: Jarkko Nikula @ 2008-11-24 14:23 UTC (permalink / raw)
  To: ext David Brownell; +Cc: Tony Lindgren, linux-omap

On Fri, 21 Nov 2008 16:08:37 -0800
"ext David Brownell" <david-b@pacbell.net> wrote:

> On Friday 21 November 2008, Tony Lindgren wrote:
> > 
> > But I guess Jarkko will still change some names in his patch series?
> > 
> 
> Minor stuff, as I recall.  I'll let him respond...
> 
Yeah, I hope to get finally this set refreshed this week...


Jarkko

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

end of thread, other threads:[~2008-11-24 14:23 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-31 12:17 [OMAP and mainline][RFC 2.6.28-rc2-omap 0/3] legacy gpio phaseout (III) Jarkko Nikula
2008-10-31 12:17 ` [OMAP and mainline][RFC 2.6.28-rc2-omap 1/3] ARM: OMAP: Switch to gpio_request/free calls Jarkko Nikula
2008-10-31 12:17 ` [OMAP and mainline][RFC 2.6.28-rc2-omap 2/3] OneNAND: OMAP2: " Jarkko Nikula
2008-10-31 12:17 ` [OMAP and mainline][RFC 2.6.28-rc2-omap 3/3] USB: OHCI-OMAP: " Jarkko Nikula
2008-10-31 17:56   ` David Brownell
2008-11-03 11:37     ` Jarkko Nikula
2008-11-10 22:23       ` David Brownell
2008-11-11 13:17         ` Jarkko Nikula
2008-11-12  6:28           ` David Brownell
2008-11-12  7:53             ` Jarkko Nikula
2008-11-21 22:16               ` Tony Lindgren
2008-11-21 23:37                 ` David Brownell
2008-11-21 23:40                   ` Tony Lindgren
2008-11-22  0:08                     ` David Brownell
2008-11-24 14:23                       ` Jarkko Nikula

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