Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI: x86: Move acpi_quirk_skip_serdev_enumeration() out of CONFIG_X86_ANDROID_TABLETS

Some recent(ish) Dell AIO devices have a backlight controller board
connected to an UART.

This UART has a DELL0501 HID with CID set to PNP0501 so that the UART is
still handled by 8250_pnp.c. Unfortunately there is no separate ACPI device
with an UartSerialBusV2() resource to model the backlight-controller.

The next patch in this series will use acpi_quirk_skip_serdev_enumeration()
to still create a serdev for this for a backlight driver to bind to
instead of creating a /dev/ttyS0.

This new acpi_quirk_skip_serdev_enumeration() use is not limited to Android
X86 tablets, so move it out of the ifdef CONFIG_X86_ANDROID_TABLETS block.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Hans de Goede and committed by
Rafael J. Wysocki
7c86e174 b401b621

+25 -15
+14 -4
drivers/acpi/x86/utils.c
··· 428 428 } 429 429 EXPORT_SYMBOL_GPL(acpi_quirk_skip_i2c_client_enumeration); 430 430 431 - int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip) 431 + static int acpi_dmi_skip_serdev_enumeration(struct device *controller_parent, bool *skip) 432 432 { 433 433 struct acpi_device *adev = ACPI_COMPANION(controller_parent); 434 434 const struct dmi_system_id *dmi_id; 435 435 long quirks = 0; 436 436 u64 uid; 437 437 int ret; 438 - 439 - *skip = false; 440 438 441 439 ret = acpi_dev_uid_to_integer(adev, &uid); 442 440 if (ret) ··· 461 463 462 464 return 0; 463 465 } 464 - EXPORT_SYMBOL_GPL(acpi_quirk_skip_serdev_enumeration); 465 466 466 467 bool acpi_quirk_skip_gpio_event_handlers(void) 467 468 { ··· 475 478 return (quirks & ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS); 476 479 } 477 480 EXPORT_SYMBOL_GPL(acpi_quirk_skip_gpio_event_handlers); 481 + #else 482 + static int acpi_dmi_skip_serdev_enumeration(struct device *controller_parent, bool *skip) 483 + { 484 + return 0; 485 + } 478 486 #endif 487 + 488 + int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip) 489 + { 490 + *skip = false; 491 + 492 + return acpi_dmi_skip_serdev_enumeration(controller_parent, skip); 493 + } 494 + EXPORT_SYMBOL_GPL(acpi_quirk_skip_serdev_enumeration); 479 495 480 496 /* Lists of PMIC ACPI HIDs with an (often better) native charger driver */ 481 497 static const struct {
+11 -11
include/acpi/acpi_bus.h
··· 749 749 bool acpi_quirk_skip_acpi_ac_and_battery(void); 750 750 int acpi_install_cmos_rtc_space_handler(acpi_handle handle); 751 751 void acpi_remove_cmos_rtc_space_handler(acpi_handle handle); 752 + int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip); 752 753 #else 753 754 static inline bool acpi_device_override_status(struct acpi_device *adev, 754 755 unsigned long long *status) ··· 767 766 static inline void acpi_remove_cmos_rtc_space_handler(acpi_handle handle) 768 767 { 769 768 } 770 - #endif 771 - 772 - #if IS_ENABLED(CONFIG_X86_ANDROID_TABLETS) 773 - bool acpi_quirk_skip_i2c_client_enumeration(struct acpi_device *adev); 774 - int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip); 775 - bool acpi_quirk_skip_gpio_event_handlers(void); 776 - #else 777 - static inline bool acpi_quirk_skip_i2c_client_enumeration(struct acpi_device *adev) 778 - { 779 - return false; 780 - } 781 769 static inline int 782 770 acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip) 783 771 { 784 772 *skip = false; 785 773 return 0; 774 + } 775 + #endif 776 + 777 + #if IS_ENABLED(CONFIG_X86_ANDROID_TABLETS) 778 + bool acpi_quirk_skip_i2c_client_enumeration(struct acpi_device *adev); 779 + bool acpi_quirk_skip_gpio_event_handlers(void); 780 + #else 781 + static inline bool acpi_quirk_skip_i2c_client_enumeration(struct acpi_device *adev) 782 + { 783 + return false; 786 784 } 787 785 static inline bool acpi_quirk_skip_gpio_event_handlers(void) 788 786 {