/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * In some cases UART attached devices which require an in kernel driver, * e.g. UART attached Bluetooth HCIs are described in the ACPI tables * by an ACPI device with a broken or missing UartSerialBusV2() resource. * * This causes the kernel to create a /dev/ttyS# char-device for the UART * instead of creating an in kernel serdev-controller + serdev-device pair * for the in kernel driver. * * The quirk handling in acpi_quirk_skip_serdev_enumeration() makes the kernel * create a serdev-controller device for these UARTs instead of a /dev/ttyS#. * * Instantiating the actual serdev-device to bind to is up to pdx86 code, * this header provides a helper for getting the serdev-controller device. */ #include <linux/acpi.h> #include <linux/device.h> #include <linux/err.h> #include <linux/printk.h> #include <linux/sprintf.h> #include <linux/string.h> static inline struct device * get_serdev_controller(const char *serial_ctrl_hid, const char *serial_ctrl_uid, int serial_ctrl_port, const char *serdev_ctrl_name) { … }