From patchwork Fri Oct 14 17:24:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 615202 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A86E1C433FE for ; Fri, 14 Oct 2022 17:24:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229572AbiJNRYp (ORCPT ); Fri, 14 Oct 2022 13:24:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229609AbiJNRYo (ORCPT ); Fri, 14 Oct 2022 13:24:44 -0400 Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E4B8F581 for ; Fri, 14 Oct 2022 10:24:42 -0700 (PDT) Received: from tr.lan (ip-86-49-12-201.bb.vodafone.cz [86.49.12.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id E17A584B2B; Fri, 14 Oct 2022 19:24:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1665768281; bh=Z/JdrWVE+bUsHIAmKuHFgeNsx+Og1FVroPqDTEuFGhw=; h=From:To:Cc:Subject:Date:From; b=l5Jr81REN6lIEe2dmy3EwM70R+UsPjQvayBzO2Ul/1S0Iwue4SL294rY65+xiYSvd 6t3E2rAiQL2DLccKLo+xKvc64kSPpFOYa4sJFvNNYxhdJDlu0I9B40Fl2PgB0IkjAt 8jeqSAgWyIyLdRWMT1dl8N9uTRwnBe6TI/dDTjCQp6aRbgVi67AbOhsPi+GK+/BZM1 DhHGsJvlskS33M3m4Q6uI5xucDLXsZOMgIjznK8C/jqFk2fNCrVFTs1sVw40cDYgCi ecrUGbBjJLrNhuhGqbgyk1HaGC/+0bROVrPK7LrZioE/bFy5uoM2DtDJeP3Gl0EsW0 BvRETDFXhmtnw== From: Marek Vasut To: linux-pm@vger.kernel.org Cc: Marek Vasut , Hans de Goede , Andy Shevchenko , =?utf-8?b?TWljaGHFgiBN?= =?utf-8?b?aXJvc8WCYXc=?= , Sebastian Reichel Subject: [PATCH v2 1/7] power: supply: bq25890: Document POWER_SUPPLY_PROP_CURRENT_NOW Date: Fri, 14 Oct 2022 19:24:21 +0200 Message-Id: <20221014172427.128512-1-marex@denx.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Document that POWER_SUPPLY_PROP_CURRENT_NOW really does refer to ADC-sampled immediate battery charge current I_BAT , since the meaning is not clear with all the currents which might be measured by charger chips. Reviewed-by: Hans de Goede Signed-off-by: Marek Vasut Reviewed-by: Hans de Goede --- Cc: Andy Shevchenko Cc: Hans de Goede Cc: Michał Mirosław Cc: Sebastian Reichel To: linux-pm@vger.kernel.org --- V2: Add RB from Hans --- drivers/power/supply/bq25890_charger.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c index 6020b58c641d2..1298d5720aa4b 100644 --- a/drivers/power/supply/bq25890_charger.c +++ b/drivers/power/supply/bq25890_charger.c @@ -588,7 +588,14 @@ static int bq25890_power_supply_get_property(struct power_supply *psy, val->intval = 2304000 + ret * 20000; break; - case POWER_SUPPLY_PROP_CURRENT_NOW: + case POWER_SUPPLY_PROP_CURRENT_NOW: /* I_BAT now */ + /* + * This is ADC-sampled immediate charge current supplied + * from charger to battery. The property name is confusing, + * for clarification refer to: + * Documentation/ABI/testing/sysfs-class-power + * /sys/class/power_supply//current_now + */ ret = bq25890_field_read(bq, F_ICHGR); /* read measured value */ if (ret < 0) return ret;