Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2190286imu; Thu, 10 Jan 2019 09:43:58 -0800 (PST) X-Google-Smtp-Source: ALg8bN6Kv2sIiENTxtTyrbUO8axcObaZpLkcP+Q+3GT7/znt0sWLHccKJFqYQ99TrVeD59dDhmC3 X-Received: by 2002:a17:902:b40d:: with SMTP id x13mr11403112plr.237.1547142238199; Thu, 10 Jan 2019 09:43:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547142238; cv=none; d=google.com; s=arc-20160816; b=YtdsFnkHahWqwtAsMk4FjUpGtqfLrdJp+qX1fpivEP+r89XB22FZUbGhEhnN0eJoyX nXGmbGoLH6hTyEzcqoHGWF7gqH5BBU80DlWY9BYo8E1lRc2LFC1BzL6UZvC8NLvtQMiA FTtxbUZs6kWoMn7CHHQ6df6Lgjl4FPpd848ZC1RnsMIrbjyCuK3AWPnUOgF5D8QFVOWe KKN0LYF6NoHasjdi2ImKw7W933ixxMxFauwZf0i5twV7g3bisuCc8W/pTyct3qkfcR6g +A4MtfH7k3DEuplFDL1tTnXxdU1H1OURqU2Dr3kugbU/ZfTE76MctBTMLAHSfcVuadAP ziVQ== 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=L7xbis/bWk+lkZ2MfcZ9JfEn4PMnZLxCzjgAcuoZt9w=; b=Q6TeoWIOfcmi/OSHSp8waM7tBd0M7ze3wALUv6WSrZYogPs8dtGH48HpUxWWc3sx53 6D54NFKyNmEewE1d9dUibhiHoIRrPcJwPSPega+j9WCWcYh45cHAiPuSky5ml8rNDRdt DXGSPZF4eUE4m87JRt6lLoyGtoi0M+h9249G8muPqvufrlJ1GFE7nk5OKN4cEo/pbAYP lJBhfULT/pOjvs868+YEfsgrhHuCZAewE8nwFJp2zzBj86FZdrFS2SfFIbZyDBCkfQa7 wMTce/C40blN4T695tFamaBi2bQPLbnGruNWZkimKyYEF86lclNIQTKFhZMsZMICszYZ PdDg== 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 m1si55166108pgi.218.2019.01.10.09.43.43; Thu, 10 Jan 2019 09:43:58 -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 S1730455AbfAJRmV (ORCPT + 99 others); Thu, 10 Jan 2019 12:42:21 -0500 Received: from shell.v3.sk ([90.176.6.54]:58375 "EHLO shell.v3.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730630AbfAJRmT (ORCPT ); Thu, 10 Jan 2019 12:42:19 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id ED2A71002E6; Thu, 10 Jan 2019 18:42:15 +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 E3hahsxEAcF4; Thu, 10 Jan 2019 18:42:06 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id E922B1002F5; Thu, 10 Jan 2019 18:42:05 +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 YWVTRvrErKAc; Thu, 10 Jan 2019 18:42:03 +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 0E0A11002E7; Thu, 10 Jan 2019 18:42:03 +0100 (CET) From: Lubomir Rintel To: Sebastian Reichel Cc: Rob Herring , Mark Rutland , x86@kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Lubomir Rintel , Andy Shevchenko , Pavel Machek , Sebastian Reichel Subject: [PATCH v5 3/7] power: supply: olpc_battery: Use DT to get battery version Date: Thu, 10 Jan 2019 18:40:01 +0100 Message-Id: <20190110174005.1202564-4-lkundrak@v3.sk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190110174005.1202564-1-lkundrak@v3.sk> References: <20190110174005.1202564-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. That wouldn't work on FDT-based ARM MMP2 platform. Add the XO 1.5 compatible string too. This is actually not completely necessary as the battery nodes on XO 1.5 claim to be compatible with "olpc,xo1-battery", but there are, in fact, differencies. Signed-off-by: Lubomir Rintel Reviewed-by: Andy Shevchenko Acked-by: Pavel Machek Reviewed-by: Sebastian Reichel --- Changes since v2: - Clarify the XO 1 compatibility in the commit message. 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.20.1