All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Fleming <afleming@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] s5p-mmc: Fix ambiguous setting of data transfer width
Date: Wed, 31 Aug 2011 20:23:04 -0500	[thread overview]
Message-ID: <CAKWjMd51_TtqdwNrNAarQyLMCS=CB+A_v-YEn_KMW_7i-OhwMA@mail.gmail.com> (raw)
In-Reply-To: <1314701731-19099-1-git-send-email-chander.kashyap@linaro.org>

On Tue, Aug 30, 2011 at 5:55 AM, Chander Kashyap
<chander.kashyap@linaro.org> wrote:
> 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 <chander.kashyap@linaro.org>
> ---
> ?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);


I know these were like this before, but those numbers are awfully
magical. You should really define constants for them.

Also, this seems like a very confusing way to do this? Why not clear
both bits@the start, and then set the one that is needed?

Andy

  parent reply	other threads:[~2011-09-01  1:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-30 10:55 [U-Boot] [PATCH] s5p-mmc: Fix ambiguous setting of data transfer width Chander Kashyap
2011-08-31  8:33 ` Jaehoon Chung
2011-09-01  1:23 ` Andy Fleming [this message]
2011-09-01  2:26   ` Minkyu Kang
2011-09-01  5:51     ` Wolfgang Denk
2011-09-02  8:09       ` Minkyu Kang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKWjMd51_TtqdwNrNAarQyLMCS=CB+A_v-YEn_KMW_7i-OhwMA@mail.gmail.com' \
    --to=afleming@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.