[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKDJKT46cJQbjdObUxBpWsciG1FjcL8CdV7iAeMefjNQPGicKA@mail.gmail.com>
Date: Tue, 3 May 2016 09:30:48 +0530
From: Manish Badarkhe <badarkhe.manish@...il.com>
To: Baolin Wang <baolin.wang@...aro.org>
Cc: balbi@...nel.org, gregkh@...uxfoundation.org, sre@...nel.org,
Dmitry Eremin-Solenikov <dbaryshkov@...il.com>,
David Woodhouse <dwmw2@...radead.org>, robh@...nel.org,
m.szyprowski@...sung.com, ruslan.bilovol@...il.com,
peter.chen@...escale.com, stern@...land.harvard.edu,
r.baldyga@...sung.com, yoshihiro.shimoda.uh@...esas.com,
Lee Jones <lee.jones@...aro.org>,
Mark Brown <broonie@...nel.org>,
ckeepax@...nsource.wolfsonmicro.com,
patches@...nsource.wolfsonmicro.com, linux-pm@...r.kernel.org,
linux-usb@...r.kernel.org,
device-mainlining@...ts.linuxfoundation.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RESEND PATCH v10 4/4] power: wm831x_power: Support USB charger
current limit management
On Tue, May 3, 2016 at 9:00 AM, Baolin Wang <baolin.wang@...aro.org> wrote:
> Integrate with the newly added USB charger interface to limit the current
> we draw from the USB input based on the input device configuration
> identified by the USB stack, allowing us to charge more quickly from high
> current inputs without drawing more current than specified from others.
>
> Signed-off-by: Mark Brown <broonie@...nel.org>
> Signed-off-by: Baolin Wang <baolin.wang@...aro.org>
> Acked-by: Lee Jones <lee.jones@...aro.org>
> Acked-by: Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>
> Acked-by: Peter Chen <peter.chen@...escale.com>
> Acked-by: Sebastian Reichel <sre@...nel.org>
> ---
> drivers/power/wm831x_power.c | 69 ++++++++++++++++++++++++++++++++++++++
> include/linux/mfd/wm831x/pdata.h | 3 ++
> 2 files changed, 72 insertions(+)
>
> diff --git a/drivers/power/wm831x_power.c b/drivers/power/wm831x_power.c
> index 7082301..cef1812 100644
> --- a/drivers/power/wm831x_power.c
> +++ b/drivers/power/wm831x_power.c
> @@ -13,6 +13,7 @@
> #include <linux/platform_device.h>
> #include <linux/power_supply.h>
> #include <linux/slab.h>
> +#include <linux/usb/charger.h>
>
> #include <linux/mfd/wm831x/core.h>
> #include <linux/mfd/wm831x/auxadc.h>
> @@ -31,6 +32,8 @@ struct wm831x_power {
> char usb_name[20];
> char battery_name[20];
> bool have_battery;
> + struct usb_charger *usb_charger;
> + struct notifier_block usb_notify;
> };
>
> static int wm831x_power_check_online(struct wm831x *wm831x, int supply,
> @@ -125,6 +128,43 @@ static enum power_supply_property wm831x_usb_props[] = {
> POWER_SUPPLY_PROP_VOLTAGE_NOW,
> };
>
> +/* In milliamps */
> +static const unsigned int wm831x_usb_limits[] = {
> + 0,
> + 2,
> + 100,
> + 500,
> + 900,
> + 1500,
> + 1800,
> + 550,
> +};
Just for curiosity, How these current limits are getting decided?
Can we have some proper defines over here so that it can be grasped easily?
Thanks
Manish Badarkhe
Powered by blists - more mailing lists