Skip to content

Commit 7c86e17

Browse files
jwrdegoederafaeljw
authored andcommitted
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>
1 parent b401b62 commit 7c86e17

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

drivers/acpi/x86/utils.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,16 +428,14 @@ bool acpi_quirk_skip_i2c_client_enumeration(struct acpi_device *adev)
428428
}
429429
EXPORT_SYMBOL_GPL(acpi_quirk_skip_i2c_client_enumeration);
430430

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)
432432
{
433433
struct acpi_device *adev = ACPI_COMPANION(controller_parent);
434434
const struct dmi_system_id *dmi_id;
435435
long quirks = 0;
436436
u64 uid;
437437
int ret;
438438

439-
*skip = false;
440-
441439
ret = acpi_dev_uid_to_integer(adev, &uid);
442440
if (ret)
443441
return 0;
@@ -463,7 +461,6 @@ int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *s
463461

464462
return 0;
465463
}
466-
EXPORT_SYMBOL_GPL(acpi_quirk_skip_serdev_enumeration);
467464

468465
bool acpi_quirk_skip_gpio_event_handlers(void)
469466
{
@@ -478,8 +475,21 @@ bool acpi_quirk_skip_gpio_event_handlers(void)
478475
return (quirks & ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS);
479476
}
480477
EXPORT_SYMBOL_GPL(acpi_quirk_skip_gpio_event_handlers);
478+
#else
479+
static int acpi_dmi_skip_serdev_enumeration(struct device *controller_parent, bool *skip)
480+
{
481+
return 0;
482+
}
481483
#endif
482484

485+
int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip)
486+
{
487+
*skip = false;
488+
489+
return acpi_dmi_skip_serdev_enumeration(controller_parent, skip);
490+
}
491+
EXPORT_SYMBOL_GPL(acpi_quirk_skip_serdev_enumeration);
492+
483493
/* Lists of PMIC ACPI HIDs with an (often better) native charger driver */
484494
static const struct {
485495
const char *hid;

include/acpi/acpi_bus.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,7 @@ bool acpi_device_override_status(struct acpi_device *adev, unsigned long long *s
749749
bool acpi_quirk_skip_acpi_ac_and_battery(void);
750750
int acpi_install_cmos_rtc_space_handler(acpi_handle handle);
751751
void acpi_remove_cmos_rtc_space_handler(acpi_handle handle);
752+
int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip);
752753
#else
753754
static inline bool acpi_device_override_status(struct acpi_device *adev,
754755
unsigned long long *status)
@@ -766,23 +767,22 @@ static inline int acpi_install_cmos_rtc_space_handler(acpi_handle handle)
766767
static inline void acpi_remove_cmos_rtc_space_handler(acpi_handle handle)
767768
{
768769
}
770+
static inline int
771+
acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip)
772+
{
773+
*skip = false;
774+
return 0;
775+
}
769776
#endif
770777

771778
#if IS_ENABLED(CONFIG_X86_ANDROID_TABLETS)
772779
bool acpi_quirk_skip_i2c_client_enumeration(struct acpi_device *adev);
773-
int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip);
774780
bool acpi_quirk_skip_gpio_event_handlers(void);
775781
#else
776782
static inline bool acpi_quirk_skip_i2c_client_enumeration(struct acpi_device *adev)
777783
{
778784
return false;
779785
}
780-
static inline int
781-
acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip)
782-
{
783-
*skip = false;
784-
return 0;
785-
}
786786
static inline bool acpi_quirk_skip_gpio_event_handlers(void)
787787
{
788788
return false;

0 commit comments

Comments
 (0)