From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tony Lindgren Subject: Re: [PATCH 3/6] OMAP: mmc-twl4030 add cover switch Date: Tue, 10 Mar 2009 12:29:31 -0700 Message-ID: <20090310192931.GA19229@atomide.com> References: <20090310093255.16889.30509.sendpatchset@ahunter-laptop> <20090310093316.16889.58719.sendpatchset@ahunter-laptop> <200903101050.57677.david-b@pacbell.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mho-01-bos.mailhop.org ([63.208.196.178]:50165 "EHLO mho-01-bos.mailhop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752075AbZCJT3g (ORCPT ); Tue, 10 Mar 2009 15:29:36 -0400 Content-Disposition: inline In-Reply-To: <200903101050.57677.david-b@pacbell.net> Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: David Brownell Cc: Adrian Hunter , Jarkko Lavinen , linux-omap Mailing List * David Brownell [090310 10:51]: > On Tuesday 10 March 2009, Adrian Hunter wrote: > > >From 1667cd29afa90d041c0782223253835e6bc25b18 Mon Sep 17 00:00:00 2001 > > From: Adrian Hunter > > 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 > > Acked-by: David Brownell > > 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 > > > > > > >