linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang@pengutronix.de>
To: Shawn Guo <shawn.guo@linaro.org>
Cc: Chris Ball <cjb@laptop.org>,
	sameo@linux.intel.com, Arnd Bergmann <arnd@arndb.de>,
	patches@linaro.org, devicetree-discuss@lists.ozlabs.org,
	linux-mmc@vger.kernel.org, Saeed Bishara <saeed@marvell.com>,
	Xiaobo Xie <X.Xie@freescale.com>,
	kernel@pengutronix.de, Mike Rapoport <mike@compulab.co.il>,
	Olof Johansson <olof@lixom.net>,
	Anton Vorontsov <avorontsov@ru.mvista.com>,
	linuxppc-dev@lists.ozlabs.org,
	Albert Herranz <albert_herranz@yahoo.es>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 3/7] mmc: sdhci: make sdhci-of device drivers self registered
Date: Tue, 24 May 2011 21:32:02 +0200	[thread overview]
Message-ID: <20110524193202.GB25727@pengutronix.de> (raw)
In-Reply-To: <1304601778-13837-4-git-send-email-shawn.guo@linaro.org>

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

On Thu, May 05, 2011 at 09:22:54PM +0800, Shawn Guo wrote:
> The patch turns the sdhci-of-core common stuff into helper functions
> added into sdhci-pltfm.c, and makes sdhci-of device drviers self
> registered using the same pair of .probe and .remove used by
> sdhci-pltfm device drivers.
> 
> As a result, sdhci-of-core.c and sdhci-of.h can be eliminated with
> those common things merged into sdhci-pltfm.c and sdhci-pltfm.h
> respectively.
> 
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>

After taking care of Anton's comment and fixing this minor thingie...

> +#ifdef CONFIG_OF
> +static bool sdhci_of_wp_inverted(struct device_node *np)
> +{
> +	if (of_get_property(np, "sdhci,wp-inverted", NULL))
> +		return true;
> +
> +	/* Old device trees don't have the wp-inverted property. */
> +#ifdef CONFIG_PPC
> +	return machine_is(mpc837x_rdb) || machine_is(mpc837x_mds);
> +#else
> +	return false;
> +#endif

/* CONFIG_PPC */ after #endif

> +}
> +
> +void sdhci_get_of_property(struct platform_device *pdev)
> +{
> +	struct device_node *np = pdev->dev.of_node;
> +	struct sdhci_host *host = platform_get_drvdata(pdev);
> +	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> +	const __be32 *clk;
> +	int size;
> +
> +	if (of_device_is_available(np)) {
> +		if (of_get_property(np, "sdhci,auto-cmd12", NULL))
> +			host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12;
> +
> +		if (of_get_property(np, "sdhci,1-bit-only", NULL))
> +			host->quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA;
> +
> +		if (sdhci_of_wp_inverted(np))
> +			host->quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT;
> +
> +		clk = of_get_property(np, "clock-frequency", &size);
> +		if (clk && size == sizeof(*clk) && *clk)
> +			pltfm_host->clock = be32_to_cpup(clk);
> +	}
> +}
> +#else
> +void sdhci_get_of_property(struct platform_device *pdev) {}
> +#endif

/* CONFIG_OF */

you can add

Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>

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

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

  parent reply	other threads:[~2011-05-24 19:32 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-05 13:22 [PATCH v2 0/7] Consolidate sdhci pltfm & OF drivers and get them self registered Shawn Guo
2011-05-05 13:22 ` [PATCH v2 1/7] mmc: sdhci: make sdhci-pltfm device drivers " Shawn Guo
2011-05-05 14:24   ` Anton Vorontsov
2011-05-05 13:22 ` [PATCH v2 2/7] mmc: sdhci: eliminate sdhci_of_host and sdhci_of_data Shawn Guo
2011-05-05 14:23   ` Anton Vorontsov
2011-05-24 19:26   ` Wolfram Sang
2011-05-05 13:22 ` [PATCH v2 3/7] mmc: sdhci: make sdhci-of device drivers self registered Shawn Guo
2011-05-05 14:23   ` Anton Vorontsov
2011-05-06  2:15     ` Shawn Guo
2011-05-24 19:32   ` Wolfram Sang [this message]
2011-05-05 13:22 ` [PATCH v2 4/7] sdhci: rename sdhci-esdhc-imx.c to sdhci-esdhc.c Shawn Guo
2011-05-05 13:22 ` [PATCH v2 5/7] mmc: sdhci: consolidate sdhci-of-esdhc and sdhci-esdhc-imx Shawn Guo
2011-05-05 14:20   ` Anton Vorontsov
2011-05-19  9:48   ` Wolfram Sang
2011-05-24 19:40   ` Wolfram Sang
2011-05-25  6:06     ` Shawn Guo
2011-05-25  6:46       ` Uwe Kleine-König
2011-05-25  9:36         ` Shawn Guo
2011-05-05 13:22 ` [PATCH v2 6/7] mmc: sdhci: merge two sdhci-pltfm.h into one Shawn Guo
2011-05-05 14:13   ` Anton Vorontsov
2011-05-05 13:22 ` [PATCH v2 7/7] ARM: mxc: remove esdhc.h and use the public one Shawn Guo
2011-05-06  8:39   ` Uwe Kleine-König
2011-05-09  6:23     ` Shawn Guo
2011-05-19  9:40 ` [PATCH v2 0/7] Consolidate sdhci pltfm & OF drivers and get them self registered Wolfram Sang
2011-05-19 16:09   ` Shawn Guo
2011-05-19 17:05     ` 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=20110524193202.GB25727@pengutronix.de \
    --to=w.sang@pengutronix.de \
    --cc=X.Xie@freescale.com \
    --cc=albert_herranz@yahoo.es \
    --cc=arnd@arndb.de \
    --cc=avorontsov@ru.mvista.com \
    --cc=cjb@laptop.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mike@compulab.co.il \
    --cc=olof@lixom.net \
    --cc=patches@linaro.org \
    --cc=saeed@marvell.com \
    --cc=sameo@linux.intel.com \
    --cc=shawn.guo@linaro.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).