From: Tony Lindgren <tony@atomide.com>
To: Carl Philipp Klemm <philipp@uvos.xyz>
Cc: Pavel Machek <pavel@ucw.cz>,
Arthur Demchenkov <spinal.by@gmail.com>,
Merlijn Wajer <merlijn@wizzup.org>,
linux-omap@vger.kernel.org, Sebastian Reichel <sre@kernel.org>
Subject: Re: [PATCH v2 1/2] power: supply: cpcap-battery: Add battery type auto detection for mapphone devices
Date: Sat, 24 Apr 2021 15:59:25 +0300 [thread overview]
Message-ID: <YIQWLfKU8WaqYsuo@atomide.com> (raw)
In-Reply-To: <20210424111722.5defa3b4bab246143ca2c0ae@uvos.xyz>
* Carl Philipp Klemm <philipp@uvos.xyz> [210424 09:17]:
> > The battery inserted property is still based on the presence of a thermistor, so I don't see how this patch changes the bevior with regards to this use case at all except for that info print. Previously the battery information struct was simply set to the values expected from eb41 no matter what.
OK sounds like I should test these patches with a power supply.
> Vefore writing this patch i did use the below on my xt875, which dose what you ask. maybe this is something you would like to see included in addition to the above? if so i can submitt it aswell:
>
> [PATCH] power: supply: cpcap-battery: make charge_full_design writeable, so that different/custom batteries can be used.
>
> Especially usfull on XTT875 where both HW4X and BW8X exsist
Yeah I think for generic batteries we should require that the battery
properties get initialized. Also the type can be li-ion vs li-po, I think
the charge voltage we already have configurable.
Regards,
Tony
> ---
> drivers/power/supply/cpcap-battery.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/power/supply/cpcap-battery.c b/drivers/power/supply/cpcap-battery.c
> index be8d8b746f24..6465cb1b084c 100644
> --- a/drivers/power/supply/cpcap-battery.c
> +++ b/drivers/power/supply/cpcap-battery.c
> @@ -769,6 +769,13 @@ static int cpcap_battery_set_property(struct power_supply *psy,
>
> ddata->charge_full = val->intval;
>
> + return 0;
> + case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
> + if (val->intval < 0)
> + return -EINVAL;
> +
> + ddata->config.info.charge_full_design = val->intval;
> +
> return 0;
> default:
> return -EINVAL;
> @@ -783,6 +790,7 @@ static int cpcap_battery_property_is_writeable(struct power_supply *psy,
> switch (psp) {
> case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE:
> case POWER_SUPPLY_PROP_CHARGE_FULL:
> + case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
> return 1;
> default:
> return 0;
> --
> 2.31.0
next prev parent reply other threads:[~2021-04-24 12:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-24 7:00 [PATCH v2 1/2] power: supply: cpcap-battery: Add battery type auto detection for mapphone devices carl
2021-04-24 9:17 ` Carl Philipp Klemm
2021-04-24 12:59 ` Tony Lindgren [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-04-23 12:55 Carl Philipp Klemm
2021-04-24 6:47 ` Tony Lindgren
2021-06-04 12:54 ` Sebastian Reichel
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=YIQWLfKU8WaqYsuo@atomide.com \
--to=tony@atomide.com \
--cc=linux-omap@vger.kernel.org \
--cc=merlijn@wizzup.org \
--cc=pavel@ucw.cz \
--cc=philipp@uvos.xyz \
--cc=spinal.by@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.