From: Chanwoo Choi <cw00.choi@samsung.com>
To: myungjoo.ham@samsung.com,
Dan Carpenter <dan.carpenter@oracle.com>,
"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
"broonie@kernel.org" <broonie@kernel.org>,
"krzk@kernel.org" <krzk@kernel.org>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: "kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] regulator: max8997/8966: fix charger cv voltage set bug
Date: Tue, 09 May 2017 23:33:31 +0000 [thread overview]
Message-ID: <591251CB.6000505@samsung.com> (raw)
In-Reply-To: <20170508054544epcms1p6d3d429e6f062e987adf72fc2c04ed159@epcms1p6>
Hi,
On 2017년 05월 08일 14:45, MyungJoo Ham wrote:
>
> When min charger-CV is <= 4.0V and max charger-CV is >= 4.0V,
> we can use 4.00V as CV (register value = 0x1).`
>
> The original code had a typo that wrote ">=" (max_uV >= 4000000),
> which should've been "<", which is not necessary anyway
> as mentioned by Dan Carpenter.
>
> Reported-By: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
> ---
> drivers/regulator/max8997-regulator.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/regulator/max8997-regulator.c b/drivers/regulator/max8997-regulator.c
> index efabc0e..559b9ac 100644
> --- a/drivers/regulator/max8997-regulator.c
> +++ b/drivers/regulator/max8997-regulator.c
> @@ -428,12 +428,9 @@ static int max8997_set_voltage_charger_cv(struct regulator_dev *rdev,
> if (max_uV < 4000000 || min_uV > 4350000)
> return -EINVAL;
>
> - if (min_uV <= 4000000) {
> - if (max_uV >= 4000000)
> - return -EINVAL;
> - else
> - val = 0x1;
> - } else if (min_uV <= 4200000 && max_uV >= 4200000)
> + if (min_uV <= 4000000)
> + val = 0x1;
> + else if (min_uV <= 4200000 && max_uV >= 4200000)
> val = 0x0;
> else {
> lb = (min_uV - 4000001) / 20000 + 2;
>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
--
Best Regards,
Chanwoo Choi
Samsung Electronics
next prev parent reply other threads:[~2017-05-09 23:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20170428141118epcas2p42c864cf574cc6fa3ffedbef22029e3ef@epcms1p6>
2017-04-28 14:11 ` [bug report] regulator: MAX8997/8966 support Dan Carpenter
2017-05-08 5:45 ` [PATCH] regulator: max8997/8966: fix charger cv voltage set bug MyungJoo Ham
2017-05-08 9:14 ` Bartlomiej Zolnierkiewicz
2017-05-09 23:33 ` Chanwoo Choi [this message]
2017-05-15 8:04 ` Applied "regulator: max8997/8966: fix charger cv voltage set bug" to the regulator tree Mark Brown
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=591251CB.6000505@samsung.com \
--to=cw00.choi@samsung.com \
--cc=b.zolnierkie@samsung.com \
--cc=broonie@kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=krzk@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
/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