All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hein_Tibosch <hein_tibosch@yahoo.es>
To: amit kachhap <amit.kachhap@linaro.org>
Cc: Girish K S <girish.shivananjappa@linaro.org>,
	linux-mmc@vger.kernel.org, patches@linaro.org,
	linux-samsung-soc@vger.kernel.org, subhashj@codeaurora.org,
	Chris Ball <cjb@laptop.org>
Subject: Re: [PATCH V2] mmc: core: Add host capability check for power class
Date: Thu, 15 Dec 2011 17:57:18 +0800	[thread overview]
Message-ID: <4EE9C47E.6040101@yahoo.es> (raw)
In-Reply-To: <CADGdYn5MYLD4ReuBZuF7QCkJo34aDhGsDpDWX_S3DuKNk9J85Q@mail.gmail.com>

On 12/15/2011 2:03 PM, amit kachhap wrote:

> On Thu, Dec 15, 2011 at 9:28 AM, Girish K S
> <girish.shivananjappa@linaro.org> wrote:
>> This patch adds a check whether the host supports maximum current value
>> obtained from the device's extended csd register for a selected interface
>> voltage and frequency.
>>
>> cc: Chris Ball <cjb@laptop.org>
>> Signed-off-by: Girish K S <girish.shivananjappa@linaro.org>
>> ---
>> Changes in v2:
>>        deleted a unnecessary if else condition identified by subhash J
>> Changes in v1:
>>       reduced the number of comparisons as per Hein's suggestion
>>
>>  drivers/mmc/core/mmc.c   |   19 +++++++++++++++++++
>>  include/linux/mmc/card.h |    4 ++++
>>  2 files changed, 23 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
>> index 006e932..b9ef777 100644
>> --- a/drivers/mmc/core/mmc.c
>> +++ b/drivers/mmc/core/mmc.c
>> @@ -688,6 +688,25 @@ static int mmc_select_powerclass(struct mmc_card *card,
>>                pwrclass_val = (pwrclass_val & EXT_CSD_PWR_CL_4BIT_MASK) >>
>>                                EXT_CSD_PWR_CL_4BIT_SHIFT;
>>
>> +       if (pwrclass_val >= MMC_MAX_CURRENT_800)
> Hi girish,
>
> These checks can be made like ,
> if (pwrclass_val > MMC_MAX_CURRENT_800)
>         pwrclass_val = MMC_MAX_CURRENT_800;
> Applicable in all below conditional checks.
Hi both,

Suppose pwrclass_val == MMC_MAX_CURRENT_800 (13),
then with

+       if (pwrclass_val > MMC_MAX_CURRENT_800)
+               pwrclass_val = MMC_MAX_CURRENT_800;
+       else if (pwrclass_val > MMC_MAX_CURRENT_600)
+               pwrclass_val = MMC_MAX_CURRENT_600;

it would get a value of MMC_MAX_CURRENT_600, which is too low

Hein

  parent reply	other threads:[~2011-12-15  9:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-15  3:58 [PATCH V2] mmc: core: Add host capability check for power class Girish K S
2011-12-15  6:03 ` amit kachhap
2011-12-15  6:16   ` Girish K S
2011-12-15  9:57   ` Hein_Tibosch [this message]
2011-12-15 10:04 ` Saugata Das
2011-12-15 10:52   ` Girish K S
2011-12-15 13:05     ` Saugata Das
2012-03-28 11:09       ` Subhash Jadavani
2012-03-29  5:47         ` Girish K S
2012-03-30  4:58           ` Girish K S
2012-03-30  5:46             ` Subhash Jadavani
2012-04-02  7:49         ` Saugata Das
2012-04-02 10:54           ` Subhash Jadavani
2012-04-03 10:42             ` Saugata Das

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=4EE9C47E.6040101@yahoo.es \
    --to=hein_tibosch@yahoo.es \
    --cc=amit.kachhap@linaro.org \
    --cc=cjb@laptop.org \
    --cc=girish.shivananjappa@linaro.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=subhashj@codeaurora.org \
    /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.