@@ -44,6 +44,11 @@ static bool cros_ec_lpc_acpi_device_found;
44
44
* the ACPI device.
45
45
*/
46
46
#define CROS_EC_LPC_QUIRK_ACPI_ID BIT(1)
47
+ /*
48
+ * Indicates that lpc_driver_data.quirk_aml_mutex_name should be used
49
+ * to find an AML mutex to protect access to Microchip EC.
50
+ */
51
+ #define CROS_EC_LPC_QUIRK_AML_MUTEX BIT(2)
47
52
48
53
/**
49
54
* struct lpc_driver_data - driver data attached to a DMI device ID to indicate
@@ -52,11 +57,14 @@ static bool cros_ec_lpc_acpi_device_found;
52
57
* @quirk_mmio_memory_base: The first I/O port addressing EC mapped memory (used
53
58
* when quirk ...REMAP_MEMORY is set.)
54
59
* @quirk_acpi_id: An ACPI HID to be used to find the ACPI device.
60
+ * @quirk_aml_mutex_name: The name of an AML mutex to be used to protect access
61
+ * to Microchip EC.
55
62
*/
56
63
struct lpc_driver_data {
57
64
u32 quirks ;
58
65
u16 quirk_mmio_memory_base ;
59
66
const char * quirk_acpi_id ;
67
+ const char * quirk_aml_mutex_name ;
60
68
};
61
69
62
70
/**
@@ -482,6 +490,17 @@ static int cros_ec_lpc_probe(struct platform_device *pdev)
482
490
}
483
491
ACPI_COMPANION_SET (dev , adev );
484
492
}
493
+
494
+ if (quirks & CROS_EC_LPC_QUIRK_AML_MUTEX ) {
495
+ const char * name
496
+ = driver_data -> quirk_aml_mutex_name ;
497
+ ret = cros_ec_lpc_mec_acpi_mutex (ACPI_COMPANION (dev ), name );
498
+ if (ret ) {
499
+ dev_err (dev , "failed to get AML mutex '%s'" , name );
500
+ return ret ;
501
+ }
502
+ dev_info (dev , "got AML mutex '%s'" , name );
503
+ }
485
504
}
486
505
487
506
/*
0 commit comments