From patchwork Tue Feb 15 00:07:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Rivera-Matos X-Patchwork-Id: 542939 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 EE67CC433FE for ; Tue, 15 Feb 2022 00:08:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232418AbiBOAIi (ORCPT ); Mon, 14 Feb 2022 19:08:38 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232045AbiBOAIg (ORCPT ); Mon, 14 Feb 2022 19:08:36 -0500 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1617797BAC; Mon, 14 Feb 2022 16:08:26 -0800 (PST) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 21ED8OWX007514; Mon, 14 Feb 2022 18:08:18 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=O8T/YqduycuFSaC3l7VKvTNlSLrGHSoXe+0Lz9rd/4o=; b=ds/RDGgv+cEYogB6ecuJXgGskbzRQ36QeXx1GalA+A1MisgtVYXwWZx1j2Q2P0+q+f3P lwsg0F383TUEuS9TTH8t4NturUskd2FehB9FzlyiXzA8pzOH8O01RlhRF/rhcm1v77OP 6keSQD5h9EwGm/lX5YsIvD90rPyKF3Zy4rKfX/p4JWroUAoS2WqYIT/MwN+F+HFau15n dqWQa0T7X8+431jZxbuLm6fALFKnpxt1Ap+e4BC+Kjyia394iAPtXK+hnnRsvWjnl/WN IHbv7AB5E0GgLeFHLOlfgTiZv/W0bUppP+Xq/N4OgwWU106vqT0vZtOFGR16gssZ3ql+ +Q== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3e7qq18nh7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 14 Feb 2022 18:08:17 -0600 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Tue, 15 Feb 2022 00:08:15 +0000 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.2375.18 via Frontend Transport; Tue, 15 Feb 2022 00:08:15 +0000 Received: from ricardo-lws.crystal.cirrus.com (ricardo-lws.ad.cirrus.com [141.131.206.19]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id F2E1FB16; Tue, 15 Feb 2022 00:08:14 +0000 (UTC) From: Ricardo Rivera-Matos To: , , , CC: Ricardo Rivera-Matos Subject: [PATCH v3 1/3] power: supply: Introduces bypass charging property Date: Mon, 14 Feb 2022 18:07:56 -0600 Message-ID: <20220215000758.803501-2-rriveram@opensource.cirrus.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220215000758.803501-1-rriveram@opensource.cirrus.com> References: <20220215000758.803501-1-rriveram@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: fgYY-myAEmJ9d6AMNAbrolTDl10Knhq6 X-Proofpoint-GUID: fgYY-myAEmJ9d6AMNAbrolTDl10Knhq6 X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Adds a POWER_SUPPLY_CHARGE_TYPE_BYPASS option to the POWER_SUPPLY_PROP_CHARGE_TYPE property to facilitate bypass charging operation. In bypass charging operation, the charger bypasses the charging path around the integrated converter allowing for a "smart" wall adaptor to perform the power conversion externally. This operational mode is critical for the USB PPS standard of power adaptors and is becoming a common feature in modern charging ICs such as: - BQ25980 - BQ25975 - BQ25960 - LN8000 - LN8410 Signed-off-by: Ricardo Rivera-Matos --- Documentation/ABI/testing/sysfs-class-power | 7 +++++-- drivers/power/supply/power_supply_sysfs.c | 1 + include/linux/power_supply.h | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power index f7904efc4cfa..8e3bf1aa6268 100644 --- a/Documentation/ABI/testing/sysfs-class-power +++ b/Documentation/ABI/testing/sysfs-class-power @@ -380,13 +380,16 @@ Description: algorithm to adjust the charge rate dynamically, without any user configuration required. "Custom" means that the charger uses the charge_control_* properties as configuration for some - different algorithm. + different algorithm. "Bypass" means the charger bypasses the + charging path around the integrated converter allowing for a + "smart" wall adaptor to perform the power conversion + externally. Access: Read, Write Valid values: "Unknown", "N/A", "Trickle", "Fast", "Standard", - "Adaptive", "Custom" + "Adaptive", "Custom", "Bypass" What: /sys/class/power_supply//charge_term_current Date: July 2014 diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c index c3d7cbcd4fad..1368e13dc94b 100644 --- a/drivers/power/supply/power_supply_sysfs.c +++ b/drivers/power/supply/power_supply_sysfs.c @@ -89,6 +89,7 @@ static const char * const POWER_SUPPLY_CHARGE_TYPE_TEXT[] = { [POWER_SUPPLY_CHARGE_TYPE_ADAPTIVE] = "Adaptive", [POWER_SUPPLY_CHARGE_TYPE_CUSTOM] = "Custom", [POWER_SUPPLY_CHARGE_TYPE_LONGLIFE] = "Long Life", + [POWER_SUPPLY_CHARGE_TYPE_BYPASS] = "Bypass", }; static const char * const POWER_SUPPLY_HEALTH_TEXT[] = { diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 9ca1f120a211..9432234d7900 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -49,6 +49,7 @@ enum { POWER_SUPPLY_CHARGE_TYPE_ADAPTIVE, /* dynamically adjusted speed */ POWER_SUPPLY_CHARGE_TYPE_CUSTOM, /* use CHARGE_CONTROL_* props */ POWER_SUPPLY_CHARGE_TYPE_LONGLIFE, /* slow speed, longer life */ + POWER_SUPPLY_CHARGE_TYPE_BYPASS, /* bypassing the charger */ }; enum { From patchwork Tue Feb 15 00:07:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Rivera-Matos X-Patchwork-Id: 543600 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 92104C433F5 for ; Tue, 15 Feb 2022 00:08:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232392AbiBOAIh (ORCPT ); Mon, 14 Feb 2022 19:08:37 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232386AbiBOAIg (ORCPT ); Mon, 14 Feb 2022 19:08:36 -0500 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94AD797BAD; Mon, 14 Feb 2022 16:08:26 -0800 (PST) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 21ED8O50007511; Mon, 14 Feb 2022 18:08:19 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=ThW2rdxPPGMSDnk0VDFSlrn59RuYijZAMFSNrBmICJU=; b=YF38/BZSPJOVnBXd/IZ6rjuPBMkqi6MWxKe5fwYwCGOV/0SBtEYzcIUzXEMfgwUL7dzb NalfRHMfgADNiz5f6Q2NrJvmp1ihxiARmBJJqwzXc/CseX7RW90xl2rVPybrVfwo6TWn m05WmMf138VudKVgV6rxzgSRKyLmkd7zWABe6DLbYE4+w8QMgEIcJUpAf0WXSPmk4yEe OsOCX/0lLiyo9GrNFPKbIPibAkVEjRxa1Wp4Rt6HkcWAbN5d08BRVuVJD7Nl3AQk8WoW yHCx4yNvXs6Yd7B2rgfXzCpXLiRT8cK8Ck+ih0MEtusFmjN7z1YOnPJmbnzT8k//R5Ya rA== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3e7qq18nh8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 14 Feb 2022 18:08:19 -0600 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Tue, 15 Feb 2022 00:08:17 +0000 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.2375.18 via Frontend Transport; Tue, 15 Feb 2022 00:08:17 +0000 Received: from ricardo-lws.crystal.cirrus.com (ricardo-lws.ad.cirrus.com [141.131.206.19]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 1BA1BB16; Tue, 15 Feb 2022 00:08:15 +0000 (UTC) From: Ricardo Rivera-Matos To: , , , CC: Ricardo Rivera-Matos Subject: [PATCH v3 2/3] power: supply: bq25980: Implements POWER_SUPPLY_CHARGE_TYPE_BYPASS Date: Mon, 14 Feb 2022 18:07:57 -0600 Message-ID: <20220215000758.803501-3-rriveram@opensource.cirrus.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220215000758.803501-1-rriveram@opensource.cirrus.com> References: <20220215000758.803501-1-rriveram@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: vbwslcIKQnsgtNm3GOGD70hMUuHiKEsH X-Proofpoint-GUID: vbwslcIKQnsgtNm3GOGD70hMUuHiKEsH X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This patch remaps the bypass operation from POWER_SUPPLY_CHARGE_TYPE_FAST to POWER_SUPPLY_CHARGE_TYPE_BYPASS. Signed-off-by: Ricardo Rivera-Matos --- drivers/power/supply/bq25980_charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/supply/bq25980_charger.c b/drivers/power/supply/bq25980_charger.c index 0008c229fd9c..296b221a70fd 100644 --- a/drivers/power/supply/bq25980_charger.c +++ b/drivers/power/supply/bq25980_charger.c @@ -764,7 +764,7 @@ static int bq25980_get_charger_property(struct power_supply *psy, if (!state.ce) val->intval = POWER_SUPPLY_CHARGE_TYPE_NONE; else if (state.bypass) - val->intval = POWER_SUPPLY_CHARGE_TYPE_FAST; + val->intval = POWER_SUPPLY_CHARGE_TYPE_BYPASS; else if (!state.bypass) val->intval = POWER_SUPPLY_CHARGE_TYPE_STANDARD; break; From patchwork Tue Feb 15 00:07:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Rivera-Matos X-Patchwork-Id: 543599 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 A3E84C433EF for ; Tue, 15 Feb 2022 00:08:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232421AbiBOAIl (ORCPT ); Mon, 14 Feb 2022 19:08:41 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232398AbiBOAIh (ORCPT ); Mon, 14 Feb 2022 19:08:37 -0500 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC34698592; Mon, 14 Feb 2022 16:08:27 -0800 (PST) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 21E8pDbi031979; Mon, 14 Feb 2022 18:08:19 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=yvLDbSoOiHYVUaGAf88ObqoKHl+AJqhcwIW4kLXp17U=; b=mdCCzRUuL39FHQqgeZsUoemwtPJcqFQGRJ+yhAOz67NN+CYzWx+GaqFevOFyx2xscTnO n55VWPvTOnPX9l+FOOjrVFi1YYPjlQrKuAzOALKCCj//OZ2wCsUGcVLeZ2dML+U6ixCN uUXKWYUUAeIvO5zd02wZdAy9Z/189y1Q+JlRquMujryJSLp88ZuQDFIGJo/ohk5cWrco +qRKlDxuOWTk/7r9PbhySK+psA7V68WPDIl2jrXPnaftWugpiLQXjoZhJRbtMLbedqoz lPzzHHElmVglXPHKeBErOwAm1WVKRA12OVfAgSZI5/WBHHg68VLIIu02O6BZBrUBv1Uh /Q== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3e7kx7rukx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 14 Feb 2022 18:08:19 -0600 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Tue, 15 Feb 2022 00:08:18 +0000 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.2375.18 via Frontend Transport; Tue, 15 Feb 2022 00:08:18 +0000 Received: from ricardo-lws.crystal.cirrus.com (ricardo-lws.ad.cirrus.com [141.131.206.19]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 41C49B16; Tue, 15 Feb 2022 00:08:17 +0000 (UTC) From: Ricardo Rivera-Matos To: , , , CC: Ricardo Rivera-Matos Subject: [PATCH v3 3/3] ABI: testing: sysfs-class-power: Adds "Long Life" entry Date: Mon, 14 Feb 2022 18:07:58 -0600 Message-ID: <20220215000758.803501-4-rriveram@opensource.cirrus.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220215000758.803501-1-rriveram@opensource.cirrus.com> References: <20220215000758.803501-1-rriveram@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: ADNtf2A49AXMgoohqGVqySN2s59j31vV X-Proofpoint-GUID: ADNtf2A49AXMgoohqGVqySN2s59j31vV X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Adds a brief desciption of the "Long Life" charge type and adds "Long Life" to the list of valid values. Signed-off-by: Ricardo Rivera-Matos --- Documentation/ABI/testing/sysfs-class-power | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power index 8e3bf1aa6268..b304fa9c1482 100644 --- a/Documentation/ABI/testing/sysfs-class-power +++ b/Documentation/ABI/testing/sysfs-class-power @@ -380,16 +380,17 @@ Description: algorithm to adjust the charge rate dynamically, without any user configuration required. "Custom" means that the charger uses the charge_control_* properties as configuration for some - different algorithm. "Bypass" means the charger bypasses the - charging path around the integrated converter allowing for a - "smart" wall adaptor to perform the power conversion - externally. + different algorithm. "Long Life" means the charger reduces its + charging rate in order to prolong the battery health. "Bypass" + means the charger bypasses the charging path around the + integrated converter allowing for a "smart" wall adaptor to + perform the power conversion externally. Access: Read, Write Valid values: "Unknown", "N/A", "Trickle", "Fast", "Standard", - "Adaptive", "Custom", "Bypass" + "Adaptive", "Custom", "Long Life", "Bypass" What: /sys/class/power_supply//charge_term_current Date: July 2014