lkml.org 
[lkml]   [2010]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] MMC: move regulator handling closer to core
From
2010/8/30 Adrian Hunter <adrian.hunter@nokia.com>:

> [Me]
>> diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
>> index 0a4e43f..47dae9b 100644
>> --- a/drivers/mmc/host/pxamci.c
>> +++ b/drivers/mmc/host/pxamci.c
>> @@ -99,14 +99,26 @@ static inline void pxamci_init_ocr(struct pxamci_host
>> *host)
>>        }
>>  }
>>  -static inline void pxamci_set_power(struct pxamci_host *host, unsigned
>> int vdd)
>> +static inline void pxamci_set_power(struct pxamci_host *host,
>> +                                   unsigned char power_mode,
>> +                                   unsigned int vdd)
>>  {
>>        int on;
>>  -#ifdef CONFIG_REGULATOR
>> -       if (host->vcc)
>> -               mmc_regulator_set_ocr(host->vcc, vdd);
>> -#endif
>> +       if (host->vcc) {
>> +               int ret;
>> +
>> +               if (power_mode == MMC_POWER_UP) {
>> +                       ret = mmc_regulator_set_ocr(host->mmc, host->vcc,
>> vdd);
>> +                       if (ret)
>> +                               dev_err(mmc_dev(host->mmc),
>> +                                       "could not set regulator OCR\n");
>> +               } else if (power_mode == MMC_POWER_OFF)
>> +                       ret = mmc_regulator_set_ocr(host->mmc, host->vcc,
>> 0);
>> +                       if (ret)
>> +                               dev_err(mmc_dev(host->mmc),
>> +                                       "could not disable regulator\n");
>> +       }
>
> mmc_power_off() does set ios->vdd to 0 so the original code was fine
> wrt to ignoring power_mode.

Yeah I know. This bit was to increase readability, explicitly showing
the power state like this makes it more clear what is happening I think.

The rest of the comments are fixed, new patch soon.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-08-31 16:39    [W:0.059 / U:0.516 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site