[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VefP3oPyRJ=Z9Y5Wv3rSc-nJdKFLJ60YLdUbP5dFikS+w@mail.gmail.com>
Date: Sat, 28 Mar 2020 13:02:17 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Saravanan Sekar <sravanhome@...il.com>
Cc: Lee Jones <lee.jones@...aro.org>, Rob Herring <robh+dt@...nel.org>,
Jonathan Cameron <jic23@...nel.org>,
Hartmut Knaack <knaack.h@....de>,
Lars-Peter Clausen <lars@...afoo.de>,
Peter Meerwald <pmeerw@...erw.net>,
Sebastian Reichel <sre@...nel.org>,
devicetree <devicetree@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-iio <linux-iio@...r.kernel.org>,
Linux PM <linux-pm@...r.kernel.org>
Subject: Re: [PATCH v5 4/5] power: supply: Add support for mps mp2629 battery charger
On Sat, Mar 28, 2020 at 2:12 AM Saravanan Sekar <sravanhome@...il.com> wrote:
>
> The mp2629 provides switching-mode battery charge management for
> single-cell Li-ion or Li-polymer battery. Driver supports the
> access/control input source and battery charging parameters.
...
> +#include <linux/module.h>
> +#include <linux/of_device.h>
Missed header bits.h.
...
> + ret = iio_read_channel_processed(charger->iiochan[ch], &chval);
> + if (ret < 0)
Is it possible to get positive returned value?
> + return ret;
...
> + val->intval = (rval * props[fld].step) + props[fld].min;
Too many parentheses.
...
> + return ((psp == POWER_SUPPLY_PROP_PRECHARGE_CURRENT) ||
> + (psp == POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT) ||
> + (psp == POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT) ||
> + (psp == POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE));
Ditto.
...
> + return ((psp == POWER_SUPPLY_PROP_INPUT_VOLTAGE_LIMIT) ||
> + (psp == POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT));
Ditto.
...
> + return sprintf(buf, "%d mohm\n", rval);
Hmm... For units we usually have separate node, but it is up to
maintainer, I dunno what the common practice is there.
...
> + int val;
> + int ret;
> +
> + ret = kstrtoint(buf, 10, &val);
> + if (ret)
> + return ret;
> +
> + if (val < 0 && val > 140)
What the point to convert negative values in the first place? kstrtouint()
> + return -ERANGE;
...
> + struct power_supply_config psy_cfg = {NULL};
{ 0 }
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists