Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3500885ybl; Sun, 12 Jan 2020 19:54:18 -0800 (PST) X-Google-Smtp-Source: APXvYqyCYuwelM29dW5fZlrxE6P2OvnQQL9MW8Tu0nzUGrMuLOfE1TU3VQixuJwGyM8SqMUI+pVV X-Received: by 2002:a05:6830:1047:: with SMTP id b7mr12187351otp.77.1578887658473; Sun, 12 Jan 2020 19:54:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578887658; cv=none; d=google.com; s=arc-20160816; b=HP42o3tWR1t/qYgWVbye8dk6VStjEUjY0EKXc6iNPJjEMgIabiZRCnxOC7dslpYYx3 te4tqEfMafeWrWegefyG9x0i9x5LdJtKrnsWXRPhhVGCTocjoevBkSMYEJavIWj7VAvx yNRhhg90AknWe7pGU73Gu5pyN770vzNZ/iokCYSx3rQVJsjTTVBA4zzXMlcYnvmvATGQ dbdx4WDrMRJNf9R8kHlvZxlNMXH86Aap9cXgn/1rWz0lllizcyGgu24bOfIbjMD7ST1g P9u7oBohJUm4LhNzQp3qiOzBWu34nPLHNF9qfyDwFNly2JbkFABno8vKZFtmP+Uprbdk zmow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=vCm43OVqh1tdf1g+1ymIQ+gacGhvIUXgumdmJE6p1gg=; b=GYrrD/8QMl8Zj6hv3VA2Pjm5jVGbnA6hO7e9f4yPtahjVoxMAZuqhEQkDW/Nl6aKnK aJAiIK9112hEwCizvfeyZC3sKIUxmz29GF1odJO0vB6ZE24pJRhXO6H+fF4uBWdBzCG7 U3LDMX+QIOM/o07Tv7atDDXCXe6SMp5PKWFARFQUf+3BPW6bLyrMgemPv/FopCrSVHtF 4X4W7VgZt3msoAHz5oWk2fPpMeMVznIm7qVFPsY8Rm6aafSZaaLW6+6FaAAAIXjQH/GN 4oP9QU+aOA43CGIDR5pwvgd97mWM0qD857jSZ3YwnqrzU+jIJ5UWRxOu9uoq//JeaSUi ucVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm1 header.b=Q8EoaAJx; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=cSEIE+rt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6si6112338otq.41.2020.01.12.19.54.06; Sun, 12 Jan 2020 19:54:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@sholland.org header.s=fm1 header.b=Q8EoaAJx; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=cSEIE+rt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387559AbgAMDxO (ORCPT + 99 others); Sun, 12 Jan 2020 22:53:14 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:51067 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387415AbgAMDxN (ORCPT ); Sun, 12 Jan 2020 22:53:13 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 2F74C21C1B; Sun, 12 Jan 2020 22:53:12 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sun, 12 Jan 2020 22:53:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm1; bh=vCm43OVqh1tdf1g+1ymIQ+gacG hvIUXgumdmJE6p1gg=; b=Q8EoaAJx/buSkJA12CwUm6dqAm86cDJK632cl3DuuB THZMgGlFS+05Djk7Y0O+UQXBLX+CVdSzhfiwQ9qEF2ynmVc8YCAtbqdBUzO9nURb PItLMLayCvUwvdfL2wBPHUyYKrOjj1Pa79WtJt4aEv55cIL0lG8hAVkZ6muM9QuV o3JzExcqAxy9fpEA5A24XQ19Sg5y1RGiTwzc+Jf26Axb1Zf7EUcwvDGa39fEeqUT t5CmD1lJvKWuqJep9d5e6qKwZTJi+ZQAM8XNHmcSzYTaIWD+9bgTTeCTSscFGNW4 eEvGu72hJTAeKlQ+P2PjNNgs3OJSPpkufP2LVy6esd4w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=vCm43OVqh1tdf1g+1 ymIQ+gacGhvIUXgumdmJE6p1gg=; b=cSEIE+rt3kDCiy3VkOFlDc3v2WI0WmA2j ZcLSzw248FK9dnaXqZ6owZ/L60SfMJiWcAWSfzPTebndhgkvQ9SxszbRtkXpnUJD 1IOlFysvlWVW1xNP6DxUxTofrNDhk6549/5dTyeRog/Q3bH3nBqCd77sJW043Zl3 9TzBGhuPEIvkawBSE1u3yzYLmIcwHldUGshS/Rn99G1MMmhAkermbbjshAspO1Aq DX46cQpvVoxa7sARq53u/hPCkAWfSq6JgSy/1OQfjnzJOWtLseaPkekQ+kCGP6+C NuZSUm1BKSv05cOiJhO9Jj5Q2ozD5zCTNc2k28kQSRujVPKJ92DFQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdeiledgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgvlhcu jfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucfkphepje dtrddufeehrddugeekrdduhedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmuhgv lhesshhhohhllhgrnhgurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from titanium.stl.sholland.net (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id 403248005C; Sun, 12 Jan 2020 22:53:11 -0500 (EST) From: Samuel Holland To: Chen-Yu Tsai , Sebastian Reichel , Oskari Lemmela Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Samuel Holland Subject: [PATCH v3 0/8] X-Powers Power Supply Improvements Date: Sun, 12 Jan 2020 21:53:02 -0600 Message-Id: <20200113035310.18950-1-samuel@sholland.org> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series adds some improvements to the axp20x* power supply drivers to better support suspend/resume and use on mobile devices. The first two patches fix bugs I found while testing the ONLINE control added in later patches. Patches 3 and 7 allow userspace to take the power supplies offline. Patches 4 and 8 allow userspace to control the wakeup behavior. Patch 9 avoids polling USB VBUS presence when possible. While working on the RSB driver, I was seeing ~50 transfers per second, while idle and tracked it down to this VBUS polling (20 reads/second). The polling often caused the CPU to clock up and back down, which triggered the remaining transfers (changes to the CPU voltage). Unfortunately, I don't see a way to avoid the polling when running on battery (where it matters most), other than to move the polling back to the USB PHY driver. Changes since v2: - Patch 1 was merged - Only check ACIN_PATH_SEL when necessary (1) - Update commit message (5) - Avoided reordering lines until/unless necessary (5, 7) - Update comment and add ID check in axp20x_usb_power_set_property (it seemed more correct than adding another comment) (6) - Add Reviewed-by where there were no comments (2-4, 7-8) Changes since v1: - Add patches 1-2 - Shift value properly in calls to regmap_update_bits (3, 7) - Use #ifdef instead of #if to avoid -Wundef warnings (4, 8) - Poll once after an IRQ, instead of setting power->online in the IRQ (9) - Poll once on resume, in case the state changed during suspend (9) Samuel Holland (8): power: supply: axp20x_ac_power: Fix reporting online status power: supply: axp20x_ac_power: Allow offlining power: supply: axp20x_ac_power: Add wakeup control power: supply: axp20x_usb_power: Remove unused device_node power: supply: axp20x_usb_power: Use a match structure power: supply: axp20x_usb_power: Allow offlining power: supply: axp20x_usb_power: Add wakeup control power: supply: axp20x_usb_power: Only poll while offline drivers/power/supply/axp20x_ac_power.c | 131 +++++++++++--- drivers/power/supply/axp20x_usb_power.c | 219 ++++++++++++++++++------ 2 files changed, 276 insertions(+), 74 deletions(-) -- 2.23.0