lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGb2v6598dSC278vVdQ_f54piLS0y4BnN3V4ZUhbGXKavx+ryQ@mail.gmail.com>
Date:   Tue, 16 May 2017 13:18:34 +0800
From:   Chen-Yu Tsai <wens@...e.org>
To:     Quentin Schulz <quentin.schulz@...e-electrons.com>
Cc:     Sebastian Reichel <sre@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Chen-Yu Tsai <wens@...e.org>,
        "open list:THERMAL" <linux-pm@...r.kernel.org>,
        devicetree <devicetree@...r.kernel.org>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        Liam Breck <liam@...workimprov.net>,
        Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
        linux-sunxi <linux-sunxi@...glegroups.com>
Subject: Re: [PATCH 1/4] power: supply: axp20x_battery: add support for DT battery

On Thu, May 11, 2017 at 9:42 PM, Quentin Schulz
<quentin.schulz@...e-electrons.com> 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@...e-electrons.com>
> ---
>  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)) {

This is not in -next. It would help if you mention any requisite patches.

ChenYu

> +               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
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ