Skip to content

power-suppy/i2c/extcon: Add support for cht-wc PMIC without USB-PD support

Hans de Goede linux-efi linux-i2c linux-pm lkml oe-kbuild-all platform-driver-x86 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 21 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13platform/x86: Rename touchscreen_dmi to dmi_device_propertiesMAINTAINERS drivers/firmware/efi/embedded-firmware.c drivers/platform/x86/Kconfig +3 more+20 -181 reply
2/13platform/x86: dmi_device_properties: Add setup info for boards with a CHT Whiskey Cove PMICdrivers/platform/x86/dmi_device_properties.c+46 -02 replies
3/13power: supply: bq25890: Fix race causing oops at bootdrivers/power/supply/bq25890_charger.c+11 -121 reply
4/13power: supply: bq25890: Fix initial setting of the F_CONV_RATE fielddrivers/power/supply/bq25890_charger.c+5 -51 reply
5/13power: supply: bq25890: Add a bq25890_rw_init_data() helperdrivers/power/supply/bq25890_charger.c+40 -220 replies
6/13power: supply: bq25890: Add support for skipping initializationdrivers/power/supply/bq25890_charger.c+16 -72 replies
7/13power: supply: bq25890: Enable charging on boards where we skip resetdrivers/power/supply/bq25890_charger.c+11 -01 reply
8/13power: supply: bq25890: Drop dev->platform_data == NULL checkdrivers/power/supply/bq25890_charger.c+4 -80 replies
9/13power: supply: bq25890: Add bq25890_set_otg_cfg() helperdrivers/power/supply/bq25890_charger.c+15 -134 replies
10/13power: supply: bq25890: Add support for registering the Vbus boost converter as a regulatordrivers/power/supply/bq25890_charger.c include/linux/power/bq25890_charger.h+71 -02 replies
11/13i2c: cht-wc: Add support for devices using a bq25890 chargerdrivers/i2c/busses/i2c-cht-wc.c+59 -185 replies
12/13extcon: intel-cht-wc: Check new "intel,cht-wc-setup" device-propertydrivers/extcon/extcon-intel-cht-wc.c+22 -160 replies
13/13extcon: intel-cht-wc: Add support for devices with an USB-micro-B connectordrivers/extcon/extcon-intel-cht-wc.c+81 -02 replies

Reviews trailers per patch

1 of 13 patches has a Reviewed-by or Acked-by.

PatchWolfram Sang
1/13
2/13
3/13
4/13
5/13
6/13
7/13
8/13
9/13
10/13
11/13A-b
12/13
13/13

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/13] power-suppy/i2c/extcon: Add support for cht-wc PMIC without USB-PD support

On many X86 devices with a Cherry Trail SoC the PMIC / battery charger support is not fully handled by ACPI. Instead we need to load native drivers for the PMIC and various chips surrounding the PMIC like the charger IC. So far we mostly support the AXP288 PMIC this way, as well as the Intel Whiskey Cove PMIC with a FUSB302 Type-C controller + other ICs for a USB-PD, USB-3 (superspeed) and DP-altmode capable Type-C connector, as found on the GPD win and GPD pocket mini laptops.

On the Xiaomi Mi Pad 2 tablet the Whiskey Cove PMIC is used in a different setup then on the GPD devices, supporting only USB-2 with BC1.2 spec charger detection on its USB connector.

This series adds support for the charger IC in this setup and for having the extcon-intel-cht-wc code control the 5V Vbus boost converter and the USB role-switch, which is done by the FUSB302 Type-C controller driver in the GPD case.

This fixes the tablet not charging under Linux, host-mode only working when booted in host-mode, as well as device-mode not working. Note device-mode still does not work when plugged into a CDP port. I have identified the cause for this and I plan to submit a fix later.

This series consists of the following parts:

Patch 1 + 2: Add a "intel,cht-wc-setup" device property to the Whiskey Cove i2c-client so that various WC drivers can use this to identify which setup they are dealing with.

Patch 3 + 4: bq25890 psy driver bug-fixes

Patch 5 - 8: bq25890 psy support for non-devicetree devices

Patch 9 + 10: bq25890 psy support for registering the builtin Vbus boost converter as a regulator

Patch 11: Add support to the i2c-cht-wc I2C-controller driver to instantiate an i2c-client for the attached bq25890 charger

Patch 12 + 13: extcon-intel-cht-wc add support for the USB-2 only with BC1.2 charger detection setup

Assuming everybody is ok with this series, we need to talk about how to merge this.

Patch 1 makes some very small changes (just a rename) to drivers/firmware/efi code, I would like to merging this + patch 2 through the pdx86 tree (where the real changes are). Ard, can I have your ack for this please ?

Patch 11 depends on a header file added by patch 10, since the i2c-cht-wc.c code otherwise sees very little changes I believe it makes sense for patch 11 to be merged into linux-power-supply.git/for-next together with patches 3-10. Wolfram can we have you ack for this?

Patch 12 + 13 can be merged through the extcon tree, these have no (compile time) dependencies on the other patches.

This is all 5.17 material, and I will make sure the pdx86 patches adding the new property will land in 5.17-rc1, hopefully the rest will land then too, but if other bits land later that is fine too, as long as the new property is there behavior won't change on the GPD win/pocket and we won't get any regressions.

Regards,

Hans

p.s.

Patch 3 and 4 are pure bq25890 bugfixes and should probably be picked up right away independent of the rest of the series.

Hans de Goede (13):
platform/x86: Rename touchscreen_dmi to dmi_device_properties platform/x86: dmi_device_properties: Add setup info for boards with a
CHT Whiskey Cove PMIC
power: supply: bq25890: Fix race causing oops at boot
power: supply: bq25890: Fix initial setting of the F_CONV_RATE field
power: supply: bq25890: Add a bq25890_rw_init_data() helper
power: supply: bq25890: Add support for skipping initialization
power: supply: bq25890: Enable charging on boards where we skip reset
power: supply: bq25890: Drop dev->platform_data == NULL check
power: supply: bq25890: Add bq25890_set_otg_cfg() helper
power: supply: bq25890: Add support for registering the Vbus boost
converter as a regulator
i2c: cht-wc: Add support for devices using a bq25890 charger
extcon: intel-cht-wc: Check new "intel,cht-wc-setup" device-property
extcon: intel-cht-wc: Add support for devices with an USB-micro-B
connector

 MAINTAINERS                                   |   2 +-
 drivers/extcon/extcon-intel-cht-wc.c          | 119 ++++++++--
 drivers/firmware/efi/embedded-firmware.c      |   4 +-
 drivers/i2c/busses/i2c-cht-wc.c               |  77 ++++--
 drivers/platform/x86/Kconfig                  |  20 +-
 drivers/platform/x86/Makefile                 |   2 +-
 ...chscreen_dmi.c => dmi_device_properties.c} |  54 ++++-
 drivers/power/supply/bq25890_charger.c        | 223 ++++++++++++------
 include/linux/efi_embedded_fw.h               |   2 +-
 include/linux/power/bq25890_charger.h         |  15 ++
 10 files changed, 400 insertions(+), 118 deletions(-)
 rename drivers/platform/x86/{touchscreen_dmi.c => dmi_device_properties.c} (96%)
 create mode 100644 include/linux/power/bq25890_charger.h
Signature · 1 line
2.31.1