• Hans de Goede's avatar
    ACPI / x86: Add acpi_quirk_skip_[i2c_client|serdev]_enumeration() helpers · 35f9e773
    Hans de Goede authored
    x86 ACPI boards which ship with only Android as their factory image usually
    declare a whole bunch of bogus I2C devs in their ACPI tables and sometimes
    there are issues with serdev devices on these boards too, e.g. the resource
    points to the wrong serdev_controller.
    
    Instantiating I2C / serdev devs for these bogus devs causes various issues,
    e.g. GPIO/IRQ resource conflicts because sometimes drivers do bind to them.
    The Android x86 kernel fork shipped on these devices has some special code
    to remove the bogus I2C clients (and serdevs are ignored completely).
    
    Introduce acpi_quirk_skip_i2c_client_enumeration() and
    acpi_quirk_skip_serdev_enumeration() helpers. Which can be used by the I2C/
    serdev code to skip instantiating any I2C or serdev devs on broken boards.
    
    These 2 helpers are added to drivers/acpi/x86/utils.c so that the DMI table
    can be shared between the I2C and serdev code.
    
    Note these boards typically do actually have I2C and serdev devices, just
    different ones then the ones described in their DSDT. The devices which
    are actually present are manually instantiated by the
    drivers/platform/x86/x86-android-tablets.c kernel module.
    
    The new helpers are only build if CONFIG_X86_ANDROID_TABLETS is enabled,
    otherwise they are empty stubs to not unnecessarily grow the kernel size.
    Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    35f9e773
utils.c 9.18 KB