LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Pierre Ossman <drzeus-mmc@drzeus.cx>
To: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
David Brownell <dbrownell@users.sourceforge.net>,
Grant Likely <grant.likely@secretlab.ca>
Subject: Re: [PATCH 2/3] mmc: Add mmc_vddrange_to_ocrmask() helper function
Date: Sat, 8 Nov 2008 21:55:37 +0100 [thread overview]
Message-ID: <20081108215537.12cdf5f6@mjolnir.drzeus.cx> (raw)
In-Reply-To: <20081030195632.GB13640@oksana.dev.rtsoft.ru>
On Thu, 30 Oct 2008 22:56:32 +0300
Anton Vorontsov <avorontsov@ru.mvista.com> wrote:
> +/**
> + * mmc_vddrange_to_ocrmask - Convert a voltage range to the OCR mask
> + * @vdd_min: minimum voltage value (mV)
> + * @vdd_max: maximum voltage value (mV)
> + * @mask: pointer to the mask
> + *
Why the pointer? Why not let the caller handle the aggregation? That
would be a lot safer.
> + /* fill the mask, from max bit to min bit */
> + while (vdd_max >= vdd_min)
> + *mask |= 1 << vdd_max--;
> + return 0;
Many cards get a bit uppity with a single bit set. If possible, try to
make this function set two bits when the voltage is right on the
boundary (e.g. 3.3V).
Rgds
--
-- Pierre Ossman
Linux kernel, MMC maintainer http://www.kernel.org
rdesktop, core developer http://www.rdesktop.org
WARNING: This correspondence is being monitored by the
Swedish government. Make sure your server uses encryption
for SMTP traffic and consider using PGP for end-to-end
encryption.
next prev parent reply other threads:[~2008-11-08 20:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-30 19:55 [PATCH 0/3 RFC] MMC SPI support for OpenFirmware platforms Anton Vorontsov
2008-10-30 19:56 ` [PATCH 1/3] powerpc: Add mmc-spi-slot bindings Anton Vorontsov
2008-10-30 20:37 ` Grant Likely
2008-10-30 23:02 ` Anton Vorontsov
2008-10-30 23:24 ` David Gibson
2008-10-30 23:28 ` Anton Vorontsov
2008-10-30 19:56 ` [PATCH 2/3] mmc: Add mmc_vddrange_to_ocrmask() helper function Anton Vorontsov
2008-11-08 20:55 ` Pierre Ossman [this message]
2008-11-26 19:54 ` [PATCH v2] " Anton Vorontsov
2008-11-30 20:06 ` Pierre Ossman
2008-12-01 11:53 ` Anton Vorontsov
2008-12-14 17:28 ` Pierre Ossman
2008-10-30 19:56 ` [PATCH 3/3] mmc_spi: Add support for OpenFirmware bindings Anton Vorontsov
2008-11-08 20:50 ` [PATCH 0/3 RFC] MMC SPI support for OpenFirmware platforms Pierre Ossman
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=20081108215537.12cdf5f6@mjolnir.drzeus.cx \
--to=drzeus-mmc@drzeus.cx \
--cc=avorontsov@ru.mvista.com \
--cc=dbrownell@users.sourceforge.net \
--cc=grant.likely@secretlab.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--subject='Re: [PATCH 2/3] mmc: Add mmc_vddrange_to_ocrmask() helper function' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).