From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751813AbdFHP62 (ORCPT ); Thu, 8 Jun 2017 11:58:28 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:50552 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750725AbdFHP60 (ORCPT ); Thu, 8 Jun 2017 11:58:26 -0400 Date: Thu, 8 Jun 2017 17:58:21 +0200 From: Sebastian Reichel To: Quentin Schulz Cc: robh+dt@kernel.org, mark.rutland@arm.com, wens@csie.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, liam@networkimprov.net, thomas.petazzoni@free-electrons.com, linux-sunxi@googlegroups.com Subject: Re: [PATCH 1/4] power: supply: axp20x_battery: add support for DT battery Message-ID: <20170608155821.n5uuobjpv2gmbl5t@earth> References: <20170511134221.5569-1-quentin.schulz@free-electrons.com> <20170511134221.5569-2-quentin.schulz@free-electrons.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qugtk37hf4ozahms" Content-Disposition: inline In-Reply-To: <20170511134221.5569-2-quentin.schulz@free-electrons.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --qugtk37hf4ozahms Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > 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. >=20 > Signed-off-by: Quentin Schulz Thanks, queued. -- Sebastian > drivers/power/supply/axp20x_battery.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) >=20 > 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 =3D {}; > + struct power_supply_battery_info info; > =20 > 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); > } > =20 > + if (!power_supply_get_battery_info(axp20x_batt->batt, &info)) { > + int vmin =3D 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; > } > =20 > --=20 > 2.11.0 >=20 --qugtk37hf4ozahms Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAlk5dBoACgkQ2O7X88g7 +poADQ/+KQ6wBbg0J/zvsBXsQPQcy7bMbb54eWB273q9u/v7UG1tI73ZK2hpri6O dH57r+LDoLY0AqK5rfUA6GUVvs79ULV+u5aCINhpgzZzRM3NyIq+AQkCS/11ty7D e9BcTjah9pYwLAr2VMzg4D4i+F6w20Zifywqv9q/rmh4w4LXLQLT+cOFiE8dCgEu oGnf18R1WAMI576LATtiYNTNujPbU2rBkr2TmMWSEmdETA2AzNTN1Zeb1hh6ty8n bkWYOJo0+OZkUWn0sjSLqBZdntCzDOexUBGKo/sdbSMfLT5xXB40w5RPIdHnBW2o yMTx03PLURArfZ6jJBPUV/wqjYJVmq76LrbNM9Kp/vJkaBrR3WTohPzHTBHGfbM3 pthQ6fTslfPSCl/PrSasr1Z9RipGacILJjFaZjJB4mvwr4tugml6eydXT7jGfP0P N6v+2PuxoBq8ptxYy9+65oDs3b48A/ClQiqI8xvWWoUte/1Hy4FXRIibaNYKRe5v Fe6Vni7BGiR2ms4wrCdBBUbZWA2hmcllFhHYd90qpX0pSNUeCQ2L1hvxwODo5z6w M+ZvZVTMXw92BxU/Zyu0aQbagwGwjjo/MpMkA9Igg5OO7lyCzTVGsn0AJStqy0mm o0t/loYV3NzRymGqjb9YElLMHaWaIRCkE5v0OMUiRwvZ+EpCBkg= =39H9 -----END PGP SIGNATURE----- --qugtk37hf4ozahms--