All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: David Brownell <david-b@pacbell.net>
Cc: Adrian Hunter <adrian.hunter@nokia.com>,
	Jarkko Lavinen <jarkko.lavinen@nokia.com>,
	linux-omap Mailing List <linux-omap@vger.kernel.org>
Subject: Re: [PATCH 3/6] OMAP: mmc-twl4030 add cover switch
Date: Tue, 10 Mar 2009 12:29:31 -0700	[thread overview]
Message-ID: <20090310192931.GA19229@atomide.com> (raw)
In-Reply-To: <200903101050.57677.david-b@pacbell.net>

* David Brownell <david-b@pacbell.net> [090310 10:51]:
> On Tuesday 10 March 2009, Adrian Hunter wrote:
> > >From 1667cd29afa90d041c0782223253835e6bc25b18 Mon Sep 17 00:00:00 2001
> > From: Adrian Hunter <adrian.hunter@nokia.com>
> > Date: Mon, 26 Jan 2009 13:14:28 +0200
> > Subject: [PATCH] OMAP: mmc-twl4030 add cover switch
> > 
> > Allow a cover switch to be used to cause a rescan of the
> > MMC slot.
> > 
> > Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
> 
> Acked-by: David Brownell <dbrownell@users.sourceforge.net>
> 
> Because a cover switch is not the same as a card detect switch...

Pushed this too after after editing the header change to apply.

Tony 
 
> > ---
> >  arch/arm/mach-omap2/mmc-twl4030.c |   13 ++++++++++++-
> >  arch/arm/mach-omap2/mmc-twl4030.h |    1 +
> >  2 files changed, 13 insertions(+), 1 deletions(-)
> > 
> > diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
> > index 736b039..a58deba 100644
> > --- a/arch/arm/mach-omap2/mmc-twl4030.c
> > +++ b/arch/arm/mach-omap2/mmc-twl4030.c
> > @@ -105,6 +105,14 @@ static int twl_mmc_get_ro(struct device *dev, int slot)
> >  	return gpio_get_value_cansleep(mmc->slots[0].gpio_wp);
> >  }
> >  
> > +static int twl_mmc_get_cover_state(struct device *dev, int slot)
> > +{
> > +	struct omap_mmc_platform_data *mmc = dev->platform_data;
> > +
> > +	/* NOTE: assumes card detect signal is active-low */
> > +	return !gpio_get_value_cansleep(mmc->slots[0].switch_pin);
> > +}
> > +
> >  /*
> >   * MMC Slot Initialization.
> >   */
> > @@ -427,7 +435,10 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
> >  
> >  			mmc->slots[0].switch_pin = c->gpio_cd;
> >  			mmc->slots[0].card_detect_irq = gpio_to_irq(c->gpio_cd);
> > -			mmc->slots[0].card_detect = twl_mmc_card_detect;
> > +			if (c->cover_only)
> > +				mmc->slots[0].get_cover_state = twl_mmc_get_cover_state;
> > +			else
> > +				mmc->slots[0].card_detect = twl_mmc_card_detect;
> >  		} else
> >  			mmc->slots[0].switch_pin = -EINVAL;
> >  
> > diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h
> > index 087a969..e87bc8d 100644
> > --- a/arch/arm/mach-omap2/mmc-twl4030.h
> > +++ b/arch/arm/mach-omap2/mmc-twl4030.h
> > @@ -12,6 +12,7 @@ struct twl4030_hsmmc_info {
> >  	bool	transceiver;	/* MMC-2 option */
> >  	bool	ext_clock;	/* use external pin for input clock */
> >  	bool	vsim_18v;	/* MMC-2 option */
> > +	bool	cover_only;	/* No card detect - just cover switch */
> >  	int	gpio_cd;	/* or -EINVAL */
> >  	int	gpio_wp;	/* or -EINVAL */
> >  	struct device *dev;	/* returned: pointer to mmc adapter */
> > -- 
> > 1.5.6.3
> > 
> > 
> 
> 
> 

  reply	other threads:[~2009-03-10 19:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-10  9:32 [PATCH 0/6] mmc-twl4030 patches for RX51 Adrian Hunter
2009-03-10  9:33 ` [PATCH 1/6] OMAP: mmc-twl4030 fix name buffer length Adrian Hunter
2009-03-10 17:28   ` David Brownell
2009-03-10 19:17   ` [APPLIED] <span class="quote">> [PATCH] OMAP: mmc-twl4030 fix name buffer length</span> Tony Lindgren
2009-03-10  9:33 ` [PATCH 2/6] OMAP: mmc-twl4030 support VSIM is VMMC2_IO Adrian Hunter
2009-03-10 17:46   ` David Brownell
2009-03-10  9:33 ` [PATCH 3/6] OMAP: mmc-twl4030 add cover switch Adrian Hunter
2009-03-10 17:50   ` David Brownell
2009-03-10 19:29     ` Tony Lindgren [this message]
2009-03-10  9:33 ` [PATCH 4/6] OMAP: mmc-twl4030 allow arbitrary slot names Adrian Hunter
2009-03-10 17:56   ` David Brownell
2009-03-10 19:22   ` [APPLIED] <span class="quote">> [PATCH] OMAP: mmc-twl4030 allow arbitrary slot names</span> Tony Lindgren
2009-03-10  9:33 ` [PATCH 6/6] OMAP: mmc-twl4030: Add VAUX3 support Adrian Hunter
     [not found] ` <20090310093329.16889.76098.sendpatchset@ahunter-laptop>
2009-03-10 17:58   ` [PATCH 5/6] RX51: adjust hsmmc info David Brownell
2009-03-10 19:30     ` Tony Lindgren

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=20090310192931.GA19229@atomide.com \
    --to=tony@atomide.com \
    --cc=adrian.hunter@nokia.com \
    --cc=david-b@pacbell.net \
    --cc=jarkko.lavinen@nokia.com \
    --cc=linux-omap@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.