public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang@pengutronix.de>
To: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: Albert Herranz <albert_herranz@yahoo.es>,
	linux-mmc@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: [RFC PATCH v2 0/4] mmc: wii: sdhci controller support
Date: Wed, 16 Dec 2009 13:42:34 +0100	[thread overview]
Message-ID: <20091216124234.GB4283@pengutronix.de> (raw)
In-Reply-To: <20091214224552.GA21934@oksana.dev.rtsoft.ru>

[-- Attachment #1: Type: text/plain, Size: 2056 bytes --]

On Tue, Dec 15, 2009 at 01:45:52AM +0300, Anton Vorontsov wrote:
> On Mon, Dec 14, 2009 at 11:24:15PM +0100, Albert Herranz wrote:
> > This patch set adds support for the SDHCI controllers found in the
> > "Hollywood" chipset of the Nintendo Wii video game console.
> > 
> > First, the existing sdhci-of driver is splitted into a core part and
> > a eSDHC-only part. Then the Nintendo Wii SDHCI support is added as an
> > add-on to that, re-using common code.
> 
> All four patches
> 
> Acked-by: Anton Vorontsov <avorontsov@ru.mvista.com>

Interesting coincidence, I'd need to tackle these parts right now, too, just
with a different aim. The eSDHC-core was also used in the ARM-based imx35,
which means I need the code using a platform device. Just yesterday, I thought
about ways to do this. My favourite idea so far is to implement a
quirk-infrastructure. So, roughly:

Let the matching-structs look something like this:

static const struct of_device_id sdhci_of_match[] = {
	{ .compatible = "fsl,mpc8379-esdhc", .data = "esdhc", },
	...
}

Then, we have a sdhci-quirk.c making use of a struct like this:

struct sdhci_quirk_data {
	char name[SDHCI_QUIRK_NAME_SIZE];
	unsigned int quirks;
	struct sdhci_ops *ops;
};

and exposing a function like

	sdhci_apply_quirk(host, sdhci_match_data);

which will then go through the table of quirks to see if the match_data matches
a quirk-name. That could be used in sdhci-of.c and shdci-pltfm.c equally.

I am still looking into issues like abstracting the clock-handling, make bigger
quirks optional and checking if there is a graceful way for a quirk to keep
extra-data. I'd be happy to hear opinions about the current sketch
nevertheless.

Kind regards,

   Wolfram

PS: This shouldn't affect the above patch-set IMHO. Factoring out the
esdhc-stuff is a step in the right direction in any case.

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2009-12-16 12:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-14 22:24 [RFC PATCH v2 0/4] mmc: wii: sdhci controller support Albert Herranz
2009-12-14 22:24 ` [RFC PATCH v2 1/4] sdhci: protect header file against multi inclusion Albert Herranz
2009-12-14 22:24 ` [RFC PATCH v2 2/4] sdhci-of: rename main driver file prior to reorganization Albert Herranz
2009-12-14 22:24 ` [RFC PATCH v2 3/4] sdhci-of: reorganize driver to support additional hardware Albert Herranz
2009-12-14 22:24 ` [RFC PATCH v2 4/4] sdhci-of: add support for the wii sdhci controller Albert Herranz
2009-12-14 22:45 ` [RFC PATCH v2 0/4] mmc: wii: sdhci controller support Anton Vorontsov
2009-12-16 12:42   ` Wolfram Sang [this message]
2009-12-16 13:06     ` Anton Vorontsov
2009-12-16 13:53       ` Wolfram Sang
2009-12-16 22:35   ` Albert Herranz

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=20091216124234.GB4283@pengutronix.de \
    --to=w.sang@pengutronix.de \
    --cc=akpm@linux-foundation.org \
    --cc=albert_herranz@yahoo.es \
    --cc=avorontsov@ru.mvista.com \
    --cc=linux-mmc@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox