From patchwork Mon Aug 7 16:01:39 2017 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: 109576 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp1785222qge; Mon, 7 Aug 2017 09:02:45 -0700 (PDT) X-Received: by 10.84.174.4 with SMTP id q4mr1143743plb.235.1502121765156; Mon, 07 Aug 2017 09:02:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502121765; cv=none; d=google.com; s=arc-20160816; b=gcQZuUOV+Wg/g1MuWLXW+CqWl0yFgzojlYd6HCQGk9K+oCvLyGy4y7xRJyU1PNavHL wwY/GHzXpmBVxNUmNBW8cPvoamoju4Q104V7bwhFhkSeBjonHousz1KzRcst+qDcB5oE 2I/jBQqp6Q6DFQmOatl7e+DKtjoPI37RtSXMmy570OU89vD/iQK6ZnOU2nK4izqzZgHu 6uN64BIZTyjzzqLQ5LUvoaYDLpL1UdvFDFq/o4flBMC8nEHD5fvqVhiSnbzefhEIteLe v93nZ1UAH9K7DqnY2k/AptmQoBCWiDJ1jErB0LPILYYugXPonjKogDf5wGng+6YGNqYf 40WA== 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=0SwCmT7BoBvCVRAmrfEF7afd7A/CXllcr7feGZe1fsc=; b=qc6XuYvbXy/r73j9l6Y1s1KND1lRpO1j/rbYYgSuxfDPpbU3qCz9dtpf3LSt0nlmY2 x/DA4uSGku1i6uQl6lD4FDoVKOiEEjg29iSuunGaOxl+Zph6HVqoreXfTxIfDO1pVig4 5VAdFpqBWGRTBl3tAJbFygd5dRNc2gRZwldA2otcSUeX7oOreH9w7nThfakfCc8Xttl2 j7m1hD+yeUfQsNffAajA4RD0HxkXhdZd9wi8WhYQnxEu0tk4XBRjV/UwXptbQf3TNtDl YYXcwy+WAIsC/6b9+k5s5heqw0Hcb4ND50crAWwRjZjjYJpMr2Xj3VLgzEMl2sGLoTLq B2jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.b=c3HXkh9u; 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 v18si1214608pgb.915.2017.08.07.09.02.44; Mon, 07 Aug 2017 09:02:45 -0700 (PDT) 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.b=c3HXkh9u; 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 S1752068AbdHGQCl (ORCPT + 25 others); Mon, 7 Aug 2017 12:02:41 -0400 Received: from fllnx210.ext.ti.com ([198.47.19.17]:35266 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751963AbdHGQCJ (ORCPT ); Mon, 7 Aug 2017 12:02:09 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id v77G22o7009568; Mon, 7 Aug 2017 11:02:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1502121722; bh=L5FSFKrwAYT7d2ae0ppgomEXxAYtrhKP27vRgFsZ4JI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=c3HXkh9uStR1aeeYuFsJqmPMmJo5II5Dcu/19Zb1/nzHG0814yYxbGeKq3rYA3txZ xcBc3dT/HPk2VrFIXww8hsYXwnlRSs8hdh91s1/RihLVHDzrOK3gAx5MHiaDyB9Abo KQspUlKAYM29VpUV1Vmyy2iTG7T/00iKV7wZFr0c= Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v77G21kq030538; Mon, 7 Aug 2017 11:02:02 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.294.0; Mon, 7 Aug 2017 11:02:02 -0500 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 v77G1jGu023497; Mon, 7 Aug 2017 11:01:59 -0500 From: Kishon Vijay Abraham I To: Ulf Hansson , Tony Lindgren , Rob Herring , Adrian Hunter CC: , , , , , Subject: [RFC PATCH 4/7] mmc: sdhci: Add quirk to indicate broken POWER_CONTROL Date: Mon, 7 Aug 2017 21:31:39 +0530 Message-ID: <20170807160142.12134-5-kishon@ti.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170807160142.12134-1-kishon@ti.com> References: <20170807160142.12134-1-kishon@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org TI's implementation of sdhci controller used in DRA7 SoC's uses POWER_CONTROL register for configuring IO voltage and not for core voltage (vdd) which is it's intended use. Add a quirk to indicate broken POWER_CONTROL register. Signed-off-by: Kishon Vijay Abraham I --- drivers/mmc/host/sdhci.c | 6 ++++++ drivers/mmc/host/sdhci.h | 2 ++ 2 files changed, 8 insertions(+) -- 2.11.0 diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index d5050ec42481..a7465a56e6b5 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1419,6 +1419,9 @@ static void sdhci_set_power_reg(struct sdhci_host *host, unsigned char mode, mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); + if (host->quirks2 & SDHCI_QUIRK2_BROKEN_POWER_CONTROL) + return; + if (mode != MMC_POWER_OFF) sdhci_writeb(host, SDHCI_POWER_ON, SDHCI_POWER_CONTROL); else @@ -1430,6 +1433,9 @@ void sdhci_set_power_noreg(struct sdhci_host *host, unsigned char mode, { u8 pwr = 0; + if (host->quirks2 & SDHCI_QUIRK2_BROKEN_POWER_CONTROL) + return; + if (mode != MMC_POWER_OFF) { switch (1 << vdd) { case MMC_VDD_165_195: diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 39c7a2723906..ba94cca7c892 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -439,6 +439,8 @@ struct sdhci_host { #define SDHCI_QUIRK2_NO_CRC_STRIPPING (1<<16) /* Controller has bad caps bits, but really supports DMA */ #define SDHCI_QUIRK2_FORCE_ADMA (1<<17) +/* Controller uses POWER_CONTROL for managing IO voltage and not core voltage */ +#define SDHCI_QUIRK2_BROKEN_POWER_CONTROL (1<<18) int irq; /* Device IRQ */ void __iomem *ioaddr; /* Mapped address */