Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp672432imu; Fri, 16 Nov 2018 08:27:20 -0800 (PST) X-Google-Smtp-Source: AJdET5fYmBiUhi2nV0y/dClZxbgadjFRfa1BD16HzosUU8m1t0RXMA+vyXYUik44KSZvD4xErgQ7 X-Received: by 2002:a17:902:be07:: with SMTP id r7-v6mr11484528pls.137.1542385640515; Fri, 16 Nov 2018 08:27:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542385640; cv=none; d=google.com; s=arc-20160816; b=QZJOxbuewddmRt5Ss0yT47hvhbNH8xXYwgoK1RnEFDb4B8fUByan99wyc9uQwpA2g8 QbNsXKh3bDNPGM52K7A7TRl/CvxlCyzOnzcNlhSsGHzqHOa5hK8zTA4xl+P2LCKYg3Ak f77eq6I94pSuIIahpV04165oPHJ6HgtcbHzNJjTAMDj1FiY39RS2mRSuCkP44hg+6sRk Wn3yp3TBIBYlRbji7GFDk8r3g/wKwbXH+w+APLBWDRZlP4kKOu2QALDf+kq49A+DfJ0S wW4U8gKZJkZdXD7WA56Qw7pSLbKnBOngy+S7zS4QjD2tUC2g9xG7QYggBJRBPz38UOof Kakw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=eDNLbj7g5BXYow8q3GZ7KOBIqW/T9tKImXuUDO011N4=; b=VLWtmQuXSsoRGRBTPxIC2r2wRHBm0BJz9F8ucdtg3CPuhQwcbtYQsAsu70iBrWZArH Z44XaaMStZOPFzVDg6JI8HPvY3p/qzXFVvt6mwFVG2ZHVsJ9zd+111TBSLDnkHlHJZVv z3bCxdGLkZT1CmzJYBBQQCp2UH3aey4wy8k9janzyr3rR17gWyvsF1v0hZt/LcwSL7YX on/rENOV9GrlrKu28faCNCi8o1fYwUyoVazOe16Bkl+4k+PF+GJpQe1bdfmlQTMp9TX9 hhZWYlJfuAlBGWd73vYBlC3HCyO+oZpps29XjdGgnRl+83x45jQz0Vk7TJvAeXk8lOBb I07A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a34-v6si34216740pld.249.2018.11.16.08.27.06; Fri, 16 Nov 2018 08:27:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390315AbeKQCiP (ORCPT + 99 others); Fri, 16 Nov 2018 21:38:15 -0500 Received: from shell.v3.sk ([90.176.6.54]:57131 "EHLO shell.v3.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390279AbeKQCiO (ORCPT ); Fri, 16 Nov 2018 21:38:14 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 8EEEB52BCA; Fri, 16 Nov 2018 17:25:09 +0100 (CET) Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id MT5pcP-7ImJU; Fri, 16 Nov 2018 17:24:45 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 1E65752C9A; Fri, 16 Nov 2018 17:24:27 +0100 (CET) X-Virus-Scanned: amavisd-new at zimbra.v3.sk Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id QC0bbS4oxfgI; Fri, 16 Nov 2018 17:24:24 +0100 (CET) Received: from belphegor.brq.redhat.com (nat-pool-brq-t.redhat.com [213.175.37.10]) by zimbra.v3.sk (Postfix) with ESMTPSA id 158FB52FB0; Fri, 16 Nov 2018 17:24:19 +0100 (CET) From: Lubomir Rintel To: Mark Brown , Geert Uytterhoeven , Darren Hart , Andy Shevchenko Cc: 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, Lubomir Rintel Subject: [PATCH v2 13/17] power: supply: olpc_battery: Use DT to get battery version Date: Fri, 16 Nov 2018 17:23:59 +0100 Message-Id: <20181116162403.49854-14-lkundrak@v3.sk> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181116162403.49854-1-lkundrak@v3.sk> References: <20181116162403.49854-1-lkundrak@v3.sk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Avoid using the x86 OLPC platform specific call to get the board version. It won't work on FDT-based ARM MMP2 platform. Signed-off-by: Lubomir Rintel Reviewed-by: Andy Shevchenko Acked-by: Pavel Machek --- Changes since v1: - Sort the new include a bit higher drivers/power/supply/olpc_battery.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/power/supply/olpc_battery.c b/drivers/power/supply/o= lpc_battery.c index 5a97e42a3547..5323987d9284 100644 --- a/drivers/power/supply/olpc_battery.c +++ b/drivers/power/supply/olpc_battery.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -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 2.19.1