From patchwork Tue Jul 16 06:36:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Behme X-Patchwork-Id: 2827904 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1E1D8C0AB2 for ; Tue, 16 Jul 2013 06:36:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 47A9E201D1 for ; Tue, 16 Jul 2013 06:36:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1E218201D3 for ; Tue, 16 Jul 2013 06:36:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751597Ab3GPGgW (ORCPT ); Tue, 16 Jul 2013 02:36:22 -0400 Received: from smtp6-v.fe.bosch.de ([139.15.237.11]:26934 "EHLO smtp6-v.fe.bosch.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750907Ab3GPGgV (ORCPT ); Tue, 16 Jul 2013 02:36:21 -0400 Received: from vsmta12.fe.internet.bosch.com (unknown [10.4.98.52]) by imta24.fe.bosch.de (Postfix) with ESMTP id 0D04FD8019D for ; Tue, 16 Jul 2013 08:36:20 +0200 (CEST) Received: from localhost (vsgw1.fe.internet.bosch.com [10.4.98.15]) by vsmta12.fe.internet.bosch.com (Postfix) with SMTP id D93D61B80721 for ; Tue, 16 Jul 2013 08:36:19 +0200 (CEST) Received: from SI-HUB1000.de.bosch.com (10.4.103.106) by si-hub03.de.bosch.com (10.3.144.92) with Microsoft SMTP Server (TLS) id 8.3.298.1; Tue, 16 Jul 2013 08:36:14 +0200 Received: from hi-z5661.hi.de.bosch.com (10.34.217.143) by SI-HUB1000.de.bosch.com (10.4.103.106) with Microsoft SMTP Server id 14.3.146.0; Tue, 16 Jul 2013 08:36:13 +0200 Received: from hi-z5661.hi.de.bosch.com (localhost [127.0.0.1]) by hi-z5661.hi.de.bosch.com (Postfix) with ESMTP id 8B0B6411C5; Tue, 16 Jul 2013 08:36:13 +0200 (CEST) From: Dirk Behme To: CC: Chris Ball , Shawn Guo , Dirk Behme Subject: [PATCH] mmc: sdhci-esdhc-imx: Write only 4 bit in case of TIMEOUT_CONTROL Date: Tue, 16 Jul 2013 08:36:11 +0200 Message-ID: <1373956571-25967-1-git-send-email-dirk.behme@de.bosch.com> X-Mailer: git-send-email 1.8.2 MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In case of SDHCI_TIMEOUT_CONTROL write only 4 bits and not the whole byte to avoid touching other unrelated bits in the i.MX6 SYS_CTRL register. E.g. IPP_RST_N shouldn't be touched accidently. Signed-off-by: Dirk Behme Acked-by: Shawn Guo --- drivers/mmc/host/sdhci-esdhc-imx.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 1dd5ba8..1af3a2a 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -362,6 +362,18 @@ static void esdhc_writeb_le(struct sdhci_host *host, u8 val, int reg) esdhc_clrset_le(host, mask, new_val, reg); return; + case SDHCI_TIMEOUT_CONTROL: + /* + * On i.MX6 the timeout value DTOCV is 4 bit large. Touch only + * these 4 bits (lower nibble of the byte), but not the upper + * nibble of the byte. The upper nibble of the byte contains + * IPP_RST_N which should keep the reset value, i.e. 1, and + * shouldn't be touched here. + */ + if (is_imx6q_usdhc(imx_data)) { + esdhc_clrset_le(host, 0x0f, val, reg); + return; + } } esdhc_clrset_le(host, 0xff, val, reg);