From patchwork Tue Aug 30 10:55:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chander Kashyap X-Patchwork-Id: 3796 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 3B02923F22 for ; Tue, 30 Aug 2011 10:55:49 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 2BAF5A184ED for ; Tue, 30 Aug 2011 10:55:49 +0000 (UTC) Received: by fxd18 with SMTP id 18so7742371fxd.11 for ; Tue, 30 Aug 2011 03:55:49 -0700 (PDT) Received: by 10.223.22.14 with SMTP id l14mr5184932fab.100.1314701748981; Tue, 30 Aug 2011 03:55:48 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.11.8 with SMTP id m8cs130657lab; Tue, 30 Aug 2011 03:55:47 -0700 (PDT) Received: by 10.100.82.9 with SMTP id f9mr5030639anb.0.1314701746385; Tue, 30 Aug 2011 03:55:46 -0700 (PDT) Received: from mail-pz0-f45.google.com (mail-pz0-f45.google.com [209.85.210.45]) by mx.google.com with ESMTPS id z1si3176742pbp.55.2011.08.30.03.55.45 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 30 Aug 2011 03:55:46 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.45 is neither permitted nor denied by best guess record for domain of chander.kashyap@linaro.org) client-ip=209.85.210.45; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.45 is neither permitted nor denied by best guess record for domain of chander.kashyap@linaro.org) smtp.mail=chander.kashyap@linaro.org Received: by pzk33 with SMTP id 33so13418700pzk.32 for ; Tue, 30 Aug 2011 03:55:45 -0700 (PDT) Received: by 10.142.179.20 with SMTP id b20mr2981478wff.422.1314701745310; Tue, 30 Aug 2011 03:55:45 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id q19sm3566577wfn.6.2011.08.30.03.55.42 (version=SSLv3 cipher=OTHER); Tue, 30 Aug 2011 03:55:44 -0700 (PDT) From: Chander Kashyap To: u-boot@lists.denx.de Cc: mk7.kang@samsung.com, bjlee@samsung.com, patches@linaro.org, samsung@lists.linaro.org, linaro-dev@lists.linaro.org, Chander Kashyap Subject: [PATCH] s5p-mmc: Fix ambiguous setting of data transfer width Date: Tue, 30 Aug 2011 16:25:31 +0530 Message-Id: <1314701731-19099-1-git-send-email-chander.kashyap@linaro.org> X-Mailer: git-send-email 1.7.4.1 mmc data transfer width is set as following: WIDE8[5]: 0 = Depend on WIDE4 1 = 8-bit mode WIDE4[1]: 1 = 4-bit mode 0 = 1-bit mode In case of 4-bit mode reset 8-bit mode and in case of 1-bit mode reset 8-bit mode and 4-bit mode Signed-off-by: Chander Kashyap Acked-by: Jaehoon Chung --- drivers/mmc/s5p_mmc.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/s5p_mmc.c b/drivers/mmc/s5p_mmc.c index 7786ecf..6e6ad08 100644 --- a/drivers/mmc/s5p_mmc.c +++ b/drivers/mmc/s5p_mmc.c @@ -368,12 +368,16 @@ static void mmc_set_ios(struct mmc *mmc) * 1 = 4-bit mode * 0 = 1-bit mode */ - if (mmc->bus_width == 8) + if (mmc->bus_width == 8) { ctrl |= (1 << 5); - else if (mmc->bus_width == 4) + ctrl &= ~(1 << 1); + } else if (mmc->bus_width == 4) { ctrl |= (1 << 1); - else + ctrl &= ~(1 << 5); + } else { ctrl &= ~(1 << 1); + ctrl &= ~(1 << 5); + } /* * OUTEDGEINV[2]