public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: jonghwa3.lee@samsung.com
To: Anton Vorontsov <anton@enomsg.org>
Cc: linux-pm@vger.kernel.org, dwmw2@infradead.org,
	myungjoo.ham@samsung.com, cw00.choi@samsung.com
Subject: Re: [PATCH] battery: max17042: Fix temperature unit to milli centigrade.
Date: Mon, 28 Oct 2013 11:00:52 +0900	[thread overview]
Message-ID: <526DC554.30506@samsung.com> (raw)
In-Reply-To: <20131025231720.GB9015@teo>

Hi,
On 2013년 10월 26일 08:17, Anton Vorontsov wrote:

> On Fri, Oct 25, 2013 at 01:53:18PM +0900, Jonghwa Lee wrote:
>> Standard temp node represents temperature of power supply class
>> in milli centigrade. So fix max17042 fuel gauge driver to follow
>> the standard. (deci-centigrade --> milli-centigrade)
> 
> Maybe I am confused, but the doc says:
> 
>  * All voltages, currents, charges, energies, time and temperatures in uV,      
>  * µA, µAh, µWh, seconds and tenths of degree Celsius unless otherwise          
>  * stated
> 
> So, the current code seems to be correct.
> 


Honestly, I missed the above paragraph you showed rather I read following one.

TEMP - temperature of the power supply.
TEMP_ALERT_MIN - minimum battery temperature alert value in milli centigrade.
TEMP_ALERT_MAX - maximum battery temperature alert value in milli centigrade.
TEMP_AMBIENT - ambient temperature.
TEMP_AMBIENT_ALERT_MIN - minimum ambient temperature alert value in milli
centigrade.
TEMP_AMBIENT_ALERT_MAX - maximum ambient temperature alert value in milli
centigrade.

So, we use different unit for properties related temperature, right?
current temperature is in tenth of centigrade and threshold temperatures and
ambient temperature are in milli centigrade. Wouldn't it have to be in same unit?

Thanks,
Jonghwa

> Thanks,
> 
> Anton
> 
>> Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
>> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
>> ---
>>  drivers/power/max17042_battery.c |    4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c
>> index d664ef5..892ecfc 100644
>> --- a/drivers/power/max17042_battery.c
>> +++ b/drivers/power/max17042_battery.c
>> @@ -220,9 +220,9 @@ static int max17042_get_property(struct power_supply *psy,
>>  			val->intval = (0x7fff & ~val->intval) + 1;
>>  			val->intval *= -1;
>>  		}
>> -		/* The value is converted into deci-centigrade scale */
>> +		/* The value is converted into milli-centigrade scale */
>>  		/* Units of LSB = 1 / 256 degree Celsius */
>> -		val->intval = val->intval * 10 / 256;
>> +		val->intval = val->intval * 1000 / 256;
>>  		break;
>>  	case POWER_SUPPLY_PROP_CURRENT_NOW:
>>  		if (chip->pdata->enable_current_sense) {
>> -- 
>> 1.7.9.5
> 



  reply	other threads:[~2013-10-28  2:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-25  4:53 [PATCH] battery: max17042: Fix temperature unit to milli centigrade Jonghwa Lee
2013-10-25 23:17 ` Anton Vorontsov
2013-10-28  2:00   ` jonghwa3.lee [this message]
2013-10-28  5:27     ` [PATCH] power_supply: Fix documentation for TEMP_*ALERT* properties Anton Vorontsov
2013-10-28  6:22       ` jonghwa3.lee
2013-10-28  6:43         ` Anton Vorontsov
2013-10-28 17:20       ` Mark A. Greer
2013-10-29  3:13         ` Anton Vorontsov

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=526DC554.30506@samsung.com \
    --to=jonghwa3.lee@samsung.com \
    --cc=anton@enomsg.org \
    --cc=cw00.choi@samsung.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox