[PATCH V4 14/15] power: supply: axp20x_battery: add support for AXP717
Sebastian Reichel
sebastian.reichel at collabora.com
Tue Aug 27 09:24:42 PDT 2024
Hi,
On Wed, Aug 21, 2024 at 04:54:55PM GMT, Chris Morgan wrote:
> + case POWER_SUPPLY_PROP_VOLTAGE_NOW:
> + ret = iio_read_channel_processed(axp20x_batt->batt_v,
> + &val->intval);
> + if (ret)
> + return ret;
> +
> + /* IIO framework gives mV but Power Supply framework gives uV */
> + val->intval *= 1000;
> + return 0;
I see you followed the existing pattern for these two drivers. Can
you please add another patch, which converts both drivers to the
following pattern:
return iio_read_channel_processed_scale(adc_chan, &val->intval, 1000);
[...]
> +static int axp717_battery_set_max_voltage(struct axp20x_batt_ps *axp20x_batt,
> + int val)
> +{
> + switch (val) {
> + case 4000000:
> + val = AXP717_CHRG_CV_4_0V;
> + break;
> +
> + case 4100000:
> + val = AXP717_CHRG_CV_4_1V;
> + break;
> +
> + case 4200000:
> + val = AXP717_CHRG_CV_4_2V;
> + break;
> +
> + default:
> + /*
> + * AXP717 can go up to 4.35, 4.4, and 5.0 volts which
> + * seem too high for lithium batteries, so do not allow.
> + */
> + return -EINVAL;
4.35V and 4.4V batteries exists. You can find them when you search
for LiHV (Lithium High Voltage).
[...]
Otherwise LGTM,
-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20240827/2ace5ae0/attachment.sig>
More information about the linux-arm-kernel
mailing list