From patchwork Wed Feb 6 19:46:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2106531 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id C59A23FCFC for ; Wed, 6 Feb 2013 19:47:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758030Ab3BFTrV (ORCPT ); Wed, 6 Feb 2013 14:47:21 -0500 Received: from moutng.kundenserver.de ([212.227.126.186]:52780 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757346Ab3BFTrR (ORCPT ); Wed, 6 Feb 2013 14:47:17 -0500 Received: from axis700.grange (dslb-178-006-240-079.pools.arcor-ip.net [178.6.240.79]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0MT86g-1UUA1f2kys-00SPwx; Wed, 06 Feb 2013 20:47:06 +0100 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id E24B040BC7; Wed, 6 Feb 2013 20:47:04 +0100 (CET) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1U3AxU-0004qY-Oi; Wed, 06 Feb 2013 20:47:04 +0100 From: Guennadi Liakhovetski To: linux-mmc@vger.kernel.org Cc: devicetree-discuss@lists.ozlabs.org, linux-sh@vger.kernel.org, Magnus Damm , Simon Horman , Guennadi Liakhovetski , Arnd Bergmann Subject: [PATCH v3 12/13] mmc: add DT bindings for more MMC capability flags Date: Wed, 6 Feb 2013 20:46:59 +0100 Message-Id: <1360180020-18555-13-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1360180020-18555-1-git-send-email-g.liakhovetski@gmx.de> References: <1360180020-18555-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:RsYUZEAD8IxUllOREsr3M0mGhLF143zE//Dv7lLiDEL aaC/p2n9BQGdu6iE3xRQ2llOhkja3BY50ZZ+qk0cv51VncgD2I 4sTQOOWSkJDJQOyeXpwsCfWGV1ZH4wQmyjOdUlY10rDzQTyM95 cqahIbkJPx9qFMFA+tGPgi2kLnnzh4ACJ+6elAgx+4ceujsNCR fJn6PO7a//eiZ598ZLr6AO4x9ovRdwY5z1eBHeWaqfbH/Y6hyq eNskV/fS0tddBm/k5N9PU2RZ8sV6BLOTsTSs5eBNS1JJKIe5wy d3ADG0vFzal3EIhcXJmjW/0kYHwXhPlUj0uhwMaDmCkKvEKLHX oycy1DEa0hxljP6oneocVrw5qkaNQAVAT6+cM7CkRFpyKF+yda W2YsOoKLhXwUg== 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, MMC_CAP_POWER_OFF_CARD and MMC_CAP_SDIO_IRQ 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 Cc: Arnd Bergmann --- v3: add cap-sdio-irq Documentation/devicetree/bindings/mmc/mmc.txt | 4 ++++ drivers/mmc/core/host.c | 13 +++++++++++++ 2 files changed, 17 insertions(+), 0 deletions(-) diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt index 51dd64f..a043c78 100644 --- a/Documentation/devicetree/bindings/mmc/mmc.txt +++ b/Documentation/devicetree/bindings/mmc/mmc.txt @@ -25,6 +25,10 @@ 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 +- cap-sdio-irq: enable SDIO IRQ signalling on this interface *NOTE* on CD and WP polarity. As of 3.8, SD/MMC drivers parse their DT nodes each in its own way, including calculation of CD and WP polarities. Our goal is diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index c412612..56b6227 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -380,6 +380,19 @@ void mmc_of_parse(struct mmc_host *host) } if (explicit_inv_wp ^ gpio_inv_wp) host->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH; + + 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, "cap-sdio-irq", &len)) + host->caps |= MMC_CAP_SDIO_IRQ; + 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);