From patchwork Mon Oct 28 05:27:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 3100551 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8CE039F432 for ; Mon, 28 Oct 2013 05:27:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9DBF3202C3 for ; Mon, 28 Oct 2013 05:27:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A8EB20259 for ; Mon, 28 Oct 2013 05:27:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752080Ab3J1F1s (ORCPT ); Mon, 28 Oct 2013 01:27:48 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:41653 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751569Ab3J1F1s (ORCPT ); Mon, 28 Oct 2013 01:27:48 -0400 Received: by mail-pd0-f173.google.com with SMTP id r10so6535299pdi.4 for ; Sun, 27 Oct 2013 22:27:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=U4gHSF1RNO3Qb0mq/I9ADOUwg3DcOrtwbSmYmB6dJgA=; b=Po+YOar6CFQ2w1/x/0Qez8M99TbvWuLYbCNuI75ZEmVTBBClYjvUC24jpHpYEP9naA i/p+smBqSbpt4gLytrRLUvIF0OwHzmTK8EjHd6irOWPHQn2SVM/DCastDuwBB34VbsaZ K8E52HFFTwfj97Wb+Fa980F1gqSYJHQUawHVDYQiB4bRNPblX5zcNd3LlSf5v0dSM3Go QkkMJF27KaM2qZ9NIiMsGzQJt7/glAxGBN4qaYdEijsU3KYAeRmPFc6mDhau6i2Uvy6B i3HglukIKQLbYSqtrcsePzMZERZfmm+8LFFudO+pEA5q+uIngFF8WCu+8trQk836s+RY fLRA== X-Gm-Message-State: ALoCoQnk9t33IuC02XxvRQcd65zn6w1HuNRfnhJom5OhbwZ7CjmXUuBDIPDhEDiwNoxWSS0op1Eb X-Received: by 10.66.121.131 with SMTP id lk3mr23748962pab.61.1382938067529; Sun, 27 Oct 2013 22:27:47 -0700 (PDT) Received: from localhost ([209.141.63.79]) by mx.google.com with ESMTPSA id j9sm32005868paj.18.2013.10.27.22.27.45 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Sun, 27 Oct 2013 22:27:46 -0700 (PDT) Date: Sun, 27 Oct 2013 22:27:43 -0700 From: Anton Vorontsov To: jonghwa3.lee@samsung.com, "Mark A. Greer" Cc: linux-pm@vger.kernel.org, dwmw2@infradead.org, myungjoo.ham@samsung.com, cw00.choi@samsung.com, Ramakrishna Pallala Subject: [PATCH] power_supply: Fix documentation for TEMP_*ALERT* properties Message-ID: <20131028052743.GA31070@teo> References: <1382676798-27835-1-git-send-email-jonghwa3.lee@samsung.com> <20131025231720.GB9015@teo> <526DC554.30506@samsung.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <526DC554.30506@samsung.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP All temperatures should be in tenth degrees Celsius. bq24190_charger.c probably should be fixed. Reported-by: Jonghwa Lee Cc: Mark A. Greer Signed-off-by: Anton Vorontsov --- On Mon, Oct 28, 2013 at 11:00:52AM +0900, jonghwa3.lee@samsung.com wrote: > > * All voltages, currents, charges, energies, time and temperatures in uV, > > * µA, µAh, µWh, seconds and tenths of degree Celsius unless otherwise > > * stated > > > > So, the current code seems to be correct. > > Honestly, I missed the above paragraph you showed rather I read following one. > > TEMP - temperature of the power supply. > TEMP_ALERT_MIN - minimum battery temperature alert value in milli centigrade. > TEMP_ALERT_MAX - maximum battery temperature alert value in milli centigrade. > TEMP_AMBIENT - ambient temperature. > TEMP_AMBIENT_ALERT_MIN - minimum ambient temperature alert value in milli > centigrade. > TEMP_AMBIENT_ALERT_MAX - maximum ambient temperature alert value in milli > centigrade. > > So, we use different unit for properties related temperature, right? > current temperature is in tenth of centigrade and threshold temperatures and > ambient temperature are in milli centigrade. Wouldn't it have to be in same unit? :( They should. Thanks for spotting. The patch down below should fix the issue... Documentation/power/power_supply_class.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/power/power_supply_class.txt b/Documentation/power/power_supply_class.txt index 3f10b39..89a8816 100644 --- a/Documentation/power/power_supply_class.txt +++ b/Documentation/power/power_supply_class.txt @@ -135,11 +135,11 @@ CAPACITY_LEVEL - capacity level. This corresponds to POWER_SUPPLY_CAPACITY_LEVEL_*. TEMP - temperature of the power supply. -TEMP_ALERT_MIN - minimum battery temperature alert value in milli centigrade. -TEMP_ALERT_MAX - maximum battery temperature alert value in milli centigrade. +TEMP_ALERT_MIN - minimum battery temperature alert. +TEMP_ALERT_MAX - maximum battery temperature alert. TEMP_AMBIENT - ambient temperature. -TEMP_AMBIENT_ALERT_MIN - minimum ambient temperature alert value in milli centigrade. -TEMP_AMBIENT_ALERT_MAX - maximum ambient temperature alert value in milli centigrade. +TEMP_AMBIENT_ALERT_MIN - minimum ambient temperature alert. +TEMP_AMBIENT_ALERT_MAX - maximum ambient temperature alert. TIME_TO_EMPTY - seconds left for battery to be considered empty (i.e. while battery powers a load)