Skip to contentSkip to conversation

legacy gpio phaseout (V) ...

PATCH In review Jarkko Nikula 4 participants 7 messages Dec 3, 2008 – Jan 7, 2009

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover legacy gpio phaseout (V) ...

Hi

With these two patches gpiolib conversion in mainline is almost complete when applied on top of Tony's Omap gpio update set for 2.6.29. Only board-apollon.c is remain in mainline but it is differentiated quite much from linux-omap so I'm going to send my next set against linux-omap only.

Note, these versions don't change mach/gpio.h include statement to linux/gpio.h due merge conflicts in mainline. SX1 seems to lack some gpio-swich related patch and omap2 onenand is getting some include fixes from mtd tree.

Signature · 1 line
Jarkko
#1 lore raw

PATCH 1/2 ARM: OMAP: SX1: Switch to gpio_request calls (OMAP and mainline)

---
 arch/arm/mach-omap1/board-sx1.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-omap1/board-sx1.c +3 -3
index 786c6a0..bfafba2 100644
@@ -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 */
Signature · 1 line
1.5.6.5
#2 lore raw

PATCH 2/2 OneNAND: OMAP2: Switch to gpio_request/free calls (OMAP and mainline)

In reply to Jarkko Nikula
---
 drivers/mtd/onenand/omap2.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/mtd/onenand/omap2.c +3 -3
index 1298563..9ae49b1 100644
@@ -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);
Signature · 1 line
1.5.6.5
#3 lore raw

Re: [PATCH 2/2] OneNAND: OMAP2: Switch to gpio_request/free calls (OMAP and mainline)

Quoted 5 lines · On Wed, 3 Dec 2008 09:37:24 +0200 Jarkko Nikula <[email protected]>…
---
 drivers/mtd/onenand/omap2.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Grr, I forgot to add Adrian into cc list.

Quoted 34 lines
drivers/mtd/onenand/omap2.c +3 -3
index 1298563..9ae49b1 100644
@@ -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);
Signature · 1 line
1.5.6.5
#4 lore raw

PATCH 1/1 OneNAND: OMAP2: Switch to generic gpio calls

In reply to Jarkko Nikula

From: Jarkko Nikula <[email protected]>

---
drivers/mtd/onenand/omap2.c | 16 ++++++++--------

1 files changed, 8 insertions(+), 8 deletions(-)
drivers/mtd/onenand/omap2.c +0 -0
index a7e4d98..c260e2d 100644
@@ -149,7 +149,7 @@ static int omap2_onenand_wait(struct mtd_info *mtd, int state)
 
		INIT_COMPLETION(c->irq_done);
		if (c->gpio_irq) {
-			result = omap_get_gpio_datain(c->gpio_irq);
+			result = gpio_get_value(c->gpio_irq);
			if (result == -1) {
				ctrl = read_reg(c, ONENAND_REG_CTRL_STATUS);
				intr = read_reg(c, ONENAND_REG_INTERRUPT);
@@ -629,14 +629,14 @@ 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;
	}

- omap_set_gpio_direction(c->gpio_irq, 1);
+ gpio_direction_input(c->gpio_irq);

- if ((r = request_irq(OMAP_GPIO_IRQ(c->gpio_irq),
+ if ((r = request_irq(gpio_to_irq(c->gpio_irq),

			     omap2_onenand_interrupt, IRQF_TRIGGER_RISING,
			     pdev->dev.driver->name, c)) < 0)
		goto err_release_gpio;
@@ -723,10 +723,10 @@ err_release_dma:
	if (c->dma_channel != -1)
		omap_free_dma(c->dma_channel);
	if (c->gpio_irq)
-		free_irq(OMAP_GPIO_IRQ(c->gpio_irq), c);
+		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:
@@ -760,8 +760,8 @@ static int __devexit omap2_onenand_remove(struct platform_device *pdev)
	omap2_onenand_shutdown(pdev);
	platform_set_drvdata(pdev, NULL);
	if (c->gpio_irq) {
-		free_irq(OMAP_GPIO_IRQ(c->gpio_irq), c);
-		omap_free_gpio(c->gpio_irq);
+		free_irq(gpio_to_irq(c->gpio_irq), c);
+		gpio_free(c->gpio_irq);
	}
	iounmap(c->onenand.base);
	release_mem_region(c->phys_base, ONENAND_IO_SIZE);
Signature · 1 line
1.5.4.3
#5 lore raw

Re: [PATCH] OneNAND: OMAP2: Switch to generic gpio calls

Quoted 2 lines · Adrian Hunter

-               if ((r = omap_request_gpio(c->gpio_irq)) < 0) { +               if ((r = gpio_request(c->gpio_irq, "OneNAND irq")) < 0) {

Worth noting that this depends on the OMAP patches which make those calls be equivalent. Those patches are going into 2.6.29-early via the ARM tree, as I recall; getting the merge order wrong would break bisectability -- but not buildability.

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

reviewer
#6 lore raw
In reply to Jarkko Nikula
Quoted 11 lines · Jarkko Nikula

Hi

With these two patches gpiolib conversion in mainline is almost complete when applied on top of Tony's Omap gpio update set for 2.6.29. Only board-apollon.c is remain in mainline but it is differentiated quite much from linux-omap so I'm going to send my next set against linux-omap only.

Note, these versions don't change mach/gpio.h include statement to linux/gpio.h due merge conflicts in mainline. SX1 seems to lack some gpio-swich related patch and omap2 onenand is getting some include fixes from mtd tree.

I've finally pushed these as one patch and also removed the remaining calls. Also on their way to mainline hopefully within next few days.

Regards,

Tony