From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30631C32789 for ; Sun, 4 Nov 2018 12:37:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB7AC20685 for ; Sun, 4 Nov 2018 12:37:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DB7AC20685 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729797AbeKDVwF (ORCPT ); Sun, 4 Nov 2018 16:52:05 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:40747 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729232AbeKDVwF (ORCPT ); Sun, 4 Nov 2018 16:52:05 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 928B78092E; Sun, 4 Nov 2018 13:37:08 +0100 (CET) Date: Sun, 4 Nov 2018 13:37:10 +0100 From: Pavel Machek To: Lubomir Rintel Cc: Mark Brown , Geert Uytterhoeven , Darren Hart , Andy Shevchenko , Greg Kroah-Hartman , James Cameron , Sebastian Reichel , Rob Herring , Mark Rutland , Eric Miao , Haojian Zhuang , Daniel Mack , Robert Jarzmik , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, devel@driverdev.osuosl.org, linux-pm@vger.kernel.org Subject: Re: [PATCH 12/15] power: supply: olpc_battery: Use DT to get battery version Message-ID: <20181104123710.GE23864@amd> References: <20181010172300.317643-1-lkundrak@v3.sk> <20181010172300.317643-13-lkundrak@v3.sk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4imyEzq1NYdDURgI" Content-Disposition: inline In-Reply-To: <20181010172300.317643-13-lkundrak@v3.sk> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --4imyEzq1NYdDURgI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed 2018-10-10 19:22:57, Lubomir Rintel wrote: > Avoid using the x86 OLPC platform specific call to get the board > version. It won't work on FDT-based ARM MMP2 platform. >=20 > Signed-off-by: Lubomir Rintel > Reviewed-by: Andy Shevchenko Acked-by: Pavel Machek AFAICT, this should go earlier in the series; first, add support in the code, then switch to new name in DTS. Pavel > --- > drivers/power/supply/olpc_battery.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/power/supply/olpc_battery.c b/drivers/power/supply/o= lpc_battery.c > index 5a97e42a3547..540d44bf536f 100644 > --- a/drivers/power/supply/olpc_battery.c > +++ b/drivers/power/supply/olpc_battery.c > @@ -19,6 +19,7 @@ > #include > #include > #include > +#include > #include > =20 > =20 > @@ -622,11 +623,13 @@ static int olpc_battery_probe(struct platform_devic= e *pdev) > olpc_ac =3D power_supply_register(&pdev->dev, &olpc_ac_desc, NULL); > if (IS_ERR(olpc_ac)) > return PTR_ERR(olpc_ac); > - > - if (olpc_board_at_least(olpc_board_pre(0xd0))) { /* XO-1.5 */ > + if (of_property_match_string(pdev->dev.of_node, "compatible", > + "olpc,xo1.5-battery") >=3D 0) { > + /* XO-1.5 */ > olpc_bat_desc.properties =3D olpc_xo15_bat_props; > olpc_bat_desc.num_properties =3D ARRAY_SIZE(olpc_xo15_bat_props); > - } else { /* XO-1 */ > + } else { > + /* XO-1 */ > olpc_bat_desc.properties =3D olpc_xo1_bat_props; > olpc_bat_desc.num_properties =3D ARRAY_SIZE(olpc_xo1_bat_props); > } > @@ -672,6 +675,7 @@ static int olpc_battery_remove(struct platform_device= *pdev) > =20 > static const struct of_device_id olpc_battery_ids[] =3D { > { .compatible =3D "olpc,xo1-battery" }, > + { .compatible =3D "olpc,xo1.5-battery" }, > {} > }; > MODULE_DEVICE_TABLE(of, olpc_battery_ids); --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --4imyEzq1NYdDURgI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlve5/YACgkQMOfwapXb+vKVMQCglB45t0fL+NdRGuPEXikeYlXU xawAn0WUe00BpyiCxZyBEVF4ebFCwH9f =Cup/ -----END PGP SIGNATURE----- --4imyEzq1NYdDURgI--