devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Reichel <sebastian.reichel-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
To: Quentin Schulz
	<quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	mark.rutland-5wv7dgnIgG8@public.gmane.org,
	wens-jdAy2FN1RRM@public.gmane.org,
	linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	liam-RYWXG+zxWwBdeoIcmNTgJF6hYfS7NtTn@public.gmane.org,
	thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: [PATCH 1/4] power: supply: axp20x_battery: add support for DT battery
Date: Thu, 8 Jun 2017 17:58:21 +0200	[thread overview]
Message-ID: <20170608155821.n5uuobjpv2gmbl5t@earth> (raw)
In-Reply-To: <20170511134221.5569-2-quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1638 bytes --]

Hi,

On Thu, May 11, 2017 at 03:42:17PM +0200, Quentin Schulz wrote:
> This adds support in X-Powers AXP20X and AXP22X battery driver for a
> fixed battery in DT.
> 
> It will take the minimum supported voltage by the battery as defined in
> the battery DT node and set the V_OFF register to this value, telling
> the system to shut down if the supplied power is below this value.
> 
> Signed-off-by: Quentin Schulz <quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>

Thanks, queued.

-- Sebastian

>  drivers/power/supply/axp20x_battery.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/power/supply/axp20x_battery.c b/drivers/power/supply/axp20x_battery.c
> index 5d29b2eab8fc..66f530541735 100644
> --- a/drivers/power/supply/axp20x_battery.c
> +++ b/drivers/power/supply/axp20x_battery.c
> @@ -433,6 +433,7 @@ static int axp20x_power_probe(struct platform_device *pdev)
>  {
>  	struct axp20x_batt_ps *axp20x_batt;
>  	struct power_supply_config psy_cfg = {};
> +	struct power_supply_battery_info info;
>  
>  	if (!of_device_is_available(pdev->dev.of_node))
>  		return -ENODEV;
> @@ -484,6 +485,15 @@ static int axp20x_power_probe(struct platform_device *pdev)
>  		return PTR_ERR(axp20x_batt->batt);
>  	}
>  
> +	if (!power_supply_get_battery_info(axp20x_batt->batt, &info)) {
> +		int vmin = info.voltage_min_design_uv;
> +
> +		if (vmin > 0 && axp20x_set_voltage_min_design(axp20x_batt,
> +							      vmin))
> +			dev_err(&pdev->dev,
> +				"couldn't set voltage_min_design\n");
> +	}
> +
>  	return 0;
>  }
>  
> -- 
> 2.11.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2017-06-08 15:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11 13:42 [PATCH 0/4] set battery info on AXP20X and AXP22X from DT Quentin Schulz
     [not found] ` <20170511134221.5569-1-quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-05-11 13:42   ` [PATCH 1/4] power: supply: axp20x_battery: add support for DT battery Quentin Schulz
     [not found]     ` <20170511134221.5569-2-quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-05-16  5:18       ` Chen-Yu Tsai
     [not found]         ` <CAGb2v6598dSC278vVdQ_f54piLS0y4BnN3V4ZUhbGXKavx+ryQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-05-16  6:33           ` Quentin Schulz
2017-06-08 15:58       ` Sebastian Reichel [this message]
2017-05-11 13:42   ` [PATCH 2/4] dt-bindings: power: battery: add constant-charge-current-max-microamp property Quentin Schulz
     [not found]     ` <20170511134221.5569-3-quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-05-15 20:14       ` Rob Herring
2017-05-11 13:42   ` [PATCH 3/4] power: supply: power_supply_core: add constant-charge-current optional property Quentin Schulz
2017-05-11 13:42   ` [PATCH 4/4] power: supply: axp20x_battery: add DT support for battery max constant charge current Quentin Schulz
     [not found]     ` <20170511134221.5569-5-quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-06-08 15:58       ` Sebastian Reichel

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=20170608155821.n5uuobjpv2gmbl5t@earth \
    --to=sebastian.reichel-zgy8ohtn/8ppycu2f3hruq@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=liam-RYWXG+zxWwBdeoIcmNTgJF6hYfS7NtTn@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=wens-jdAy2FN1RRM@public.gmane.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).