Skip to content

Commit ea40075

Browse files
committed
Merge branches 'acpi-utils', 'acpi-resource', 'acpi-property' and 'acpi-soc'
Merge ACPI utilities updates, ACPI resource management updates, ACPI device properties management updates and ACPI LPSS (Intel SoC) driver update for 6.7-rc1: - Rework acpi_handle_list handling so as to manage it dynamically, including size computation (Rafael Wysocki). - Clean up ACPI utilities code so as to make it follow the kernel coding style (Jonathan Bergh). - Consolidate IRQ trigger-type override DMI tables and drop .ident values from dmi_system_id tables used for ACPI resources management quirks (Hans de Goede). - Add ACPI IRQ override for TongFang GMxXGxx (Werner Sembach). - Allow _DSD buffer data only for byte accessors and document the _DSD data buffer GUID (Andy Shevchenko). - Drop BayTrail and Lynxpoint pinctrl device IDs from the ACPI LPSS driver, because it does not need them (Raag Jadav). * acpi-utils: ACPI: utils: Remove redundant braces around individual statement ACPI: utils: Fix up white space in a few places ACPI: utils: Dynamically determine acpi_handle_list size ACPI: thermal: Merge trip initialization functions ACPI: thermal: Collapse trip devices update function wrappers ACPI: thermal: Collapse trip devices update functions ACPI: thermal: Add device list to struct acpi_thermal_trip ACPI: thermal: Fix a small leak in acpi_thermal_add() ACPI: thermal: Drop valid flag from struct acpi_thermal_trip ACPI: thermal: Drop redundant trip point flags ACPI: thermal: Untangle initialization and updates of active trips ACPI: thermal: Untangle initialization and updates of the passive trip ACPI: thermal: Simplify critical and hot trips representation ACPI: thermal: Create and populate trip points table earlier ACPI: thermal: Determine the number of trip points earlier ACPI: thermal: Fold acpi_thermal_get_info() into its caller ACPI: thermal: Simplify initialization of critical and hot trips * acpi-resource: ACPI: resource: Do IRQ override on TongFang GMxXGxx ACPI: resource: Drop .ident values from dmi_system_id tables ACPI: resource: Consolidate IRQ trigger-type override DMI tables * acpi-property: ACPI: property: Document the _DSD data buffer GUID ACPI: property: Allow _DSD buffer data only for byte accessors * acpi-soc: ACPI: LPSS: drop BayTrail and Lynxpoint pinctrl HIDs
5 parents 93003de + 6b54bdd + 0da9ecc + 43451c4 + bda3df1 commit ea40075

File tree

8 files changed

+509
-424
lines changed

8 files changed

+509
-424
lines changed

drivers/acpi/acpi_lpss.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -368,16 +368,13 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = {
368368
{ "INT33C4", LPSS_ADDR(lpt_uart_dev_desc) },
369369
{ "INT33C5", LPSS_ADDR(lpt_uart_dev_desc) },
370370
{ "INT33C6", LPSS_ADDR(lpt_sdio_dev_desc) },
371-
{ "INT33C7", },
372371

373372
/* BayTrail LPSS devices */
374373
{ "80860F09", LPSS_ADDR(byt_pwm_dev_desc) },
375374
{ "80860F0A", LPSS_ADDR(byt_uart_dev_desc) },
376375
{ "80860F0E", LPSS_ADDR(byt_spi_dev_desc) },
377376
{ "80860F14", LPSS_ADDR(byt_sdio_dev_desc) },
378377
{ "80860F41", LPSS_ADDR(byt_i2c_dev_desc) },
379-
{ "INT33B2", },
380-
{ "INT33FC", },
381378

382379
/* Braswell LPSS devices */
383380
{ "80862286", LPSS_ADDR(lpss_dma_desc) },
@@ -396,7 +393,6 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = {
396393
{ "INT3434", LPSS_ADDR(lpt_uart_dev_desc) },
397394
{ "INT3435", LPSS_ADDR(lpt_uart_dev_desc) },
398395
{ "INT3436", LPSS_ADDR(lpt_sdio_dev_desc) },
399-
{ "INT3437", },
400396

401397
/* Wildcat Point LPSS devices */
402398
{ "INT3438", LPSS_ADDR(lpt_spi_dev_desc) },
@@ -578,6 +574,7 @@ static bool acpi_lpss_dep(struct acpi_device *adev, acpi_handle handle)
578574
{
579575
struct acpi_handle_list dep_devices;
580576
acpi_status status;
577+
bool ret = false;
581578
int i;
582579

583580
if (!acpi_has_method(adev->handle, "_DEP"))
@@ -591,11 +588,14 @@ static bool acpi_lpss_dep(struct acpi_device *adev, acpi_handle handle)
591588
}
592589

593590
for (i = 0; i < dep_devices.count; i++) {
594-
if (dep_devices.handles[i] == handle)
595-
return true;
591+
if (dep_devices.handles[i] == handle) {
592+
ret = true;
593+
break;
594+
}
596595
}
597596

598-
return false;
597+
acpi_handle_list_free(&dep_devices);
598+
return ret;
599599
}
600600

601601
static void acpi_lpss_link_consumer(struct device *dev1,
@@ -657,10 +657,9 @@ static int acpi_lpss_create_device(struct acpi_device *adev,
657657
int ret;
658658

659659
dev_desc = (const struct lpss_device_desc *)id->driver_data;
660-
if (!dev_desc) {
661-
pdev = acpi_create_platform_device(adev, NULL);
662-
return IS_ERR_OR_NULL(pdev) ? PTR_ERR(pdev) : 1;
663-
}
660+
if (!dev_desc)
661+
return -EINVAL;
662+
664663
pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
665664
if (!pdata)
666665
return -ENOMEM;

drivers/acpi/property.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ static const guid_t ads_guid =
5555
GUID_INIT(0xdbb8e3e6, 0x5886, 0x4ba6,
5656
0x87, 0x95, 0x13, 0x19, 0xf5, 0x2a, 0x96, 0x6b);
5757

58+
/* ACPI _DSD data buffer GUID: edb12dd0-363d-4085-a3d2-49522ca160c4 */
5859
static const guid_t buffer_prop_guid =
5960
GUID_INIT(0xedb12dd0, 0x363d, 0x4085,
6061
0xa3, 0xd2, 0x49, 0x52, 0x2c, 0xa1, 0x60, 0xc4);
@@ -1102,25 +1103,26 @@ static int acpi_data_prop_read(const struct acpi_device_data *data,
11021103
switch (proptype) {
11031104
case DEV_PROP_STRING:
11041105
break;
1105-
case DEV_PROP_U8 ... DEV_PROP_U64:
1106+
default:
11061107
if (obj->type == ACPI_TYPE_BUFFER) {
11071108
if (nval > obj->buffer.length)
11081109
return -EOVERFLOW;
1109-
break;
1110+
} else {
1111+
if (nval > obj->package.count)
1112+
return -EOVERFLOW;
11101113
}
1111-
fallthrough;
1112-
default:
1113-
if (nval > obj->package.count)
1114-
return -EOVERFLOW;
11151114
break;
11161115
}
11171116
if (nval == 0)
11181117
return -EINVAL;
11191118

1120-
if (obj->type != ACPI_TYPE_BUFFER)
1121-
items = obj->package.elements;
1122-
else
1119+
if (obj->type == ACPI_TYPE_BUFFER) {
1120+
if (proptype != DEV_PROP_U8)
1121+
return -EPROTO;
11231122
items = obj;
1123+
} else {
1124+
items = obj->package.elements;
1125+
}
11241126

11251127
switch (proptype) {
11261128
case DEV_PROP_U8:

drivers/acpi/resource.c

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -385,127 +385,144 @@ unsigned int acpi_dev_get_irq_type(int triggering, int polarity)
385385
}
386386
EXPORT_SYMBOL_GPL(acpi_dev_get_irq_type);
387387

388-
static const struct dmi_system_id medion_laptop[] = {
388+
/*
389+
* DMI matches for boards where the DSDT specifies the kbd IRQ as
390+
* level active-low and using the override changes this to rising edge,
391+
* stopping the keyboard from working.
392+
*/
393+
static const struct dmi_system_id irq1_level_low_skip_override[] = {
389394
{
390-
.ident = "MEDION P15651",
395+
/* MEDION P15651 */
391396
.matches = {
392397
DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
393398
DMI_MATCH(DMI_BOARD_NAME, "M15T"),
394399
},
395400
},
396401
{
397-
.ident = "MEDION S17405",
402+
/* MEDION S17405 */
398403
.matches = {
399404
DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
400405
DMI_MATCH(DMI_BOARD_NAME, "M17T"),
401406
},
402407
},
403408
{
404-
.ident = "MEDION S17413",
409+
/* MEDION S17413 */
405410
.matches = {
406411
DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
407412
DMI_MATCH(DMI_BOARD_NAME, "M1xA"),
408413
},
409414
},
410-
{ }
411-
};
412-
413-
static const struct dmi_system_id asus_laptop[] = {
414415
{
415-
.ident = "Asus Vivobook K3402ZA",
416+
/* Asus Vivobook K3402ZA */
416417
.matches = {
417418
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
418419
DMI_MATCH(DMI_BOARD_NAME, "K3402ZA"),
419420
},
420421
},
421422
{
422-
.ident = "Asus Vivobook K3502ZA",
423+
/* Asus Vivobook K3502ZA */
423424
.matches = {
424425
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
425426
DMI_MATCH(DMI_BOARD_NAME, "K3502ZA"),
426427
},
427428
},
428429
{
429-
.ident = "Asus Vivobook S5402ZA",
430+
/* Asus Vivobook S5402ZA */
430431
.matches = {
431432
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
432433
DMI_MATCH(DMI_BOARD_NAME, "S5402ZA"),
433434
},
434435
},
435436
{
436-
.ident = "Asus Vivobook S5602ZA",
437+
/* Asus Vivobook S5602ZA */
437438
.matches = {
438439
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
439440
DMI_MATCH(DMI_BOARD_NAME, "S5602ZA"),
440441
},
441442
},
442443
{
443-
.ident = "Asus ExpertBook B1402CBA",
444+
/* Asus ExpertBook B1402CBA */
444445
.matches = {
445446
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
446447
DMI_MATCH(DMI_BOARD_NAME, "B1402CBA"),
447448
},
448449
},
449450
{
450-
.ident = "Asus ExpertBook B1502CBA",
451+
/* Asus ExpertBook B1502CBA */
451452
.matches = {
452453
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
453454
DMI_MATCH(DMI_BOARD_NAME, "B1502CBA"),
454455
},
455456
},
456457
{
457-
.ident = "Asus ExpertBook B2402CBA",
458+
/* Asus ExpertBook B2402CBA */
458459
.matches = {
459460
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
460461
DMI_MATCH(DMI_BOARD_NAME, "B2402CBA"),
461462
},
462463
},
463464
{
464-
.ident = "Asus ExpertBook B2402FBA",
465+
/* Asus ExpertBook B2402FBA */
465466
.matches = {
466467
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
467468
DMI_MATCH(DMI_BOARD_NAME, "B2402FBA"),
468469
},
469470
},
470471
{
471-
.ident = "Asus ExpertBook B2502",
472+
/* Asus ExpertBook B2502 */
472473
.matches = {
473474
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
474475
DMI_MATCH(DMI_BOARD_NAME, "B2502CBA"),
475476
},
476477
},
478+
{
479+
/* LG Electronics 17U70P */
480+
.matches = {
481+
DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
482+
DMI_MATCH(DMI_BOARD_NAME, "17U70P"),
483+
},
484+
},
477485
{ }
478486
};
479487

480-
static const struct dmi_system_id tongfang_gm_rg[] = {
488+
/*
489+
* DMI matches for AMD Zen boards where the DSDT specifies the kbd IRQ
490+
* as falling edge and this must be overridden to rising edge,
491+
* to have a working keyboard.
492+
*/
493+
static const struct dmi_system_id irq1_edge_low_force_override[] = {
481494
{
482-
.ident = "TongFang GMxRGxx/XMG CORE 15 (M22)/TUXEDO Stellaris 15 Gen4 AMD",
495+
/* TongFang GMxRGxx/XMG CORE 15 (M22)/TUXEDO Stellaris 15 Gen4 AMD */
483496
.matches = {
484497
DMI_MATCH(DMI_BOARD_NAME, "GMxRGxx"),
485498
},
486499
},
487-
{ }
488-
};
489-
490-
static const struct dmi_system_id maingear_laptop[] = {
491500
{
492-
.ident = "MAINGEAR Vector Pro 2 15",
501+
/* TongFang GMxXGxx/TUXEDO Polaris 15 Gen5 AMD */
502+
.matches = {
503+
DMI_MATCH(DMI_BOARD_NAME, "GMxXGxx"),
504+
},
505+
},
506+
{
507+
/* TongFang GM6XGxX/TUXEDO Stellaris 16 Gen5 AMD */
508+
.matches = {
509+
DMI_MATCH(DMI_BOARD_NAME, "GM6XGxX"),
510+
},
511+
},
512+
{
513+
/* MAINGEAR Vector Pro 2 15 */
493514
.matches = {
494515
DMI_MATCH(DMI_SYS_VENDOR, "Micro Electronics Inc"),
495516
DMI_MATCH(DMI_PRODUCT_NAME, "MG-VCP2-15A3070T"),
496517
}
497518
},
498519
{
499-
.ident = "MAINGEAR Vector Pro 2 17",
520+
/* MAINGEAR Vector Pro 2 17 */
500521
.matches = {
501522
DMI_MATCH(DMI_SYS_VENDOR, "Micro Electronics Inc"),
502523
DMI_MATCH(DMI_PRODUCT_NAME, "MG-VCP2-17A3070T"),
503524
},
504525
},
505-
{ }
506-
};
507-
508-
static const struct dmi_system_id pcspecialist_laptop[] = {
509526
{
510527
/* TongFang GM6BGEQ / PCSpecialist Elimina Pro 16 M, RTX 3050 */
511528
.matches = {
@@ -527,17 +544,6 @@ static const struct dmi_system_id pcspecialist_laptop[] = {
527544
{ }
528545
};
529546

530-
static const struct dmi_system_id lg_laptop[] = {
531-
{
532-
.ident = "LG Electronics 17U70P",
533-
.matches = {
534-
DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
535-
DMI_MATCH(DMI_BOARD_NAME, "17U70P"),
536-
},
537-
},
538-
{ }
539-
};
540-
541547
struct irq_override_cmp {
542548
const struct dmi_system_id *system;
543549
unsigned char irq;
@@ -548,12 +554,8 @@ struct irq_override_cmp {
548554
};
549555

550556
static const struct irq_override_cmp override_table[] = {
551-
{ medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
552-
{ asus_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
553-
{ tongfang_gm_rg, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
554-
{ maingear_laptop, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
555-
{ pcspecialist_laptop, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
556-
{ lg_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
557+
{ irq1_level_low_skip_override, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
558+
{ irq1_edge_low_force_override, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
557559
};
558560

559561
static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,

drivers/acpi/scan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,6 +2032,7 @@ static u32 acpi_scan_check_dep(acpi_handle handle, bool check_dep)
20322032
mutex_unlock(&acpi_dep_list_lock);
20332033
}
20342034

2035+
acpi_handle_list_free(&dep_devices);
20352036
return count;
20362037
}
20372038

0 commit comments

Comments
 (0)