From patchwork Fri Dec 7 16:19:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Rudholm X-Patchwork-Id: 13420 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 3122A23E51 for ; Fri, 7 Dec 2012 16:20:54 +0000 (UTC) Received: from mail-ie0-f178.google.com (mail-ie0-f178.google.com [209.85.223.178]) by fiordland.canonical.com (Postfix) with ESMTP id D41A3A19897 for ; Fri, 7 Dec 2012 16:20:53 +0000 (UTC) Received: by mail-ie0-f178.google.com with SMTP id c12so1708865ieb.23 for ; Fri, 07 Dec 2012 08:20:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:x-gm-message-state; bh=j72s3hnPOnMkSVNUJ24uH7090+idcKAQHyVj/dBLM14=; b=fm8PVPnMhQwHPj/HF15fhFn+Dpgx3xIzpRi5vAWDJHvSC+EvLh0U7U7epBVhtE+t0P NQnh33GN4GU1/YEgNlny8iI2iBNBIPZzqJC3Aqg6iNznIdeB40vIbv714uxST5MQzlVf ekvcY3sJYKhr/OFpI92488nRZn/bPdUvUBTT62vhw/Ff+39XDd1qj0HNP0s7rL0zj1Ku ExSUGMff2sskzFxGJWvzmFwlnyEhJqMkS0ksT55NMlYb9QxkWf/kzuZRhnjv40HuIYIj +2zBOCBPIX7NKxRkChu9K42QcXnL8XtrD+DQSI0UAXgMlNwf9SgbJTZr2Vf0JtfuW4qb YYFg== Received: by 10.50.213.69 with SMTP id nq5mr9602315igc.70.1354897253282; Fri, 07 Dec 2012 08:20:53 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp483806igt; Fri, 7 Dec 2012 08:20:52 -0800 (PST) Received: by 10.216.204.32 with SMTP id g32mr2331265weo.79.1354897249804; Fri, 07 Dec 2012 08:20:49 -0800 (PST) Received: from eu1sys200aog105.obsmtp.com (eu1sys200aog105.obsmtp.com [207.126.144.119]) by mx.google.com with SMTP id s42si25301454eem.34.2012.12.07.08.20.36 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 07 Dec 2012 08:20:49 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.119 is neither permitted nor denied by best guess record for domain of johan.rudholm@stericsson.com) client-ip=207.126.144.119; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.119 is neither permitted nor denied by best guess record for domain of johan.rudholm@stericsson.com) smtp.mail=johan.rudholm@stericsson.com Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob105.postini.com ([207.126.147.11]) with SMTP ID DSNKUMIXSkN1EoPaghYWdtC9PsW3p0uw2gOv@postini.com; Fri, 07 Dec 2012 16:20:49 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D074E1A9; Fri, 7 Dec 2012 16:20:20 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 6A13C4B77; Fri, 7 Dec 2012 16:20:20 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 1544824C2FC; Fri, 7 Dec 2012 17:20:12 +0100 (CET) Received: from steludxu1610.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.3.83.0; Fri, 7 Dec 2012 17:20:19 +0100 From: Johan Rudholm To: , Chris Ball Cc: Per Forlin , Ulf Hansson , Fredrik Soderstedt , Kevin Liu , Philip Rakity , Daniel Drake , Aaron , Subhash Jadavani , Johan Rudholm Subject: [PATCH 1/3] mmc: core: Add mmc_power_cycle Date: Fri, 7 Dec 2012 17:19:34 +0100 Message-ID: <1354897176-15307-2-git-send-email-johan.rudholm@stericsson.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1354897176-15307-1-git-send-email-johan.rudholm@stericsson.com> References: <1354897176-15307-1-git-send-email-johan.rudholm@stericsson.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlYuQNTfT5pOpbpUprCz4wJajrcm5gFrq72HRAVGhLjdjyYjv2YT/a8nS3H26j1Td9ouQwE Add mmc_power_cycle which can be used to power cycle for instance SD-cards. Signed-off-by: Johan Rudholm --- drivers/mmc/core/core.c | 8 ++++++++ drivers/mmc/core/core.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index aaed768..285f064 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1372,6 +1372,14 @@ void mmc_power_off(struct mmc_host *host) mmc_host_clk_release(host); } +void mmc_power_cycle(struct mmc_host *host) +{ + mmc_power_off(host); + /* Wait at least 1 ms according to SD spec */ + mmc_delay(1); + mmc_power_up(host); +} + /* * Cleanup when the last reference to the bus operator is dropped. */ diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h index 3bdafbc..4a90067 100644 --- a/drivers/mmc/core/core.h +++ b/drivers/mmc/core/core.h @@ -45,6 +45,7 @@ int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, void mmc_set_timing(struct mmc_host *host, unsigned int timing); void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type); void mmc_power_off(struct mmc_host *host); +void mmc_power_cycle(struct mmc_host *host); static inline void mmc_delay(unsigned int ms) {