Skip to content

Commit d8f2038

Browse files
jwrdegoederafaeljw
authored andcommitted
ACPI: x86: Add PNP_UART1_SKIP quirk for Lenovo Blade2 tablets
The x86 Android tablets on which quirks to skip looking for a matching UartSerialBus resource and instead unconditionally create a serial bus device (serdev) are necessary there are 2 sorts of serialports: ACPI enumerated highspeed designware UARTs, these are the ones which typcially need to be skipped since they need a serdev for the attached BT HCI. A PNP enumerated UART which is part of the PCU. So far the existing quirks have ignored this. But on the Lenovo Yoga Tablet 2 Pro 1380 models this is used for a custom fastcharging protocol. There is a Micro USB switch which can switch the USB data lines to this uart and then a 600 baud protocol is used to configure the charger for a voltage higher then 5V. Add a new ACPI_QUIRK_PNP_UART1_SKIP quirk type and set this for the existing entry for the Lenovo Yoga Tablet 2 830 / 1050 models. Note this will lead to unnecessarily also creating a serdev for the PCU UART on the 830 / 1050 which don't need this, but the UART is not used otherwise there so that is not a problem. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent bfd1a49 commit d8f2038

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

drivers/acpi/x86/utils.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,10 @@ bool force_storage_d3(void)
269269
#define ACPI_QUIRK_SKIP_I2C_CLIENTS BIT(0)
270270
#define ACPI_QUIRK_UART1_SKIP BIT(1)
271271
#define ACPI_QUIRK_UART1_TTY_UART2_SKIP BIT(2)
272-
#define ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY BIT(3)
273-
#define ACPI_QUIRK_USE_ACPI_AC_AND_BATTERY BIT(4)
274-
#define ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS BIT(5)
272+
#define ACPI_QUIRK_PNP_UART1_SKIP BIT(3)
273+
#define ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY BIT(4)
274+
#define ACPI_QUIRK_USE_ACPI_AC_AND_BATTERY BIT(5)
275+
#define ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS BIT(6)
275276

276277
static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = {
277278
/*
@@ -351,6 +352,7 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = {
351352
DMI_MATCH(DMI_BIOS_VERSION, "BLADE_21"),
352353
},
353354
.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
355+
ACPI_QUIRK_PNP_UART1_SKIP |
354356
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY),
355357
},
356358
{
@@ -449,14 +451,18 @@ static int acpi_dmi_skip_serdev_enumeration(struct device *controller_parent, bo
449451
if (ret)
450452
return 0;
451453

452-
/* to not match on PNP enumerated debug UARTs */
453-
if (!dev_is_platform(controller_parent))
454-
return 0;
455-
456454
dmi_id = dmi_first_match(acpi_quirk_skip_dmi_ids);
457455
if (dmi_id)
458456
quirks = (unsigned long)dmi_id->driver_data;
459457

458+
if (!dev_is_platform(controller_parent)) {
459+
/* PNP enumerated UARTs */
460+
if ((quirks & ACPI_QUIRK_PNP_UART1_SKIP) && uid == 1)
461+
*skip = true;
462+
463+
return 0;
464+
}
465+
460466
if ((quirks & ACPI_QUIRK_UART1_SKIP) && uid == 1)
461467
*skip = true;
462468

0 commit comments

Comments
 (0)