public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <me@felipebalbi.com>
To: Felipe Balbi <me@felipebalbi.com>
Cc: David Brownell <david-b@pacbell.net>,
	Felipe Balbi <felipe.balbi@nokia.com>,
	linux-omap@vger.kernel.org, Tony Lindgren <tony@atomide.com>,
	Jean Delvare <khali@linux-fr.org>
Subject: Re: [PATCH 11/9] move twl4030-gpio to drivers/gpio
Date: Sun, 28 Sep 2008 02:09:07 +0300	[thread overview]
Message-ID: <20080927230902.GD8468@frodo> (raw)
In-Reply-To: <20080927222900.GC8468@frodo>

On Sun, Sep 28, 2008 at 01:29:05AM +0300, Felipe Balbi wrote:
> On Sat, Sep 27, 2008 at 02:41:40PM -0700, David Brownell wrote:
> > From: David Brownell <dbrownell@users.sourceforge.net>
> > 
> > Move the twl4030 GPIO support from drivers/i2c/chips to drivers/gpio,
> > which is a more appropriate home for this code.
> > 
> > The Kconfig symbol name is changed to match the GPIO_* convention for
> > such symbols, so config files must change in the obvious ways (Kconfig
> > will prompt you).  There's now some helptext.
> > 
> > It can now be compiled as a module, should anyone really want to
> > do that; that'll be mostly useful for test builds.  Sanity check the
> > IRQ range we're given.
> > 
> > Initialization order needed a bit of work too:  core add_children()
> > called only after IRQs get set up, gpio uses subsys_initcall.  This
> > depends on a patch making i2c driver model init use postcore_initcall.

We need something like the patch below (I can't find a substitute
to twl4030_set_gpio_edge_ctrl and twl4030_set_gpio_debounce):

==== patch 1 (desired) ====

diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 32b517b..3ca43aa 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -16,6 +16,7 @@
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/i2c/twl4030.h>
+#include <linux/gpio.h>
 #include <mach/hardware.h>
 #include <mach/mmc.h>
 #include <mach/board.h>
@@ -48,7 +49,7 @@
 
 static int hsmmc_card_detect(int irq)
 {
-	return twl4030_get_gpio_datain(irq - TWL4030_GPIO_IRQ_BASE);
+	return gpio_get_value(irq - TWL4030_GPIO_IRQ_BASE);
 }
 
 /*
@@ -61,7 +62,7 @@ static int hsmmc_late_init(struct device *dev)
 	/*
 	 * Configure TWL4030 GPIO parameters for MMC hotplug irq
 	 */
-	ret = twl4030_request_gpio(MMC1_CD_IRQ);
+	ret = gpio_request(MMC1_CD_IRQ, "mmc_card_detect");
 	if (ret)
 		goto err;
 
@@ -88,11 +89,7 @@ err:
 
 static void hsmmc_cleanup(struct device *dev)
 {
-	int ret = 0;
-
-	ret = twl4030_free_gpio(MMC1_CD_IRQ);
-	if (ret)
-		dev_err(dev, "Failed to configure TWL4030 GPIO IRQ\n");
+	gpio_free(MMC1_CD_IRQ);
 }
 
 #ifdef CONFIG_PM


> > 
> > Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
> > ---
> > NOTE:  requires an I2C patch:
> > 
> >   http://marc.info/?l=i2c&m=122227316012577&w=2
> > 
> > I CC'd Jean since that doesn't seem to be in his queue yet, and
> > that's pretty essential to moving such TWL stuff out of the
> > i2c/chips directory into more appropriate locations.
> 
> This patch breaks hsmmc.c:
> arch/arm/mach-omap2/built-in.o: In function `hsmmc_card_detect':
> /home/underline/workspace/linux-omap-2.6/arch/arm/mach-omap2/hsmmc.c:51: undefined reference to `twl4030_get_gpio_datain'
> arch/arm/mach-omap2/built-in.o: In function `hsmmc_cleanup':
> /home/underline/workspace/linux-omap-2.6/arch/arm/mach-omap2/hsmmc.c:93: undefined reference to `twl4030_free_gpio'
> arch/arm/mach-omap2/built-in.o: In function `hsmmc_late_init':
> /home/underline/workspace/linux-omap-2.6/arch/arm/mach-omap2/hsmmc.c:64: undefined reference to `twl4030_request_gpio'
> /home/underline/workspace/linux-omap-2.6/arch/arm/mach-omap2/hsmmc.c:68: undefined reference to `twl4030_set_gpio_edge_ctrl'
> /home/underline/workspace/linux-omap-2.6/arch/arm/mach-omap2/hsmmc.c:78: undefined reference to `twl4030_set_gpio_debounce'
> 
> -- 
> balbi
> --
> 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

-- 
balbi

  reply	other threads:[~2008-09-27 23:09 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-26 11:19 [PATCH 0/9] twl4030 updates Felipe Balbi
2008-09-26 11:19 ` [PATCH 1/9] twl4030: fix potential null pointer dereference Felipe Balbi
2008-09-26 11:19   ` [PATCH 2/9] twl4030-gpio: Remove default pullup enable/disable of GPIO Felipe Balbi
2008-09-26 11:19     ` [PATCH 3/9] i2c: clean add_children a bit Felipe Balbi
2008-09-26 11:19       ` [PATCH 4/9] i2c: move twl4030_keypad to new style registration Felipe Balbi
2008-09-26 11:19         ` [PATCH 5/9] i2c: move twl4030-usb to platform_device Felipe Balbi
2008-09-26 11:19           ` [PATCH 6/9] i2c: twl4030-usb: add 'vbus' sysfs file Felipe Balbi
2008-09-26 11:19             ` [PATCH 7/9] twl4030 gpio platform data Felipe Balbi
2008-09-26 11:19               ` [PATCH 8/9] twl4030 uses gpiolib Felipe Balbi
2008-09-26 11:19                 ` [PATCH 9/9] i2c: move twl4030-madc to new registration style Felipe Balbi
2008-09-26 17:09                   ` David Brownell
2008-09-26 17:46                     ` Felipe Balbi
2008-09-27  7:37                       ` Mikko Ylinen
2008-09-27 15:04                         ` David Brownell
2008-09-27 15:40                           ` Steve Sakoman
2008-09-27 17:17                             ` David Brownell
2008-10-01 14:20                           ` Mikko Ylinen
2008-10-01 16:13                             ` David Brownell
2008-09-26 19:50                   ` David Brownell
2008-09-26 20:01                     ` Steve Sakoman
2008-09-26 17:10                 ` [PATCH 8/9] twl4030 uses gpiolib David Brownell
2008-09-26 17:47                   ` Felipe Balbi
2008-09-26 18:57                     ` David Brownell
2008-09-28  1:01           ` [PATCH 5/9] i2c: move twl4030-usb to platform_device David Brownell
2008-09-28  3:03             ` Felipe Balbi
2008-09-26 17:12 ` [PATCH 0/9] twl4030 updates David Brownell
2008-09-26 17:50   ` Felipe Balbi
2008-09-26 18:55     ` David Brownell
2008-09-26 19:00   ` David Brownell
2008-09-26 19:10     ` Steve Sakoman
2008-09-26 19:23       ` Felipe Balbi
2008-09-26 19:45       ` David Brownell
2008-09-27 19:14 ` David Brownell
2008-09-27 21:17   ` Felipe Balbi
2008-09-27 21:45     ` David Brownell
2008-09-27 21:46       ` Felipe Balbi
2008-09-27 21:41 ` [PATCH 11/9] move twl4030-gpio to drivers/gpio David Brownell
2008-09-27 22:29   ` Felipe Balbi
2008-09-27 23:09     ` Felipe Balbi [this message]
2008-09-27 23:45       ` David Brownell
2008-09-28  3:14         ` Felipe Balbi
2008-09-28  5:16           ` David Brownell
2008-10-01 13:46             ` Felipe Contreras
2008-10-01 13:52               ` Felipe Balbi
2008-10-01 15:58               ` David Brownell
2008-10-01 16:05                 ` Jean Delvare
2008-10-01 16:32                   ` David Brownell
2008-09-27 23:29     ` David Brownell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080927230902.GD8468@frodo \
    --to=me@felipebalbi.com \
    --cc=david-b@pacbell.net \
    --cc=felipe.balbi@nokia.com \
    --cc=khali@linux-fr.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox