From patchwork Mon May 8 22:09:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 98850 Delivered-To: patches@linaro.org Received: by 10.140.96.100 with SMTP id j91csp1539133qge; Mon, 8 May 2017 15:09:08 -0700 (PDT) X-Received: by 10.28.154.86 with SMTP id c83mr6060676wme.94.1494281348808; Mon, 08 May 2017 15:09:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494281348; cv=none; d=google.com; s=arc-20160816; b=Z4/yh8yyTnpvsKOSXYI9tWmqX37siPMhwuT5lZUfA5YqkiuIb42OujeSC+rv3ZKzyU r0jcFANVil1ICbnyrRlRnfzcon/JxQgaKjnKXxGltxvHFwcG5VnNHmJK/jr9seG7+zXw AqyviNI4M56NresKk8I5Uk4AzCk18dBcQ4JzuFXBhJ5lqg+07sjE77CVymGnVOOYrFVd Wjp6R1VxQzKX2cK7ZubLjVnaBxER8UAcFKFPlVwdSoHHaY7TqfBpVz+TVuRuoIlbsbJf ox1lTyOo8mkluVJnHpU+2NLBDe9aL3ZXhYm95OgC48wdWjVCFq9X9q3U8oHTBs6EIevi WPtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=RqxjaRP6bAlLrU+Of5N/8exF2RISG6jrLnvNa5KjH/k=; b=yWkYQky0mjk9voYuRmAQMt27kHFsQUlQ5nOzOm3bkzOJjXHKzsUwdg7S4lKmExgYYd 4KFl9opU4Q0bY/TREf/X/AzZski7yQpha27pMI73/i1yKG47S1Gsf8uNWij04KzKRm6j UFTepelfIxbqEhjHKezb/9hvxQey8YzLvBG+GZqlylp9+wWZ4941I6N/5wB0w+JzFueB 97IYcK0ZROwK4Y/J1Q3E2RHUrSad5E1IEzb6r2qgMFFYR199UMzDa4UfgCjOZ929d6Af xvt3hhDzYQWN3eZCMcmpPbEvdCdat8Yu8R8I4rTko04OdsXiJHBB/SwNERC3RUJKhd03 HVtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:400c:c09::230 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com. [2a00:1450:400c:c09::230]) by mx.google.com with ESMTPS id 46si16788402wrx.82.2017.05.08.15.09.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 May 2017 15:09:08 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:400c:c09::230 as permitted sender) client-ip=2a00:1450:400c:c09::230; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:400c:c09::230 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by mail-wm0-x230.google.com with SMTP id u65so100519940wmu.1 for ; Mon, 08 May 2017 15:09:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RqxjaRP6bAlLrU+Of5N/8exF2RISG6jrLnvNa5KjH/k=; b=e4K8EolHr6j046Fnb6m3qHZjCNnunFw86DYAbT9NG57yZUfILHdJhzy1jraiSFSJPT Fzx+X4Hxqu/e1aPt/otyBMorXVCxlqiLKHYOdyjLO9Q/31pz1k12HI3qswqOPgP429Yi 1Ne362vW/QEmhh1MjzQDHr5MdTOpy8bLNnaOA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RqxjaRP6bAlLrU+Of5N/8exF2RISG6jrLnvNa5KjH/k=; b=BLx9bTs++uvOmIAKe6A4l0syhhpm1Tigb2JkmIFjmETbKiMgy4fuRqazsBFn1OL/4f JS4kK2xHT7cTAOFHnNZIEQHZ75o/dCn+1THRpeXDy9DooM6tblaMpr2evJWZMOnOLfIz WxthtqqB49nuVA8Kcha3PT2jqCZxy+SSXK9hILjMcyXN9pTBWeEp8Fd1ZYz3QB+4yZxy Ru06JoP4Ilx9u6MdfeWVtx8m4B1+XQHP/MiRO+fsSmiH0oEA9C2whsU/jYXSJXP9sAIm O6vtXjaMVAI9dCLraKUQx9rTAHOXQxmOIqYEYxIdg5QYpIx2NSQualvrSPdvCJ8aji7n G/Sw== X-Gm-Message-State: AN3rC/7vlFA7KQCFtBBJdxtK60qKAkxMgyIGNA5soTd3FpmnMqs2yH+G EeQm3zieeFD255Q6ZUk= X-Received: by 10.25.89.197 with SMTP id n188mr23179061lfb.163.1494281348455; Mon, 08 May 2017 15:09:08 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-155-4-221-67.na.cust.bahnhof.se. [155.4.221.67]) by smtp.gmail.com with ESMTPSA id 1sm1741011ljn.59.2017.05.08.15.09.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 May 2017 15:09:07 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Heiner Kallweit , Marek Szyprowski , Javier Martinez Canillas , Douglas Anderson , Markus Reichl , Anand Moon Subject: [PATCH 1/2] mmc: pwrseq: Add reset callback to the struct mmc_pwrseq_ops Date: Tue, 9 May 2017 00:09:02 +0200 Message-Id: <1494281343-18963-2-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1494281343-18963-1-git-send-email-ulf.hansson@linaro.org> References: <1494281343-18963-1-git-send-email-ulf.hansson@linaro.org> The ->reset() callback is needed to implement a better support for eMMC HW reset. The following changes will take advantage of the new callback. Suggested-by: Heiner Kallweit Signed-off-by: Ulf Hansson --- drivers/mmc/core/pwrseq.c | 8 ++++++++ drivers/mmc/core/pwrseq.h | 3 +++ 2 files changed, 11 insertions(+) -- 2.7.4 diff --git a/drivers/mmc/core/pwrseq.c b/drivers/mmc/core/pwrseq.c index 9386c47..e3ad30f 100644 --- a/drivers/mmc/core/pwrseq.c +++ b/drivers/mmc/core/pwrseq.c @@ -76,6 +76,14 @@ void mmc_pwrseq_power_off(struct mmc_host *host) pwrseq->ops->power_off(host); } +void mmc_pwrseq_reset(struct mmc_host *host) +{ + struct mmc_pwrseq *pwrseq = host->pwrseq; + + if (pwrseq && pwrseq->ops->reset) + pwrseq->ops->reset(host); +} + void mmc_pwrseq_free(struct mmc_host *host) { struct mmc_pwrseq *pwrseq = host->pwrseq; diff --git a/drivers/mmc/core/pwrseq.h b/drivers/mmc/core/pwrseq.h index 39c911a..819386f 100644 --- a/drivers/mmc/core/pwrseq.h +++ b/drivers/mmc/core/pwrseq.h @@ -18,6 +18,7 @@ struct mmc_pwrseq_ops { void (*pre_power_on)(struct mmc_host *host); void (*post_power_on)(struct mmc_host *host); void (*power_off)(struct mmc_host *host); + void (*reset)(struct mmc_host *host); }; struct mmc_pwrseq { @@ -36,6 +37,7 @@ int mmc_pwrseq_alloc(struct mmc_host *host); void mmc_pwrseq_pre_power_on(struct mmc_host *host); void mmc_pwrseq_post_power_on(struct mmc_host *host); void mmc_pwrseq_power_off(struct mmc_host *host); +void mmc_pwrseq_reset(struct mmc_host *host); void mmc_pwrseq_free(struct mmc_host *host); #else @@ -49,6 +51,7 @@ static inline int mmc_pwrseq_alloc(struct mmc_host *host) { return 0; } static inline void mmc_pwrseq_pre_power_on(struct mmc_host *host) {} static inline void mmc_pwrseq_post_power_on(struct mmc_host *host) {} static inline void mmc_pwrseq_power_off(struct mmc_host *host) {} +static inline void mmc_pwrseq_reset(struct mmc_host *host) {} static inline void mmc_pwrseq_free(struct mmc_host *host) {} #endif