Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1187524imm; Wed, 10 Oct 2018 10:24:34 -0700 (PDT) X-Google-Smtp-Source: ACcGV635OEWa97gCbYwCL3Tkolxhb6oOo2dBB7/s1eAuGcYvf5/i3bI4WNysORdg4/EIDd7hlcMr X-Received: by 2002:a62:aa17:: with SMTP id e23-v6mr35693557pff.211.1539192274695; Wed, 10 Oct 2018 10:24:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539192274; cv=none; d=google.com; s=arc-20160816; b=nRPSKhJoSwmy4f8erCvTu3mBfEoMzHjdMv4WByxpf2xY+UDkAyos0gLIobOzbzq2z6 zIyws31HXGf2C5nocSky09AUVPifNw+He/024nDTZyFWffEY7/v5ofEmlUnNCP7elHUD r618S17jCy02Xln2S3obb+O9nPASp2gwM9dNeF3ioF653Iec88zpZv2LLGl4agMNWyKx o0+uGbiGYisjqC4OojQv0fpzoX2wzfz2ndwQk13pwZWzYqGocXa9zWocWd56btRNz6Qe BUNoWJt7aNJ8gCTZDsygo22/jK5I7mn6cYO2K9MGIvIoi2oYoflfB3Wucz1ie1r9WO0e QtJw== 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=2IOD8I303BO9OAGgJf2Iw6omPlu7+O0+zXujawk0/1Q=; b=XSGU9FrBysBVTcepGvRcp7wJ1VDYtwLs+tdfphQgftpRsZVUPZN8IL8tPoHKVQPai3 acV9Uju9H7uewNQUujHgh6BWUAzT52M5sx9z3fIRCvFLpDM3RoWutzr5O3JIqeWB9lmc 22DjJbkEUprIPV9sr7l1tTnVQL2QM+S1hkYi8BWbKt6qGJmQ1AValfTrMllL6GgkJQar //huDB6ykvnIXE9blUzrmGaGUnNvBRhd66IwciFZZ4DYsmKi4cgDCfM0AQnLftq53Ruh RfORa295EeTeYK8EUCnJ6Y6FePKPzf2y1PFBMU3fryYLPVWKQan2eqvXsv0vh3qBDNUv DKuA== 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 g4-v6si24513049plo.254.2018.10.10.10.24.20; Wed, 10 Oct 2018 10:24:34 -0700 (PDT) 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 S1727600AbeJKAqy (ORCPT + 99 others); Wed, 10 Oct 2018 20:46:54 -0400 Received: from shell.v3.sk ([90.176.6.54]:54589 "EHLO shell.v3.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727454AbeJKAqw (ORCPT ); Wed, 10 Oct 2018 20:46:52 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 7B50DBCFB9; Wed, 10 Oct 2018 19:23:42 +0200 (CEST) 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 sLHODR34e9fd; Wed, 10 Oct 2018 19:23:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id E8E93BCFAA; Wed, 10 Oct 2018 19:23:16 +0200 (CEST) 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 eea6XUC9iZTl; Wed, 10 Oct 2018 19:23:13 +0200 (CEST) Received: from belphegor.lan (ip-89-102-31-34.net.upcbroadband.cz [89.102.31.34]) by zimbra.v3.sk (Postfix) with ESMTPSA id CB6F0BCFC7; Wed, 10 Oct 2018 19:23:08 +0200 (CEST) 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 12/15] power: supply: olpc_battery: Use DT to get battery version Date: Wed, 10 Oct 2018 19:22:57 +0200 Message-Id: <20181010172300.317643-13-lkundrak@v3.sk> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181010172300.317643-1-lkundrak@v3.sk> References: <20181010172300.317643-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 --- 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..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 2.19.0