linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] mmc: mxs-mmc: add cd-inverted and non-removeable
@ 2013-03-25 15:02 Marc Kleine-Budde
  2013-03-25 15:02 ` [PATCH 1/2] mmc: mxs-mmc: add cd-inverted property Marc Kleine-Budde
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2013-03-25 15:02 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

this patch add support for the cd-inverted and non-removeable property (as
defined in devicetree/bindings/mmc/mmc.txt) to the mxs-mmc driver. Tested on a
custom imx28 board.

This series applies to Chris Ball's cjb/mmc-next branch.

regards,
Marc Kleine-Budde

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

* [PATCH 1/2] mmc: mxs-mmc: add cd-inverted property
  2013-03-25 15:02 [PATCH 0/2] mmc: mxs-mmc: add cd-inverted and non-removeable Marc Kleine-Budde
@ 2013-03-25 15:02 ` Marc Kleine-Budde
  2013-03-25 15:02 ` [PATCH 2/2] mmc: mxs-mmc: add non-removeable property Marc Kleine-Budde
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2013-03-25 15:02 UTC (permalink / raw)
  To: linux-arm-kernel

The card-detect GPIO is inverted on some boards. Handle such case.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/mmc/host/mxs-mmc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 4efe302..0cdf1f6 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -72,6 +72,7 @@ struct mxs_mmc_host {
 	int				sdio_irq_en;
 	int				wp_gpio;
 	bool				wp_inverted;
+	bool				cd_inverted;
 };
 
 static int mxs_mmc_get_ro(struct mmc_host *mmc)
@@ -96,7 +97,7 @@ static int mxs_mmc_get_cd(struct mmc_host *mmc)
 	struct mxs_ssp *ssp = &host->ssp;
 
 	return !(readl(ssp->base + HW_SSP_STATUS(ssp)) &
-		 BM_SSP_STATUS_CARD_DETECT);
+		 BM_SSP_STATUS_CARD_DETECT)) ^ host->cd_inverted;
 }
 
 static void mxs_mmc_reset(struct mxs_mmc_host *host)
@@ -691,6 +692,8 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 	if (flags & OF_GPIO_ACTIVE_LOW)
 		host->wp_inverted = 1;
 
+	host->cd_inverted = of_property_read_bool(np, "cd-inverted");
+
 	mmc->f_min = 400000;
 	mmc->f_max = 288000000;
 	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
-- 
1.8.2.rc2

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

* [PATCH 2/2] mmc: mxs-mmc: add non-removeable property
  2013-03-25 15:02 [PATCH 0/2] mmc: mxs-mmc: add cd-inverted and non-removeable Marc Kleine-Budde
  2013-03-25 15:02 ` [PATCH 1/2] mmc: mxs-mmc: add cd-inverted property Marc Kleine-Budde
@ 2013-03-25 15:02 ` Marc Kleine-Budde
  2013-04-04 14:07   ` Chris Ball
  2013-03-26  5:36 ` [PATCH 0/2] mmc: mxs-mmc: add cd-inverted and non-removeable Shawn Guo
  2013-04-03  7:56 ` Marc Kleine-Budde
  3 siblings, 1 reply; 7+ messages in thread
From: Marc Kleine-Budde @ 2013-03-25 15:02 UTC (permalink / raw)
  To: linux-arm-kernel

Some boards have non removeable cards like eMMC. Handle such case.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/mmc/host/mxs-mmc.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 0cdf1f6..b85f383 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -73,6 +73,7 @@ struct mxs_mmc_host {
 	int				wp_gpio;
 	bool				wp_inverted;
 	bool				cd_inverted;
+	bool				non_removeable;
 };
 
 static int mxs_mmc_get_ro(struct mmc_host *mmc)
@@ -96,8 +97,9 @@ static int mxs_mmc_get_cd(struct mmc_host *mmc)
 	struct mxs_mmc_host *host = mmc_priv(mmc);
 	struct mxs_ssp *ssp = &host->ssp;
 
-	return !(readl(ssp->base + HW_SSP_STATUS(ssp)) &
-		 BM_SSP_STATUS_CARD_DETECT)) ^ host->cd_inverted;
+	return host->non_removeable ||
+		!(readl(ssp->base + HW_SSP_STATUS(ssp)) &
+		  BM_SSP_STATUS_CARD_DETECT) ^ host->cd_inverted;
 }
 
 static void mxs_mmc_reset(struct mxs_mmc_host *host)
@@ -687,8 +689,10 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 		mmc->caps |= MMC_CAP_4_BIT_DATA;
 	else if (bus_width == 8)
 		mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
+	host->non_removeable = of_property_read_bool(np, "non-removable");
+	if (host->non_removeable)
+		mmc->caps |= MMC_CAP_NONREMOVABLE;
 	host->wp_gpio = of_get_named_gpio_flags(np, "wp-gpios", 0, &flags);
-
 	if (flags & OF_GPIO_ACTIVE_LOW)
 		host->wp_inverted = 1;
 
-- 
1.8.2.rc2

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

* [PATCH 0/2] mmc: mxs-mmc: add cd-inverted and non-removeable
  2013-03-25 15:02 [PATCH 0/2] mmc: mxs-mmc: add cd-inverted and non-removeable Marc Kleine-Budde
  2013-03-25 15:02 ` [PATCH 1/2] mmc: mxs-mmc: add cd-inverted property Marc Kleine-Budde
  2013-03-25 15:02 ` [PATCH 2/2] mmc: mxs-mmc: add non-removeable property Marc Kleine-Budde
@ 2013-03-26  5:36 ` Shawn Guo
  2013-04-03  7:56 ` Marc Kleine-Budde
  3 siblings, 0 replies; 7+ messages in thread
From: Shawn Guo @ 2013-03-26  5:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 25, 2013 at 04:02:29PM +0100, Marc Kleine-Budde wrote:
> Hello,
> 
> this patch add support for the cd-inverted and non-removeable property (as
> defined in devicetree/bindings/mmc/mmc.txt) to the mxs-mmc driver. Tested on a
> custom imx28 board.
> 
> This series applies to Chris Ball's cjb/mmc-next branch.

For both,

Acked-by: Shawn Guo <shawn.guo@linaro.org>

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

* [PATCH 0/2] mmc: mxs-mmc: add cd-inverted and non-removeable
  2013-03-25 15:02 [PATCH 0/2] mmc: mxs-mmc: add cd-inverted and non-removeable Marc Kleine-Budde
                   ` (2 preceding siblings ...)
  2013-03-26  5:36 ` [PATCH 0/2] mmc: mxs-mmc: add cd-inverted and non-removeable Shawn Guo
@ 2013-04-03  7:56 ` Marc Kleine-Budde
  3 siblings, 0 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2013-04-03  7:56 UTC (permalink / raw)
  To: linux-arm-kernel

On 03/25/2013 04:02 PM, Marc Kleine-Budde wrote:
> Hello,
> 
> this patch add support for the cd-inverted and non-removeable property (as
> defined in devicetree/bindings/mmc/mmc.txt) to the mxs-mmc driver. Tested on a
> custom imx28 board.
> 
> This series applies to Chris Ball's cjb/mmc-next branch.

ping

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130403/5c9ccc69/attachment.sig>

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

* [PATCH 2/2] mmc: mxs-mmc: add non-removeable property
  2013-03-25 15:02 ` [PATCH 2/2] mmc: mxs-mmc: add non-removeable property Marc Kleine-Budde
@ 2013-04-04 14:07   ` Chris Ball
  2013-04-04 14:25     ` Marc Kleine-Budde
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Ball @ 2013-04-04 14:07 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Mon, Mar 25 2013, Marc Kleine-Budde wrote:
> +	host->non_removeable = of_property_read_bool(np, "non-removable");
> +	if (host->non_removeable)
> +		mmc->caps |= MMC_CAP_NONREMOVABLE;

The correct spelling is "non_removable", as used in the DT property.

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* [PATCH 2/2] mmc: mxs-mmc: add non-removeable property
  2013-04-04 14:07   ` Chris Ball
@ 2013-04-04 14:25     ` Marc Kleine-Budde
  0 siblings, 0 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2013-04-04 14:25 UTC (permalink / raw)
  To: linux-arm-kernel

On 04/04/2013 04:07 PM, Chris Ball wrote:
> Hi,
> 
> On Mon, Mar 25 2013, Marc Kleine-Budde wrote:
>> +	host->non_removeable = of_property_read_bool(np, "non-removable");
>> +	if (host->non_removeable)
>> +		mmc->caps |= MMC_CAP_NONREMOVABLE;
> 
> The correct spelling is "non_removable", as used in the DT property.
> 
> Thanks,

Will fix.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130404/0d412978/attachment.sig>

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

end of thread, other threads:[~2013-04-04 14:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-25 15:02 [PATCH 0/2] mmc: mxs-mmc: add cd-inverted and non-removeable Marc Kleine-Budde
2013-03-25 15:02 ` [PATCH 1/2] mmc: mxs-mmc: add cd-inverted property Marc Kleine-Budde
2013-03-25 15:02 ` [PATCH 2/2] mmc: mxs-mmc: add non-removeable property Marc Kleine-Budde
2013-04-04 14:07   ` Chris Ball
2013-04-04 14:25     ` Marc Kleine-Budde
2013-03-26  5:36 ` [PATCH 0/2] mmc: mxs-mmc: add cd-inverted and non-removeable Shawn Guo
2013-04-03  7:56 ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).