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: 9885741 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 515CA60363 for ; Mon, 7 Aug 2017 16:04:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D90F4262AE for ; Mon, 7 Aug 2017 16:04:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD91E274A3; Mon, 7 Aug 2017 16:04:14 +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 6A922262AE for ; Mon, 7 Aug 2017 16:04:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752037AbdHGQCk (ORCPT ); Mon, 7 Aug 2017 12:02:40 -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-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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 */