• Hans de Goede's avatar
    platform/x86: intel_cht_int33fe: Switch to DMI modalias based loading · 915623a8
    Hans de Goede authored
    The intel_cht_int33fe driver is intended to deal with ACPI INT33FE
    firmware-nodes on Cherry Trail devices with a Whiskey Cove PMIC.
    
    The original version of the driver only dealt with the GPD win and
    GPD pocket boards where 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.
    
    Later it was split into a Type-C and a Micro-B variant to deal with
    the Lenovo Yoga Book YB1-X90 / Lenovo Yoga Book YB1-X91 boards where
    the ACPI INT33FE firmware-node only describes the TI BQ27542 fuelgauge.
    
    Currently the driver differentiates between these 2 models by counting
    the number of I2cSerialBus resources in the firmware-node.
    
    There are a number of problems with this approach:
    
    1. The driver autoloads based on the acpi:INT33FE modalias causing it
    to get loaded on almost all Bay Trail and Cherry Trail devices. It
    checks for the presence of a WC PMIC, so it won't bind but the loading
    still wastes time and memory.
    
    2. Both code paths in the driver are really only designed for a single
    board and have harcoded various assumptions about these boards, if
    another design matching the current checks ever shows up the driver
    may end up doing something completely wrong.
    
    Avoid both issues by switching to using DMI based autoloading of
    the module, which has neither of these problems.
    
    Note this splits the previous intel_cht_int33fe kernel module into two
    modules: intel_cht_int33fe_typec and intel_cht_int33fe_microb, one for
    each model.
    Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    Link: https://lore.kernel.org/r/20220206220220.88491-2-hdegoede@redhat.com
    915623a8
Makefile 128 Bytes