From patchwork Thu Nov 3 14:16:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 9411031 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 17B0A60722 for ; Thu, 3 Nov 2016 14:58:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 082F32AC35 for ; Thu, 3 Nov 2016 14:58:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EFA592AC33; Thu, 3 Nov 2016 14:58:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC2E62AC33 for ; Thu, 3 Nov 2016 14:58:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756892AbcKCO6d (ORCPT ); Thu, 3 Nov 2016 10:58:33 -0400 Received: from kirsty.vergenet.net ([202.4.237.240]:49629 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755028AbcKCO6d (ORCPT ); Thu, 3 Nov 2016 10:58:33 -0400 Received: from penelope.kanocho.kobe.vergenet.net (52D9BC73.cm-11-1c.dynamic.ziggo.nl [82.217.188.115]) by kirsty.vergenet.net (Postfix) with ESMTPSA id 7C1FC25AD76; Fri, 4 Nov 2016 01:58:30 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verge.net.au; s=mail; t=1478185110; bh=31CyIfhEhbwUT8inviX0B/q9uDhLLCNsnw3AQuf543w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OxFw5op4qX01sNJI0PYy97FMrmrwPcnr+z8177943SOh2NFr3uLiXGzZp+PgqW792 woBchpJa7k4GnvY/ddawAnX6R9rb3RrJjGLoo174v3+Uz+pgUrefOBEdXt+X1CpCA5 27coSqSlFOTnJkRpyYq7Zoa8HCWtATzNnxiscbuo= Received: by penelope.kanocho.kobe.vergenet.net (Postfix, from userid 7100) id 0D0E06076E; Thu, 3 Nov 2016 15:16:12 +0100 (CET) From: Simon Horman To: Wolfram Sang , Ulf Hansson Cc: Magnus Damm , linux-mmc@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Ai Kyuse , Simon Horman Subject: [PATCH v8 4/6] mmc: tmio: Add hw reset support Date: Thu, 3 Nov 2016 15:16:02 +0100 Message-Id: <1478182564-18762-5-git-send-email-horms+renesas@verge.net.au> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: <1478182564-18762-1-git-send-email-horms+renesas@verge.net.au> References: <1478182564-18762-1-git-send-email-horms+renesas@verge.net.au> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ai Kyuse Add hw reset support. Signed-off-by: Ai Kyuse Signed-off-by: Simon Horman --- This is required by tuning support which will be introduced by follow-up patches. v6 * Rely on core to retune on reset v5 * As suggested by Ulf Hansson - Broke out of a larger patch --- drivers/mmc/host/tmio_mmc.h | 1 + drivers/mmc/host/tmio_mmc_pio.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h index b93762950e8f..c5adf52fc049 100644 --- a/drivers/mmc/host/tmio_mmc.h +++ b/drivers/mmc/host/tmio_mmc.h @@ -167,6 +167,7 @@ struct tmio_mmc_host { int (*start_signal_voltage_switch)(struct mmc_host *mmc, struct mmc_ios *ios); int (*write16_hook)(struct tmio_mmc_host *host, int addr); + void (*hw_reset)(struct tmio_mmc_host *host); }; struct tmio_mmc_host *tmio_mmc_host_alloc(struct platform_device *pdev); diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index 0ae967087ea1..ce6e93758576 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c @@ -759,6 +759,14 @@ static int tmio_mmc_start_data(struct tmio_mmc_host *host, return 0; } +static void tmio_mmc_hw_reset(struct mmc_host *mmc) +{ + struct tmio_mmc_host *host = mmc_priv(mmc); + + if (host->hw_reset) + host->hw_reset(host); +} + /* Process requests from the MMC layer */ static void tmio_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) { @@ -975,6 +983,7 @@ static struct mmc_host_ops tmio_mmc_ops = { .get_cd = mmc_gpio_get_cd, .enable_sdio_irq = tmio_mmc_enable_sdio_irq, .multi_io_quirk = tmio_multi_io_quirk, + .hw_reset = tmio_mmc_hw_reset, }; static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)