max17042_battery: Support CHARGE_COUNTER power supply attribute
PATCH 1/1 max17042_battery: Support CHARGE_COUNTER power supply attribute
This patch adds the support for CHARGE_COUNTER power supply attribute to max17042/47 driver.
Note:QH(Charge Counter) register is not documented in max17042 the Spec.
--- drivers/power/max17042_battery.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
drivers/power/max17042_battery.c +8 -0
@@ -113,6 +113,7 @@ static enum power_supply_property max17042_battery_props[] = {POWER_SUPPLY_PROP_VOLTAGE_OCV ,POWER_SUPPLY_PROP_CAPACITY ,POWER_SUPPLY_PROP_CHARGE_FULL , +POWER_SUPPLY_PROP_CHARGE_COUNTER ,POWER_SUPPLY_PROP_TEMP ,POWER_SUPPLY_PROP_CURRENT_NOW , POWER_SUPPLY_PROP_CURRENT_AVG,
@@ -201,6 +202,13 @@ static int max17042_get_property(struct power_supply *psy, val->intval = ret *1000 /2 ;break ; +case POWER_SUPPLY_PROP_CHARGE_COUNTER : + ret =max17042_read_reg (chip->client,MAX17042_QH ); +if (ret <0 ) +return ret; + + val->intval = ret *1000 /2 ; +break ;case POWER_SUPPLY_PROP_TEMP : ret =max17042_read_reg (chip->client,MAX17042_TEMP );if (ret <0 )
Signature · 1 line
1.7.0.4
Hi Anton,
Quoted 9 lines
Sent: Monday, May 07, 2012 10:26 AM
To: [email protected]
Cc: Anton Vorontsov; Anton Vorontsov; Pallala, Ramakrishna
Subject: [PATCH]max17042_battery: SupportCHARGE_COUNTERpower supply attributeThis patch adds the support for
CHARGE_COUNTERpower supply attribute to max17042/47 driver.
Quoted 7 lines
Note:QH(Charge Counter) register is not documented in max17042 the Spec.
Signed-off-by Ramakrishna Pallala <[email protected]>--- drivers/power/max17042_battery.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
I am waiting for the comments or ACK from you on this patch.
Thanks,
Ram
Anton Vorontsov
AppliedQuoted 7 lines · Ramakrishna Pallala
This patch adds the support for
CHARGE_COUNTERpower supply attribute to max17042/47 driver.Note:QH(Charge Counter) register is not documented in max17042 the Spec.
Signed-off-by Ramakrishna Pallala <[email protected]>---
Applied, thank you!
Signature · 2 lines
Anton Vorontsov Email: [email protected]