From patchwork Wed Jan 23 16:45:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2026091 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id A6792DF2E5 for ; Wed, 23 Jan 2013 16:45:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754231Ab3AWQpP (ORCPT ); Wed, 23 Jan 2013 11:45:15 -0500 Received: from moutng.kundenserver.de ([212.227.126.171]:58535 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752976Ab3AWQpO (ORCPT ); Wed, 23 Jan 2013 11:45:14 -0500 Received: from axis700.grange (dslb-178-006-250-035.pools.arcor-ip.net [178.6.250.35]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0M53tq-1UxIfh3n0o-00z8I0; Wed, 23 Jan 2013 17:45:12 +0100 Received: by axis700.grange (Postfix, from userid 1000) id 8CC8440B99; Wed, 23 Jan 2013 17:45:11 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id 82E8640B98; Wed, 23 Jan 2013 17:45:11 +0100 (CET) Date: Wed, 23 Jan 2013 17:45:11 +0100 (CET) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: linux-mmc@vger.kernel.org cc: Chris Ball , devicetree-discuss@lists.ozlabs.org, Magnus Damm Subject: [PATCH/RFC] mmc: add DT bindings for more MMC capability flags Message-ID: MIME-Version: 1.0 X-Provags-ID: V02:K0:A3GQNARXBLfFITnsoAK3w06FY+tbvVLpOR6uJ39foCU Gmsnov90MeSaVZWa5LnanB2QAgmUVmG7EHdOXhgCB8Wxh1Yclf lCTh/MPvZjPVxH2kNsLFTHSdkxsitkvHgyROw3E8YJY34Llsts VfqzdSIb22f9RRZQxZ+WomYS4iaJXeVj/yrvpBaNrLgxkuWQOo 9ldN6+Ui7+jHj16puMLNAcluA/TVyO24sIURItsUVfUkAWql0j AW1h8mBKTwb8mAI2v0FntnZz0twpBf/KE81QA4z4H9hb04ykq8 9nH41Uq1zpB5jUhEdgR5xlIu5wCro7iVihRIIXpfa2q02pUSXi PLB4rgWcd3HhIT7q7rg8e457kdIz5vJvIPmBPo69iYTX7oEYad eCnbqsPHk4XDg== Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Many MMC capability flags are platform-dependent and are traditionally set in platform data. With DT often each such capability requires a special binding. Add bindings for MMC_CAP_SD_HIGHSPEED, MMC_CAP_MMC_HIGHSPEED and MMC_CAP_POWER_OFF_CARD capabilities. Also add code to DT parser to look up "keep-power-in-suspend" and "enable-sdio-wakeup" bindings and set MMC_PM_KEEP_POWER and MMC_PM_WAKE_SDIO_IRQ respectively, if found. Signed-off-by: Guennadi Liakhovetski --- Attention: contains new DT bindings, please, comment! Documentation/devicetree/bindings/mmc/mmc.txt | 5 ++++- drivers/mmc/core/host.c | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletions(-) diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt index e180892..92ec534c 100644 --- a/Documentation/devicetree/bindings/mmc/mmc.txt +++ b/Documentation/devicetree/bindings/mmc/mmc.txt @@ -25,8 +25,11 @@ Optional properties: - max-frequency: maximum operating clock frequency - no-1-8-v: when present, denotes that 1.8v card voltage is not supported on this system, even if the controller claims it is. +- cap-sd-highspeed: SD high-speed timing is supported +- cap-mmc-highspeed: MMC high-speed timing is supported +- cap-power-off-card: powering off the card is safe -cd-inverted and wp-inverted properties are deprecated ans shouldn't be used, +cd-inverted and wp-inverted properties are deprecated and shouldn't be used, instead pleaseuse the OF_GPIO_ACTIVE_LOW flag in respective GPIO bindings. Note, that the default (as defined by the SDHCI standard) CD and WP polarity is active-low, so, OF_GPIO_ACTIVE_LOW should normally be set, and only be left diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index e4c1cbd..f3ea268 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -372,6 +372,17 @@ void mmc_of_parse(struct mmc_host *host) dev_err(host->parent, "Failed to request WP GPIO: %d!\n", ret); } + + if (of_find_property(np, "cap-sd-highspeed", &len)) + host->caps |= MMC_CAP_SD_HIGHSPEED; + if (of_find_property(np, "cap-mmc-highspeed", &len)) + host->caps |= MMC_CAP_MMC_HIGHSPEED; + if (of_find_property(np, "cap-power-off-card", &len)) + host->caps |= MMC_CAP_POWER_OFF_CARD; + if (of_find_property(np, "keep-power-in-suspend", &len)) + host->pm_caps |= MMC_PM_KEEP_POWER; + if (of_find_property(np, "enable-sdio-wakeup", &len)) + host->pm_caps |= MMC_PM_WAKE_SDIO_IRQ; } EXPORT_SYMBOL(mmc_of_parse);