Skip to contentSkip to conversation

usb: typec: tps6598x: Export some power supply properties

PATCH Superseded Guido Günther 2 participants 3 messages Nov 26, 2020 – Nov 27, 2020

Subsystems (2)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v2 cover usb: typec: tps6598x: Export some power supply properties

This allows downstream supplies and userspace to detect whether external power is supplied.

The Librem 5 has the tp65982 in front of bq25980 charge controller. Since that is capable of sinking and sourcing power the online property helps to decide what to do. It also makes upower happy.

There will be follow up patches providing more properties but these need some more time to cook and i wanted to check if this is the right way to go?

changes from v1
- As per review comments from Heikki Krogerus
https://lore.kernel.org/linux-usb/[email protected]/
- select POWER_SUPPLY
- use POWER_SUPPLY_USB_TYPE_PD when a PD contract got negotiated

Guido Günther (1):
usb: typec: tps6598x: Export some power supply properties

 drivers/usb/typec/Kconfig    |   1 +
 drivers/usb/typec/tps6598x.c | 105 +++++++++++++++++++++++++++++++++++
 2 files changed, 106 insertions(+)
Signature · 1 line
2.29.2
#1 lore raw

PATCH v2 1/1 usb: typec: tps6598x: Export some power supply properties

This allows downstream supplies and userspace to detect whether external power is supplied.

---
 drivers/usb/typec/Kconfig    |   1 +
 drivers/usb/typec/tps6598x.c | 105 +++++++++++++++++++++++++++++++++++
 2 files changed, 106 insertions(+)
drivers/usb/typec/Kconfig +1 -0
index 6c5908a37ee8..75abdda1df32 100644
@@ -66,6 +66,7 @@ config TYPEC_TPS6598X
 	depends on I2C
 	depends on REGMAP_I2C
 	depends on USB_ROLE_SWITCH || !USB_ROLE_SWITCH
+	select POWER_SUPPLY
 	help
 	  Say Y or M here if your system has TI TPS65982 or TPS65983 USB Power
 	  Delivery controller.
drivers/usb/typec/tps6598x.c +105 -0

149 lines not on this page · raw message

Signature · 1 line
2.29.2
#2 lore raw
I love your patch! Yet something to improve:

Hi "Guido,

I love your patch! Yet something to improve:

[auto build test ERROR on usb/usb-testing]
[also build test ERROR on v5.10-rc5 next-20201126]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Guido-G-nther/usb-typec-tps6598x-Export-some-power-supply-properties/20201127-010748
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: x86_64-rhel
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/e2127770a7cde95b57cbdc55a68d783382282517
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Guido-G-nther/usb-typec-tps6598x-Export-some-power-supply-properties/20201127-010748
        git checkout e2127770a7cde95b57cbdc55a68d783382282517
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>):

>> drivers/power/supply/Kconfig:2:error: recursive dependency detected!

drivers/power/supply/Kconfig:2: symbol POWER_SUPPLY is selected by TYPEC_TPS6598X drivers/usb/typec/Kconfig:64: symbol TYPEC_TPS6598X depends on REGMAP_I2C drivers/base/regmap/Kconfig:19: symbol REGMAP_I2C is selected by CHARGER_ADP5061 drivers/power/supply/Kconfig:93: symbol CHARGER_ADP5061 depends on POWER_SUPPLY For a resolution refer to Documentation/kbuild/kconfig-language.rst subsection "Kconfig recursive dependency limitations"

vim +2 drivers/power/supply/Kconfig

8c0984e5a75337d Sebastian Reichel 2016-06-17 @2  menuconfig POWER_SUPPLY
8c0984e5a75337d Sebastian Reichel 2016-06-17  3  	bool "Power supply class support"
8c0984e5a75337d Sebastian Reichel 2016-06-17  4  	help
8c0984e5a75337d Sebastian Reichel 2016-06-17  5  	  Say Y here to enable power supply class support. This allows
8c0984e5a75337d Sebastian Reichel 2016-06-17  6  	  power supply (batteries, AC, USB) monitoring by userspace
8c0984e5a75337d Sebastian Reichel 2016-06-17  7  	  via sysfs and uevent (if available) and/or APM kernel interface
8c0984e5a75337d Sebastian Reichel 2016-06-17  8  	  (if selected below).

8c0984e5a75337d Sebastian Reichel 2016-06-17 9

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org