Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp670738imu; Fri, 16 Nov 2018 08:25:39 -0800 (PST) X-Google-Smtp-Source: AJdET5f1Pv/2SNmbw5CphTy60denTfGS81riCE1CtqFPkEiS7LEwc/xiGlT5e6mpmE1kLC75oCvd X-Received: by 2002:a62:5bc7:: with SMTP id p190-v6mr11793055pfb.175.1542385539413; Fri, 16 Nov 2018 08:25:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542385539; cv=none; d=google.com; s=arc-20160816; b=g+GPBcQfjCo0T7SHMnDnwbTcn0WchsnSlniIi786YzHxF98K5AzuIUjE/mTVmjQVcd 0eEYZ3voCzq8JchxRuqmtx9AvFyaID8rKbuYjj8jlg3UesnaUT4AY++EY9h/5/wc8go2 JWJrjRtgchSXK95SpjSTiN86qmo2HYWpW7mu995B2KcgiYEzZ+ZmYRrhusSvUgpJMNNY HRw5BafMvucDTOvUXq9iKmM2laSxjshK/Oigrma2NG6Au6WkTUy8zXXhni0PzCJ5Hgsv QrkGIRMo69i0CHKAj/V6SW3zoSnl0yVsfAVr3m+eKvK+Ch6krYr43gYw2xRX8SVFISr8 lD/Q== 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=KV87Zxzd+BQT40OCk32Og+rv0g0U4IqDyxWgZoeicFY=; b=TKSOtrDReFQxmDjO2nJacC6yykVk0y8FI9Vux+oblo5KiA+VIhS367rZBGhU3gv7lX DQATW0V0r9oM49dQUqQzg4C/B9QNENix6chCh4ZACc9uaC5gDrdkQs7gF6p4xJYCs0Kt 6KZxgdZIXG6nrMdFqFeI7iQS+Sqokz11ms/XaCVs+2mO4cJSfgRByXHyAdxxkqbdOJd4 qaF7xMzIjrmBXQz8FFit8st4pvvJRhsSd4pTOfDH/FvHyBnjILA/AgOC6P0nk7mKIRlQ iBgQXlLGQT5C1rHvpNri7dYHQZPr+1y+BSK5jcaevsV3rlBOV7UQ2jrRl19Oeh/KYhdM KgMA== 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 y16-v6si28719648pgk.479.2018.11.16.08.25.24; Fri, 16 Nov 2018 08:25:39 -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 S2390140AbeKQChq (ORCPT + 99 others); Fri, 16 Nov 2018 21:37:46 -0500 Received: from shell.v3.sk ([90.176.6.54]:57013 "EHLO shell.v3.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729055AbeKQChp (ORCPT ); Fri, 16 Nov 2018 21:37:45 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 1B2AB52F1E; Fri, 16 Nov 2018 17:24:40 +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 71z4c1BhsQGI; Fri, 16 Nov 2018 17:24:24 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 59D7852E6B; Fri, 16 Nov 2018 17:24:18 +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 EqIlQWUklik9; Fri, 16 Nov 2018 17:24:14 +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 D8C6152AE0; Fri, 16 Nov 2018 17:24:13 +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 , stable@vger.kernel.org Subject: [PATCH v2 01/17] power: supply: olpc_battery: correct the temperature units Date: Fri, 16 Nov 2018 17:23:47 +0100 Message-Id: <20181116162403.49854-2-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 According to [1] and [2], the temperature values are in tenths of degree Celsius. Exposing the Celsius value makes the battery appear on fire: $ upower -i /org/freedesktop/UPower/devices/battery_olpc_battery ... temperature: 236.9 degrees C Tested on OLPC XO-1 and OLPC XO-1.75 laptops. [1] include/linux/power_supply.h [2] Documentation/power/power_supply_class.txt Fixes: fb972873a767 ("[BATTERY] One Laptop Per Child power/battery driver= ") Cc: stable@vger.kernel.org Signed-off-by: Lubomir Rintel Acked-by: Pavel Machek --- Changes since v1: - Add Fixes tag and an Ack drivers/power/supply/olpc_battery.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/supply/olpc_battery.c b/drivers/power/supply/o= lpc_battery.c index 6da79ae14860..5a97e42a3547 100644 --- a/drivers/power/supply/olpc_battery.c +++ b/drivers/power/supply/olpc_battery.c @@ -428,14 +428,14 @@ static int olpc_bat_get_property(struct power_suppl= y *psy, if (ret) return ret; =20 - val->intval =3D (s16)be16_to_cpu(ec_word) * 100 / 256; + val->intval =3D (s16)be16_to_cpu(ec_word) * 10 / 256; break; case POWER_SUPPLY_PROP_TEMP_AMBIENT: ret =3D olpc_ec_cmd(EC_AMB_TEMP, NULL, 0, (void *)&ec_word, 2); if (ret) return ret; =20 - val->intval =3D (int)be16_to_cpu(ec_word) * 100 / 256; + val->intval =3D (int)be16_to_cpu(ec_word) * 10 / 256; break; case POWER_SUPPLY_PROP_CHARGE_COUNTER: ret =3D olpc_ec_cmd(EC_BAT_ACR, NULL, 0, (void *)&ec_word, 2); --=20 2.19.1