From patchwork Sun Jan 21 01:39:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Aren X-Patchwork-Id: 19211 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp1879773dyb; Sat, 20 Jan 2024 17:49:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IFwMjJLc6u9emUG8v54gcZ72xHV+xkaXCeFhC0faHu3NnwKzwk3hV9f1nW+A2qB/qCFrEYd X-Received: by 2002:a17:906:3a8f:b0:a28:b574:8551 with SMTP id y15-20020a1709063a8f00b00a28b5748551mr1034015ejd.147.1705801771974; Sat, 20 Jan 2024 17:49:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705801771; cv=pass; d=google.com; s=arc-20160816; b=JMGlD5xUzxLdBeIp10SZmUVXfwoA3XH9t6cD4uK+iRCE1VG6uFEqBvAy8DbeJA8qhS aajN31KKmAjmtTo3kn1IgoOxqUMseDdVruIvNp4HTDugidGuBwBr3eN4V+soBb+jxI49 hVXlBnyPHzBkocQ4addtwbX3E119LrX7YFHIzDKTWN6y2qW2rmLiUgi32E9pmFpxdqbx RMtf4ikKS7BKStVQrlwIaOUQX2JfIGQ5HrjLjKKg/fExwAC7QarK0YXb/ef4xMJMB400 yqbbtIWk548uCKrligLBW0jJG8JMETinsLtx9ejUTS/69LTnENrQE0zRHCxr8fpto5YF D25Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=dkim-signature:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from; bh=SUQPnMTPVVJvLjAXL1KekIRGdmuwaL5YumbY1tWBkMk=; fh=wEdsi57ruOXwzZ0+QCfz/ydvXnF8YJmkhQf9OA42hCQ=; b=osdd2Wyrm/DN0iPN21x/2fz9ALbzjH6IPgAV6hFASFFFZj2ky9VsEBOLDu6DJLnxZs ZiqoQa3+zinjU45Qt98PXEE6xB8M8snCwqawxr3PQGbpEDo5vVFEpaaa++qweVMrxGcj xETraK3qoP7KPHioB41ddaWXH+gwTrhIzkGF2qiXRgr7boEzbxSTzYY7fSMGbHIrznrZ xziIEQY52ShUOvn37q/1UepektQqXO8qPkHD9ruUrpv6A6JM0jb1kl9Tp62zNuJUCdsD UTctoMHmgkVvJZ6zkSbqlu+XJDLiJvErh/vp20TCVvE1emfQfzpXqWqg9xBBATYsiZdM Bc8Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@peacevolution.org header.s=dkim header.b=ZR9JZhk2; arc=pass (i=1 spf=pass spfdomain=peacevolution.org dkim=pass dkdomain=peacevolution.org dmarc=pass fromdomain=peacevolution.org); spf=pass (google.com: domain of linux-kernel+bounces-31950-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31950-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=peacevolution.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id h24-20020a170906591800b00a2f880155absi1979534ejq.633.2024.01.20.17.49.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Jan 2024 17:49:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31950-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@peacevolution.org header.s=dkim header.b=ZR9JZhk2; arc=pass (i=1 spf=pass spfdomain=peacevolution.org dkim=pass dkdomain=peacevolution.org dmarc=pass fromdomain=peacevolution.org); spf=pass (google.com: domain of linux-kernel+bounces-31950-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31950-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=peacevolution.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 93B0A1F22A0F for ; Sun, 21 Jan 2024 01:49:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A109535EFC; Sun, 21 Jan 2024 01:49:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=peacevolution.org header.i=@peacevolution.org header.b="ZR9JZhk2" Received: from a.peacevolution.org (a.peacevolution.org [206.189.193.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF8C8358B6; Sun, 21 Jan 2024 01:49:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=206.189.193.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705801752; cv=none; b=s6BPpm1547FagIbUqAI//7jV4rZkPyP5cvYXMUtqAcQ4ofD44xBd4k7Lj0csy1nZJtypO2byuxKBAEMGGuKB5vjNMp423ArVOVcHPcCLD58Gro/suPKStIlVBDeueJ8JB3LhxT3rJekuxu7C/PTzblimUljHYAkpyMcNBPyv87g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705801752; c=relaxed/simple; bh=lFIqsnnmUm8gQKiSj2GC3PO1blzYyWDVthX2nkDrJt8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=PIOCS6YtmFtnG6Xjc7EgBd00DwJoOYGLeROLxM4KxJwkEwFWK0J66yUR7bQAYoh4e3pK/zDrFzNUpevSIcDf3W5CYS6chxiMovkBvjh/R2uHl3vcNiGqmo8ivdDYDja0/KKIbQmalQ3mugDaFgS6XXuTJrofE6ihm2OAVRFpPsQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=peacevolution.org; spf=pass smtp.mailfrom=peacevolution.org; dkim=pass (1024-bit key) header.d=peacevolution.org header.i=@peacevolution.org header.b=ZR9JZhk2; arc=none smtp.client-ip=206.189.193.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=peacevolution.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=peacevolution.org Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by a.peacevolution.org (Postfix) with ESMTPA id C2CAC461AA; Sun, 21 Jan 2024 01:43:36 +0000 (UTC) From: Aren Moynihan To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Aidan MacDonald , =?utf-8?q?Ond=C5=99ej_Ji?= =?utf-8?q?rman?= , Aren Moynihan , Chen-Yu Tsai , Quentin Schulz , Sebastian Reichel Subject: [PATCH 0/3] power: supply: axp20x_usb_power: prepare for external power delivery negotiation Date: Sat, 20 Jan 2024 20:39:58 -0500 Message-ID: <20240121014057.1042466-1-aren@peacevolution.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spamd-Bar: / Authentication-Results: auth=pass smtp.auth=aren@peacevolution.org smtp.mailfrom=aren@peacevolution.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=peacevolution.org; s=dkim; t=1705801417; h=from:subject:date:message-id:to:cc:mime-version:content-type:content-transfer-encoding; bh=SUQPnMTPVVJvLjAXL1KekIRGdmuwaL5YumbY1tWBkMk=; b=ZR9JZhk2/blbXE/e6m+mphDfCN5nw4cC9HX5H8uEcJmbx2YTYeyPzowmvHIBFx1qnO3mDN HPomL04xccYct0+qqciKHFLT4lUYMA02vGW3rzKsv/oEc1H1ha55S8E5sLqLGyapsk6DpY LY57b5qGCZ8PX0oPB0HezauxU1dQZnQ= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788662798800681773 X-GMAIL-MSGID: 1788662798800681773 Being able to set the input current limit will be necessary to implement usb power delivery on the Pine64 PinePhone. The PinePhone has a separate chip (anx7688) that handles usb power delivery (among other things), so we will need a way to apply the current limit which that negotiates. The first two patches were originally based on code Ondřej Jirman wrote[1], but I have almost completely rewritten them. While working on this, I also discovered that the axp803 pmic sets a current limit of 3A on the usb port without any negotiation if it doesn't detect a battery. 1: https://xff.cz/git/linux/commit/?h=axp-6.7&id=3dcd33dfd1ae58db159427365dcb6d0d2b12f06d Aren Moynihan (3): power: supply: axp20x_usb_power: add input current limit power: supply: axp20x_usb_power: enable usb_type reporting power: supply: axp20x_usb_power: set input current limit in probe drivers/power/supply/axp20x_usb_power.c | 192 +++++++++++++++++++++++- 1 file changed, 190 insertions(+), 2 deletions(-)