1. 24 Feb, 2022 2 commits
  2. 13 Feb, 2022 7 commits
  3. 11 Feb, 2022 22 commits
  4. 02 Feb, 2022 1 commit
  5. 01 Feb, 2022 8 commits
    • Sebastian Reichel's avatar
      Merge tag 'psy-extcon-i2c-mfd-for-v5.18-signed' into psy-next · 28e54414
      Sebastian Reichel authored
      Immutable branch between power-supply, mfd, i2c and extcon for for 5.18
      
      This immutable branch fixes the charger setup on Xiaomi Mi Pad 2 and
      Lenovo Yogabook, which requires updates to multiple drivers throughout
      the tree.
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      28e54414
    • Hans de Goede's avatar
      extcon: intel-cht-wc: Report RID_A for ACA adapters · 21356ac1
      Hans de Goede authored
      Make cht_wc_extcon_get_id() report RID_A for ACA adapters, instead of
      reporting ID_FLOAT.
      
      According to the spec. we should read the USB-ID pin ADC value
      to determine the resistance of the used pull-down resister and
      then return RID_A / RID_B / RID_C based on this. But all "Accessory
      Charger Adapter"s (ACAs) which users can actually buy always use
      a combination of a charging port with one or more USB-A ports, so
      they should always use a resistor indicating RID_A. But the spec
      is hard to read / badly-worded so some of them actually indicate
      they are a RID_B ACA even though they clearly are a RID_A ACA.
      
      To workaround this simply always return INTEL_USB_RID_A, which
      matches all the ACAs which users can actually buy.
      Acked-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      21356ac1
    • Hans de Goede's avatar
      extcon: intel-cht-wc: Add support for registering a power_supply class-device · 66e31186
      Hans de Goede authored
      The bq25890 used on the Yogabook YB1-X90 / -X91 models relies on
      the extcon-driver's BC-1.2 charger detection, and the bq25890 driver
      expect this info to be  available through a parent power_supply
      class-device which models the detected charger (idem to how the Type-C
      TCPM code registers a power_supply classdev for the connected charger).
      
      Add support for registering the power_supply class-device expected
      by this setup.
      Acked-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      66e31186
    • Hans de Goede's avatar
      extcon: intel-cht-wc: Refactor cht_wc_extcon_get_charger() · 73b5ae34
      Hans de Goede authored
      This is a preparation patch for adding support for registering
      a power_supply class device.
      
      Setting usbsrc to "CHT_WC_USBSRC_TYPE_SDP << CHT_WC_USBSRC_TYPE_SHIFT"
      will make the following switch-case return EXTCON_CHG_USB_SDP
      just as before, so there is no functional change.
      Acked-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      73b5ae34
    • Hans de Goede's avatar
      extcon: intel-cht-wc: Support devs with Micro-B / USB-2 only Type-C connectors · b7fa2cd3
      Hans de Goede authored
      So far the extcon-intel-cht-wc code has only been tested on devices with
      a Type-C connector with USB-PD, USB3 (superspeed) and DP-altmode support
      through a FUSB302 Type-C controller.
      
      Some devices with the intel-cht-wc PMIC however come with an USB-micro-B
      connector, or an USB-2 only Type-C connector without USB-PD.
      
      Which device-model we are running on can be identified with the new
      cht_wc_model intel_soc_pmic field. On models without a Type-C controller
      the extcon code must control the Vbus 5V boost converter and the USB role
      switch depending on the detected cable-type.
      Acked-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      b7fa2cd3
    • Hans de Goede's avatar
      extcon: intel-cht-wc: Use new cht_wc_model intel_soc_pmic field · b910a9ce
      Hans de Goede authored
      The CHT_WC_VBUS_GPIO_CTLO GPIO actually driving an external 5V Vboost
      converter for Vbus depends on the board on which the Cherry Trail -
      Whiskey Cove PMIC is actually used.
      
      Since the information about the exact PMIC setup is necessary in other
      places too, struct intel_soc_pmic now has a new cht_wc_model field
      indicating the board model.
      
      Only poke the CHT_WC_VBUS_GPIO_CTLO GPIO if this new field is set to
      INTEL_CHT_WC_GPD_WIN_POCKET, which indicates the Type-C (with PD and
      DP-altmode) setup used on the GPD pocket and GPD win; and on which
      this GPIO actually controls an external 5V Vboost converter.
      Acked-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      b910a9ce
    • Hans de Goede's avatar
      i2c: cht-wc: Make charger i2c-client instantiation board/device-model specific · 4b326491
      Hans de Goede authored
      The i2c-controller on the Cherry Trail - Whiskey Cove PMIC is special
      in that it is always connected to the I2C charger IC of the board on
      which the PMIC is used; and the charger IC is not described in ACPI,
      so the i2c-cht-wc code needs to instantiate an i2c-client for it itself.
      
      So far this was hardcoded to instantiate an i2c-client for the
      bq24292i, with all properties, etc. set to match how this charger
      is used on the GPD win and GPD pocket devices.
      
      There is a rudimentary check to make sure the ACPI tables are at least
      somewhat as expected, but this is far from accurate, leading to
      a wrong i2c-client being instantiated for the charger on some boards.
      
      Switch to the new DMI based intel_cht_wc_get_model() helper which is
      exported by the MFD driver for the CHT Whiskey Cove PMIC to help PMIC
      cell drivers like the i2c-cht-wc code reliably detect which board
      they are running on.
      
      And add board_info for the charger ICs as found on the other 2 known
      boards with a Whisky Cove PMIC.
      
      This has been tested on all 3 known boards.
      Acked-by: default avatarWolfram Sang <wsa@kernel.org>
      Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      4b326491
    • Hans de Goede's avatar
      mfd: intel_soc_pmic_chtwc: Add cht_wc_model data to struct intel_soc_pmic · 3afcbe09
      Hans de Goede authored
      Tablet / laptop designs using an Intel Cherry Trail x86 main SoC with
      an Intel Whiskey Cove PMIC do not use a single standard setup for
      the charger, fuel-gauge and other chips surrounding the PMIC /
      charging+data USB port.
      
      Unlike what is normal on x86 this diversity in designs is not handled
      by the ACPI tables. On 2 of the 3 known designs there are no standard
      (PNP0C0A) ACPI battery devices and on the 3th design the ACPI battery
      device does not work under Linux due to it requiring non-standard
      and undocumented ACPI behavior.
      
      So to make things work under Linux we use native charger and fuel-gauge
      drivers on these devices, re-using the native drivers used on ARM boards
      with the same charger / fuel-gauge ICs.
      
      This requires various MFD-cell drivers for the CHT-WC PMIC cells to
      know which model they are exactly running on so that they can e.g.
      instantiate an I2C-client for the right model charger-IC (the charger
      is connected to an I2C-controller which is part of the PMIC).
      
      Rather then duplicating DMI-id matching to check which model we are
      running on in each MFD-cell driver, add a check for this to the
      shared drivers/mfd/intel_soc_pmic_chtwc.c code by using a
      DMI table for all 3 known models:
      
      1. The GPD Win and GPD Pocket mini-laptops, these are really 2 models
      but the Pocket re-uses the GPD Win's design in a different housing:
      
      The WC PMIC is connected to a TI BQ24292i charger, paired with
      a Maxim MAX17047 fuelgauge + a FUSB302 USB Type-C Controller +
      a PI3USB30532 USB switch, for a fully functional Type-C port.
      
      2. The Xiaomi Mi Pad 2:
      
      The WC PMIC is connected to a TI BQ25890 charger, paired with
      a TI BQ27520 fuelgauge, using the TI BQ25890 for BC1.2 charger type
      detection, for a USB-2 only Type-C port without PD.
      
      3. The Lenovo Yoga Book YB1-X90 / Lenovo Yoga Book YB1-X91 series:
      
      The WC PMIC is connected to a TI BQ25892 charger, paired with
      a TI BQ27542 fuelgauge, using the WC PMIC for BC1.2 charger type
      detection and using the BQ25892's Mediatek Pump Express+ (1.0)
      support to enable charging with up to 12V through a micro-USB port.
      Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
      Acked-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      3afcbe09