From: saravanan sekar <sravanhome@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Lee Jones <lee.jones@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Jonathan Cameron <jic23@kernel.org>,
Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald <pmeerw@pmeerw.net>,
Sebastian Reichel <sre@kernel.org>,
devicetree <devicetree@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-iio <linux-iio@vger.kernel.org>,
Linux PM <linux-pm@vger.kernel.org>
Subject: Re: [PATCH v5 4/5] power: supply: Add support for mps mp2629 battery charger
Date: Sat, 28 Mar 2020 12:29:43 +0100 [thread overview]
Message-ID: <36892440-99b2-10e8-1d7c-dd8c97e03a39@gmail.com> (raw)
In-Reply-To: <CAHp75VefP3oPyRJ=Z9Y5Wv3rSc-nJdKFLJ60YLdUbP5dFikS+w@mail.gmail.com>
Hi Andy,
On 28/03/20 12:02 pm, Andy Shevchenko wrote:
> On Sat, Mar 28, 2020 at 2:12 AM Saravanan Sekar <sravanhome@gmail.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?
Really not for processed
>> + 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.
I think I misunderstood you previous review comment "Redundant
parentheses", no sure what is the expectation
>
> ...
>
>> + 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()
Done
>> + return -ERANGE;
> ...
>
>> + struct power_supply_config psy_cfg = {NULL};
> { 0 }
>
NULL to make compiler happy.
next prev parent reply other threads:[~2020-03-28 11:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-28 0:11 [PATCH v5 0/5] Add battery charger driver support for MP2629 Saravanan Sekar
2020-03-28 0:11 ` [PATCH v5 1/5] dt-bindings: mfd: add document bindings for mp2629 Saravanan Sekar
2020-03-28 0:11 ` [PATCH v5 2/5] mfd: mp2629: Add support for mps battery charger Saravanan Sekar
2020-03-28 10:45 ` Andy Shevchenko
2020-03-28 10:51 ` saravanan sekar
2020-03-28 11:06 ` Andy Shevchenko
2020-03-28 0:11 ` [PATCH v5 3/5] iio: adc: mp2629: Add support for mp2629 ADC driver Saravanan Sekar
2020-03-28 10:52 ` Andy Shevchenko
2020-03-28 17:51 ` Jonathan Cameron
2020-03-28 0:11 ` [PATCH v5 4/5] power: supply: Add support for mps mp2629 battery charger Saravanan Sekar
2020-03-28 11:02 ` Andy Shevchenko
2020-03-28 11:03 ` Andy Shevchenko
2020-03-28 11:29 ` saravanan sekar [this message]
2020-03-28 18:44 ` Andy Shevchenko
2020-03-29 10:34 ` saravanan sekar
2020-03-29 11:17 ` Andy Shevchenko
2020-03-28 0:11 ` [PATCH v5 5/5] MAINTAINERS: Add entry for mp2629 Battery Charger driver Saravanan Sekar
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=36892440-99b2-10e8-1d7c-dd8c97e03a39@gmail.com \
--to=sravanhome@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=lee.jones@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--cc=robh+dt@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;
as well as URLs for NNTP newsgroup(s).