linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/8] X-Powers Power Supply Improvements
@ 2020-01-13  3:53 Samuel Holland
  2020-01-13  3:53 ` [PATCH v3 1/8] power: supply: axp20x_ac_power: Fix reporting online status Samuel Holland
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Samuel Holland @ 2020-01-13  3:53 UTC (permalink / raw)
  To: Chen-Yu Tsai, Sebastian Reichel, Oskari Lemmela
  Cc: linux-pm, linux-kernel, linux-sunxi, Samuel Holland

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-01-14  0:17 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-13  3:53 [PATCH v3 0/8] X-Powers Power Supply Improvements Samuel Holland
2020-01-13  3:53 ` [PATCH v3 1/8] power: supply: axp20x_ac_power: Fix reporting online status Samuel Holland
2020-01-13  4:04   ` Chen-Yu Tsai
2020-01-13  3:53 ` [PATCH v3 2/8] power: supply: axp20x_ac_power: Allow offlining Samuel Holland
2020-01-13  3:53 ` [PATCH v3 3/8] power: supply: axp20x_ac_power: Add wakeup control Samuel Holland
2020-01-13  3:53 ` [PATCH v3 4/8] power: supply: axp20x_usb_power: Remove unused device_node Samuel Holland
2020-01-13  3:53 ` [PATCH v3 5/8] power: supply: axp20x_usb_power: Use a match structure Samuel Holland
2020-01-13  4:08   ` Chen-Yu Tsai
2020-01-13  3:53 ` [PATCH v3 6/8] power: supply: axp20x_usb_power: Allow offlining Samuel Holland
2020-01-13  4:05   ` [linux-sunxi] " Chen-Yu Tsai
2020-01-13  3:53 ` [PATCH v3 7/8] power: supply: axp20x_usb_power: Add wakeup control Samuel Holland
2020-01-13  3:53 ` [PATCH v3 8/8] power: supply: axp20x_usb_power: Only poll while offline Samuel Holland
2020-01-14  0:17 ` [PATCH v3 0/8] X-Powers Power Supply Improvements Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).