Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1209332 > unrolled thread

Re: [PATCH v2 3/3] power: wm831x_power: Support USB charger current limit management

Started byMark Brown <broonie@kernel.org>
First post2015-08-18 18:20 +0200
Last post2015-08-19 18:40 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v2 3/3] power: wm831x_power: Support USB charger current  limit management Mark Brown <broonie@kernel.org> - 2015-08-18 18:20 +0200
    Re: [PATCH v2 3/3] power: wm831x_power: Support USB charger current  limit management Mark Brown <broonie@kernel.org> - 2015-08-19 18:40 +0200

#1209332 — Re: [PATCH v2 3/3] power: wm831x_power: Support USB charger current limit management

FromMark Brown <broonie@kernel.org>
Date2015-08-18 18:20 +0200
SubjectRe: [PATCH v2 3/3] power: wm831x_power: Support USB charger current limit management
Message-ID<pYRMe-2Xf-15@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

On Tue, Aug 18, 2015 at 01:20:12PM +0800, Peter Chen wrote:

> ok, I just had suspected below function's correctness, after looking
> it again, it always set 1800 as charging limit, does it be expected?

> +       /* Find the highest supported limit */
> +       best = 0;
> +       for (i = 0; i < ARRAY_SIZE(wm831x_usb_limits); i++) {
> +               if (limit < wm831x_usb_limits[i] &&

The above check is intended to ensure that we don't go over the limit
that was passed in in the callback.  The goal is to select the highest
option that is less than the limit passed in.

[toc] | [next] | [standalone]


#1209942

FromMark Brown <broonie@kernel.org>
Date2015-08-19 18:40 +0200
Message-ID<pZez8-2Yu-3@gated-at.bofh.it>
In reply to#1209332

[Multipart message — attachments visible in raw view] — view raw

On Wed, Aug 19, 2015 at 08:02:37AM +0800, Peter Chen wrote:

> Below code may be correct for the goal you expressed.

>        for (i = 0; i < ARRAY_SIZE(wm831x_usb_limits); i++) {
>                if (limit >= wm831x_usb_limits[i] &&
>                    wm831x_usb_limits[best] < wm831x_usb_limits[i])
>                        best = i;
>        }

Yes, that's right.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web