From patchwork Wed Mar 27 04:08:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunhe Lan X-Patchwork-Id: 2347371 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 6A4943FD40 for ; Wed, 27 Mar 2013 04:05:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750843Ab3C0EFT (ORCPT ); Wed, 27 Mar 2013 00:05:19 -0400 Received: from mail-db8lp0186.outbound.messaging.microsoft.com ([213.199.154.186]:17978 "EHLO db8outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750809Ab3C0EFT (ORCPT ); Wed, 27 Mar 2013 00:05:19 -0400 Received: from mail31-db8-R.bigfish.com (10.174.8.246) by DB8EHSOBE001.bigfish.com (10.174.4.64) with Microsoft SMTP Server id 14.1.225.23; Wed, 27 Mar 2013 04:05:17 +0000 Received: from mail31-db8 (localhost [127.0.0.1]) by mail31-db8-R.bigfish.com (Postfix) with ESMTP id 0848E3E015E; Wed, 27 Mar 2013 04:05:17 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h1ee6h1de0h1202h1e76h1d1ah1d2ahzz8275bh8275dhz2dh2a8h668h839he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1155h) Received: from mail31-db8 (localhost.localdomain [127.0.0.1]) by mail31-db8 (MessageSwitch) id 1364357115184997_6994; Wed, 27 Mar 2013 04:05:15 +0000 (UTC) Received: from DB8EHSMHS027.bigfish.com (unknown [10.174.8.248]) by mail31-db8.bigfish.com (Postfix) with ESMTP id 2A429BC004C; Wed, 27 Mar 2013 04:05:15 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB8EHSMHS027.bigfish.com (10.174.4.37) with Microsoft SMTP Server (TLS) id 14.1.225.23; Wed, 27 Mar 2013 04:05:11 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server (TLS) id 14.2.328.11; Wed, 27 Mar 2013 04:05:09 +0000 Received: from ustc.localdomain4 ([10.193.20.71]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id r2R450NT027229; Tue, 26 Mar 2013 21:05:05 -0700 From: Chunhe Lan To: CC: , Chunhe Lan Subject: [PATCH] mmc: sdhci-pltfm: Add SDHCI_QUIRK2_CIRCUIT_SUPPORT_VS33 quirk support Date: Wed, 27 Mar 2013 12:08:34 +0800 Message-ID: <1364357314-19480-1-git-send-email-Chunhe.Lan@freescale.com> X-Mailer: git-send-email 1.7.6.5 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org On the t4240 platform, sdhci controller can only support 1.8V voltage, but the peripheral hardware circuit has capability to support 3.3V voltage. Signed-off-by: Chunhe Lan Cc: Chris Ball --- drivers/mmc/host/sdhci-pltfm.c | 3 +++ drivers/mmc/host/sdhci.c | 3 +++ include/linux/mmc/sdhci.h | 4 ++++ 3 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index 9db7b12..9e9728f 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c @@ -98,6 +98,9 @@ void sdhci_get_of_property(struct platform_device *pdev) of_device_is_compatible(np, "fsl,mpc8536-esdhc")) host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL; + if (of_device_is_compatible(np, "fsl,t4240-esdhc")) + host->quirks2 |= SDHCI_QUIRK2_CIRCUIT_SUPPORT_VS33; + clk = of_get_property(np, "clock-frequency", &size); if (clk && size == sizeof(*clk) && *clk) pltfm_host->clock = be32_to_cpup(clk); diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index b25d94e..acd7a2f 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2730,6 +2730,9 @@ int sdhci_add_host(struct sdhci_host *host) host->caps1 : sdhci_readl(host, SDHCI_CAPABILITIES_1); + if (host->quirks2 & SDHCI_QUIRK2_CIRCUIT_SUPPORT_VS33) + caps[0] = caps[0] | SDHCI_CAN_VDD_330; + if (host->quirks & SDHCI_QUIRK_FORCE_DMA) host->flags |= SDHCI_USE_SDMA; else if (!(caps[0] & SDHCI_CAN_DO_SDMA)) diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index b838ffc..a53bbaf 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h @@ -95,6 +95,10 @@ struct sdhci_host { /* The system physically doesn't support 1.8v, even if the host does */ #define SDHCI_QUIRK2_NO_1_8_V (1<<2) #define SDHCI_QUIRK2_PRESET_VALUE_BROKEN (1<<3) +/* Controller can only supports 1.8V, but the peripheral hardware + * circuit has capability to support 3.3V + */ +#define SDHCI_QUIRK2_CIRCUIT_SUPPORT_VS33 (1<<4) int irq; /* Device IRQ */ void __iomem *ioaddr; /* Mapped address */