From patchwork Mon Feb 5 12:50:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 126847 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1942078ljc; Mon, 5 Feb 2018 04:51:43 -0800 (PST) X-Google-Smtp-Source: AH8x225Oa9pl4iNRECW93SMjrw8qckLP5SLMvQeR8xkgnBr0Qt+I5gE9d1nDPhGNrH3CdC8z2mD1 X-Received: by 2002:a17:902:183:: with SMTP id b3-v6mr15798581plb.383.1517835103030; Mon, 05 Feb 2018 04:51:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517835103; cv=none; d=google.com; s=arc-20160816; b=j9+tO+RdeO4EukdDVtmICB3mfUvE1zHn5KCTrRf5PjLaNjQ0FIZ9LE/2vhGsyu911Y rAMDPmsuxwB8PiBm0u5aHW0OIwVphKNb1zg94aAWinI1ON1AdCEyDPjSaFtFd+KpXsMz imBlYOemt1aSlKuyqOryucJpQuXqo0LGMLg8hokik+DNXtKV/kzitaCyqwVE2I0LoGn6 EjU0sA3ghnQTdB8fC/dsl63DSuh6v7aiutksJkYRy4ID+B/xmR4mCx25OvU4yuymFlM8 943SPYSp3rShhaiisruYb4nWJw3KW4/ddnySl7N20bRAGo0ZT9xCRDqWGkwRahAkVA/O MkMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=ph1QdB/cHge0ys2ZENoo7qLHVmUh0jQHgRZu8nN/B9A=; b=tapb5gCNELWe8Quhh8HTP7Z9LsR4UAdWxE7Asl8QPsgyziPeuCHg602SJqKSpVuert T4HBN1Du3nTnijnpvDJe5530MsXpisorp721Z+jxMX33d+0oZW1NEX3S66AdQFYzb2um GSko81YUzdwSyVmUBHICa0YYxrUWPVT6iWKUBkdtobNkba+radGycbIG/D7gop23Sa7R Z1aDPSFtCRJ1UL4eKdDT3yzzJtLsME09pbpQSeUNVJ7noxB45N2ysVdwePjKtUt8lASK EYz9I1PY0XAKiGuyBizKIttyS8aPEslskI4Ydphf/0/pB+840IhgfW2MtTfWCyMZ5/qB 2h0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=UIx2CP9d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q23si727871pff.403.2018.02.05.04.51.42; Mon, 05 Feb 2018 04:51:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=UIx2CP9d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753065AbeBEMvk (ORCPT + 28 others); Mon, 5 Feb 2018 07:51:40 -0500 Received: from fllnx209.ext.ti.com ([198.47.19.16]:29226 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752743AbeBEMvX (ORCPT ); Mon, 5 Feb 2018 07:51:23 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id w15Coi79010632; Mon, 5 Feb 2018 06:50:44 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1517835044; bh=sv6ZJ0aAyBVVuwihGHXPb74P5wbRtTu7unstvm7D5+M=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=UIx2CP9dLGnBBZYYqTQIoTSbLFv9dOhU+zZ3TYhf+uPnMhbd14JVALcfbs20sCrFY +i1s2BfObtS6eUQvqf/+vD/ShHlY3KHcBX5FCyX/1N8azPhwjhkHsGiIDzJrg2n7Sa 7RvAsqXkkeAcAu1ydPaKCUu2w/MoYREMj+58JHyI= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w15CoibP006621; Mon, 5 Feb 2018 06:50:44 -0600 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Mon, 5 Feb 2018 06:50:44 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Mon, 5 Feb 2018 06:50:44 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w15CoaGW023963; Mon, 5 Feb 2018 06:50:41 -0600 From: Kishon Vijay Abraham I To: Ulf Hansson , Tony Lindgren , Adrian Hunter CC: Rob Herring , Mark Rutland , Russell King , Kishon Vijay Abraham I , , , , , Subject: [PATCH v2 01/16] mmc: sdhci-omap: Update 'power_mode' outside sdhci_omap_init_74_clocks Date: Mon, 5 Feb 2018 18:20:14 +0530 Message-ID: <20180205125029.21570-2-kishon@ti.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180205125029.21570-1-kishon@ti.com> References: <20180205125029.21570-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Updating 'power_mode' in sdhci_omap_init_74_clocks results in 'power_mode' never updated to MMC_POWER_OFF during card removal. This results in initialization sequence not sent to the card during re-insertion. Fix it here by adding sdhci_omap_set_power_mode to update power_mode. This function can also be used later to perform operations that are specific to a power mode (e.g, disable tuning during power off). Signed-off-by: Kishon Vijay Abraham I Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci-omap.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 2.11.0 diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index 628bfe9a3d17..96985786cadf 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c @@ -244,6 +244,12 @@ static int sdhci_omap_start_signal_voltage_switch(struct mmc_host *mmc, return 0; } +static void sdhci_omap_set_power_mode(struct sdhci_omap_host *omap_host, + u8 power_mode) +{ + omap_host->power_mode = power_mode; +} + static void sdhci_omap_set_bus_mode(struct sdhci_omap_host *omap_host, unsigned int mode) { @@ -273,6 +279,7 @@ static void sdhci_omap_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) sdhci_omap_set_bus_mode(omap_host, ios->bus_mode); sdhci_set_ios(mmc, ios); + sdhci_omap_set_power_mode(omap_host, ios->power_mode); } static u16 sdhci_omap_calc_divisor(struct sdhci_pltfm_host *host, @@ -401,8 +408,6 @@ static void sdhci_omap_init_74_clocks(struct sdhci_host *host, u8 power_mode) sdhci_omap_writel(omap_host, SDHCI_OMAP_STAT, INT_CC_EN); enable_irq(host->irq); - - omap_host->power_mode = power_mode; } static struct sdhci_ops sdhci_omap_ops = { @@ -504,6 +509,7 @@ static int sdhci_omap_probe(struct platform_device *pdev) omap_host->host = host; omap_host->base = host->ioaddr; omap_host->dev = dev; + omap_host->power_mode = MMC_POWER_UNDEFINED; host->ioaddr += offset; mmc = host->mmc;