From: Krzysztof Kozlowski <krzk@kernel.org>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Sebastian Reichel <sre@kernel.org>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
linux-pm@vger.kernel.org
Subject: Re: [PATCH 10/13] power: max17042_battery: Add support for the CHARGE_FULL_DESIGN property
Date: Fri, 14 Apr 2017 18:34:29 +0200 [thread overview]
Message-ID: <20170414163429.vcwq2afmdiilwmeb@kozik-lap> (raw)
In-Reply-To: <20170414125919.25771-10-hdegoede@redhat.com>
On Fri, Apr 14, 2017 at 02:59:16PM +0200, Hans de Goede wrote:
> The info is there, lets export it as a property.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/power/supply/max17042_battery.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c
> index 770e188..56cfff7 100644
> --- a/drivers/power/supply/max17042_battery.c
> +++ b/drivers/power/supply/max17042_battery.c
> @@ -90,6 +90,7 @@ static enum power_supply_property max17042_battery_props[] = {
> POWER_SUPPLY_PROP_VOLTAGE_AVG,
> POWER_SUPPLY_PROP_VOLTAGE_OCV,
> POWER_SUPPLY_PROP_CAPACITY,
> + POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
> POWER_SUPPLY_PROP_CHARGE_FULL,
> POWER_SUPPLY_PROP_CHARGE_COUNTER,
> POWER_SUPPLY_PROP_TEMP,
> @@ -307,6 +308,13 @@ static int max17042_get_property(struct power_supply *psy,
>
> val->intval = data >> 8;
> break;
> + case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
> + ret = regmap_read(map, MAX17042_DesignCap, &data);
> + if (ret < 0)
> + return ret;
> +
> + val->intval = data * 1000 / 2;
You need to include the rsns. The step 0.5 mAh is valid only for 10
mOhm resistor.
Best regards,
Krzysztof
> + break;
> case POWER_SUPPLY_PROP_CHARGE_FULL:
> ret = regmap_read(map, MAX17042_FullCAP, &data);
> if (ret < 0)
> --
> 2.9.3
>
next prev parent reply other threads:[~2017-04-14 16:34 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-14 12:59 [PATCH 01/13] power: Make power_supply_am_i_supplied return -ENODEV if there are no suppliers Hans de Goede
2017-04-14 12:59 ` [PATCH 02/13] power: max17042_battery: Use sign_extend32 instead of DIY code Hans de Goede
2017-04-14 15:29 ` Krzysztof Kozlowski
2017-04-14 12:59 ` [PATCH 03/13] power: max17047_battery: The temp alert values are 8-bit 2's complement Hans de Goede
2017-04-14 15:09 ` Krzysztof Kozlowski
2017-04-14 15:16 ` Hans de Goede
2017-04-14 15:26 ` Krzysztof Kozlowski
2017-04-14 15:36 ` Hans de Goede
2017-04-14 15:39 ` Krzysztof Kozlowski
2017-04-14 12:59 ` [PATCH 04/13] power: max17042_battery: Add default platform_data for x86 use Hans de Goede
2017-04-14 15:35 ` Krzysztof Kozlowski
2017-04-14 16:07 ` Krzysztof Kozlowski
2017-04-14 17:11 ` Hans de Goede
2017-04-14 12:59 ` [PATCH 05/13] power: max17042_battery: Change name in power_supply_desc to "main-battery" Hans de Goede
2017-04-14 15:37 ` Krzysztof Kozlowski
2017-04-14 12:59 ` [PATCH 06/13] power: max17042_battery: Add support for the STATUS property Hans de Goede
2017-04-14 16:11 ` Krzysztof Kozlowski
2017-04-14 17:19 ` Hans de Goede
2017-04-14 12:59 ` [PATCH 07/13] power: max17042_battery: Add external_power_changed callback Hans de Goede
2017-04-14 16:22 ` Krzysztof Kozlowski
2017-04-14 12:59 ` [PATCH 08/13] power: max17042_battery: Add support for the TECHNOLOGY attribute Hans de Goede
2017-04-14 16:26 ` Krzysztof Kozlowski
2017-04-14 18:06 ` Hans de Goede
2017-04-14 18:20 ` Krzysztof Kozlowski
2017-04-14 18:24 ` Hans de Goede
2017-04-14 12:59 ` [PATCH 09/13] power: max17042_battery: Add support for the VOLT_MIN property Hans de Goede
2017-04-14 16:29 ` Krzysztof Kozlowski
2017-04-14 12:59 ` [PATCH 10/13] power: max17042_battery: Add support for the CHARGE_FULL_DESIGN property Hans de Goede
2017-04-14 16:34 ` Krzysztof Kozlowski [this message]
2017-04-14 18:08 ` Hans de Goede
2017-04-14 12:59 ` [PATCH 11/13] power: max17042_battery: Add support for CHARGE_NOW property Hans de Goede
2017-04-14 16:42 ` Krzysztof Kozlowski
2017-04-14 12:59 ` [PATCH 12/13] power: max17042_battery: Add support for SCOPE property Hans de Goede
2017-04-14 16:43 ` Krzysztof Kozlowski
2017-04-14 12:59 ` [PATCH 13/13] power: max77693_charger: Add supplied_to info to power_supply_config Hans de Goede
2017-04-14 16:44 ` Krzysztof Kozlowski
2017-04-14 13:56 ` [PATCH 01/13] power: Make power_supply_am_i_supplied return -ENODEV if there are no suppliers Krzysztof Kozlowski
2017-04-14 14:07 ` Hans de Goede
2017-04-14 14:31 ` Krzysztof Kozlowski
2017-04-14 15:21 ` Hans de Goede
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=20170414163429.vcwq2afmdiilwmeb@kozik-lap \
--to=krzk@kernel.org \
--cc=b.zolnierkie@samsung.com \
--cc=hdegoede@redhat.com \
--cc=linux-pm@vger.kernel.org \
--cc=sre@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox