Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp110713pxu; Tue, 24 Nov 2020 20:51:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJyVloExydyQNDWBq8e18OV6aB3aLrWJNO28D7MvobF5WyWZn0mR9bYFYW4m//Z70Dt4FdFk X-Received: by 2002:a17:906:7d1:: with SMTP id m17mr1598353ejc.98.1606279885923; Tue, 24 Nov 2020 20:51:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606279885; cv=none; d=google.com; s=arc-20160816; b=0zB8PPYtsuIeFfoWH7OT31sfAc5z9VAgligd5F69eGvv0HjtiabOw9jZmMsUgVkm+T LzIjbp3R0e7pMyGYOX5MLk3pZE8BwwP6JmBm+LAcPGyg6SoyOA/i48hKQ8fSGNIe/H62 TzLitt/83KkeHM1V35HprbcsPjEgqf09igtyQ4qgWcWEOI/4rRZcvffIbIzBZPeDYNXk BePn/OxKGfXEuHxmY1Htmyh3ENh0F83hOPs9Ur2yGDDOufOur0qQY4ecUqzMmXJ8Vv1w E3YL+C7IFEx6uB+98BX/O5PnQ1fZQaHfsVEjPnZONadZ/TEd9eAp5fgGjZ2Tt4Sd55Fi jn1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:references:in-reply-to :message-id:date:subject:cc:to:from; bh=ngMfvcVMhMZPdWSejN4KBmKbLCCi+9E8ek6pdDcBXrc=; b=ueRtE0yJ8msvNqW0iPGvgvUsyHU9eTxxNSEmMKJGAdtfddSE+oBS7O5GAL2wd6bIF5 CDsxU+iTQRks6J3c+JJNLbtxKYBPm7Y1gfjY4VMV06s2HPLd93gFXC96IHnnTxGg4yJI 5FDQNbsbZD394g8BfU53DNLpAyHoGR1JphND1ykVjRs4ummhpLnpNULdhqW+hT/HzFlN sJ4ywk+tHgm2nI4d8ll5GU/hVoSM3ugDsDP/xhGcGMHMpS0pcy+0zcZrytg7wJrQIo4q dVxwsj/fodUoKC7hTbXADMKxvJ03WG7KWgEkX4MnzLYS+YkBA2LlTC2pEy1BDh9WiXSC NJPw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=puri.sm Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a20si622705ejd.75.2020.11.24.20.51.02; Tue, 24 Nov 2020 20:51:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=puri.sm Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727468AbgKYEtE (ORCPT + 99 others); Tue, 24 Nov 2020 23:49:04 -0500 Received: from comms.puri.sm ([159.203.221.185]:48258 "EHLO comms.puri.sm" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727285AbgKYEtE (ORCPT ); Tue, 24 Nov 2020 23:49:04 -0500 Received: from localhost (localhost [127.0.0.1]) by comms.puri.sm (Postfix) with ESMTP id 0BECBE0399; Tue, 24 Nov 2020 20:48:34 -0800 (PST) Received: from comms.puri.sm ([127.0.0.1]) by localhost (comms.puri.sm [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W_YMHONlpVnG; Tue, 24 Nov 2020 20:48:33 -0800 (PST) From: Sebastian Krzyszkowiak To: Sebastian Reichel Cc: Geordan Neukum , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@puri.sm Subject: [PATCH 4/4] power: max17042_battery: Export charge termination current property Date: Wed, 25 Nov 2020 05:48:30 +0100 Message-ID: <3900768.gxICSWkFWK@pliszka> In-Reply-To: <2264396.HPVdm0XNkV@pliszka> References: <2264396.HPVdm0XNkV@pliszka> Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The value is there, so let's export it. Signed-off-by: Sebastian Krzyszkowiak --- drivers/power/supply/max17042_battery.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c index 26f6f89eb648..79d4b5988360 100644 --- a/drivers/power/supply/max17042_battery.c +++ b/drivers/power/supply/max17042_battery.c @@ -78,6 +78,7 @@ static enum power_supply_property max17042_battery_props[] = { POWER_SUPPLY_PROP_CHARGE_FULL, POWER_SUPPLY_PROP_CHARGE_NOW, POWER_SUPPLY_PROP_CHARGE_COUNTER, + POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT, POWER_SUPPLY_PROP_TEMP, POWER_SUPPLY_PROP_TEMP_ALERT_MIN, POWER_SUPPLY_PROP_TEMP_ALERT_MAX, @@ -414,6 +415,14 @@ static int max17042_get_property(struct power_supply *psy, return -EINVAL; } break; + case POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT: + ret = regmap_read(map, MAX17042_ICHGTerm, &data); + if (ret < 0) + return ret; + + data64 = data * 1562500ll; + val->intval = div_s64(data64, chip->pdata->r_sns); + break; case POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW: ret = regmap_read(map, MAX17042_TTE, &data); if (ret < 0) -- 2.29.2