linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: linaro-dev-cunTk1MwBs8s++Sfvej+rw@public.gmane.org,
	sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 4/5] mmc: sdhci: consolidate sdhci-of-esdhc and sdhci-esdhc-imx
Date: Tue, 19 Apr 2011 12:21:10 +0200	[thread overview]
Message-ID: <20110419102110.GE4164@pengutronix.de> (raw)
In-Reply-To: <1301042931-4869-5-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 3256 bytes --]

>  config MMC_SDHCI_ESDHC_IMX
> -	bool "SDHCI platform support for the Freescale eSDHC i.MX controller"
> +	bool "SDHCI support for the Freescale eSDHC i.MX controller"
>  	depends on ARCH_MX25 || ARCH_MX35 || ARCH_MX5
>  	depends on MMC_SDHCI
> -	select MMC_SDHCI_PLTFM
> +	select MMC_SDHCI_ESDHC
>  	select MMC_SDHCI_IO_ACCESSORS
>  	help
> -	  This selects the Freescale eSDHC controller support on the platform
> -	  bus, found on platforms like mx35/51.
> +	  This selects the Freescale eSDHC controller support on platforms
> +	  like mx35/51.

While we are at it, mx25 could be added and mx53 (and you know better
what else will be coming ;))

> diff --git a/drivers/mmc/host/sdhci-esdhc.c b/drivers/mmc/host/sdhci-esdhc.c
> new file mode 100644
> index 0000000..b3d1bc1
> --- /dev/null
> +++ b/drivers/mmc/host/sdhci-esdhc.c
> @@ -0,0 +1,413 @@
> +/*
> + * Freescale eSDHC controller driver for MPCxxx and i.MX.
> + *
> + * Copyright (c) 2007 Freescale Semiconductor, Inc.
> + *   Author: Xiaobo Xie <X.Xie-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> + *
> + * Copyright (c) 2009 MontaVista Software, Inc.
> + *   Author: Anton Vorontsov <avorontsov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
> + *
> + * Copyright (c) 2010 Pengutronix e.K.
> + *   Author: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License.
> + */
> +
> +#include <linux/io.h>
> +#include <linux/delay.h>
> +#include <linux/err.h>
> +#include <linux/clk.h>
> +#include <linux/mmc/host.h>
> +#include <linux/mmc/sdhci-pltfm.h>
> +#ifdef CONFIG_MMC_SDHCI_ESDHC_IMX
> +#include <mach/hardware.h>
> +#endif
> +#include "sdhci.h"
> +#include "sdhci-pltfm.h"
> +
> +/*
> + * Ops and quirks for the Freescale eSDHC controller.
> + */
> +
> +#define ESDHC_DEFAULT_QUIRKS	(SDHCI_QUIRK_FORCE_BLK_SZ_2048 | \
> +				SDHCI_QUIRK_BROKEN_CARD_DETECTION | \
> +				SDHCI_QUIRK_NO_BUSY_IRQ | \
> +				SDHCI_QUIRK_NONSTANDARD_CLOCK | \
> +				SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | \
> +				SDHCI_QUIRK_PIO_NEEDS_DELAY | \
> +				SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET | \
> +				SDHCI_QUIRK_NO_CARD_NO_RESET)

These are not the current quirks. Meanwhile BROKEN_CARD_DETECTION is
gone as well as NO_CARD_NO_RESET (at least for imx). My additions to use
GPIOs for card detect and write protect are also not in this version.

[...]

> +static struct sdhci_pltfm_data sdhci_esdhc_mpc_pdata = {
> +	.quirks = ESDHC_DEFAULT_QUIRKS,
> +	.ops = &sdhci_esdhc_mpc_ops,
> +};
> +#endif

Please mark the #endif with comments of the expression they are
depending on, e.g.

#endif /* CONFIG_MMC_SDHCI_ESDHC_MPC */

if it is not immediately visible. That helps readability.

[...]

Phew, due to all these hardware bugs, the driver will get messy, even if
we try hard. Any chances that future revisions of the core will be
updated? :)

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 192 bytes --]

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

  parent reply	other threads:[~2011-04-19 10:21 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-25  8:48 [PATCH 0/5] consolidate sdhci pltfm & OF drivers and get them self registered Shawn Guo
     [not found] ` <1301042931-4869-1-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-03-25  8:48   ` [PATCH 1/5] mmc: sdhci: make sdhci-pltfm device drivers " Shawn Guo
     [not found]     ` <1301042931-4869-2-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-03-31 15:33       ` Grant Likely
     [not found]         ` <20110331153322.GA26612-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2011-04-01  6:10           ` Shawn Guo
2011-04-19 10:20       ` Wolfram Sang
2011-04-21  8:03         ` Shawn Guo
2011-04-21  9:57           ` Wolfram Sang
2011-03-25  8:48   ` [PATCH 2/5] mmc: sdhci: eliminate sdhci_of_host and sdhci_of_data Shawn Guo
     [not found]     ` <1301042931-4869-3-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-03-31 15:34       ` Grant Likely
2011-04-19 10:20       ` Wolfram Sang
     [not found]         ` <20110419102053.GC4164-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-04-21  8:10           ` Shawn Guo
2011-03-25  8:48   ` [PATCH 3/5] mmc: sdhci: make sdhci-of device drivers self registered Shawn Guo
     [not found]     ` <1301042931-4869-4-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-03-31 15:38       ` Grant Likely
2011-04-19 10:21     ` Wolfram Sang
2011-04-21  8:17       ` Shawn Guo
2011-03-25  8:48   ` [PATCH 4/5] mmc: sdhci: consolidate sdhci-of-esdhc and sdhci-esdhc-imx Shawn Guo
2011-03-31 15:53     ` Grant Likely
2011-04-01  6:18       ` Shawn Guo
     [not found]     ` <1301042931-4869-5-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-04-19 10:21       ` Wolfram Sang [this message]
2011-04-21  8:53         ` Shawn Guo
2011-03-25  8:48   ` [PATCH 5/5] mmc: sdhci: merge two sdhci-pltfm.h into one Shawn Guo
2011-03-31 15:54     ` Grant Likely
2011-04-19 10:21     ` Wolfram Sang
2011-03-31  4:25 ` [PATCH 0/5] consolidate sdhci pltfm & OF drivers and get them self registered Shawn Guo
     [not found]   ` <20110331042507.GA21846-+NayF8gZjK2ctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2011-03-31  4:56     ` Grant Likely
2011-03-31 16:36 ` Chris Ball
2011-04-13  6:26   ` Shawn Guo
2011-04-19 10:20 ` Wolfram Sang
2011-04-19 12:47   ` Kyungmin Park
2011-04-19 17:47     ` Wolfram Sang
     [not found]       ` <20110419174712.GA29314-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-04-20  4:23         ` Kyungmin Park
2011-04-21  7:48   ` Shawn Guo
2011-04-26 13:20     ` Wolfram Sang

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=20110419102110.GE4164@pengutronix.de \
    --to=w.sang-bicnvbalz9megne8c9+irq@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=linaro-dev-cunTk1MwBs8s++Sfvej+rw@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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 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).