* Re: [PATCH v2 5/6] max17042: Fix value scaling for VCELL and avgVCELL
@ 2011-12-12 2:18 MyungJoo Ham
0 siblings, 0 replies; 2+ messages in thread
From: MyungJoo Ham @ 2011-12-12 2:18 UTC (permalink / raw)
To: dirk.brandewie@gmail.com, linux-kernel@vger.kernel.org
Cc: cbouatmailru@gmail.com, 김동근,
박경민, Jason.Wortham@maxim-ic.com,
Bruce Robertson
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=euc-kr, Size: 1530 bytes --]
> From: Bruce Robertson <bruce.e.robertson@intel.com>
>
> The bottom three bits of the register are don't care bits. The LSB
> value is 625 uV. Adjust the returned values appropriately
>
> Signed-off-by: Bruce Robertson <bruce.e.robertson@intel.com>
> Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
> ---
> drivers/power/max17042_battery.c | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c
> index 001eca1..80a6ee7 100644
> --- a/drivers/power/max17042_battery.c
> +++ b/drivers/power/max17042_battery.c
> @@ -148,11 +148,15 @@ static int max17042_get_property(struct power_supply *psy,
> break;
> case POWER_SUPPLY_PROP_VOLTAGE_NOW:
> val->intval = max17042_read_reg(chip->client,
> - MAX17042_VCELL) * 83; /* 1000 / 12 = 83 */
> + MAX17042_VCELL);
> + val->intval >>= 3;
> + val->intval *= 625; /* Units of LSB = 625 uV */
> break;
> case POWER_SUPPLY_PROP_VOLTAGE_AVG:
> val->intval = max17042_read_reg(chip->client,
> - MAX17042_AvgVCELL) * 83;
> + MAX17042_AvgVCELL);
> + val->intval >>= 3;
> + val->intval *= 625; /* Units of LSB = 625 uV */
> break;
> case POWER_SUPPLY_PROP_CAPACITY:
> val->intval = max17042_read_reg(chip->client,
> --
> 1.7.7.3
>
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 2+ messages in thread* [PATCH v2 0/6] MAX17042 add support for maxim POR procedure
@ 2011-12-09 18:08 dirk.brandewie
2011-12-09 18:08 ` [PATCH v2 5/6] max17042: Fix value scaling for VCELL and avgVCELL dirk.brandewie
0 siblings, 1 reply; 2+ messages in thread
From: dirk.brandewie @ 2011-12-09 18:08 UTC (permalink / raw)
To: linux-kernel
Cc: cbouatmailru, dg77.kim, kyungmin.park, myungjoo.ham,
Jason.Wortham, Dirk Brandewie
From: Dirk Brandewie <dirk.brandewie@gmail.com>
This patch set adds support for the power on reset procedure for the
max17042 battery fuel gauge and alert interrupts.
The accuracy of the fuel gauge is improved by configuring the fuel
gauge with the characterization data for the battery present in the
platform.
Changes since v1:
Moved power_supply_register() back to the probe max17042_get_property()
will return -EAGAIN until the init function completes
Added support for interrupts from the alert pin if the platform has it
connected to an interrupt source.
Added fix for the values returned by POWER_SUPPLY_PROP_VOLTAGE_NOW
and POWER_SUPPLY_PROP_VOLTAGE_AVG.
Added Ack's from previous patch series
Bruce Robertson (1):
max17042: Fix value scaling for VCELL and avgVCELL
Dirk Brandewie (5):
max17042: Move power suppply registration to a worker thread
max17042: Align register definitions with data sheet and init appnote
max17042: Add POR init procedure from Maxim appnote
max17042: Add support for signalling change in SOC
x86-mrst: Add battery fuel guage platform data
arch/x86/platform/mrst/mrst.c | 53 ++++
drivers/power/max17042_battery.c | 461 ++++++++++++++++++++++++++++++--
include/linux/power/max17042_battery.h | 93 ++++++-
3 files changed, 581 insertions(+), 26 deletions(-)
--
1.7.7.3
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH v2 5/6] max17042: Fix value scaling for VCELL and avgVCELL
2011-12-09 18:08 [PATCH v2 0/6] MAX17042 add support for maxim POR procedure dirk.brandewie
@ 2011-12-09 18:08 ` dirk.brandewie
0 siblings, 0 replies; 2+ messages in thread
From: dirk.brandewie @ 2011-12-09 18:08 UTC (permalink / raw)
To: linux-kernel
Cc: cbouatmailru, dg77.kim, kyungmin.park, myungjoo.ham,
Jason.Wortham, Bruce Robertson, Dirk Brandewie
From: Bruce Robertson <bruce.e.robertson@intel.com>
The bottom three bits of the register are don't care bits. The LSB
value is 625 uV. Adjust the returned values appropriately
Signed-off-by: Bruce Robertson <bruce.e.robertson@intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
---
drivers/power/max17042_battery.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c
index 001eca1..80a6ee7 100644
--- a/drivers/power/max17042_battery.c
+++ b/drivers/power/max17042_battery.c
@@ -148,11 +148,15 @@ static int max17042_get_property(struct power_supply *psy,
break;
case POWER_SUPPLY_PROP_VOLTAGE_NOW:
val->intval = max17042_read_reg(chip->client,
- MAX17042_VCELL) * 83; /* 1000 / 12 = 83 */
+ MAX17042_VCELL);
+ val->intval >>= 3;
+ val->intval *= 625; /* Units of LSB = 625 uV */
break;
case POWER_SUPPLY_PROP_VOLTAGE_AVG:
val->intval = max17042_read_reg(chip->client,
- MAX17042_AvgVCELL) * 83;
+ MAX17042_AvgVCELL);
+ val->intval >>= 3;
+ val->intval *= 625; /* Units of LSB = 625 uV */
break;
case POWER_SUPPLY_PROP_CAPACITY:
val->intval = max17042_read_reg(chip->client,
--
1.7.7.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-12-12 2:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-12 2:18 [PATCH v2 5/6] max17042: Fix value scaling for VCELL and avgVCELL MyungJoo Ham
-- strict thread matches above, loose matches on Subject: below --
2011-12-09 18:08 [PATCH v2 0/6] MAX17042 add support for maxim POR procedure dirk.brandewie
2011-12-09 18:08 ` [PATCH v2 5/6] max17042: Fix value scaling for VCELL and avgVCELL dirk.brandewie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox